8000 Begin making pyscript.py into a Python package by hoodmane · Pull Request #1232 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Begin making pyscript.py into a Python package #1232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Begin making pyscript.py into a Python package
  • Loading branch information
hoodmane committed Feb 28, 2023
commit d0d52372d56114d736559bd45b23e93698922767
5 changes: 3 additions & 2 deletions pyscriptjs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ImportmapPlugin } from './plugins/importmap';
import { StdioDirector as StdioDirector } from './plugins/stdiodirector';
// eslint-disable-next-line
// @ts-ignore
import pyscript from './python/pyscript.py';
import pyscript from './python/pyscript/__init__.py';
import { robustFetch } from './fetch';

const logger = getLogger('pyscript/main');
Expand Down Expand Up @@ -213,7 +213,8 @@ export class PyScriptApp {
logger.info('importing pyscript');

// Save and load pyscript.py from FS
interpreter.interface.FS.writeFile('pyscript.py', pyscript, { encoding: 'utf8' });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writeFile does not take an option called encoding.

interpreter.interface.FS.mkdirTree("pyscript")
interpreter.interface.FS.writeFile('pyscript/__init__.py', pyscript);
//Refresh the module cache so Python consistently finds pyscript module
interpreter.invalidate_module_path_cache();

Expand Down
0