easycoder 250518.1__py2.py3-none-any.whl → 250520.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__ = "250520.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,13 +84,14 @@ 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
96
  command['value'] = self.getValue()
95
97
  self.skip('to')
@@ -705,10 +707,12 @@ class Graphics(Handler):
705
707
 
706
708
  # set [the] width/height [of] {widget} [to] {value}
707
709
  # set [the] layout of {window} to {layout}
710
+ # set [the] spacing of {layout} to {value}
708
711
  # set [the] text [of] {label}/{button}/{lineinput} [to] {text}
709
712
  # set [the] color [of] {label}/{button}/{lineinput} [to] {color}
710
713
  # set [the] state [of] {checkbox} [to] {color}
711
714
  # set {listbox} to {list}
715
+ # set blocked true/false
712
716
  def k_set(self, command):
713
717
  self.skip('the')
714
718
  token = self.nextToken()
@@ -735,6 +739,16 @@ class Graphics(Handler):
735
739
  command['layout'] = record['name']
736
740
  self.add(command)
737
741
  return True
742
+ elif token == 'spacing':
743
+ self.skip('of')
744
+ if self.nextIsSymbol():
745
+ record = self.getSymbolRecord()
746
+ if record['keyword'] == 'layout':
747
+ command['name'] = record['name']
748
+ self.skip('to')
749
+ command['value'] = self.nextValue()
750
+ self.add(command)
751
+ return True
738
752
  elif token == 'text':
739
753
  self.skip('of')
740
754
  if self.nextIsSymbol():
@@ -776,6 +790,9 @@ class Graphics(Handler):
776
790
  command['value'] = self.nextValue()
777
791
  self.add(command)
778
792
  return True
793
+ elif token == 'blocked':
794
+ self.blocked = True if self.nextToken() == 'true' else False
795
+ return True
779
796
  elif self.isSymbol():
780
797
  record = self.getSymbolRecord()
781
798
  if record['keyword'] == 'listbox':
@@ -797,11 +814,13 @@ class Graphics(Handler):
797
814
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
798
815
  elif what == 'layout':
799
816
  window = self.getVariable(command['name'])['window']
800
- layout = self.getVariable(command['layout'])
801
817
  content = self.getVariable(command['layout'])['widget']
802
818
  container = QWidget()
803
819
  container.setLayout(content)
804
820
  window.setCentralWidget(container)
821
+ elif what == 'spacing':
822
+ layout = self.getVariable(command['name'])['widget']
823
+ layout.setSpacing(self.getRuntimeValue(command['value']))
805
824
  elif what == 'text':
806
825
  record = self.getVariable(command['name'])
807
826
  widget = self.getVariable(command['name'])['widget']
@@ -891,14 +910,14 @@ class Graphics(Handler):
891
910
  def r_start(self, command):
892
911
  def on_last_window_closed():
893
912
  self.program.kill()
894
- def resume():
913
+ def init():
895
914
  self.program.flush(self.nextPC())
896
915
  def flush():
897
- self.program.flushCB()
916
+ if not self.blocked: self.program.flushCB()
898
917
  timer = QTimer()
899
918
  timer.timeout.connect(flush)
900
919
  timer.start(10)
901
- QTimer.singleShot(500, resume)
920
+ QTimer.singleShot(500, init)
902
921
  self.app.lastWindowClosed.connect(on_last_window_closed)
903
922
  self.app.exec()
904
923
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250518.1
3
+ Version: 250520.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,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=gCsKYJQmDaGZBEmVNE1uPPEjT_PDYfKVn93NYe62x_Q,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=68VdAbE_mSq_RJY26u5CC_nGnkg9rxIjQ2VnB7mBIK0,38670
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-250520.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
+ easycoder-250520.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ easycoder-250520.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
17
+ easycoder-250520.1.dist-info/METADATA,sha256=E_tnIlndfBiBc3pPnGMtbtwBbtbaP4BN-UqBrIX8Hbo,6829
18
+ easycoder-250520.1.dist-info/RECORD,,