easycoder 250611.1__py2.py3-none-any.whl → 250611.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 CHANGED
@@ -9,4 +9,4 @@ from .ec_program import *
9
9
  from .ec_timestamp import *
10
10
  from .ec_value import *
11
11
 
12
- __version__ = "250611.1"
12
+ __version__ = "250611.3"
easycoder/ec_core.py CHANGED
@@ -1262,20 +1262,40 @@ class Core(Handler):
1262
1262
  # Save a value to a file
1263
1263
  def k_save(self, command):
1264
1264
  command['content'] = self.nextValue()
1265
- if self.nextIs('to'):
1266
- if self.nextIsSymbol():
1267
- record = self.getSymbolRecord()
1268
- if record['keyword'] == 'ssh':
1269
- command['ssh'] = record['name']
1270
- command['path'] = self.nextValue()
1271
- self.add(command)
1272
- return True
1273
- command['file'] = self.getValue()
1274
- self.add(command)
1275
- return True
1265
+ self.skip('to')
1266
+ if self.nextIsSymbol():
1267
+ record = self.getSymbolRecord()
1268
+ if record['keyword'] == 'ssh':
1269
+ command['ssh'] = record['name']
1270
+ command['path'] = self.nextValue()
1271
+ self.add(command)
1272
+ else:
1273
+ command['file'] = self.getValue()
1274
+ command['or'] = None
1275
+ save = self.getPC()
1276
+ self.addCommand(command)
1277
+ if self.peek() == 'or':
1278
+ self.nextToken()
1279
+ self.nextToken()
1280
+ # Add a 'goto' to skip the 'or'
1281
+ cmd = {}
1282
+ cmd['lino'] = command['lino']
1283
+ cmd['domain'] = 'core'
1284
+ cmd['keyword'] = 'gotoPC'
1285
+ cmd['goto'] = 0
1286
+ cmd['debug'] = False
1287
+ skip = self.getPC()
1288
+ self.addCommand(cmd)
1289
+ # Process the 'or'
1290
+ self.getCommandAt(save)['or'] = self.getPC()
1291
+ self.compileOne()
1292
+ # Fixup the skip
1293
+ self.getCommandAt(skip)['goto'] = self.getPC()
1294
+ return True
1276
1295
  return False
1277
1296
 
1278
1297
  def r_save(self, command):
1298
+ errorReason = None
1279
1299
  content = self.getRuntimeValue(command['content'])
1280
1300
  if 'ssh' in command:
1281
1301
  ssh = self.getVariable(command['ssh'])
@@ -1284,14 +1304,21 @@ class Core(Handler):
1284
1304
  try:
1285
1305
  with sftp.open(path, 'w') as remote_file: remote_file.write(content.encode())
1286
1306
  except:
1287
- RuntimeError(self.program, 'Unable to write to {path}')
1307
+ errorReason = 'Unable to write to {path}'
1288
1308
  else:
1289
1309
  filename = self.getRuntimeValue(command['file'])
1290
1310
  if filename.endswith('.json'): content = json.dumps(content)
1291
1311
  try:
1292
1312
  with open(filename, 'w') as f: f.write(content)
1293
1313
  except:
1294
- RuntimeError(self.program, f'Unable to write to {filename}')
1314
+ errorReason = f'Unable to write to {filename}'
1315
+
1316
+ if errorReason:
1317
+ if command['or'] != None:
1318
+ print(f'Exception "{errorReason}": Running the "or" clause')
1319
+ return command['or']
1320
+ else:
1321
+ RuntimeError(self.program, f'Error: {errorReason}')
1295
1322
  return self.nextPC()
1296
1323
 
1297
1324
  # Send a message to a module
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250611.1
3
+ Version: 250611.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>
@@ -1,16 +1,16 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=YHVXt82vfS0c3zSol9yOtOFFnHuvrKOBwvIGFyf0YsQ,262
2
+ easycoder/__init__.py,sha256=voy_RCKYvgiPjR7wwHHL7EoqTiEgVEaryG0X8grr938,262
3
3
  easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
4
4
  easycoder/ec_compiler.py,sha256=zKZXXUrQyHbwZ1gJARnwfdAPHWTARa5SN9Y31iuty8o,5086
5
5
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
- easycoder/ec_core.py,sha256=h0yGdqGMKxvF5BGIyVlPHd-FMjrj9kvLAlLIzXsA3L8,96119
6
+ easycoder/ec_core.py,sha256=7V6xpQQU_ytf0iyEA77Wgn0Cim6Gs04a35BOwQ-uq3c,97087
7
7
  easycoder/ec_handler.py,sha256=zPDZ_hqdgNnkCd8B5HmSLkqsGgf4aDmqcUBOPHgo47U,2305
8
8
  easycoder/ec_program.py,sha256=FmC9Oz4IpkmNq6D2TgMzVa3ha2TDv7jA15uwX_HFJVs,10080
9
9
  easycoder/ec_pyside.py,sha256=I1y8QZgMHLWWxWbKLm_JzHJo6bwASak7tdnuAcuh66c,39904
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.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
- easycoder-250611.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- easycoder-250611.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
- easycoder-250611.1.dist-info/METADATA,sha256=EKv2N_T9PNM8eV1Qkn7ADJx76THgGSwaMJzinGug3oI,6853
16
- easycoder-250611.1.dist-info/RECORD,,
12
+ easycoder-250611.3.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
+ easycoder-250611.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
+ easycoder-250611.3.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
+ easycoder-250611.3.dist-info/METADATA,sha256=5kidKl8I-UM7_tymVH_em9wZf5ktYgWFI-jUcD1Zo8U,6853
16
+ easycoder-250611.3.dist-info/RECORD,,