mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-22 19:53:00 -05:00
pre-commit: Add codespell and other checks (#263)
This commit is contained in:
@@ -16,7 +16,7 @@ export class PyButton extends BaseEvalElement {
|
||||
if (this.hasAttribute('label')) {
|
||||
this.label = this.getAttribute('label');
|
||||
}
|
||||
|
||||
|
||||
// Styling does the same thing as class in normal HTML. Using the name "class" makes the style to malfunction
|
||||
if (this.hasAttribute('styling')) {
|
||||
let klass = this.getAttribute('styling');
|
||||
@@ -25,7 +25,7 @@ export class PyButton extends BaseEvalElement {
|
||||
}else{
|
||||
klass = klass.trim()
|
||||
const newClassArray = klass.split(' ');
|
||||
// trim each element to remove unecessary spaces which makes the button style to malfunction
|
||||
// trim each element to remove unnecessary spaces which makes the button style to malfunction
|
||||
this.class = (() => {const concatenatedString = []; for (let i = 0; i < newClassArray.length; i++) {if (newClassArray[i].trim() !== '')(concatenatedString.push(newClassArray[i].trim()));} return concatenatedString;})();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import io
|
||||
import sys
|
||||
import time
|
||||
|
||||
import micropip
|
||||
from js import console, document, setInterval, setTimeout
|
||||
import micropip # noqa: F401
|
||||
from js import console, document
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
@@ -72,10 +72,9 @@ def format_mime(obj):
|
||||
|
||||
mimebundle = eval_formatter(obj, "_repr_mimebundle_")
|
||||
if isinstance(mimebundle, tuple):
|
||||
format_dict, md_dict = mimebundle
|
||||
format_dict, _ = mimebundle
|
||||
else:
|
||||
format_dict = mimebundle
|
||||
md_dict = {}
|
||||
|
||||
output, not_available = None, []
|
||||
for method, mime_type in reversed(MIME_METHODS.items()):
|
||||
@@ -130,7 +129,7 @@ class PyScript:
|
||||
|
||||
@staticmethod
|
||||
def run_until_complete(f):
|
||||
p = loop.run_until_complete(f)
|
||||
_ = loop.run_until_complete(f)
|
||||
|
||||
|
||||
class Element:
|
||||
@@ -311,7 +310,6 @@ class PyListTemplate:
|
||||
return [c.data for c in self._children]
|
||||
|
||||
def render_children(self):
|
||||
out = []
|
||||
binds = {}
|
||||
for i, c in enumerate(self._children):
|
||||
txt = c.element.innerHTML
|
||||
@@ -328,7 +326,7 @@ class PyListTemplate:
|
||||
srcEl.element.onclick()
|
||||
evtEl.classList = srcEl.element.classList
|
||||
|
||||
for new_id, old_id in binds.items():
|
||||
for new_id in binds:
|
||||
Element(new_id).element.onclick = foo
|
||||
|
||||
def connect(self):
|
||||
|
||||
Reference in New Issue
Block a user