easycoder 250611.4__py2.py3-none-any.whl → 250611.6__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_core.py +40 -13
- {easycoder-250611.4.dist-info → easycoder-250611.6.dist-info}/METADATA +1 -1
- {easycoder-250611.4.dist-info → easycoder-250611.6.dist-info}/RECORD +7 -7
- {easycoder-250611.4.dist-info → easycoder-250611.6.dist-info}/LICENSE +0 -0
- {easycoder-250611.4.dist-info → easycoder-250611.6.dist-info}/WHEEL +0 -0
- {easycoder-250611.4.dist-info → easycoder-250611.6.dist-info}/entry_points.txt +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_core.py
CHANGED
|
@@ -732,17 +732,37 @@ class Core(Handler):
|
|
|
732
732
|
if record['keyword'] == 'ssh':
|
|
733
733
|
command['ssh'] = record['name']
|
|
734
734
|
command['path'] = self.nextValue()
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
735
|
+
else:
|
|
736
|
+
command['file'] = self.getValue()
|
|
737
|
+
else:
|
|
738
|
+
command['file'] = self.getValue()
|
|
739
|
+
command['or'] = None
|
|
740
|
+
load = self.getPC()
|
|
739
741
|
self.add(command)
|
|
742
|
+
if self.peek() == 'or':
|
|
743
|
+
self.nextToken()
|
|
744
|
+
self.nextToken()
|
|
745
|
+
# Add a 'goto' to skip the 'or'
|
|
746
|
+
cmd = {}
|
|
747
|
+
cmd['lino'] = command['lino']
|
|
748
|
+
cmd['domain'] = 'core'
|
|
749
|
+
cmd['keyword'] = 'gotoPC'
|
|
750
|
+
cmd['goto'] = 0
|
|
751
|
+
cmd['debug'] = False
|
|
752
|
+
skip = self.getPC()
|
|
753
|
+
self.add(cmd)
|
|
754
|
+
# Process the 'or'
|
|
755
|
+
self.getCommandAt(load)['or'] = self.getPC()
|
|
756
|
+
self.compileOne()
|
|
757
|
+
# Fixup the skip
|
|
758
|
+
self.getCommandAt(skip)['goto'] = self.getPC()
|
|
740
759
|
return True
|
|
741
760
|
else:
|
|
742
761
|
FatalError(self.compiler, f'I don\'t understand \'{self.getToken()}\'')
|
|
743
762
|
return False
|
|
744
763
|
|
|
745
764
|
def r_load(self, command):
|
|
765
|
+
errorReason = None
|
|
746
766
|
target = self.getVariable(command['target'])
|
|
747
767
|
if 'ssh' in command:
|
|
748
768
|
ssh = self.getVariable(command['ssh'])
|
|
@@ -751,17 +771,24 @@ class Core(Handler):
|
|
|
751
771
|
try:
|
|
752
772
|
with sftp.open(path, 'r') as remote_file: content = remote_file.read().decode()
|
|
753
773
|
except:
|
|
754
|
-
|
|
774
|
+
errorReason = f'Unable to read from {path}'
|
|
755
775
|
else:
|
|
756
776
|
filename = self.getRuntimeValue(command['file'])
|
|
757
777
|
try:
|
|
758
778
|
with open(filename) as f: content = f.read()
|
|
779
|
+
try:
|
|
780
|
+
if filename.endswith('.json'): content = json.loads(content)
|
|
781
|
+
except:
|
|
782
|
+
errorReason = 'Bad or null JSON string'
|
|
759
783
|
except:
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
784
|
+
errorReason = f'Unable to read from {filename}'
|
|
785
|
+
|
|
786
|
+
if errorReason:
|
|
787
|
+
if command['or'] != None:
|
|
788
|
+
print(f'Exception "{errorReason}": Running the "or" clause')
|
|
789
|
+
return command['or']
|
|
790
|
+
else:
|
|
791
|
+
RuntimeError(self.program, f'Error: {errorReason}')
|
|
765
792
|
value = {}
|
|
766
793
|
value['type'] = 'text'
|
|
767
794
|
value['content'] = content
|
|
@@ -1293,8 +1320,7 @@ class Core(Handler):
|
|
|
1293
1320
|
self.compileOne()
|
|
1294
1321
|
# Fixup the skip
|
|
1295
1322
|
self.getCommandAt(skip)['goto'] = self.getPC()
|
|
1296
|
-
|
|
1297
|
-
return False
|
|
1323
|
+
return True
|
|
1298
1324
|
|
|
1299
1325
|
def r_save(self, command):
|
|
1300
1326
|
errorReason = None
|
|
@@ -1303,8 +1329,9 @@ class Core(Handler):
|
|
|
1303
1329
|
ssh = self.getVariable(command['ssh'])
|
|
1304
1330
|
path = self.getRuntimeValue(command['path'])
|
|
1305
1331
|
sftp = ssh['sftp']
|
|
1332
|
+
if path.endswith('.json'): content = json.dumps(content)
|
|
1306
1333
|
try:
|
|
1307
|
-
with sftp.open(path, 'w') as remote_file: remote_file.write(content
|
|
1334
|
+
with sftp.open(path, 'w') as remote_file: remote_file.write(content)
|
|
1308
1335
|
except:
|
|
1309
1336
|
errorReason = 'Unable to write to {path}'
|
|
1310
1337
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version: 250611.
|
|
3
|
+
Version: 250611.6
|
|
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,16 +1,16 @@
|
|
|
1
1
|
easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
|
|
2
|
-
easycoder/__init__.py,sha256=
|
|
2
|
+
easycoder/__init__.py,sha256=o9_YySaPtBz9duIzrRdHcPDut__hzgczecPnl09GrpA,262
|
|
3
3
|
easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
|
|
4
4
|
easycoder/ec_compiler.py,sha256=6X9Sy5hr9-Ek36XqWrHJ8Ct1fE5sw2hBLKKFMh2RfRs,5130
|
|
5
5
|
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
-
easycoder/ec_core.py,sha256=
|
|
6
|
+
easycoder/ec_core.py,sha256=hbs4B2MNdm9Sr8XGdyawimqlFsSbIamFHV8gSXYkP_8,98158
|
|
7
7
|
easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
|
|
8
8
|
easycoder/ec_program.py,sha256=IDpfq9oghFJMJyRD9uab31VOP5MOF4M7kcUVfDn7d4I,9992
|
|
9
9
|
easycoder/ec_pyside.py,sha256=X84j4WC0n0p9PaoJI1W4dqDzAHTFD5izX2aLoPCQ8kE,39855
|
|
10
10
|
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
11
11
|
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
12
|
-
easycoder-250611.
|
|
13
|
-
easycoder-250611.
|
|
14
|
-
easycoder-250611.
|
|
15
|
-
easycoder-250611.
|
|
16
|
-
easycoder-250611.
|
|
12
|
+
easycoder-250611.6.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
13
|
+
easycoder-250611.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
easycoder-250611.6.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
15
|
+
easycoder-250611.6.dist-info/METADATA,sha256=bvdNTQNjSxZc84yC2A8SVRyWt3TcL9mePqb7ENxZaoI,6853
|
|
16
|
+
easycoder-250611.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|