Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
6de43c9e
Commit
6de43c9e
authored
Sep 20, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Module.locateFile inside _loadPackage
parent
73e3898b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
src/pyodide.js
src/pyodide.js
+16
-15
test/conftest.py
test/conftest.py
+1
-1
No files found.
src/pyodide.js
View file @
6de43c9e
...
@@ -38,7 +38,6 @@ var languagePluginLoader = new Promise((resolve, reject) => {
...
@@ -38,7 +38,6 @@ var languagePluginLoader = new Promise((resolve, reject) => {
let
loadedPackages
=
window
.
pyodide
.
loadedPackages
;
let
loadedPackages
=
window
.
pyodide
.
loadedPackages
;
let
queue
=
[].
concat
(
names
||
[]);
let
queue
=
[].
concat
(
names
||
[]);
let
toLoad
=
new
Array
();
let
toLoad
=
new
Array
();
window
.
pyodide
.
_toLoadPackages
=
toLoad
;
while
(
queue
.
length
)
{
while
(
queue
.
length
)
{
let
package_uri
=
queue
.
pop
();
let
package_uri
=
queue
.
pop
();
...
@@ -81,6 +80,20 @@ var languagePluginLoader = new Promise((resolve, reject) => {
...
@@ -81,6 +80,20 @@ var languagePluginLoader = new Promise((resolve, reject) => {
}
}
}
}
console
.
log
(
`Trying to load
${
Object
.
keys
(
toLoad
)}
`
);
window
.
pyodide
.
_module
.
locateFile
=
(
path
)
=>
{
// handle packages loaded from custom URLs
let
package
=
path
.
replace
(
/
\.
data$/
,
""
);
if
(
package
in
toLoad
)
{
let
package_uri
=
toLoad
[
package
];
if
(
package_uri
!=
'
default channel
'
)
{
return
package_uri
.
replace
(
/
\.
js$/
,
"
.data
"
);
};
};
return
baseURL
+
path
;
};
let
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
let
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
if
(
Object
.
keys
(
toLoad
).
length
===
0
)
{
if
(
Object
.
keys
(
toLoad
).
length
===
0
)
{
resolve
(
'
No new packages to load
'
);
resolve
(
'
No new packages to load
'
);
...
@@ -162,6 +175,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
...
@@ -162,6 +175,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
// Rearrange namespace for public API
// Rearrange namespace for public API
let
PUBLIC_API
=
[
let
PUBLIC_API
=
[
'
loadPackage
'
,
'
loadPackage
'
,
'
loadedPackages
'
,
'
pyimport
'
,
'
pyimport
'
,
'
repr
'
,
'
repr
'
,
'
runPython
'
,
'
runPython
'
,
...
@@ -197,20 +211,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
...
@@ -197,20 +211,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
return
{};
return
{};
};
};
Module
.
locateFile
=
(
path
)
=>
{
Module
.
locateFile
=
(
path
)
=>
baseURL
+
path
;
if
((
window
.
hasOwnProperty
(
'
pyodide
'
))
&&
(
window
.
pyodide
.
hasOwnProperty
(
'
_toLoadPackages
'
)))
{
// handle packages loaded from custom URLs
let
package
=
path
.
replace
(
/
\.
data$/
,
""
);
if
(
package
in
window
.
pyodide
.
_toLoadPackages
)
{
let
package_uri
=
window
.
pyodide
.
_toLoadPackages
[
package
];
if
(
package_uri
!=
'
default channel
'
)
{
return
package_uri
.
replace
(
/
\.
js$/
,
"
.data
"
);
};
};
};
return
baseURL
+
path
;
};
var
postRunPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
var
postRunPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
Module
.
postRun
=
()
=>
{
Module
.
postRun
=
()
=>
{
delete
window
.
Module
;
delete
window
.
Module
;
...
...
test/conftest.py
View file @
6de43c9e
...
@@ -112,7 +112,7 @@ class SeleniumWrapper:
...
@@ -112,7 +112,7 @@ class SeleniumWrapper:
except
TimeoutException
as
exc
:
except
TimeoutException
as
exc
:
_display_driver_logs
(
self
.
browser
,
self
.
driver
)
_display_driver_logs
(
self
.
browser
,
self
.
driver
)
print
(
self
.
logs
)
print
(
self
.
logs
)
raise
TimeoutException
()
raise
TimeoutException
(
'wait_until_packages_loaded timed out'
)
@
property
@
property
def
urls
(
self
):
def
urls
(
self
):
...
...
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