easycoder 251028.1__py2.py3-none-any.whl → 251103.3__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_compiler.py +9 -3
- easycoder/ec_core.py +11 -6
- easycoder/ec_handler.py +1 -1
- easycoder/ec_program.py +2 -3
- easycoder/ec_pyside.py +33 -16
- {easycoder-251028.1.dist-info → easycoder-251103.3.dist-info}/METADATA +1 -1
- easycoder-251103.3.dist-info/RECORD +19 -0
- easycoder-251028.1.dist-info/RECORD +0 -19
- {easycoder-251028.1.dist-info → easycoder-251103.3.dist-info}/WHEEL +0 -0
- {easycoder-251028.1.dist-info → easycoder-251103.3.dist-info}/entry_points.txt +0 -0
- {easycoder-251028.1.dist-info → easycoder-251103.3.dist-info}/licenses/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_compiler.py
CHANGED
|
@@ -78,7 +78,10 @@ class Compiler:
|
|
|
78
78
|
return self.program.code[pc]
|
|
79
79
|
|
|
80
80
|
# Add a command to the code list
|
|
81
|
-
def
|
|
81
|
+
def addCommand(self, command):
|
|
82
|
+
if len(self.code) == 0:
|
|
83
|
+
if hasattr(self.program, 'usingGraphics'):
|
|
84
|
+
pass
|
|
82
85
|
self.code.append(command)
|
|
83
86
|
|
|
84
87
|
def isSymbol(self):
|
|
@@ -161,7 +164,7 @@ class Compiler:
|
|
|
161
164
|
command['locked'] = False
|
|
162
165
|
command['extra'] = extra
|
|
163
166
|
if 'keyword' in command: command['hasValue'] = self.hasValue(command['keyword'])
|
|
164
|
-
self.
|
|
167
|
+
self.addCommand(command)
|
|
165
168
|
return True
|
|
166
169
|
|
|
167
170
|
# Compile the current token
|
|
@@ -209,7 +212,7 @@ class Compiler:
|
|
|
209
212
|
self.index = index
|
|
210
213
|
while True:
|
|
211
214
|
token = self.tokens[self.index]
|
|
212
|
-
keyword = token.token
|
|
215
|
+
# keyword = token.token
|
|
213
216
|
if self.debugCompile: print(self.script.lines[token.lino])
|
|
214
217
|
# if keyword != 'else':
|
|
215
218
|
if self.compileOne() == True:
|
|
@@ -223,3 +226,6 @@ class Compiler:
|
|
|
223
226
|
|
|
224
227
|
def compileFromHere(self, stopOn):
|
|
225
228
|
return self.compileFrom(self.getIndex(), stopOn)
|
|
229
|
+
|
|
230
|
+
def compileFromStart(self):
|
|
231
|
+
return self.compileFrom(0, [])
|
easycoder/ec_core.py
CHANGED
|
@@ -1769,12 +1769,17 @@ class Core(Handler):
|
|
|
1769
1769
|
self.program.importPlugin(f'{source}:{clazz}')
|
|
1770
1770
|
return True
|
|
1771
1771
|
return False
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1772
|
+
else:
|
|
1773
|
+
token = self.nextToken()
|
|
1774
|
+
if token in ['graphics', 'debugger']:
|
|
1775
|
+
if not hasattr(self.program, 'usingGraphics'):
|
|
1776
|
+
print('Loading graphics module')
|
|
1777
|
+
from .ec_pyside import Graphics
|
|
1778
|
+
self.program.graphics = Graphics
|
|
1779
|
+
self.program.useClass(Graphics)
|
|
1780
|
+
self.program.usingGraphics = True
|
|
1781
|
+
if token == 'debugger': self.program.debugging = True
|
|
1782
|
+
return True
|
|
1778
1783
|
return False
|
|
1779
1784
|
|
|
1780
1785
|
# Declare a general-purpose variable
|
easycoder/ec_handler.py
CHANGED
|
@@ -23,7 +23,7 @@ class Handler:
|
|
|
23
23
|
self.rewindTo = compiler.rewindTo
|
|
24
24
|
self.warning = compiler.warning
|
|
25
25
|
self.getPC = compiler.getPC
|
|
26
|
-
self.add = compiler.
|
|
26
|
+
self.add = compiler.addCommand
|
|
27
27
|
self.getCommandAt = compiler.getCommandAt
|
|
28
28
|
self.compileOne = compiler.compileOne
|
|
29
29
|
self.compileFromHere = compiler.compileFromHere
|
easycoder/ec_program.py
CHANGED
|
@@ -34,9 +34,9 @@ class Program:
|
|
|
34
34
|
self.domainIndex = {}
|
|
35
35
|
self.name = '<anon>'
|
|
36
36
|
self.code = []
|
|
37
|
+
self.pc = 0
|
|
37
38
|
self.symbols = {}
|
|
38
39
|
self.onError = 0
|
|
39
|
-
self.pc = 0
|
|
40
40
|
self.debugStep = False
|
|
41
41
|
self.stack = []
|
|
42
42
|
self.script = Script(source)
|
|
@@ -48,7 +48,6 @@ class Program:
|
|
|
48
48
|
self.externalControl = False
|
|
49
49
|
self.ticker = 0
|
|
50
50
|
self.running = True
|
|
51
|
-
# self.start()
|
|
52
51
|
|
|
53
52
|
# This is called at 10msec intervals by the GUI code
|
|
54
53
|
def flushCB(self):
|
|
@@ -62,7 +61,7 @@ class Program:
|
|
|
62
61
|
module['child'] = self
|
|
63
62
|
startCompile = time.time()
|
|
64
63
|
self.tokenise(self.script)
|
|
65
|
-
if self.compiler.
|
|
64
|
+
if self.compiler.compileFromStart():
|
|
66
65
|
finishCompile = time.time()
|
|
67
66
|
s = len(self.script.lines)
|
|
68
67
|
t = len(self.script.tokens)
|
easycoder/ec_pyside.py
CHANGED
|
@@ -836,6 +836,7 @@ class Graphics(Handler):
|
|
|
836
836
|
|
|
837
837
|
# Initialize the graphics environment
|
|
838
838
|
def k_init(self, command):
|
|
839
|
+
# return True
|
|
839
840
|
if self.nextIs('graphics'):
|
|
840
841
|
self.add(command)
|
|
841
842
|
return True
|
|
@@ -847,7 +848,22 @@ class Graphics(Handler):
|
|
|
847
848
|
self.program.screenWidth = screen[0]
|
|
848
849
|
self.program.screenHeight = screen[1]
|
|
849
850
|
print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
|
|
850
|
-
return self.nextPC()
|
|
851
|
+
# return self.nextPC()
|
|
852
|
+
def on_last_window_closed():
|
|
853
|
+
self.program.kill()
|
|
854
|
+
def init():
|
|
855
|
+
self.program.flush(self.nextPC())
|
|
856
|
+
def flush():
|
|
857
|
+
if not self.blocked:
|
|
858
|
+
if self.runOnTick != 0:
|
|
859
|
+
self.program.run(self.runOnTick)
|
|
860
|
+
self.program.flushCB()
|
|
861
|
+
timer = QTimer()
|
|
862
|
+
timer.timeout.connect(flush)
|
|
863
|
+
timer.start(10)
|
|
864
|
+
QTimer.singleShot(500, init)
|
|
865
|
+
self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
866
|
+
self.app.exec()
|
|
851
867
|
|
|
852
868
|
# Declare a label variable
|
|
853
869
|
def k_label(self, command):
|
|
@@ -1367,21 +1383,22 @@ class Graphics(Handler):
|
|
|
1367
1383
|
return False
|
|
1368
1384
|
|
|
1369
1385
|
def r_start(self, command):
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
timer
|
|
1381
|
-
timer.
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
self.app.
|
|
1386
|
+
return self.nextPC()
|
|
1387
|
+
# def on_last_window_closed():
|
|
1388
|
+
# self.program.kill()
|
|
1389
|
+
# def init():
|
|
1390
|
+
# self.program.flush(self.nextPC())
|
|
1391
|
+
# def flush():
|
|
1392
|
+
# if not self.blocked:
|
|
1393
|
+
# if self.runOnTick != 0:
|
|
1394
|
+
# self.program.run(self.runOnTick)
|
|
1395
|
+
# self.program.flushCB()
|
|
1396
|
+
# timer = QTimer()
|
|
1397
|
+
# timer.timeout.connect(flush)
|
|
1398
|
+
# timer.start(10)
|
|
1399
|
+
# QTimer.singleShot(500, init)
|
|
1400
|
+
# self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
1401
|
+
# self.app.exec()
|
|
1385
1402
|
|
|
1386
1403
|
# Declare a widget variable
|
|
1387
1404
|
def k_widget(self, command):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 251103.3
|
|
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>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
easycoder/__init__.py,sha256=wKNst-IocgEEuxeW5PXV9sMNZLt2GSUBeD6LNfBcYrQ,339
|
|
2
|
+
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
+
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
|
+
easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
|
|
5
|
+
easycoder/ec_compiler.py,sha256=1zQ0ApmeHLqPAyP3tKGg1OR0kTEx2S-u6rAxP6EzHS0,5517
|
|
6
|
+
easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
|
|
7
|
+
easycoder/ec_core.py,sha256=c51wdwTwppZwGLOhN22SBCdAmnTFQw0eirMJxkOb8vI,100780
|
|
8
|
+
easycoder/ec_handler.py,sha256=zEZ5cPruEVZp3SIQ6ZjdZN5jDyW2gFvHcNmFaet4Sd4,2324
|
|
9
|
+
easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
|
|
10
|
+
easycoder/ec_program.py,sha256=aPuZOYWFqGd1jsLDl5M5YmLu5LfFAewF9EZh6zHIbyM,10308
|
|
11
|
+
easycoder/ec_pyside.py,sha256=Pkf0lgDTgC7WOjjleiGeBj4e9y9de4DDNlZFsajkVjU,58374
|
|
12
|
+
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
|
+
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
+
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
+
easycoder-251103.3.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
+
easycoder-251103.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
easycoder-251103.3.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
+
easycoder-251103.3.dist-info/METADATA,sha256=BIHn7arUH62vZ-y2lCwKbYIFuCU4Yl_SVZgUVvFKAs8,6897
|
|
19
|
+
easycoder-251103.3.dist-info/RECORD,,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=DtTAJ59tYSGCL-sZNDgv96scJt8hE5gAukr0B0Bjp28,339
|
|
2
|
-
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
-
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
|
-
easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
|
|
5
|
-
easycoder/ec_compiler.py,sha256=LYwGNs8dcHKXI_nnu1sVFe1N36vjvylcUO_tX_bLjrk,5359
|
|
6
|
-
easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
|
|
7
|
-
easycoder/ec_core.py,sha256=TPD35szxgKpUrCmPvDJjGepXifQ1RJzh2nPaBA94FF8,100494
|
|
8
|
-
easycoder/ec_handler.py,sha256=ED08ULiOlZkcs4XHxAguvdPZw_dFXuwGDFLbFuo0kLs,2317
|
|
9
|
-
easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
|
|
10
|
-
easycoder/ec_program.py,sha256=srVDRlELMElvnkjxmREczUVPkvPXPvanZglN4hKreLI,10324
|
|
11
|
-
easycoder/ec_pyside.py,sha256=UDGmiCVbmAoW1vmVp3S-7YRumwoJefMS2UlgDts95NU,57758
|
|
12
|
-
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
|
-
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
-
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
-
easycoder-251028.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
-
easycoder-251028.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
-
easycoder-251028.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
-
easycoder-251028.1.dist-info/METADATA,sha256=iBrOg-GCrRejNmeIGgs0Fu7br7z7dDEwHvbHc1WPd6s,6897
|
|
19
|
-
easycoder-251028.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|