easycoder 250518.1__py2.py3-none-any.whl → 250522.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__ = "250518.1"
12
+ __version__ = "250522.1"
easycoder/ec_compiler.py CHANGED
@@ -16,6 +16,7 @@ class Compiler:
16
16
  self.program.compiler = self
17
17
  self.addCommand = self.program.add
18
18
  self.compileConstant = self.value.compileConstant
19
+ self.debugCompile = False
19
20
 
20
21
  def getPC(self):
21
22
  return len(self.program.code)
@@ -174,7 +175,7 @@ class Compiler:
174
175
  self.rewindTo(mark)
175
176
  else:
176
177
  self.rewindTo(mark)
177
- FatalError(self, f'Unable to compile this "{token}" command. Perhaps a syntax error?')
178
+ FatalError(self, f'Unable to compile this "{token}" command')
178
179
 
179
180
  # Compile a single command
180
181
  def compileOne(self):
@@ -196,7 +197,7 @@ class Compiler:
196
197
  while True:
197
198
  token = self.tokens[self.index]
198
199
  keyword = token.token
199
- # line = self.script.lines[token.lino]
200
+ if self.debugCompile: print(self.script.lines[token.lino])
200
201
  # print(f'{keyword} - {line}')
201
202
  # if keyword != 'else':
202
203
  if self.compileOne() == True:
easycoder/ec_core.py CHANGED
@@ -202,7 +202,11 @@ class Core(Handler):
202
202
  # Debug the script
203
203
  def k_debug(self, command):
204
204
  token = self.peek()
205
- if token in ['step', 'stop', 'program', 'custom']:
205
+ if token == 'compile':
206
+ self.compiler.debugCompile = True
207
+ self.nextToken()
208
+ return True
209
+ elif token in ['step', 'stop', 'program', 'custom']:
206
210
  command['mode'] = token
207
211
  self.nextToken()
208
212
  elif token == 'stack':
@@ -222,7 +226,9 @@ class Core(Handler):
222
226
  return True
223
227
 
224
228
  def r_debug(self, command):
225
- if command['mode'] == 'step':
229
+ if command['mode'] == 'compile':
230
+ self.program.debugStep = True
231
+ elif command['mode'] == 'step':
226
232
  self.program.debugStep = True
227
233
  elif command['mode'] == 'stop':
228
234
  self.program.debugStep = False
@@ -1455,6 +1461,7 @@ class Core(Handler):
1455
1461
  content = value['content'].split(self.getRuntimeValue(command['on']))
1456
1462
  elements = len(content)
1457
1463
  target['elements'] = elements
1464
+ target['index'] = 0
1458
1465
  target['value'] = [None] * elements
1459
1466
 
1460
1467
  for index, item in enumerate(content):
easycoder/ec_pyside.py CHANGED
@@ -39,6 +39,7 @@ class Graphics(Handler):
39
39
 
40
40
  def __init__(self, compiler):
41
41
  Handler.__init__(self, compiler)
42
+ self.blocked = False
42
43
 
43
44
  def getName(self):
44
45
  return 'graphics'
@@ -83,15 +84,18 @@ class Graphics(Handler):
83
84
  elif self.isSymbol():
84
85
  record = self.getSymbolRecord()
85
86
  if record['extra'] == 'gui':
86
- if self.peek() == 'to':
87
- # (2)
88
- record = self.getSymbolRecord()
89
- command['widget'] = record['name']
90
- self.nextToken()
91
- return addToLayout()
92
- return False
87
+ if record['keyword'] in ['layout', 'groupbox', 'label', 'pushbutton', 'checkbox', 'lineinput', 'listbox', 'combobox']:
88
+ if self.peek() == 'to':
89
+ # (2)
90
+ record = self.getSymbolRecord()
91
+ command['widget'] = record['name']
92
+ self.nextToken()
93
+ return addToLayout()
94
+ else: return False
93
95
  # (1)
94
- command['value'] = self.getValue()
96
+ value = self.getValue()
97
+ if value == None: return False
98
+ command['value'] = value
95
99
  self.skip('to')
96
100
  if self.nextIsSymbol():
97
101
  record = self.getSymbolRecord()
@@ -705,10 +709,12 @@ class Graphics(Handler):
705
709
 
706
710
  # set [the] width/height [of] {widget} [to] {value}
707
711
  # set [the] layout of {window} to {layout}
712
+ # set [the] spacing of {layout} to {value}
708
713
  # set [the] text [of] {label}/{button}/{lineinput} [to] {text}
709
714
  # set [the] color [of] {label}/{button}/{lineinput} [to] {color}
710
715
  # set [the] state [of] {checkbox} [to] {color}
711
716
  # set {listbox} to {list}
717
+ # set blocked true/false
712
718
  def k_set(self, command):
713
719
  self.skip('the')
714
720
  token = self.nextToken()
@@ -735,6 +741,16 @@ class Graphics(Handler):
735
741
  command['layout'] = record['name']
736
742
  self.add(command)
737
743
  return True
744
+ elif token == 'spacing':
745
+ self.skip('of')
746
+ if self.nextIsSymbol():
747
+ record = self.getSymbolRecord()
748
+ if record['keyword'] == 'layout':
749
+ command['name'] = record['name']
750
+ self.skip('to')
751
+ command['value'] = self.nextValue()
752
+ self.add(command)
753
+ return True
738
754
  elif token == 'text':
739
755
  self.skip('of')
740
756
  if self.nextIsSymbol():
@@ -776,6 +792,9 @@ class Graphics(Handler):
776
792
  command['value'] = self.nextValue()
777
793
  self.add(command)
778
794
  return True
795
+ elif token == 'blocked':
796
+ self.blocked = True if self.nextToken() == 'true' else False
797
+ return True
779
798
  elif self.isSymbol():
780
799
  record = self.getSymbolRecord()
781
800
  if record['keyword'] == 'listbox':
@@ -797,11 +816,13 @@ class Graphics(Handler):
797
816
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
798
817
  elif what == 'layout':
799
818
  window = self.getVariable(command['name'])['window']
800
- layout = self.getVariable(command['layout'])
801
819
  content = self.getVariable(command['layout'])['widget']
802
820
  container = QWidget()
803
821
  container.setLayout(content)
804
822
  window.setCentralWidget(container)
823
+ elif what == 'spacing':
824
+ layout = self.getVariable(command['name'])['widget']
825
+ layout.setSpacing(self.getRuntimeValue(command['value']))
805
826
  elif what == 'text':
806
827
  record = self.getVariable(command['name'])
807
828
  widget = self.getVariable(command['name'])['widget']
@@ -891,14 +912,14 @@ class Graphics(Handler):
891
912
  def r_start(self, command):
892
913
  def on_last_window_closed():
893
914
  self.program.kill()
894
- def resume():
915
+ def init():
895
916
  self.program.flush(self.nextPC())
896
917
  def flush():
897
- self.program.flushCB()
918
+ if not self.blocked: self.program.flushCB()
898
919
  timer = QTimer()
899
920
  timer.timeout.connect(flush)
900
921
  timer.start(10)
901
- QTimer.singleShot(500, resume)
922
+ QTimer.singleShot(500, init)
902
923
  self.app.lastWindowClosed.connect(on_last_window_closed)
903
924
  self.app.exec()
904
925
 
@@ -1,11 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 250518.1
3
+ Version: 250522.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>
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE
9
10
  Requires-Dist: pytz
10
11
  Requires-Dist: requests
11
12
  Requires-Dist: pyside6
@@ -1,18 +1,18 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=8yrJdKMAo1fcUBele7RuG120U6R5ChqSYPzPPZ7UnT0,262
2
+ easycoder/__init__.py,sha256=fBeU_blUdyJ9_2Boq25g8iJDpMC7OVgv8R5jWWzYs5Q,262
3
3
  easycoder/ec_classes.py,sha256=L6-6yWHDHw8yF9TGL4WWc4p1aUyXzYz6Gom7jJ43h8o,1823
4
- easycoder/ec_compiler.py,sha256=vNOAKIK2pX_cW4mcxwCe0OR16iqeZqvZQ6JCgQ5MqtU,5062
4
+ easycoder/ec_compiler.py,sha256=zKZXXUrQyHbwZ1gJARnwfdAPHWTARa5SN9Y31iuty8o,5086
5
5
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
- easycoder/ec_core.py,sha256=OZRsF90uesePweZZQ64XEPlQ_se7xEMd3wUoNoSgOvg,91997
6
+ easycoder/ec_core.py,sha256=ATuBnJP4RZZCzB7How8XUouF7PoFM7JwuVrjh4oQGH4,92242
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=d_CchiglkCdAgX2CSIQ_WTWcDEvFWCQmRKdoqLCaooU,10087
11
- easycoder/ec_pyside.py,sha256=9A2F3giJyvbBb8Xj4Zd08kvkmCdmBz1g5eoasURadAQ,37733
11
+ easycoder/ec_pyside.py,sha256=gyQJLrLiYQ6IATWKpiksfEBk7pqFw6Eviy7saOeCfZc,38731
12
12
  easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
13
13
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
- easycoder-250518.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
- easycoder-250518.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
- easycoder-250518.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
17
- easycoder-250518.1.dist-info/METADATA,sha256=vHvoEYT1IDX4_-oDsSR7UB6ffNwuBuuiDxQ-xUkbNK4,6829
18
- easycoder-250518.1.dist-info/RECORD,,
14
+ easycoder-250522.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
+ easycoder-250522.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ easycoder-250522.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
17
+ easycoder-250522.1.dist-info/METADATA,sha256=FWjDsxXZKOWuBGBBtN6Ukfd567dxzMoiEAULWNlAkDY,6851
18
+ easycoder-250522.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.10.1
2
+ Generator: flit 3.12.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any