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
Labels
Merge Requests
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
036dad3f
Commit
036dad3f
authored
9 years ago
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_data_notebook bt5: Exception catch for only json dump to make code more readable
parent
ace10d25
1 merge request
!29
Business Template : erp5_data_notebook (To execute remote python code from inside of erp5)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
...m/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
+5
-2
No files found.
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
View file @
036dad3f
...
@@ -152,9 +152,10 @@ result = {\n
...
@@ -152,9 +152,10 @@ result = {\n
}\n
}\n
\n
\n
# Catch exception while seriaizing the result to be passed to jupyter frontend\n
# Catch exception while seriaizing the result to be passed to jupyter frontend\n
# and in case of error put code_result as None and status as \'error\' which would\n
# be shown by Jupyter frontend\n
try:\n
try:\n
serialized_result = json.dumps(result)\n
serialized_result = json.dumps(result)\n
data_notebook_line.edit(notebook_code_result=code_result)\n
except UnicodeDecodeError:\n
except UnicodeDecodeError:\n
result = {\n
result = {\n
u\'code_result\': None,\n
u\'code_result\': None,\n
...
@@ -164,7 +165,9 @@ except UnicodeDecodeError:\n
...
@@ -164,7 +165,9 @@ except UnicodeDecodeError:\n
u\'status\': u\'error\'\n
u\'status\': u\'error\'\n
}\n
}\n
serialized_result = json.dumps(result)\n
serialized_result = json.dumps(result)\n
\n
\n
data_notebook_line.edit(notebook_code_result=code_result)\n
\n
return serialized_result\n
return serialized_result\n
</string>
</value>
</string>
</value>
</item>
</item>
...
...
This diff is collapsed.
Click to expand it.
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