Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
23b9cc45
Commit
23b9cc45
authored
Nov 16, 2016
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up unused variables.
parent
1174b7f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
...teItem/portal_components/extension.erp5.JupyterCompile.py
+5
-7
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.xml
...eItem/portal_components/extension.erp5.JupyterCompile.xml
+5
-8
No files found.
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
View file @
23b9cc45
...
@@ -180,7 +180,6 @@ def Base_runJupyterCode(self, jupyter_code, old_notebook_context):
...
@@ -180,7 +180,6 @@ def Base_runJupyterCode(self, jupyter_code, old_notebook_context):
# Saving the initial globals dict so as to compare it after code execution
# Saving the initial globals dict so as to compare it after code execution
globals_dict
=
globals
()
globals_dict
=
globals
()
result_string
=
''
notebook_context
=
old_notebook_context
notebook_context
=
old_notebook_context
# Execute only if jupyter_code is not empty
# Execute only if jupyter_code is not empty
...
@@ -432,8 +431,7 @@ class EnvironmentDefinitionError(TypeError):
...
@@ -432,8 +431,7 @@ class EnvironmentDefinitionError(TypeError):
def
canSerialize
(
obj
):
def
canSerialize
(
obj
):
result
=
False
container_type_tuple
=
(
list
,
tuple
,
dict
,
set
,
frozenset
)
container_type_tuple
=
(
list
,
tuple
,
dict
,
set
,
frozenset
)
# if object is a container, we need to check its elements for presence of
# if object is a container, we need to check its elements for presence of
...
@@ -479,7 +477,7 @@ def canSerialize(obj):
...
@@ -479,7 +477,7 @@ def canSerialize(obj):
#
#
# Even though the issue seems complicated, this quickfix should be
# Even though the issue seems complicated, this quickfix should be
# properly rewritten in a better way as soon as possible.
# properly rewritten in a better way as soon as possible.
except
(
cPickle
.
PicklingError
,
TypeError
,
NameError
,
AttributeError
)
as
e
:
except
(
cPickle
.
PicklingError
,
TypeError
,
NameError
,
AttributeError
):
return
False
return
False
else
:
else
:
return
True
return
True
...
@@ -735,7 +733,7 @@ class ImportFixer(ast.NodeTransformer):
...
@@ -735,7 +733,7 @@ class ImportFixer(ast.NodeTransformer):
"WARNING: Your imported the module %s without using "
"WARNING: Your imported the module %s without using "
"the environment object, which is not recomended. "
"the environment object, which is not recomended. "
"Your import was automatically converted to use such method."
"Your import was automatically converted to use such method."
"The setup function
registered was named
%s_setup.
\
\
n"
"The setup function
was named as:
%s_setup.
\
\
n"
"'"
)
%
(
module_name
,
module_name
)
"'"
)
%
(
module_name
,
module_name
)
tree
=
ast
.
parse
(
warning
)
tree
=
ast
.
parse
(
warning
)
return
tree
.
body
[
0
]
return
tree
.
body
[
0
]
...
@@ -763,7 +761,7 @@ def renderAsHtml(self, renderable_object):
...
@@ -763,7 +761,7 @@ def renderAsHtml(self, renderable_object):
compile_jupyter_frame
=
sys
.
_getframe
(
3
)
compile_jupyter_frame
=
sys
.
_getframe
(
3
)
compile_jupyter_locals
=
compile_jupyter_frame
.
f_locals
compile_jupyter_locals
=
compile_jupyter_frame
.
f_locals
processor
=
compile_jupyter_locals
[
'processor_list'
].
getProcessorFor
(
renderable_object
)
processor
=
compile_jupyter_locals
[
'processor_list'
].
getProcessorFor
(
renderable_object
)
result
,
mime_type
=
processor
(
renderable_object
).
process
()
result
,
_
=
processor
(
renderable_object
).
process
()
compile_jupyter_locals
[
'inject_variable_dict'
][
'_print'
].
write
(
result
)
compile_jupyter_locals
[
'inject_variable_dict'
][
'_print'
].
write
(
result
)
compile_jupyter_locals
[
'display_data'
][
'mime_type'
]
=
'text/html'
compile_jupyter_locals
[
'display_data'
][
'mime_type'
]
=
'text/html'
...
@@ -773,7 +771,7 @@ def getErrorMessageForException(self, exception, notebook_context):
...
@@ -773,7 +771,7 @@ def getErrorMessageForException(self, exception, notebook_context):
code execution (notebook_context) and will return a dict as Jupyter
code execution (notebook_context) and will return a dict as Jupyter
requires for error rendering.
requires for error rendering.
'''
'''
etype
,
value
,
tb
=
sys
.
exc_info
()
_
,
value
,
_
=
sys
.
exc_info
()
traceback_text
=
traceback
.
format_exc
().
split
(
'
\
n
'
)[:
-
1
]
traceback_text
=
traceback
.
format_exc
().
split
(
'
\
n
'
)[:
-
1
]
return
{
return
{
'status'
:
'error'
,
'status'
:
'error'
,
...
...
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.xml
View file @
23b9cc45
...
@@ -46,14 +46,11 @@
...
@@ -46,14 +46,11 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
W: 85, 2: Redefining name \'traceback\' from outer scope (line 9) (redefined-outer-name)
</string>
<string>
W:308, 10: Use of exec (exec-used)
</string>
<string>
W:197, 8: Use of exec (exec-used)
</string>
<string>
W:357, 10: Use of exec (exec-used)
</string>
<string>
W:252, 8: Use of exec (exec-used)
</string>
<string>
W:372, 10: Use of exec (exec-used)
</string>
<string>
W:264, 8: Use of exec (exec-used)
</string>
<string>
W:460, 6: No exception type(s) specified (bare-except)
</string>
<string>
W:327, 10: Unused variable \'mime_type\' (unused-variable)
</string>
<string>
W:916, 2: Redefining name \'IFrame\' from outer scope (line 22) (redefined-outer-name)
</string>
<string>
W:462, 2: Redefining name \'IFrame\' from outer scope (line 17) (redefined-outer-name)
</string>
<string>
W: 9, 0: Unused import traceback (unused-import)
</string>
<string>
W: 13, 0: Unused import transaction (unused-import)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment