easycoder 250810.1__py2.py3-none-any.whl → 250810.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
@@ -11,4 +11,4 @@ from .ec_pyside import *
11
11
  from .ec_timestamp import *
12
12
  from .ec_value import *
13
13
 
14
- __version__ = "250810.1"
14
+ __version__ = "250810.3"
easycoder/ec_pyside.py CHANGED
@@ -54,7 +54,7 @@ class Graphics(Handler):
54
54
  def isWidget(self, keyword):
55
55
  return keyword in [
56
56
  'layout',
57
- 'groupbox',
57
+ 'group',
58
58
  'label',
59
59
  'pushbutton',
60
60
  'checkbox',
@@ -115,11 +115,12 @@ class Graphics(Handler):
115
115
  # (3) add stretch {widget} to {layout}
116
116
  # (4) add stretch to {layout}
117
117
  # (5) add spacer {size} to {layout}
118
+ # (6) add {widget} at {col} {row} in {grid layout}
118
119
  def k_add(self, command):
119
120
  def addToLayout():
120
121
  if self.nextIsSymbol():
121
122
  record = self.getSymbolRecord()
122
- if record['keyword'] in ['layout', 'groupbox', 'element']:
123
+ if record['keyword'] in ['layout', 'group', 'element']:
123
124
  command['layout'] = record['name']
124
125
  self.add(command)
125
126
  return True
@@ -155,12 +156,20 @@ class Graphics(Handler):
155
156
  record = self.getSymbolRecord()
156
157
  if record['extra'] == 'gui':
157
158
  if self.isWidget(record['keyword']):
159
+ command['widget'] = record['name']
158
160
  if self.peek() == 'to':
159
161
  # (2)
160
162
  record = self.getSymbolRecord()
161
- command['widget'] = record['name']
162
163
  self.nextToken()
163
164
  return addToLayout()
165
+ elif self.peek() == 'at':
166
+ # (6)
167
+ self.nextToken()
168
+ command['row'] = self.nextValue()
169
+ command['col'] = self.nextValue()
170
+ self.skip('in')
171
+ return addToLayout()
172
+
164
173
  else: return False
165
174
  # (1)
166
175
  value = self.getValue()
@@ -180,6 +189,12 @@ class Graphics(Handler):
180
189
  widget = self.getVariable(command['widget'])
181
190
  if widget['keyword'] in ['listbox', 'combobox']:
182
191
  widget['widget'].addItem(value)
192
+ elif 'row' in command and 'col' in command:
193
+ layout = self.getVariable(command['layout'])['widget']
194
+ widget = self.getVariable(command['widget'])['widget']
195
+ row = self.getRuntimeValue(command['row'])
196
+ col = self.getRuntimeValue(command['col'])
197
+ layout.addWidget(widget, row, col)
183
198
  else:
184
199
  layoutRecord = self.getVariable(command['layout'])
185
200
  widget = command['widget']
@@ -194,11 +209,11 @@ class Graphics(Handler):
194
209
  layout = layoutRecord['widget']
195
210
  stretch = 'stretch' in command
196
211
  if widgetRecord['keyword'] == 'layout':
197
- if layoutRecord['keyword'] == 'groupbox':
212
+ if layoutRecord['keyword'] == 'group':
198
213
  if widgetRecord['keyword'] == 'layout':
199
214
  layout.setLayout(widget)
200
215
  else:
201
- RuntimeError(self.program, 'Can only add a layout to a groupbox')
216
+ RuntimeError(self.program, 'Can only add a layout to a group')
202
217
  else:
203
218
  if stretch: layout.addLayout(widget, stretch=1)
204
219
  else: layout.addLayout(widget)
@@ -363,7 +378,7 @@ class Graphics(Handler):
363
378
  if self.peek() == 'text':
364
379
  self.nextToken()
365
380
  text = self.nextValue()
366
- else: text = ''
381
+ else: text = self.compileConstant('')
367
382
  command['text'] = text
368
383
  self.add(command)
369
384
  return True
@@ -471,7 +486,7 @@ class Graphics(Handler):
471
486
  keyword = record['keyword']
472
487
  if keyword == 'window': return self.k_createWindow(command)
473
488
  elif keyword == 'layout': return self.k_createLayout(command)
474
- elif keyword == 'groupbox': return self.k_createGroupBox(command)
489
+ elif keyword == 'group': return self.k_createGroupBox(command)
475
490
  elif keyword == 'label': return self.k_createLabel(command)
476
491
  elif keyword == 'pushbutton': return self.k_createPushbutton(command)
477
492
  elif keyword == 'checkbox': return self.k_createCheckBox(command)
@@ -499,19 +514,19 @@ class Graphics(Handler):
499
514
  return self.nextPC()
500
515
 
501
516
  def r_createLayout(self, command, record):
502
- type = command['type']
503
- if type == 'QHBoxLayout': layout = QHBoxLayout()
504
- elif type == 'QGridLayout': layout = QGridLayout()
505
- elif type == 'QStackedLayout': layout = QStackedLayout()
517
+ layoutType = command['type']
518
+ if layoutType == 'QHBoxLayout': layout = QHBoxLayout()
519
+ elif layoutType == 'QGridLayout': layout = QGridLayout()
520
+ elif layoutType == 'QStackedLayout': layout = QStackedLayout()
506
521
  else: layout = QVBoxLayout()
507
522
  layout.setContentsMargins(5,0,5,0)
508
523
  record['widget'] = layout
509
524
  return self.nextPC()
510
525
 
511
526
  def r_createGroupBox(self, command, record):
512
- groupbox = QGroupBox(self.getRuntimeValue(command['title']))
513
- groupbox.setAlignment(Qt.AlignLeft)
514
- record['widget'] = groupbox
527
+ group = QGroupBox(self.getRuntimeValue(command['title']))
528
+ group.setAlignment(Qt.AlignLeft)
529
+ record['widget'] = group
515
530
  return self.nextPC()
516
531
 
517
532
  def r_createLabel(self, command, record):
@@ -548,6 +563,7 @@ class Graphics(Handler):
548
563
 
549
564
  def r_createCheckBox(self, command, record):
550
565
  checkbox = QCheckBox(self.getRuntimeValue(command['text']))
566
+ checkbox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
551
567
  record['widget'] = checkbox
552
568
  return self.nextPC()
553
569
 
@@ -625,7 +641,7 @@ class Graphics(Handler):
625
641
  keyword = record['keyword']
626
642
  if keyword == 'window': return self.r_createWindow(command, record)
627
643
  elif keyword == 'layout': return self.r_createLayout(command, record)
628
- elif keyword == 'groupbox': return self.r_createGroupBox(command, record)
644
+ elif keyword == 'group': return self.r_createGroupBox(command, record)
629
645
  elif keyword == 'label': return self.r_createLabel(command, record)
630
646
  elif keyword == 'pushbutton': return self.r_createPushbutton(command, record)
631
647
  elif keyword == 'checkbox': return self.r_createCheckBox(command, record)
@@ -669,10 +685,10 @@ class Graphics(Handler):
669
685
  return self.nextPC()
670
686
 
671
687
  # Create a group box
672
- def k_groupbox(self, command):
688
+ def k_group(self, command):
673
689
  return self.compileVariable(command, 'gui')
674
690
 
675
- def r_groupbox(self, command):
691
+ def r_group(self, command):
676
692
  return self.nextPC()
677
693
 
678
694
  # Initialize the graphics environment
@@ -953,6 +969,29 @@ class Graphics(Handler):
953
969
  command['value'] = self.nextValue()
954
970
  self.add(command)
955
971
  return True
972
+ elif token == 'alignment':
973
+ self.skip('of')
974
+ if self.nextIsSymbol():
975
+ record = self.getSymbolRecord()
976
+ if record['extra'] == 'gui':
977
+ command['name'] = record['name']
978
+ self.skip('to')
979
+ flags = []
980
+ while self.peek() in ['left', 'hcenter', 'right', 'top', 'vcenter', 'bottom', 'center']:
981
+ flags.append(self.nextToken())
982
+ command['value'] = flags
983
+ self.add(command)
984
+ return True
985
+ elif token == 'style':
986
+ self.skip('of')
987
+ if self.nextIsSymbol():
988
+ record = self.getSymbolRecord()
989
+ if record['keyword'] == 'label':
990
+ command['name'] = record['name']
991
+ self.skip('to')
992
+ command['value'] = self.nextValue()
993
+ self.add(command)
994
+ return True
956
995
  elif token == 'color':
957
996
  self.skip('of')
958
997
  if self.nextIsSymbol():
@@ -1021,6 +1060,23 @@ class Graphics(Handler):
1021
1060
  widget = self.getVariable(command['name'])['widget']
1022
1061
  state = self.getRuntimeValue(command['value'])
1023
1062
  widget.setChecked(state)
1063
+ elif what == 'alignment':
1064
+ widget = self.getVariable(command['name'])['widget']
1065
+ flags = command['value']
1066
+ alignment = 0
1067
+ for flag in flags:
1068
+ if flag == 'left': alignment |= Qt.AlignLeft
1069
+ elif flag == 'hcenter': alignment |= Qt.AlignHCenter
1070
+ elif flag == 'right': alignment |= Qt.AlignRight
1071
+ elif flag == 'top': alignment |= Qt.AlignTop
1072
+ elif flag == 'vcenter': alignment |= Qt.AlignVCenter
1073
+ elif flag == 'bottom': alignment |= Qt.AlignBottom
1074
+ elif flag == 'center': alignment |= Qt.AlignCenter
1075
+ widget.setAlignment(alignment)
1076
+ elif what == 'style':
1077
+ widget = self.getVariable(command['name'])['widget']
1078
+ styles = self.getRuntimeValue(command['value'])
1079
+ widget.setStyleSheet(styles)
1024
1080
  elif what == 'color':
1025
1081
  widget = self.getVariable(command['name'])['widget']
1026
1082
  color = self.getRuntimeValue(command['value'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250810.1
3
+ Version: 250810.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>
@@ -1,4 +1,4 @@
1
- easycoder/__init__.py,sha256=O4prZn9Zw9PP1eKt91TjQ-WKBBnOfsfaZztkZr_gBxQ,314
1
+ easycoder/__init__.py,sha256=7SNthjbKvFYHnKTilRMWlc5PTRJTF-hM4ZQDvcvgenA,314
2
2
  easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
3
3
  easycoder/ec_classes.py,sha256=PWPaJuTfaWD4-tgT-2WWOgeFV_jXxlxyKCxvXyylCUU,1824
4
4
  easycoder/ec_compiler.py,sha256=-uuXDbfgFBGXSrr7EneDnnneFOFsU-UuCIpNHsCqY0s,5289
@@ -7,11 +7,11 @@ easycoder/ec_core.py,sha256=r0bFQV3LXCCh4CP6289h6UvK6gpq4L0BQDrEWkeVo_0,98040
7
7
  easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
8
8
  easycoder/ec_keyboard.py,sha256=jLFtBWS61OWI8S5WO_cZJPAWrclMpgHSnMoNVbJ_2sQ,20217
9
9
  easycoder/ec_program.py,sha256=7h2QKGunsiu5l2OKn-sw-Dd70kZJrb4b2idHubeSXDs,9989
10
- easycoder/ec_pyside.py,sha256=uTDoIQnwTBmsOyfc5_7g0dSDaFEvqAs1ksPj2bF16zg,46825
10
+ easycoder/ec_pyside.py,sha256=fMTM-N5GbCHfQxyRhcHk5hE8e-dEd6TagvUToWoeEFE,49513
11
11
  easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
12
12
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
13
- easycoder-250810.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
- easycoder-250810.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- easycoder-250810.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
16
- easycoder-250810.1.dist-info/METADATA,sha256=QBS3f2dL6bzZ_5rM8MFA5OqVyTiTkHFlMpOCGXA5nRk,6875
17
- easycoder-250810.1.dist-info/RECORD,,
13
+ easycoder-250810.3.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
+ easycoder-250810.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
+ easycoder-250810.3.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
16
+ easycoder-250810.3.dist-info/METADATA,sha256=vVpAZ4IHuxGWN69cdiTa9z7mGquBIGY9mQNt8GOQEYo,6875
17
+ easycoder-250810.3.dist-info/RECORD,,