easycoder 250504.1__py2.py3-none-any.whl → 250505.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__ = "250504.1"
12
+ __version__ = "250505.3"
easycoder/ec_core.py CHANGED
@@ -260,24 +260,27 @@ class Core(Handler):
260
260
  # Delete a file or a property
261
261
  # delete {filename}
262
262
  # delete property {value} of {variable}
263
+ # delete element {name} of {variable}
263
264
  def k_delete(self, command):
264
265
  token = self.nextToken( )
266
+ command['type'] = token
265
267
  if token == 'file':
266
- command['type'] = 'file'
267
268
  command['filename'] = self.nextValue()
268
269
  self.add(command)
269
270
  return True
270
- elif token == 'property':
271
- command['key'] = self.nextValue();
272
- if self.nextIs('of'):
273
- command['type'] = 'property'
274
- command['var'] = self.nextToken()
275
- self.add(command)
276
- return True
277
- else:
278
- self.warning(f'Core.delete: "of" expected; got {self.getToken()}')
271
+ elif token in ['property', 'element']:
272
+ command['key'] = self.nextValue()
273
+ self.skip('of')
274
+ if self.nextIsSymbol():
275
+ record = self.getSymbolRecord()
276
+ if record['hasValue']:
277
+ command['var'] = record['name']
278
+ self.add(command)
279
+ return True
280
+ FatalError(self.compiler, f'Variable {record['name']} does not hold a value')
281
+ self.warning(f'Core.delete: variable expected; got {self.getToken()}')
279
282
  else:
280
- self.warning(f'Core.delete: "file" or "property" expected; got {token}')
283
+ self.warning(f'Core.delete: "file", "property" or "element" expected; got {token}')
281
284
  return False
282
285
 
283
286
  def r_delete(self, command):
@@ -295,6 +298,14 @@ class Core(Handler):
295
298
  content.pop(key, None)
296
299
  value['content'] = content
297
300
  self.putSymbolValue(symbolRecord, value)
301
+ elif type == 'element':
302
+ key = self.getRuntimeValue(command['key'])
303
+ symbolRecord = self.getVariable(command['var'])
304
+ value = self.getSymbolValue(symbolRecord)
305
+ content = value['content']
306
+ content.remove(key)
307
+ value['content'] = content
308
+ self.putSymbolValue(symbolRecord, value)
298
309
  return self.nextPC()
299
310
 
300
311
  # Arithmetic division
@@ -921,7 +932,7 @@ class Core(Handler):
921
932
  command['from'] = self.getToken()
922
933
  self.add(command)
923
934
  return True
924
- return False;
935
+ return False
925
936
 
926
937
  def r_pop(self, command):
927
938
  symbolRecord = self.getVariable(command['target'])
@@ -929,7 +940,7 @@ class Core(Handler):
929
940
  RuntimeError(self.program, f'{symbolRecord["name"]} does not hold a value')
930
941
  stackRecord = self.getVariable(command['from'])
931
942
  stack = self.getSymbolValue(stackRecord)
932
- v = stack.pop();
943
+ v = stack.pop()
933
944
  self.putSymbolValue(stackRecord, stack)
934
945
  value = {}
935
946
  value['type'] = 'int' if type(v) == int else 'text'
@@ -1725,7 +1736,6 @@ class Core(Handler):
1725
1736
  symbolRecord = self.getVariable(command['target'])
1726
1737
  if not symbolRecord['hasValue']:
1727
1738
  RuntimeError(self.program, f'{symbolRecord["name"]} does not hold a value')
1728
- return None
1729
1739
  value = self.getSymbolValue(symbolRecord)
1730
1740
  if value == None:
1731
1741
  RuntimeError(self.program, f'{symbolRecord["name"]} has not been initialised')
@@ -2479,13 +2489,20 @@ class Core(Handler):
2479
2489
  if token == 'does':
2480
2490
  self.nextToken()
2481
2491
  if self.nextIs('not'):
2482
- if self.nextIs('have'):
2492
+ token = self.nextToken()
2493
+ if token == 'have':
2483
2494
  if self.nextToken() == 'property':
2484
2495
  prop = self.nextValue()
2485
2496
  condition.type = 'hasProperty'
2486
2497
  condition.property = prop
2487
2498
  condition.negate = not condition.negate
2488
2499
  return condition
2500
+ elif token == 'include':
2501
+ value = self.nextValue()
2502
+ condition.type = 'includes'
2503
+ condition.value2 = value
2504
+ condition.negate = not condition.negate
2505
+ return condition
2489
2506
  return None
2490
2507
 
2491
2508
  if token in ['starts', 'ends']:
@@ -2586,7 +2603,8 @@ class Core(Handler):
2586
2603
  def c_includes(self, condition):
2587
2604
  value1 = self.getRuntimeValue(condition.value1)
2588
2605
  value2 = self.getRuntimeValue(condition.value2)
2589
- return value2 in value1
2606
+ includes = value2 in value1
2607
+ return not includes if condition.negate else includes
2590
2608
 
2591
2609
  def c_is(self, condition):
2592
2610
  comparison = self.program.compare(condition.value1, condition.value2)
easycoder/ec_pyside.py CHANGED
@@ -297,7 +297,7 @@ class Graphics(Handler):
297
297
  if self.peek() == 'size':
298
298
  self.nextToken()
299
299
  size = self.nextValue()
300
- else: size = 10
300
+ else: size = self.compileConstant(10)
301
301
  command['size'] = size
302
302
  self.add(command)
303
303
  return True
@@ -714,6 +714,7 @@ class Graphics(Handler):
714
714
  # set [the] width/height [of] {widget} [to] {value}
715
715
  # set [the] text [of] {label}/{button}/{lineinput} [to] {text}
716
716
  # set [the] color [of] {label}/{button}/{lineinput} [to] {color}
717
+ # set [the] state [of] {checkbox} [to] {color}
717
718
  # set {listbox} to {list}
718
719
  def k_set(self, command):
719
720
  self.skip('the')
@@ -739,6 +740,16 @@ class Graphics(Handler):
739
740
  command['value'] = self.nextValue()
740
741
  self.add(command)
741
742
  return True
743
+ elif token == 'state':
744
+ self.skip('of')
745
+ if self.nextIsSymbol():
746
+ record = self.getSymbolRecord()
747
+ if record['keyword'] == 'checkbox':
748
+ command['name'] = record['name']
749
+ self.skip('to')
750
+ command['value'] = self.nextValue()
751
+ self.add(command)
752
+ return True
742
753
  elif token == 'color':
743
754
  self.skip('of')
744
755
  if self.nextIsSymbol():
@@ -786,6 +797,10 @@ class Graphics(Handler):
786
797
  widget.setText(text)
787
798
  if record['keyword'] == 'pushbutton':
788
799
  widget.setAccessibleName(text)
800
+ elif what == 'state':
801
+ widget = self.getVariable(command['name'])['widget']
802
+ state = self.getRuntimeValue(command['value'])
803
+ widget.setChecked(state)
789
804
  elif what == 'color':
790
805
  widget = self.getVariable(command['name'])['widget']
791
806
  color = self.getRuntimeValue(command['value'])
@@ -797,6 +812,7 @@ class Graphics(Handler):
797
812
  elif what == 'listbox':
798
813
  widget = self.getVariable(command['name'])['widget']
799
814
  value = self.getRuntimeValue(command['value'])
815
+ widget.clear()
800
816
  widget.addItems(value)
801
817
  return self.nextPC()
802
818
 
@@ -889,36 +905,35 @@ class Graphics(Handler):
889
905
  value['domain'] = self.getName()
890
906
  token = self.getToken()
891
907
  if self.isSymbol():
892
- value['name'] = token
893
- value['type'] = 'symbol'
894
- return value
895
-
896
- if self.tokenIs('the'):
897
- self.nextToken()
898
- token = self.getToken()
899
-
900
- if token == 'count':
901
- self.skip('of')
902
- if self.nextIsSymbol():
908
+ if self.getSymbolRecord()['extra'] == 'gui':
909
+ value['name'] = token
903
910
  value['type'] = 'symbol'
904
- record = self.getSymbolRecord()
905
- keyword = record['keyword']
906
- if keyword in ['combobox', 'listbox']:
907
- value['type'] = 'count'
908
- value['name'] = record['name']
909
- return value
910
-
911
- if token == 'current':
912
- self.skip('item')
913
- self.skip('in')
914
- if self.nextIsSymbol():
915
- value['type'] = 'symbol'
916
- record = self.getSymbolRecord()
917
- keyword = record['keyword']
918
- if keyword == 'listbox':
919
- value['type'] = 'current'
920
- value['name'] = record['name']
921
- return value
911
+ return value
912
+
913
+ else:
914
+ if self.tokenIs('the'): token = self.nextToken()
915
+ if token == 'count':
916
+ self.skip('of')
917
+ if self.nextIsSymbol():
918
+ value['type'] = 'symbol'
919
+ record = self.getSymbolRecord()
920
+ keyword = record['keyword']
921
+ if keyword in ['combobox', 'listbox']:
922
+ value['type'] = 'count'
923
+ value['name'] = record['name']
924
+ return value
925
+
926
+ elif token == 'current':
927
+ self.skip('item')
928
+ self.skip('in')
929
+ if self.nextIsSymbol():
930
+ value['type'] = 'symbol'
931
+ record = self.getSymbolRecord()
932
+ keyword = record['keyword']
933
+ if keyword == 'listbox':
934
+ value['type'] = 'current'
935
+ value['name'] = record['name']
936
+ return value
922
937
 
923
938
  return None
924
939
 
@@ -959,6 +974,13 @@ class Graphics(Handler):
959
974
  v['type'] = 'text'
960
975
  v['content'] = content
961
976
  return v
977
+ elif keyword == 'checkbox':
978
+ checkbox = symbolRecord['widget']
979
+ content = checkbox.isChecked()
980
+ v = {}
981
+ v['type'] = 'boolean'
982
+ v['content'] = content
983
+ return v
962
984
  return None
963
985
 
964
986
  def v_count(self, v):
@@ -1,12 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250504.1
3
+ Version: 250505.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>
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: MIT License
9
- License-File: LICENSE
10
9
  Requires-Dist: pytz
11
10
  Requires-Dist: pyside6
12
11
  Project-URL: Home, https://github.com/easycoder/easycoder-py
@@ -14,7 +13,7 @@ Project-URL: Home, https://github.com/easycoder/easycoder-py
14
13
  # Introduction
15
14
  **_EasyCoder_** is a high-level English-like domain-specific scripting language (DSL) suited for prototyping and rapid testing of ideas. It operates on the command line and a graphics module is under construction. The language is written in Python and it acts as a fairly thin wrapper around standard Python functions, giving fast compilation and good runtime performance for general applications.
16
15
 
17
- **_EasyCoder_** is well suited to building command-line or graphical applications for expressing random logic such as operating procedures and rules, or controlling physical systems, primarily wifi devices. It is particularly easy to construct and issue REST commands to local or remote web servers.
16
+ **_EasyCoder_** is well suited to building command-line or graphical applications for expressing random logic such as operating procedures and rules, or controlling physical systems, particularly those using wifi devices. It is easy to construct and issue REST commands to local or remote web servers.
18
17
 
19
18
  For more advanced applications, **_EasyCoder_** is designed to be extensible, by enabling extra language syntax to be added via plugin-in modules. Once these are installed they act as seamless extensions to the basic syntax provided. **_EasyCoder_** derives its power from the use of rich and comprehensive language rather than a complex system of frameworks such as those commonly used in modern programming. This makes it very easy to learn as our brains are wired to operate that way. Having said that, the needs of most control systems are usually served by a fairly modest number of keywords and syntactic variants.
20
19
  <hr>
@@ -1,18 +1,18 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=EGnBVcP5HZKaL9fLqsey2v6VejGMeqhyENBsyHElMgw,262
2
+ easycoder/__init__.py,sha256=c8tAQyiYf2jD3A5tSYSTllTS3Wdbn3PXTZXOm_VHKv8,262
3
3
  easycoder/ec_classes.py,sha256=xnWBNak8oKydkFoxHLlq9wo3lIsB3aMnTDrqbtCfoWo,1512
4
4
  easycoder/ec_compiler.py,sha256=vNOAKIK2pX_cW4mcxwCe0OR16iqeZqvZQ6JCgQ5MqtU,5062
5
5
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
- easycoder/ec_core.py,sha256=4mFDsTS0Cd_Z0li8Oad_EMT783weuSm3S1IlWSoXIMY,91286
6
+ easycoder/ec_core.py,sha256=U5PIYmQNhA3QF2tlQ8luX83Aqio8sdqzXZCGI1hiSeY,92221
7
7
  easycoder/ec_graphics.py,sha256=WXxKMB4GJSmxvk-FVbOTyufiUx4TYIzyDoB1PCAO3JY,16067
8
8
  easycoder/ec_gutils.py,sha256=yqu4RRQ6VdRkC5B2ADBYsXzgNu76dLnekd9aUjdEgPw,6399
9
9
  easycoder/ec_handler.py,sha256=zPDZ_hqdgNnkCd8B5HmSLkqsGgf4aDmqcUBOPHgo47U,2305
10
10
  easycoder/ec_program.py,sha256=CxGYl1slYXNOYFxiSMc-BuXL_QztYuBfCXltPCtw1U4,10011
11
- easycoder/ec_pyside.py,sha256=6GIZpnmIj9LissJopfqcSvc1i1qbl4h56PQsJXOu9XU,36005
11
+ easycoder/ec_pyside.py,sha256=gXAinTNQ-NC-TrSfEXGVY4Fmcy5uV_jDAoN_IsdNtiI,37080
12
12
  easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
13
13
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
- easycoder-250504.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
- easycoder-250504.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
- easycoder-250504.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
17
- easycoder-250504.1.dist-info/METADATA,sha256=WFCQMbyGyIaudwFDHkiXLAfz4VtOkx2OBuPAV-NAelo,6825
18
- easycoder-250504.1.dist-info/RECORD,,
14
+ easycoder-250505.3.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
+ easycoder-250505.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ easycoder-250505.3.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
17
+ easycoder-250505.3.dist-info/METADATA,sha256=Oc8nm1uq23c2Q1ZObOZ6sERoIwbFHbBHeMzIL_bPDUY,6805
18
+ easycoder-250505.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.12.0
2
+ Generator: flit 3.10.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any