easycoder 250204.1__py2.py3-none-any.whl → 250207.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EasyCode source code
2
2
  These are the Python files that comprise **_EasyCoder_**.
3
3
 
4
- **_EasyCoder_** has a small number of third-party dependencies. A minor one is `pytz`, which handles timezones. The biggest one by far is `kivy`, a comprehensive Python graphics library.
4
+ **_EasyCoder_** has a small number of third-party dependencies. A minor one is `pytz`, which handles timezones. The biggest one by far is `PySimpleGUI`, a comprehensive Python graphics library.
5
5
 
6
- If an **_EasyCoder_** script filename ends with `.ecs` it's a command-line script. If it ends with `.ecg` it's a script for a graphical application and will cause `kivy` to be imported. Obviously this will only work on a GUI-based system, whereas command-line scripts will run anywhere there is Python.
6
+ If an **_EasyCoder_** script filename ends with `.ecs` it's a command-line script. If it ends with `.ecg` it's a script for a graphical application and will cause `PySimpleGUI` to be imported. Obviously this will only work on a GUI-based system, whereas command-line scripts will run anywhere there is Python.
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__ = "250204.1"
12
+ __version__ = "250207.1"
easycoder/ec_core.py CHANGED
@@ -484,6 +484,7 @@ class Core(Handler):
484
484
  except:
485
485
  pass
486
486
  RuntimeError(self.program, f'There is no label "{label}"')
487
+ return None
487
488
 
488
489
  def r_gotoPC(self, command):
489
490
  return command['goto']
@@ -498,14 +499,12 @@ class Core(Handler):
498
499
 
499
500
  def r_gosub(self, command):
500
501
  label = command['gosub'] + ':'
501
- try:
502
- address = self.symbols[label]
503
- if address != None:
504
- self.stack.append(self.nextPC())
505
- return address
506
- except:
507
- pass
508
- RuntimeError(self.program, f'There is no label "{label}"')
502
+ address = self.symbols[label]
503
+ if address != None:
504
+ self.stack.append(self.nextPC())
505
+ return address
506
+ RuntimeError(self.program, f'There is no label "{label + ":"}"')
507
+ return None
509
508
 
510
509
  # if <condition> <action> [else <action>]
511
510
  def k_if(self, command):
@@ -707,9 +706,11 @@ class Core(Handler):
707
706
  def r_load(self, command):
708
707
  target = self.getVariable(command['target'])
709
708
  file = self.getRuntimeValue(command['file'])
710
- f = open(file, 'r')
711
- content = f.read()
712
- f.close()
709
+ try:
710
+ with open(file, 'r') as f:
711
+ content = f.read()
712
+ except:
713
+ content=None
713
714
  value = {}
714
715
  value['type'] = 'text'
715
716
  value['content'] = content
@@ -1005,8 +1006,10 @@ class Core(Handler):
1005
1006
  lino = str(code['lino'] + 1)
1006
1007
  while len(lino) < 5: lino = f' {lino}'
1007
1008
  if value == None: value = '<empty>'
1008
- if 'log' in command: print(f'{datetime.now().time()}:{lino}-> {value}')
1009
- else: print(value)
1009
+ if 'log' in command:
1010
+ print(f'{datetime.now().time()}:{lino}-> {value}')
1011
+ else:
1012
+ print(value)
1010
1013
  return self.nextPC()
1011
1014
 
1012
1015
  # Push a value onto a stack
@@ -1216,9 +1219,8 @@ class Core(Handler):
1216
1219
  def r_save(self, command):
1217
1220
  content = self.getRuntimeValue(command['content'])
1218
1221
  file = self.getRuntimeValue(command['file'])
1219
- f = open(file, 'w')
1220
- f.write(content)
1221
- f.close()
1222
+ with open(file, 'w') as f:
1223
+ f.write(content)
1222
1224
  return self.nextPC()
1223
1225
 
1224
1226
  # Send a message to a module
@@ -1817,10 +1819,12 @@ class Core(Handler):
1817
1819
  return None
1818
1820
 
1819
1821
  if token == 'value':
1820
- value['type'] = 'valueOf'
1821
1822
  if self.nextIs('of'):
1822
- value['content'] = self.nextValue()
1823
- return value
1823
+ v = self.nextValue()
1824
+ if v !=None:
1825
+ value['type'] = 'valueOf'
1826
+ value['content'] = v
1827
+ return value
1824
1828
  return None
1825
1829
 
1826
1830
  if token == 'length':
@@ -1989,10 +1993,6 @@ class Core(Handler):
1989
1993
  value['type'] = 'text'
1990
1994
  if self.encoding == 'utf-8':
1991
1995
  value['content'] = content.decode('utf-8')
1992
- elif self.encoding == 'hex':
1993
- b = content.encode('utf-8')
1994
- mb = binascii.unhexlify(b)
1995
- value['content'] = mb.decode('utf-8')
1996
1996
  elif self.encoding == 'base64':
1997
1997
  base64_bytes = content.encode('ascii')
1998
1998
  message_bytes = base64.b64decode(base64_bytes)
@@ -2036,10 +2036,6 @@ class Core(Handler):
2036
2036
  value['type'] = 'text'
2037
2037
  if self.encoding == 'utf-8':
2038
2038
  value['content'] = content.encode('utf-8')
2039
- elif self.encoding == 'hex':
2040
- b = content.encode('utf-8')
2041
- mb = binascii.hexlify(b)
2042
- value['content'] = mb.decode('utf-8')
2043
2039
  elif self.encoding == 'base64':
2044
2040
  data_bytes = content.encode('ascii')
2045
2041
  base64_bytes = base64.b64encode(data_bytes)
easycoder/ec_graphics.py CHANGED
@@ -1,4 +1,5 @@
1
- from .ec_classes import FatalError, RuntimeError, Handler
1
+ from .ec_classes import FatalError, RuntimeError
2
+ from .ec_handler import Handler
2
3
  from .ec_gutils import GUtils
3
4
  import PySimpleGUI as psg
4
5
  import json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: easycoder
3
- Version: 250204.1
3
+ Version: 250207.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,17 +1,17 @@
1
- easycoder/README.md,sha256=PYqOc_SkIGiFbyCNs90y7JqoqWe4aO1xYIW-6bOnFKU,573
2
- easycoder/__init__.py,sha256=hLMGC60RrVT7YsX6vj0nXfkwrDe44zEhhtTXTeYy8xk,262
1
+ easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
+ easycoder/__init__.py,sha256=bIXuFkzlKBKV89CzP8RTzVcXmrJ4rKJ6VctsvqmD4ns,262
3
3
  easycoder/ec_classes.py,sha256=xnWBNak8oKydkFoxHLlq9wo3lIsB3aMnTDrqbtCfoWo,1512
4
4
  easycoder/ec_compiler.py,sha256=dFJEA_uOhD-HeSiAdBzmmA6q3LHThUVoJpSETanmSHs,4800
5
5
  easycoder/ec_condition.py,sha256=WSbONo4zs2sX1icOVpscZDFSCAEFmTsquoc2RGcLx_k,763
6
- easycoder/ec_core.py,sha256=ORrMf2TlsAxETK-5Of-zrSCHX517nVHtThI7ew9ts0o,87416
7
- easycoder/ec_graphics.py,sha256=8GhnqIOITyZzIkdjouTnOQ9x0J6RpMz0sFseKkJATfE,12977
6
+ easycoder/ec_core.py,sha256=9YCBTXemI9T_TVtHfC2aSeVVyT7cCHCrwCCI6blY7pk,87209
7
+ easycoder/ec_graphics.py,sha256=I5C4YYzdaCjL7_Vc7cNalABV18PL8QOqDbJQnQB6lrY,13000
8
8
  easycoder/ec_gutils.py,sha256=Pfz3u5KQieXm-F7qsB9gy6IUGDi-oJaX9xdiM9ZeO6s,5885
9
9
  easycoder/ec_handler.py,sha256=IJvxcrJJSR53d6DS_8H5qPHKhp9y5-GV4WXAjhZxu_o,2250
10
10
  easycoder/ec_program.py,sha256=R8zMukA-pfRsOpcy9WqTw7fE_190dQfrMt2la23Yrs4,9904
11
11
  easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
12
12
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
13
- easycoder-250204.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
- easycoder-250204.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- easycoder-250204.1.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
16
- easycoder-250204.1.dist-info/METADATA,sha256=arFjAPGsq4FgHUm5QoCqVDJyiIgNQFSNF_1zVPzERlU,6162
17
- easycoder-250204.1.dist-info/RECORD,,
13
+ easycoder-250207.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
+ easycoder-250207.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
+ easycoder-250207.1.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
16
+ easycoder-250207.1.dist-info/METADATA,sha256=hfeKKSAp_NMYhjLAFnxpA18xVPe2qaP7AGqWek7JnUU,6162
17
+ easycoder-250207.1.dist-info/RECORD,,