Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
a8ca17dd
Commit
a8ca17dd
authored
Apr 04, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Remove error handling, let the notebook failed asap
parent
b9f825f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
22 deletions
+3
-22
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+3
-22
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
a8ca17dd
...
...
@@ -91,11 +91,7 @@
// New type detexted
if
(
next_type
[
1
]
===
'
code
'
)
{
// language detected
try
{
language_type
=
JSON
.
parse
(
current_line
.
match
(
language_type_regexp
)).
language
;
}
catch
(
e
)
{
throw
e
;
}
language_type
=
JSON
.
parse
(
current_line
.
match
(
language_type_regexp
)).
language
;
next_type
[
1
]
=
next_type
[
1
]
+
'
_
'
+
language_type
;
}
pushNewCell
();
...
...
@@ -299,12 +295,8 @@
function
executePyCell
(
line_list
)
{
var
result_text
,
code_text
=
line_list
.
join
(
'
\n
'
);
try
{
result_text
=
pyodide
.
runPython
(
code_text
);
}
catch
(
e
)
{
result_text
=
e
.
message
;
}
renderCodeblock
(
result_text
,
'
python
'
);
result_text
=
pyodide
.
runPython
(
code_text
);
renderCodeblock
(
result_text
);
}
function
pyodideSetting
()
{
...
...
@@ -350,27 +342,21 @@
if
(
!
is_pyodide_loaded
)
{
console
.
log
(
"
Loading pyodide
"
);
queue
.
push
(
function
()
{
console
.
log
(
"
Loading webassembly module
"
);
Module
.
instantiateWasm
=
loadPyodide
;
window
.
Module
=
Module
;
})
.
push
(
function
()
{
console
.
log
(
"
Loading pyodide.asm.data.js
"
);
return
loadJSResource
(
'
pyodide.asm.data.js
'
);
})
.
push
(
function
()
{
console
.
log
(
"
Loading pyodide.asm.js
"
);
return
loadJSResource
(
'
pyodide.asm.js
'
);
})
.
push
(
function
()
{
console
.
log
(
"
Prepare to set postRun and pyodide
"
);
return
pyodideSetting
();
});
is_pyodide_loaded
=
true
;
}
console
.
log
(
"
Fuck!
"
);
queue
.
push
(
function
()
{
console
.
log
(
"
Executing Python cell
"
);
return
executePyCell
(
cell
.
_line_list
);
});
return
queue
;
...
...
@@ -401,11 +387,6 @@
console
.
info
(
'
JSMD executed.
'
);
},
function
(
error
)
{
console
.
error
(
error
);
// do not print the error page with a non-styled pre tag
// the Python error message will be displayed along with Python source code in above
if
(
error
.
message
.
startsWith
(
'
Traceback
'
))
{
return
;
}
var
pre
=
document
.
createElement
(
'
pre
'
);
pre
.
textContent
=
error
;
document
.
body
.
appendChild
(
pre
);
...
...
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