easycoder 250609.2__py2.py3-none-any.whl → 250611.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 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__ = "250609.2"
12
+ __version__ = "250611.1"
easycoder/ec_core.py CHANGED
@@ -751,13 +751,13 @@ class Core(Handler):
751
751
  try:
752
752
  with sftp.open(path, 'r') as remote_file: content = remote_file.read().decode()
753
753
  except:
754
- RuntimeError(self.program, 'Unable to read data')
754
+ RuntimeError(self.program, f'Unable to read from {path}')
755
755
  else:
756
756
  filename = self.getRuntimeValue(command['file'])
757
757
  try:
758
758
  with open(filename) as f: content = f.read()
759
759
  except:
760
- content = ''
760
+ RuntimeError(self.program, f'Unable to read from {filename}')
761
761
  try:
762
762
  if filename.endswith('.json'): content = json.loads(content)
763
763
  except:
@@ -1055,10 +1055,10 @@ class Core(Handler):
1055
1055
  program = command['program']
1056
1056
  code = program.code[program.pc]
1057
1057
  lino = str(code['lino'] + 1)
1058
- while len(lino) < 5: lino = f' {lino}'
1058
+ # while len(lino) < 5: lino = f' {lino}'
1059
1059
  if value == None: value = '<empty>'
1060
1060
  if 'log' in command:
1061
- print(f'{datetime.now().time()}:{lino}-> {value}')
1061
+ print(f'{datetime.now().time()}:{self.program.name}:{lino}->{value}')
1062
1062
  else:
1063
1063
  print(value)
1064
1064
  return self.nextPC()
@@ -1263,16 +1263,35 @@ class Core(Handler):
1263
1263
  def k_save(self, command):
1264
1264
  command['content'] = self.nextValue()
1265
1265
  if self.nextIs('to'):
1266
- command['file'] = self.nextValue()
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()
1267
1274
  self.add(command)
1268
1275
  return True
1269
1276
  return False
1270
1277
 
1271
1278
  def r_save(self, command):
1272
1279
  content = self.getRuntimeValue(command['content'])
1273
- filename = self.getRuntimeValue(command['file'])
1274
- if filename.endswith('.json'): content = json.dumps(content)
1275
- with open(filename, 'w') as f: f.write(content)
1280
+ if 'ssh' in command:
1281
+ ssh = self.getVariable(command['ssh'])
1282
+ path = self.getRuntimeValue(command['path'])
1283
+ sftp = ssh['sftp']
1284
+ try:
1285
+ with sftp.open(path, 'w') as remote_file: remote_file.write(content.encode())
1286
+ except:
1287
+ RuntimeError(self.program, 'Unable to write to {path}')
1288
+ else:
1289
+ filename = self.getRuntimeValue(command['file'])
1290
+ if filename.endswith('.json'): content = json.dumps(content)
1291
+ try:
1292
+ with open(filename, 'w') as f: f.write(content)
1293
+ except:
1294
+ RuntimeError(self.program, f'Unable to write to {filename}')
1276
1295
  return self.nextPC()
1277
1296
 
1278
1297
  # Send a message to a module
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250609.2
3
+ Version: 250611.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,16 +1,16 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=tz50IaJCH93FqaP8zj-4hKCTqtgE_hEtFQCqRSto5cY,262
2
+ easycoder/__init__.py,sha256=YHVXt82vfS0c3zSol9yOtOFFnHuvrKOBwvIGFyf0YsQ,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=-xciv8vSVth7Xsf_ACSJPw0RYollM6hBUZhwOcCtHM0,95220
6
+ easycoder/ec_core.py,sha256=h0yGdqGMKxvF5BGIyVlPHd-FMjrj9kvLAlLIzXsA3L8,96119
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-250609.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
13
- easycoder-250609.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- easycoder-250609.2.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
- easycoder-250609.2.dist-info/METADATA,sha256=zalIz9_FoKDnNmQAO2ScWXdtKwjY7TiEyGGRAriEK5M,6853
16
- easycoder-250609.2.dist-info/RECORD,,
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,,