mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
remove unused import
This commit is contained in:
@@ -12,7 +12,6 @@ new_task_content = Element("new-task-content")
|
|||||||
def add_task(*ags, **kws):
|
def add_task(*ags, **kws):
|
||||||
# create task
|
# create task
|
||||||
task_id = f"task-{len(tasks)}"
|
task_id = f"task-{len(tasks)}"
|
||||||
now = dt.now()
|
|
||||||
task = {"id": task_id, "content": new_task_content.element.value, "done": False, "created_at": dt.now()}
|
task = {"id": task_id, "content": new_task_content.element.value, "done": False, "created_at": dt.now()}
|
||||||
|
|
||||||
tasks.append(task)
|
tasks.append(task)
|
||||||
|
|||||||
@@ -135,10 +135,9 @@ let loadFromFile = async function(s: string, runtime: any): Promise<any> {
|
|||||||
let filename = getLastPath(s);
|
let filename = getLastPath(s);
|
||||||
await runtime.runPythonAsync(`
|
await runtime.runPythonAsync(`
|
||||||
from pyodide.http import pyfetch
|
from pyodide.http import pyfetch
|
||||||
from pyodide import eval_code
|
|
||||||
response = await pyfetch("`+s+`")
|
response = await pyfetch("`+s+`")
|
||||||
content = await response.bytes()
|
content = await response.bytes()
|
||||||
|
|
||||||
with open("`+filename+`", "wb") as f:
|
with open("`+filename+`", "wb") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
`)
|
`)
|
||||||
|
|||||||
Reference in New Issue
Block a user