easycoder 250506.1__py2.py3-none-any.whl → 250507.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 +8 -0
- easycoder/ec_core.py +15 -15
- easycoder/ec_pyside.py +2 -3
- {easycoder-250506.1.dist-info → easycoder-250507.1.dist-info}/METADATA +1 -1
- {easycoder-250506.1.dist-info → easycoder-250507.1.dist-info}/RECORD +9 -9
- {easycoder-250506.1.dist-info → easycoder-250507.1.dist-info}/WHEEL +0 -0
- {easycoder-250506.1.dist-info → easycoder-250507.1.dist-info}/entry_points.txt +0 -0
- {easycoder-250506.1.dist-info → easycoder-250507.1.dist-info}/licenses/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_classes.py
CHANGED
|
@@ -8,6 +8,10 @@ class FatalError:
|
|
|
8
8
|
print(f'Compile error in {compiler.program.name} at line {lino + 1} ({script}): {message}')
|
|
9
9
|
sys.exit()
|
|
10
10
|
|
|
11
|
+
class NoValueError(FatalError):
|
|
12
|
+
def __init__(self, compiler, record):
|
|
13
|
+
super().__init__(compiler, 'Variable {record["name"]} does not hold a value')
|
|
14
|
+
|
|
11
15
|
class AssertionError:
|
|
12
16
|
def __init__(self, program, msg=None):
|
|
13
17
|
code = program.code[program.pc]
|
|
@@ -30,6 +34,10 @@ class RuntimeError:
|
|
|
30
34
|
print(f'Runtime Error in {program.name} at line {lino + 1} ({script}): {message}')
|
|
31
35
|
sys.exit()
|
|
32
36
|
|
|
37
|
+
class NoValueRuntimeError(RuntimeError):
|
|
38
|
+
def __init__(self, program, record):
|
|
39
|
+
super().__init__(program, 'Variable {record["name"]} does not hold a value')
|
|
40
|
+
|
|
33
41
|
class RuntimeWarning:
|
|
34
42
|
def __init__(self, program, message):
|
|
35
43
|
if program == None:
|
easycoder/ec_core.py
CHANGED
|
@@ -2,7 +2,7 @@ import json, math, hashlib, threading, os, subprocess, sys, requests, time, numb
|
|
|
2
2
|
from psutil import Process
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
4
|
from random import randrange
|
|
5
|
-
from .ec_classes import FatalError, RuntimeWarning, RuntimeError, AssertionError, Condition, Object
|
|
5
|
+
from .ec_classes import FatalError, RuntimeWarning, RuntimeError, AssertionError, NoValueError, NoValueRuntimeError, Condition, Object
|
|
6
6
|
from .ec_handler import Handler
|
|
7
7
|
from .ec_timestamp import getTimestamp
|
|
8
8
|
|
|
@@ -94,7 +94,7 @@ class Core(Handler):
|
|
|
94
94
|
command['target'] = symbolRecord['name']
|
|
95
95
|
self.add(command)
|
|
96
96
|
return True
|
|
97
|
-
self.warning(f'Core.append: Variable
|
|
97
|
+
self.warning(f'Core.append: Variable {symbolRecord["name"]} does not hold a value')
|
|
98
98
|
return False
|
|
99
99
|
|
|
100
100
|
def r_append(self, command):
|
|
@@ -251,7 +251,7 @@ class Core(Handler):
|
|
|
251
251
|
command['target'] = self.getToken()
|
|
252
252
|
self.add(command)
|
|
253
253
|
return True
|
|
254
|
-
self.warning(f'Core.decrement: Variable
|
|
254
|
+
self.warning(f'Core.decrement: Variable {symbolRecord["name"]} does not hold a value')
|
|
255
255
|
return False
|
|
256
256
|
|
|
257
257
|
def r_decrement(self, command):
|
|
@@ -277,7 +277,7 @@ class Core(Handler):
|
|
|
277
277
|
command['var'] = record['name']
|
|
278
278
|
self.add(command)
|
|
279
279
|
return True
|
|
280
|
-
|
|
280
|
+
NoValueError(self.compiler, record)
|
|
281
281
|
self.warning(f'Core.delete: variable expected; got {self.getToken()}')
|
|
282
282
|
else:
|
|
283
283
|
self.warning(f'Core.delete: "file", "property" or "element" expected; got {token}')
|
|
@@ -418,7 +418,7 @@ class Core(Handler):
|
|
|
418
418
|
if symbolRecord['hasValue']:
|
|
419
419
|
command['target'] = self.getToken()
|
|
420
420
|
else:
|
|
421
|
-
|
|
421
|
+
NoValueError(self.compiler, symbolRecord)
|
|
422
422
|
if self.nextIs('from'):
|
|
423
423
|
if self.nextIs('url'):
|
|
424
424
|
url = self.nextValue()
|
|
@@ -629,7 +629,7 @@ class Core(Handler):
|
|
|
629
629
|
command['target'] = self.getToken()
|
|
630
630
|
self.add(command)
|
|
631
631
|
return True
|
|
632
|
-
self.warning(f'Core.increment: Variable
|
|
632
|
+
self.warning(f'Core.increment: Variable {symbolRecord["name"]} does not hold a value')
|
|
633
633
|
return False
|
|
634
634
|
|
|
635
635
|
def r_increment(self, command):
|
|
@@ -829,13 +829,13 @@ class Core(Handler):
|
|
|
829
829
|
command['target'] = self.getToken()
|
|
830
830
|
self.add(command)
|
|
831
831
|
return True
|
|
832
|
-
self.warning(f'Core.negate: Variable
|
|
832
|
+
self.warning(f'Core.negate: Variable {symbolRecord["name"]} does not hold a value')
|
|
833
833
|
return False
|
|
834
834
|
|
|
835
835
|
def r_negate(self, command):
|
|
836
836
|
symbolRecord = self.getVariable(command['target'])
|
|
837
837
|
if not symbolRecord['hasValue']:
|
|
838
|
-
|
|
838
|
+
NoValueRuntimeError(self.program, symbolRecord)
|
|
839
839
|
return None
|
|
840
840
|
value = self.getSymbolValue(symbolRecord)
|
|
841
841
|
if value == None:
|
|
@@ -937,7 +937,7 @@ class Core(Handler):
|
|
|
937
937
|
def r_pop(self, command):
|
|
938
938
|
symbolRecord = self.getVariable(command['target'])
|
|
939
939
|
if not symbolRecord['hasValue']:
|
|
940
|
-
|
|
940
|
+
NoValueRuntimeError(self.program, symbolRecord)
|
|
941
941
|
stackRecord = self.getVariable(command['from'])
|
|
942
942
|
stack = self.getSymbolValue(stackRecord)
|
|
943
943
|
v = stack.pop()
|
|
@@ -1091,7 +1091,7 @@ class Core(Handler):
|
|
|
1091
1091
|
return -1
|
|
1092
1092
|
symbolRecord = self.getVariable(command['target'])
|
|
1093
1093
|
if not symbolRecord['hasValue']:
|
|
1094
|
-
|
|
1094
|
+
NoValueRuntimeError(self.program, symbolRecord)
|
|
1095
1095
|
return -1
|
|
1096
1096
|
self.putSymbolValue(symbolRecord, value)
|
|
1097
1097
|
return self.nextPC()
|
|
@@ -1406,13 +1406,13 @@ class Core(Handler):
|
|
|
1406
1406
|
command['target'] = self.getToken()
|
|
1407
1407
|
self.add(command)
|
|
1408
1408
|
return True
|
|
1409
|
-
self.warning(f'Core.negate: Variable
|
|
1409
|
+
self.warning(f'Core.negate: Variable {symbolRecord["name"]} does not hold a value')
|
|
1410
1410
|
return False
|
|
1411
1411
|
|
|
1412
1412
|
def r_shuffle(self, command):
|
|
1413
1413
|
symbolRecord = self.getVariable(command['target'])
|
|
1414
1414
|
if not symbolRecord['hasValue']:
|
|
1415
|
-
|
|
1415
|
+
NoValueRuntimeError(self.program, symbolRecord)
|
|
1416
1416
|
return None
|
|
1417
1417
|
value = self.getSymbolValue(symbolRecord)
|
|
1418
1418
|
if value == None:
|
|
@@ -1735,7 +1735,7 @@ class Core(Handler):
|
|
|
1735
1735
|
def incdec(self, command, mode):
|
|
1736
1736
|
symbolRecord = self.getVariable(command['target'])
|
|
1737
1737
|
if not symbolRecord['hasValue']:
|
|
1738
|
-
|
|
1738
|
+
NoValueRuntimeError(self.program, symbolRecord)
|
|
1739
1739
|
value = self.getSymbolValue(symbolRecord)
|
|
1740
1740
|
if value == None:
|
|
1741
1741
|
RuntimeError(self.program, f'{symbolRecord["name"]} has not been initialised')
|
|
@@ -1805,7 +1805,7 @@ class Core(Handler):
|
|
|
1805
1805
|
if symbolRecord['hasValue']:
|
|
1806
1806
|
value['target'] = symbolRecord['name']
|
|
1807
1807
|
return value
|
|
1808
|
-
self.warning(f'Core.compileValue: Token
|
|
1808
|
+
self.warning(f'Core.compileValue: Token {symbolRecord["name"]} does not hold a value')
|
|
1809
1809
|
return None
|
|
1810
1810
|
|
|
1811
1811
|
if token == 'property':
|
|
@@ -1816,7 +1816,7 @@ class Core(Handler):
|
|
|
1816
1816
|
if symbolRecord['hasValue']:
|
|
1817
1817
|
value['target'] = symbolRecord['name']
|
|
1818
1818
|
return value
|
|
1819
|
-
|
|
1819
|
+
NoValueError(self.compiler, symbolRecord)
|
|
1820
1820
|
return None
|
|
1821
1821
|
|
|
1822
1822
|
if token == 'arg':
|
easycoder/ec_pyside.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from easycoder import Handler,
|
|
2
|
+
from easycoder import Handler, RuntimeError
|
|
3
3
|
from PySide6.QtCore import Qt, QTimer
|
|
4
4
|
from PySide6.QtGui import QPixmap
|
|
5
5
|
from PySide6.QtWidgets import (
|
|
@@ -690,7 +690,7 @@ class Graphics(Handler):
|
|
|
690
690
|
command['index'] = self.nextValue()
|
|
691
691
|
self.skip('of')
|
|
692
692
|
else:
|
|
693
|
-
command['name'] = self.
|
|
693
|
+
command['name'] = self.getValue()
|
|
694
694
|
self.skip('in')
|
|
695
695
|
if self.nextIsSymbol():
|
|
696
696
|
record = self.getSymbolRecord()
|
|
@@ -878,7 +878,6 @@ class Graphics(Handler):
|
|
|
878
878
|
|
|
879
879
|
def r_start(self, command):
|
|
880
880
|
def on_last_window_closed():
|
|
881
|
-
print("Kill the application...")
|
|
882
881
|
self.program.kill()
|
|
883
882
|
def resume():
|
|
884
883
|
self.program.flush(self.nextPC())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250507.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,18 +1,18 @@
|
|
|
1
1
|
easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
|
|
2
|
-
easycoder/__init__.py,sha256=
|
|
3
|
-
easycoder/ec_classes.py,sha256=
|
|
2
|
+
easycoder/__init__.py,sha256=KSELOGTXCLvDM_tXjLIHUIrC4PxAETqPQYvuAO_zZp0,262
|
|
3
|
+
easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
|
|
4
4
|
easycoder/ec_compiler.py,sha256=vNOAKIK2pX_cW4mcxwCe0OR16iqeZqvZQ6JCgQ5MqtU,5062
|
|
5
5
|
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
-
easycoder/ec_core.py,sha256=
|
|
6
|
+
easycoder/ec_core.py,sha256=SX2tXGgQ1aJr8cyb8NZ3ESgnr57G1e0wLDwkJbo3C5E,92003
|
|
7
7
|
easycoder/ec_graphics.py,sha256=WXxKMB4GJSmxvk-FVbOTyufiUx4TYIzyDoB1PCAO3JY,16067
|
|
8
8
|
easycoder/ec_gutils.py,sha256=yqu4RRQ6VdRkC5B2ADBYsXzgNu76dLnekd9aUjdEgPw,6399
|
|
9
9
|
easycoder/ec_handler.py,sha256=zPDZ_hqdgNnkCd8B5HmSLkqsGgf4aDmqcUBOPHgo47U,2305
|
|
10
10
|
easycoder/ec_program.py,sha256=uv2F0Gu9ZJSW2Pb4IitUtq0xb4e_gU8emMYyIRLoS24,10064
|
|
11
|
-
easycoder/ec_pyside.py,sha256=
|
|
11
|
+
easycoder/ec_pyside.py,sha256=N-sHBWIZ-rcFVcwMbqiRbU0IJO9Hpum4jZxeh8L_wvE,37023
|
|
12
12
|
easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
|
|
13
13
|
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
-
easycoder-
|
|
15
|
-
easycoder-
|
|
16
|
-
easycoder-
|
|
17
|
-
easycoder-
|
|
18
|
-
easycoder-
|
|
14
|
+
easycoder-250507.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
15
|
+
easycoder-250507.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
+
easycoder-250507.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
17
|
+
easycoder-250507.1.dist-info/METADATA,sha256=0dsCfx7GctfUuUE5S_0j0gekEnnYOU-leSF811uh_1Y,6827
|
|
18
|
+
easycoder-250507.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|