easycoder 250103.1__py2.py3-none-any.whl → 250103.2__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
@@ -10,4 +10,4 @@ from .ec_program import *
10
10
  from .ec_timestamp import *
11
11
  from .ec_value import *
12
12
 
13
- __version__ = "250103.1"
13
+ __version__ = "250103.2"
easycoder/ec_core.py CHANGED
@@ -646,6 +646,28 @@ class Core(Handler):
646
646
  self.putSymbolValue(symbolRecord, value)
647
647
  return self.nextPC()
648
648
 
649
+ # Load a variable from a file
650
+ def k_load(self, command):
651
+ if self.nextIsSymbol():
652
+ command['target'] = self.getToken()
653
+ if self.nextIs('from'):
654
+ command['file'] = self.nextValue()
655
+ self.add(command)
656
+ return True
657
+ return False
658
+
659
+ def r_load(self, command):
660
+ target = self.getVariable(command['target'])
661
+ file = self.getRuntimeValue(command['file'])
662
+ f = open(file, 'r')
663
+ content = f.read()
664
+ f.close()
665
+ value = {}
666
+ value['type'] = 'text'
667
+ value['content'] = content
668
+ self.putSymbolValue(target, value)
669
+ return self.nextPC()
670
+
649
671
  # Arithmetic multiply
650
672
  # multiply {variable} by {value}[ giving {variable}]}
651
673
  def k_multiply(self, command):
@@ -1021,6 +1043,23 @@ class Core(Handler):
1021
1043
  self.program.name = self.nextToken()
1022
1044
  return True
1023
1045
 
1046
+ # Save a value to a file
1047
+ def k_save(self, command):
1048
+ command['content'] = self.nextValue()
1049
+ if self.nextIs('to'):
1050
+ command['file'] = self.nextValue()
1051
+ self.add(command)
1052
+ return True
1053
+ return False
1054
+
1055
+ def r_save(self, command):
1056
+ content = self.getRuntimeValue(command['content'])
1057
+ file = self.getRuntimeValue(command['file'])
1058
+ f = open(file, 'w')
1059
+ f.write(content)
1060
+ f.close()
1061
+ return self.nextPC()
1062
+
1024
1063
  # Set a value
1025
1064
  # set {variable}
1026
1065
  # set the elements of {variable} to {value}
@@ -2021,19 +2060,12 @@ class Core(Handler):
2021
2060
  value['content'] = json.dumps(item)
2022
2061
  return value
2023
2062
 
2063
+ # This is used by the expression evaluator to get the value of a symbol
2024
2064
  def v_symbol(self, symbolRecord):
2025
2065
  result = {}
2026
2066
  if symbolRecord['keyword'] == 'variable':
2027
2067
  symbolValue = self.getSymbolValue(symbolRecord)
2028
2068
  return symbolValue
2029
- # if symbolValue == None:
2030
- # return None
2031
- # result['type'] = symbolValue['type']
2032
- # content = symbolValue['content']
2033
- # if content == None:
2034
- # return ''
2035
- # result['content'] = content
2036
- # return result
2037
2069
  else:
2038
2070
  return None
2039
2071
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250103.1
3
+ Version: 250103.2
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,10 +1,10 @@
1
1
  easycoder/README.md,sha256=PYqOc_SkIGiFbyCNs90y7JqoqWe4aO1xYIW-6bOnFKU,573
2
- easycoder/__init__.py,sha256=5hieaJUWovLn09r1Tf2I2hBLjfYGXMKuBb6usyd9sYc,283
2
+ easycoder/__init__.py,sha256=JT7KWbiZJzKjiWqUFbTt4PaWE-WxWQcMEBvq4al6KL0,283
3
3
  easycoder/ec.py,sha256=Nj5PRl8GsKjfGJKq0FOM1a7FeK3cN68CoIFg8lswQEg,221
4
4
  easycoder/ec_classes.py,sha256=xnWBNak8oKydkFoxHLlq9wo3lIsB3aMnTDrqbtCfoWo,1512
5
5
  easycoder/ec_compiler.py,sha256=2r6Nk7px9UMYqIpYc6dAbYOAFu-CoWPy-iqlsed49Lo,4690
6
6
  easycoder/ec_condition.py,sha256=WSbONo4zs2sX1icOVpscZDFSCAEFmTsquoc2RGcLx_k,763
7
- easycoder/ec_core.py,sha256=1rYUGd5EXpjJkfYnnvJNjvMD_JfTGZRMEV0lLbYrzAU,78939
7
+ easycoder/ec_core.py,sha256=rglL7s3f1Ewzc0wjUPZxoY8__DJscxjZU7-Pd6OCIZQ,79904
8
8
  easycoder/ec_graphics.py,sha256=o70BdQ-Y3uIo5nheQYwJUmM3gYVerKD9_5arQ8JTP-Y,15556
9
9
  easycoder/ec_handler.py,sha256=IJvxcrJJSR53d6DS_8H5qPHKhp9y5-GV4WXAjhZxu_o,2250
10
10
  easycoder/ec_program.py,sha256=TUKQo56vURtx_UO7avIJZhz0EeOe2lNxQQz8EOOnCZ4,8685
@@ -12,8 +12,8 @@ easycoder/ec_renderer.py,sha256=ejVFemHGuFBwGA__6VfZQZeZMnw4Ilvf_y9I34k04LM,7981
12
12
  easycoder/ec_screenspec.py,sha256=TeXgccfYoE--r7Rf9t9drV1V3fU-p-iBnZwtjHzIh8M,2524
13
13
  easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
14
14
  easycoder/ec_value.py,sha256=XIBtGhcCgh1abrzAn-Wy4l_xH_3cTWakMVIiSlBAZjM,2386
15
- easycoder-250103.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
- easycoder-250103.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- easycoder-250103.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
18
- easycoder-250103.1.dist-info/METADATA,sha256=6X8NoMG3Px2cLNDqWYxoMfki71O06qYk8qILNM_49VI,5178
19
- easycoder-250103.1.dist-info/RECORD,,
15
+ easycoder-250103.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
+ easycoder-250103.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
+ easycoder-250103.2.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
18
+ easycoder-250103.2.dist-info/METADATA,sha256=UyIqZzD6XVImMRxZloXqyE_bUKKJRGCMztjXaaIPBTc,5178
19
+ easycoder-250103.2.dist-info/RECORD,,