easycoder 250824.2__py2.py3-none-any.whl → 250825.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of easycoder might be problematic. Click here for more details.
- easycoder/__init__.py +1 -1
- easycoder/ec_classes.py +2 -2
- easycoder/ec_compiler.py +3 -0
- easycoder/ec_core.py +3 -3
- easycoder/ec_pyside.py +20 -12
- {easycoder-250824.2.dist-info → easycoder-250825.1.dist-info}/METADATA +1 -1
- {easycoder-250824.2.dist-info → easycoder-250825.1.dist-info}/RECORD +10 -10
- {easycoder-250824.2.dist-info → easycoder-250825.1.dist-info}/WHEEL +0 -0
- {easycoder-250824.2.dist-info → easycoder-250825.1.dist-info}/entry_points.txt +0 -0
- {easycoder-250824.2.dist-info → easycoder-250825.1.dist-info}/licenses/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_classes.py
CHANGED
|
@@ -5,7 +5,7 @@ class FatalError:
|
|
|
5
5
|
compiler.showWarnings()
|
|
6
6
|
lino = compiler.tokens[compiler.index].lino
|
|
7
7
|
script = compiler.script.lines[lino].strip()
|
|
8
|
-
print(f'Compile error in {compiler.program.name} at line {lino + 1} ({script})
|
|
8
|
+
print(f'Compile error in {compiler.program.name} at line {lino + 1} ({script}):\n-> {message}')
|
|
9
9
|
sys.exit()
|
|
10
10
|
|
|
11
11
|
class NoValueError(FatalError):
|
|
@@ -31,7 +31,7 @@ class RuntimeError:
|
|
|
31
31
|
code = program.code[program.pc]
|
|
32
32
|
lino = code['lino']
|
|
33
33
|
script = program.script.lines[lino].strip()
|
|
34
|
-
print(f'Runtime Error in {program.name} at line {lino + 1} ({script})
|
|
34
|
+
print(f'Runtime Error in {program.name} at line {lino + 1} ({script}):\n-> {message}')
|
|
35
35
|
sys.exit()
|
|
36
36
|
|
|
37
37
|
class NoValueRuntimeError(RuntimeError):
|
easycoder/ec_compiler.py
CHANGED
|
@@ -119,6 +119,9 @@ class Compiler:
|
|
|
119
119
|
|
|
120
120
|
def getSymbolRecord(self):
|
|
121
121
|
token = self.getToken()
|
|
122
|
+
if not token in self.symbols:
|
|
123
|
+
FatalError(self, f'Undefined symbol name "{token}"')
|
|
124
|
+
return None
|
|
122
125
|
symbol = self.symbols[token]
|
|
123
126
|
if symbol == None: return None
|
|
124
127
|
symbolRecord = self.code[symbol]
|
easycoder/ec_core.py
CHANGED
|
@@ -540,11 +540,11 @@ class Core(Handler):
|
|
|
540
540
|
|
|
541
541
|
def r_gosub(self, command):
|
|
542
542
|
label = command['gosub'] + ':'
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
if label in self.symbols:
|
|
544
|
+
address = self.symbols[label]
|
|
545
545
|
self.stack.append(self.nextPC())
|
|
546
546
|
return address
|
|
547
|
-
RuntimeError(self.program, f'There is no label "{label
|
|
547
|
+
RuntimeError(self.program, f'There is no label "{label}"')
|
|
548
548
|
return None
|
|
549
549
|
|
|
550
550
|
# if <condition> <action> [else <action>]
|
easycoder/ec_pyside.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import sys
|
|
1
|
+
import sys
|
|
2
|
+
from functools import partial
|
|
2
3
|
from .ec_handler import Handler
|
|
3
4
|
from .ec_classes import RuntimeError
|
|
4
5
|
from .ec_border import Border
|
|
@@ -63,7 +64,8 @@ class Graphics(Handler):
|
|
|
63
64
|
'lineinput',
|
|
64
65
|
'multiline',
|
|
65
66
|
'listbox',
|
|
66
|
-
'combobox'
|
|
67
|
+
'combobox',
|
|
68
|
+
'widget'
|
|
67
69
|
]
|
|
68
70
|
|
|
69
71
|
def dialogTypes(self):
|
|
@@ -264,7 +266,8 @@ class Graphics(Handler):
|
|
|
264
266
|
return False
|
|
265
267
|
|
|
266
268
|
def r_clear(self, command):
|
|
267
|
-
self.getVariable(command['name'])['widget']
|
|
269
|
+
widget = self.getVariable(command['name'])['widget']
|
|
270
|
+
widget.clear()
|
|
268
271
|
return self.nextPC()
|
|
269
272
|
|
|
270
273
|
# close {window}
|
|
@@ -418,11 +421,7 @@ class Graphics(Handler):
|
|
|
418
421
|
self.add(command)
|
|
419
422
|
return True
|
|
420
423
|
|
|
421
|
-
def
|
|
422
|
-
self.add(command)
|
|
423
|
-
return True
|
|
424
|
-
|
|
425
|
-
def k_createComboBox(self, command):
|
|
424
|
+
def k_createWidget(self, command):
|
|
426
425
|
self.add(command)
|
|
427
426
|
return True
|
|
428
427
|
|
|
@@ -489,6 +488,7 @@ class Graphics(Handler):
|
|
|
489
488
|
command['name'] = record['name']
|
|
490
489
|
keyword = record['keyword']
|
|
491
490
|
if keyword == 'window': return self.k_createWindow(command)
|
|
491
|
+
elif keyword in ['listbox', 'combobox', 'widget']: return self.k_createWidget(command)
|
|
492
492
|
elif keyword == 'layout': return self.k_createLayout(command)
|
|
493
493
|
elif keyword == 'group': return self.k_createGroupBox(command)
|
|
494
494
|
elif keyword == 'label': return self.k_createLabel(command)
|
|
@@ -496,8 +496,6 @@ class Graphics(Handler):
|
|
|
496
496
|
elif keyword == 'checkbox': return self.k_createCheckBox(command)
|
|
497
497
|
elif keyword == 'lineinput': return self.k_createLineEdit(command)
|
|
498
498
|
elif keyword == 'multiline': return self.k_createMultiLineEdit(command)
|
|
499
|
-
elif keyword == 'listbox': return self.k_createListWidget(command)
|
|
500
|
-
elif keyword == 'combobox': return self.k_createComboBox(command)
|
|
501
499
|
elif keyword == 'dialog': return self.k_createDialog(command)
|
|
502
500
|
elif keyword == 'messagebox': return self.k_createMessageBox(command)
|
|
503
501
|
return False
|
|
@@ -570,6 +568,7 @@ class Graphics(Handler):
|
|
|
570
568
|
c = pushbutton.contentsMargins()
|
|
571
569
|
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
|
|
572
570
|
pushbutton.setMaximumWidth(w)
|
|
571
|
+
self.putSymbolValue(record, pushbutton)
|
|
573
572
|
record['widget'] = pushbutton
|
|
574
573
|
return self.nextPC()
|
|
575
574
|
|
|
@@ -624,6 +623,10 @@ class Graphics(Handler):
|
|
|
624
623
|
record['widget'] = QComboBox()
|
|
625
624
|
return self.nextPC()
|
|
626
625
|
|
|
626
|
+
def r_createWidget(self, command, record):
|
|
627
|
+
record['widget'] = QWidget()
|
|
628
|
+
return self.nextPC()
|
|
629
|
+
|
|
627
630
|
def r_createDialog(self, command, record):
|
|
628
631
|
|
|
629
632
|
class ECDialog(QDialog):
|
|
@@ -706,6 +709,7 @@ class Graphics(Handler):
|
|
|
706
709
|
elif keyword == 'multiline': return self.r_createMultiLineEdit(command, record)
|
|
707
710
|
elif keyword == 'listbox': return self.r_createListWidget(command, record)
|
|
708
711
|
elif keyword == 'combobox': return self.r_createComboBox(command, record)
|
|
712
|
+
elif keyword == 'widget': return self.r_createWidget(command, record)
|
|
709
713
|
elif keyword == 'dialog': return self.r_createDialog(command, record)
|
|
710
714
|
elif keyword == 'messagebox': return self.r_createMessageBox(command, record)
|
|
711
715
|
return None
|
|
@@ -877,6 +881,10 @@ class Graphics(Handler):
|
|
|
877
881
|
return False
|
|
878
882
|
|
|
879
883
|
def r_on(self, command):
|
|
884
|
+
def run(widget):
|
|
885
|
+
print(f"Widget {widget} was clicked")
|
|
886
|
+
self.run(command['goto'])
|
|
887
|
+
|
|
880
888
|
if command['type'] == 'tick':
|
|
881
889
|
self.runOnTick = command['runOnTick']
|
|
882
890
|
else:
|
|
@@ -884,7 +892,8 @@ class Graphics(Handler):
|
|
|
884
892
|
widget = record['widget']
|
|
885
893
|
keyword = record['keyword']
|
|
886
894
|
if keyword == 'pushbutton':
|
|
887
|
-
|
|
895
|
+
handler = partial(run, widget)
|
|
896
|
+
widget.clicked.connect(handler)
|
|
888
897
|
elif keyword == 'combobox':
|
|
889
898
|
widget.currentIndexChanged.connect(lambda: self.run(command['goto']))
|
|
890
899
|
elif keyword == 'listbox':
|
|
@@ -1126,7 +1135,6 @@ class Graphics(Handler):
|
|
|
1126
1135
|
layout = self.getVariable(command['name'])['widget']
|
|
1127
1136
|
layout.setSpacing(self.getRuntimeValue(command['value']))
|
|
1128
1137
|
elif what == 'text':
|
|
1129
|
-
record = self.getVariable(command['name'])
|
|
1130
1138
|
widget = self.getVariable(command['name'])['widget']
|
|
1131
1139
|
text = self.getRuntimeValue(command['value'])
|
|
1132
1140
|
keyword = record['keyword']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250825.1
|
|
4
4
|
Summary: Rapid scripting in English
|
|
5
5
|
Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
|
|
6
6
|
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=
|
|
1
|
+
easycoder/__init__.py,sha256=k6wMyhT4tubgUJLdxalHar_hnllWAD4wm4b78TDE7MY,339
|
|
2
2
|
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
3
|
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
|
-
easycoder/ec_classes.py,sha256=
|
|
5
|
-
easycoder/ec_compiler.py,sha256
|
|
4
|
+
easycoder/ec_classes.py,sha256=bejrby7mLHTeAQXhhz-1l8iv6LSbNSy30lW21KJKjXE,1832
|
|
5
|
+
easycoder/ec_compiler.py,sha256=zImpvvSEfHRGe5MiIgmiu2i7rJxsB4pVLujqmHaOqTo,5392
|
|
6
6
|
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
7
|
-
easycoder/ec_core.py,sha256=
|
|
7
|
+
easycoder/ec_core.py,sha256=s7Ovz6iTjlMqVk-tmsnOH-EEECHxsudgUF1EAlIsOZ4,98044
|
|
8
8
|
easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
|
|
9
9
|
easycoder/ec_keyboard.py,sha256=ru-HdWolBMZJPyck2s72In9tXFeLJQSPtR1TpjmIo90,18350
|
|
10
10
|
easycoder/ec_program.py,sha256=7h2QKGunsiu5l2OKn-sw-Dd70kZJrb4b2idHubeSXDs,9989
|
|
11
|
-
easycoder/ec_pyside.py,sha256=
|
|
11
|
+
easycoder/ec_pyside.py,sha256=GIoGe7m7iqqnjyi6YN2XkGHvxEzrLkkRGHaFyBsQPfw,53588
|
|
12
12
|
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
13
|
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
14
|
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
-
easycoder-
|
|
16
|
-
easycoder-
|
|
17
|
-
easycoder-
|
|
18
|
-
easycoder-
|
|
19
|
-
easycoder-
|
|
15
|
+
easycoder-250825.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
+
easycoder-250825.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
easycoder-250825.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
+
easycoder-250825.1.dist-info/METADATA,sha256=9VNsqXu-owlaaJB87c9Y1UHbb3kd2S3n7FqPnh8Kj74,6897
|
|
19
|
+
easycoder-250825.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|