Skip to content

Commit 7c1a0d1

Browse files
committed
lint and remove of textwrap in stdlib for micropython compatibility
1 parent b885f30 commit 7c1a0d1

File tree

16 files changed

+37
-16
lines changed

16 files changed

+37
-16
lines changed

pyscript.core/src/stdlib/pyscript/fetch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22

33
import js
4+
45
from pyscript.util import as_bytearray
56

67

pyscript.core/src/stdlib/pyscript/magic_js.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import js as globalThis
55
from polyscript import config as _config
66
from polyscript import js_modules
7+
78
from pyscript.util import NotSupported
89

910
RUNNING_IN_WORKER = not hasattr(globalThis, "document")

pyscript.core/src/stdlib/pyscript/websocket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import js
2+
23
from pyscript.util import as_bytearray
34

45
code = "code"

pyscript.core/src/stdlib/pyweb/media.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pyodide.ffi import to_js
2+
23
from pyscript import window
34

45

pyscript.core/src/stdlib/pyweb/ui/elements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import inspect
22
import sys
3-
from textwrap import dedent
43

5-
from pyscript import document, when, window
64
from pyweb import JSProperty, pydom
75

6+
from pyscript import document, when, window
7+
88
#: A flag to show if MicroPython is the current Python interpreter.
99
is_micropython = "MicroPython" in sys.version
1010

pyscript.core/src/stdlib/pyweb/ui/markdown.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Markdown module to generate web/HTML components from Markdown code"""
22

3-
from pyscript import document, window
43
from pyweb import pydom
54
from pyweb.ui.elements import TextElementBase, script
65

6+
from pyscript import document, window
7+
78

89
class markdown(TextElementBase):
910
"""Markdown component to render HTML from Markdown code"""

pyscript.core/src/stdlib/pyweb/ui/shoelace.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import string
2-
from textwrap import dedent
3-
4-
from pyscript import document, when, window
51
from pyweb import JSProperty, pydom
62
from pyweb.ui import elements as el
73

4+
from pyscript import document, when, window
5+
86

97
class ShoeBase(el.ElementBase):
108
tag = "div"

pyscript.core/test/camera.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from pyodide.ffi import create_proxy
2-
from pyscript import display, document, when, window
32
from pyweb import media, pydom
43

4+
from pyscript import display, document, when, window
5+
56
devicesSelect = pydom["#devices"][0]
67
video = pydom["video"][0]
78
devices = {}

pyscript.core/test/pydom.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script type="module" src="../dist/core.js"></script>
99
</head>
1010
<body>
11-
<script type="py" src="pydom.py"></script>
11+
<script type="mpy" src="pydom.py"></script>
1212

1313
<button id="just-a-button">Click For Time</button>
1414
<button id="color-button">Click For Color</button>

pyscript.core/test/pydom.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import random
2+
import sys
23
import time
34
from datetime import datetime as dt
45

5-
from pyscript import display, when
66
from pyweb import pydom
77

8+
from pyscript import display, when
9+
10+
display(sys.version, target="system-info")
11+
812

913
@when("click", "#just-a-button")
1014
def on_click():

0 commit comments

Comments
 (0)