easycoder 250517.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__ = "250517.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
@@ -37,13 +37,9 @@ from PySide6.QtWidgets import (
37
37
 
38
38
  class Graphics(Handler):
39
39
 
40
- class MainWindow(QMainWindow):
41
-
42
- def __init__(self):
43
- super().__init__()
44
-
45
40
  def __init__(self, compiler):
46
41
  Handler.__init__(self, compiler)
42
+ self.blocked = False
47
43
 
48
44
  def getName(self):
49
45
  return 'graphics'
@@ -88,13 +84,14 @@ class Graphics(Handler):
88
84
  elif self.isSymbol():
89
85
  record = self.getSymbolRecord()
90
86
  if record['extra'] == 'gui':
91
- if self.peek() == 'to':
92
- # (2)
93
- record = self.getSymbolRecord()
94
- command['widget'] = record['name']
95
- self.nextToken()
96
- return addToLayout()
97
- 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
98
95
  # (1)
99
96
  command['value'] = self.getValue()
100
97
  self.skip('to')
@@ -375,24 +372,17 @@ class Graphics(Handler):
375
372
  return False
376
373
 
377
374
  def r_createWindow(self, command, record):
378
- window = self.MainWindow()
375
+ window = QMainWindow()
379
376
  window.setWindowTitle(self.getRuntimeValue(command['title']))
380
377
  w = self.getRuntimeValue(command['w'])
381
378
  h = self.getRuntimeValue(command['h'])
382
379
  x = command['x']
383
380
  y = command['y']
384
- if x == None: x = (self.screenWidth - w) / 2
381
+ if x == None: x = (self.program.screenWidth - w) / 2
385
382
  else: x = self.getRuntimeValue(x)
386
- if y == None: y = (self.screenHeight - h) / 2
383
+ if y == None: y = (self.program.screenHeight - h) / 2
387
384
  else: y = self.getRuntimeValue(x)
388
385
  window.setGeometry(x, y, w, h)
389
- # content = self.getVariable(command['layout'])['widget']
390
- # if isinstance(content, QWidget):
391
- # container = content
392
- # else:
393
- # container = QWidget()
394
- # container.setLayout(content)
395
- # window.setCentralWidget(container)
396
386
  record['window'] = window
397
387
  return self.nextPC()
398
388
 
@@ -549,9 +539,9 @@ class Graphics(Handler):
549
539
  def r_init(self, command):
550
540
  self.app = QApplication(sys.argv)
551
541
  screen = QApplication.screens()[0].size().toTuple()
552
- self.screenWidth = screen[0]
553
- self.screenHeight = screen[1]
554
- print(f'Screen: {self.screenWidth}x{self.screenHeight}')
542
+ self.program.screenWidth = screen[0]
543
+ self.program.screenHeight = screen[1]
544
+ print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
555
545
  return self.nextPC()
556
546
 
557
547
  # Declare a label variable
@@ -717,10 +707,12 @@ class Graphics(Handler):
717
707
 
718
708
  # set [the] width/height [of] {widget} [to] {value}
719
709
  # set [the] layout of {window} to {layout}
710
+ # set [the] spacing of {layout} to {value}
720
711
  # set [the] text [of] {label}/{button}/{lineinput} [to] {text}
721
712
  # set [the] color [of] {label}/{button}/{lineinput} [to] {color}
722
713
  # set [the] state [of] {checkbox} [to] {color}
723
714
  # set {listbox} to {list}
715
+ # set blocked true/false
724
716
  def k_set(self, command):
725
717
  self.skip('the')
726
718
  token = self.nextToken()
@@ -747,6 +739,16 @@ class Graphics(Handler):
747
739
  command['layout'] = record['name']
748
740
  self.add(command)
749
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
750
752
  elif token == 'text':
751
753
  self.skip('of')
752
754
  if self.nextIsSymbol():
@@ -788,6 +790,9 @@ class Graphics(Handler):
788
790
  command['value'] = self.nextValue()
789
791
  self.add(command)
790
792
  return True
793
+ elif token == 'blocked':
794
+ self.blocked = True if self.nextToken() == 'true' else False
795
+ return True
791
796
  elif self.isSymbol():
792
797
  record = self.getSymbolRecord()
793
798
  if record['keyword'] == 'listbox':
@@ -809,11 +814,13 @@ class Graphics(Handler):
809
814
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
810
815
  elif what == 'layout':
811
816
  window = self.getVariable(command['name'])['window']
812
- layout = self.getVariable(command['layout'])
813
817
  content = self.getVariable(command['layout'])['widget']
814
818
  container = QWidget()
815
819
  container.setLayout(content)
816
820
  window.setCentralWidget(container)
821
+ elif what == 'spacing':
822
+ layout = self.getVariable(command['name'])['widget']
823
+ layout.setSpacing(self.getRuntimeValue(command['value']))
817
824
  elif what == 'text':
818
825
  record = self.getVariable(command['name'])
819
826
  widget = self.getVariable(command['name'])['widget']
@@ -903,14 +910,14 @@ class Graphics(Handler):
903
910
  def r_start(self, command):
904
911
  def on_last_window_closed():
905
912
  self.program.kill()
906
- def resume():
913
+ def init():
907
914
  self.program.flush(self.nextPC())
908
915
  def flush():
909
- self.program.flushCB()
916
+ if not self.blocked: self.program.flushCB()
910
917
  timer = QTimer()
911
918
  timer.timeout.connect(flush)
912
919
  timer.start(10)
913
- QTimer.singleShot(500, resume)
920
+ QTimer.singleShot(500, init)
914
921
  self.app.lastWindowClosed.connect(on_last_window_closed)
915
922
  self.app.exec()
916
923
 
@@ -1,12 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250517.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>
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: requests
12
11
  Requires-Dist: pyside6
@@ -1,18 +1,18 @@
1
1
  easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
2
- easycoder/__init__.py,sha256=tJvoCPTocwkmIxrMHQJ8tg8nxQ2RZgQbEqjOUBi0HHA,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=NP-nXq-ois3wp4pDMaVSxB7FsxOe4ezZ7TqkKb0KxAM,38068
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-250517.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
15
- easycoder-250517.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
- easycoder-250517.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
17
- easycoder-250517.1.dist-info/METADATA,sha256=sugEBalmSDH5JFyoRtXyUCV9bAnXxt-g1LPCPhbetEM,6851
18
- easycoder-250517.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,,
@@ -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