easycoder 251015.1__py2.py3-none-any.whl → 251017.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 +1 -1
- easycoder/ec_pyside.py +65 -53
- {easycoder-251015.1.dist-info → easycoder-251017.1.dist-info}/METADATA +1 -1
- {easycoder-251015.1.dist-info → easycoder-251017.1.dist-info}/RECORD +7 -7
- {easycoder-251015.1.dist-info → easycoder-251017.1.dist-info}/WHEEL +0 -0
- {easycoder-251015.1.dist-info → easycoder-251017.1.dist-info}/entry_points.txt +0 -0
- {easycoder-251015.1.dist-info → easycoder-251017.1.dist-info}/licenses/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_pyside.py
CHANGED
|
@@ -67,13 +67,21 @@ class Graphics(Handler):
|
|
|
67
67
|
'combobox',
|
|
68
68
|
'widget'
|
|
69
69
|
]
|
|
70
|
+
|
|
71
|
+
def setWidget(self, record, widget):
|
|
72
|
+
if not 'widget' in record:
|
|
73
|
+
record['widget'] = [None] * record['elements']
|
|
74
|
+
record['widget'][record['index']] = widget
|
|
75
|
+
|
|
76
|
+
def getWidget(self, record):
|
|
77
|
+
if 'widget' in record and record['widget'] != None:
|
|
78
|
+
if record['keyword'] == 'layout': return record['widget']
|
|
79
|
+
return record['widget'][record['index']]
|
|
80
|
+
else:
|
|
81
|
+
return None
|
|
70
82
|
|
|
71
83
|
def dialogTypes(self):
|
|
72
84
|
return ['confirm', 'lineedit', 'multiline', 'generic']
|
|
73
|
-
|
|
74
|
-
def getWidget(self, record):
|
|
75
|
-
if record['keyword'] in ['pushbutton']: return self.getSymbolContent(record)
|
|
76
|
-
else: return record['widget']
|
|
77
85
|
|
|
78
86
|
class ClickableLineEdit(QLineEdit):
|
|
79
87
|
clicked = Signal()
|
|
@@ -114,7 +122,7 @@ class Graphics(Handler):
|
|
|
114
122
|
# (2) add {widget} to {layout}
|
|
115
123
|
# (3) add stretch {widget} to {layout}
|
|
116
124
|
# (4) add stretch to {layout}
|
|
117
|
-
# (5) add spacer {size} to {layout}
|
|
125
|
+
# (5) add spacer [size] {size} to {layout}
|
|
118
126
|
# (6) add {widget} at {col} {row} in {grid layout}
|
|
119
127
|
def k_add(self, command):
|
|
120
128
|
def addToLayout():
|
|
@@ -146,6 +154,7 @@ class Graphics(Handler):
|
|
|
146
154
|
|
|
147
155
|
elif token == 'spacer':
|
|
148
156
|
self.nextToken()
|
|
157
|
+
self.skip('size')
|
|
149
158
|
command['widget'] = 'spacer'
|
|
150
159
|
command['size'] = self.nextValue()
|
|
151
160
|
self.skip('to')
|
|
@@ -186,19 +195,19 @@ class Graphics(Handler):
|
|
|
186
195
|
def r_add(self, command):
|
|
187
196
|
if 'value' in command:
|
|
188
197
|
value = self.getRuntimeValue(command['value'])
|
|
189
|
-
|
|
198
|
+
record = self.getVariable(command['widget'])
|
|
190
199
|
if widget['keyword'] == 'listbox':
|
|
191
|
-
|
|
192
|
-
elif
|
|
193
|
-
if isinstance(value, list):
|
|
194
|
-
else:
|
|
200
|
+
record['widget'].addItem(value)
|
|
201
|
+
elif record['keyword'] == 'combobox':
|
|
202
|
+
if isinstance(value, list): record['widget'].addItems(value)
|
|
203
|
+
else: record['widget'].addItem(value)
|
|
195
204
|
elif 'row' in command and 'col' in command:
|
|
196
205
|
layout = self.getVariable(command['layout'])['widget']
|
|
197
|
-
|
|
198
|
-
widget =
|
|
206
|
+
record = self.getVariable(command['widget'])
|
|
207
|
+
widget = self.getWidget(record)
|
|
199
208
|
row = self.getRuntimeValue(command['row'])
|
|
200
209
|
col = self.getRuntimeValue(command['col'])
|
|
201
|
-
if
|
|
210
|
+
if record['keyword'] == 'layout':
|
|
202
211
|
layout.addLayout(widget, row, col)
|
|
203
212
|
else:
|
|
204
213
|
layout.addWidget(widget, row, col)
|
|
@@ -272,7 +281,7 @@ class Graphics(Handler):
|
|
|
272
281
|
return False
|
|
273
282
|
|
|
274
283
|
def r_clear(self, command):
|
|
275
|
-
widget = self.getVariable(command['name'])
|
|
284
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
276
285
|
widget.clear()
|
|
277
286
|
return self.nextPC()
|
|
278
287
|
|
|
@@ -375,7 +384,7 @@ class Graphics(Handler):
|
|
|
375
384
|
if token == 'text':
|
|
376
385
|
self.nextToken()
|
|
377
386
|
command['text'] = self.nextValue()
|
|
378
|
-
|
|
387
|
+
elif token == 'icon':
|
|
379
388
|
self.nextToken()
|
|
380
389
|
command['icon'] = self.nextValue()
|
|
381
390
|
elif token == 'size':
|
|
@@ -563,7 +572,7 @@ class Graphics(Handler):
|
|
|
563
572
|
elif alignment == 'justify': label.setAlignment(Qt.AlignJustify)
|
|
564
573
|
if 'expand' in command:
|
|
565
574
|
label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
|
566
|
-
record
|
|
575
|
+
self.setWidget(record, label)
|
|
567
576
|
return self.nextPC()
|
|
568
577
|
|
|
569
578
|
def r_createPushbutton(self, command, record):
|
|
@@ -589,7 +598,7 @@ class Graphics(Handler):
|
|
|
589
598
|
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
|
|
590
599
|
pushbutton.setMaximumWidth(w)
|
|
591
600
|
self.putSymbolValue(record, pushbutton)
|
|
592
|
-
record
|
|
601
|
+
self.setWidget(record, pushbutton)
|
|
593
602
|
return self.nextPC()
|
|
594
603
|
|
|
595
604
|
def r_createCheckBox(self, command, record):
|
|
@@ -611,7 +620,7 @@ class Graphics(Handler):
|
|
|
611
620
|
}
|
|
612
621
|
""")
|
|
613
622
|
checkbox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
|
|
614
|
-
record
|
|
623
|
+
self.setWidget(record, checkbox)
|
|
615
624
|
return self.nextPC()
|
|
616
625
|
|
|
617
626
|
def r_createLineEdit(self, command, record):
|
|
@@ -622,7 +631,7 @@ class Graphics(Handler):
|
|
|
622
631
|
c = lineinput.contentsMargins()
|
|
623
632
|
w = fm.horizontalAdvance('x') * self.getRuntimeValue(command['size']) +m.left()+m.right()+c.left()+c.right()
|
|
624
633
|
lineinput.setMaximumWidth(w)
|
|
625
|
-
record
|
|
634
|
+
self.setWidget(record, lineinput)
|
|
626
635
|
return self.nextPC()
|
|
627
636
|
|
|
628
637
|
def r_createMultiLineEdit(self, command, record):
|
|
@@ -632,19 +641,19 @@ class Graphics(Handler):
|
|
|
632
641
|
charHeight = fontMetrics.height()
|
|
633
642
|
textinput.setFixedWidth(charWidth * self.getRuntimeValue(command['cols']))
|
|
634
643
|
textinput.setFixedHeight(charHeight * self.getRuntimeValue(command['rows']))
|
|
635
|
-
record
|
|
644
|
+
self.setWidget(record, textinput)
|
|
636
645
|
return self.nextPC()
|
|
637
646
|
|
|
638
647
|
def r_createListWidget(self, command, record):
|
|
639
|
-
record
|
|
648
|
+
self.setWidget(record, QListWidget())
|
|
640
649
|
return self.nextPC()
|
|
641
650
|
|
|
642
651
|
def r_createComboBox(self, command, record):
|
|
643
|
-
record
|
|
652
|
+
self.setWidget(record, QComboBox())
|
|
644
653
|
return self.nextPC()
|
|
645
654
|
|
|
646
655
|
def r_createWidget(self, command, record):
|
|
647
|
-
record
|
|
656
|
+
self.setWidget(record, QWidget())
|
|
648
657
|
return self.nextPC()
|
|
649
658
|
|
|
650
659
|
def r_createDialog(self, command, record):
|
|
@@ -783,8 +792,8 @@ class Graphics(Handler):
|
|
|
783
792
|
return False
|
|
784
793
|
|
|
785
794
|
def r_hide(self, command):
|
|
786
|
-
|
|
787
|
-
widget.hide()
|
|
795
|
+
record = self.getVariable(command['widget'])
|
|
796
|
+
if 'widget' in record: self.getWidget(record).hide()
|
|
788
797
|
return self.nextPC()
|
|
789
798
|
|
|
790
799
|
# Initialize the graphics environment
|
|
@@ -917,7 +926,7 @@ class Graphics(Handler):
|
|
|
917
926
|
|
|
918
927
|
def r_on(self, command):
|
|
919
928
|
def run(widget, record):
|
|
920
|
-
for i, w in enumerate(record['
|
|
929
|
+
for i, w in enumerate(record['widget']):
|
|
921
930
|
if w == widget:
|
|
922
931
|
record['index'] = i
|
|
923
932
|
self.run(command['goto'])
|
|
@@ -971,10 +980,10 @@ class Graphics(Handler):
|
|
|
971
980
|
record = self.getVariable(command['name'])
|
|
972
981
|
if variant == 'current':
|
|
973
982
|
if record['keyword'] == 'combobox':
|
|
974
|
-
widget = record
|
|
983
|
+
widget = self.getWidget(record)
|
|
975
984
|
widget.removeItem(widget.currentIndex())
|
|
976
985
|
if record['keyword'] == 'listbox':
|
|
977
|
-
widget = record
|
|
986
|
+
widget = self.getWidget(record)
|
|
978
987
|
selectedItem = widget.currentItem()
|
|
979
988
|
if selectedItem:
|
|
980
989
|
row = widget.row(selectedItem)
|
|
@@ -999,7 +1008,7 @@ class Graphics(Handler):
|
|
|
999
1008
|
return False
|
|
1000
1009
|
|
|
1001
1010
|
def r_select(self, command):
|
|
1002
|
-
widget = self.getVariable(command['widget'])
|
|
1011
|
+
widget = self.getWidget(self.getVariable(command['widget']))
|
|
1003
1012
|
if 'index' in command:
|
|
1004
1013
|
index = self.getRuntimeValue(command['index'])
|
|
1005
1014
|
else:
|
|
@@ -1042,9 +1051,10 @@ class Graphics(Handler):
|
|
|
1042
1051
|
self.skip('to')
|
|
1043
1052
|
if self.nextIsSymbol():
|
|
1044
1053
|
record = self.getSymbolRecord()
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1054
|
+
if record['keyword'] == 'layout':
|
|
1055
|
+
command['layout'] = record['name']
|
|
1056
|
+
self.add(command)
|
|
1057
|
+
return True
|
|
1048
1058
|
elif token == 'spacing':
|
|
1049
1059
|
self.skip('of')
|
|
1050
1060
|
if self.nextIsSymbol():
|
|
@@ -1152,25 +1162,26 @@ class Graphics(Handler):
|
|
|
1152
1162
|
def r_set(self, command):
|
|
1153
1163
|
what = command['what']
|
|
1154
1164
|
if what == 'height':
|
|
1155
|
-
widget = self.getVariable(command['name'])
|
|
1165
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
1156
1166
|
widget.setFixedHeight(self.getRuntimeValue(command['value']))
|
|
1157
1167
|
elif what == 'width':
|
|
1158
|
-
widget = self.getVariable(command['name'])
|
|
1168
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
1159
1169
|
widget.setFixedWidth(self.getRuntimeValue(command['value']))
|
|
1160
1170
|
elif what == 'layout':
|
|
1161
|
-
|
|
1171
|
+
record = self.getVariable(command['layout'])
|
|
1172
|
+
layout = record['widget']
|
|
1162
1173
|
record = self.getVariable(command['name'])
|
|
1163
1174
|
keyword = record['keyword']
|
|
1164
1175
|
if keyword == 'window':
|
|
1165
1176
|
window = record['window']
|
|
1166
1177
|
container = QWidget()
|
|
1167
|
-
container.setLayout(
|
|
1178
|
+
container.setLayout(layout)
|
|
1168
1179
|
window.setCentralWidget(container)
|
|
1169
1180
|
elif keyword == 'widget':
|
|
1170
|
-
widget = record
|
|
1171
|
-
widget.setLayout(
|
|
1181
|
+
widget = self.getWidget(record)
|
|
1182
|
+
widget.setLayout(layout)
|
|
1172
1183
|
elif what == 'spacing':
|
|
1173
|
-
layout = self.getVariable(command['name'])
|
|
1184
|
+
layout = self.getWidget(self.getVariable(command['name']))
|
|
1174
1185
|
layout.setSpacing(self.getRuntimeValue(command['value']))
|
|
1175
1186
|
elif what == 'text':
|
|
1176
1187
|
record = self.getVariable(command['name'])
|
|
@@ -1188,7 +1199,7 @@ class Graphics(Handler):
|
|
|
1188
1199
|
record = self.getVariable(command['name'])
|
|
1189
1200
|
if record['keyword'] == 'checkbox':
|
|
1190
1201
|
state = self.getRuntimeValue(command['value'])
|
|
1191
|
-
record
|
|
1202
|
+
self.getWidget(record).setChecked(state)
|
|
1192
1203
|
elif what == 'alignment':
|
|
1193
1204
|
widget = self.getVariable(command['name'])['widget']
|
|
1194
1205
|
flags = command['value']
|
|
@@ -1227,6 +1238,7 @@ class Graphics(Handler):
|
|
|
1227
1238
|
|
|
1228
1239
|
# show {window}
|
|
1229
1240
|
# show {dialog}
|
|
1241
|
+
# show {widget}
|
|
1230
1242
|
# show {messagebox} giving {result}}
|
|
1231
1243
|
def k_show(self, command):
|
|
1232
1244
|
if self.nextIsSymbol():
|
|
@@ -1240,6 +1252,10 @@ class Graphics(Handler):
|
|
|
1240
1252
|
command['dialog'] = record['name']
|
|
1241
1253
|
self.add(command)
|
|
1242
1254
|
return True
|
|
1255
|
+
elif self.isWidget(keyword):
|
|
1256
|
+
command['name'] = record['name']
|
|
1257
|
+
self.add(command)
|
|
1258
|
+
return True
|
|
1243
1259
|
elif keyword == 'messagebox':
|
|
1244
1260
|
command['messagebox'] = record['name']
|
|
1245
1261
|
self.skip('giving')
|
|
@@ -1247,10 +1263,6 @@ class Graphics(Handler):
|
|
|
1247
1263
|
command['result'] = self.getSymbolRecord()['name']
|
|
1248
1264
|
self.add(command)
|
|
1249
1265
|
return True
|
|
1250
|
-
elif self.isWidget(keyword):
|
|
1251
|
-
command['name'] = record['name']
|
|
1252
|
-
self.add(command)
|
|
1253
|
-
return True
|
|
1254
1266
|
return False
|
|
1255
1267
|
|
|
1256
1268
|
def r_show(self, command):
|
|
@@ -1306,7 +1318,7 @@ class Graphics(Handler):
|
|
|
1306
1318
|
else: record['result'] = dialog.value
|
|
1307
1319
|
elif 'name' in command:
|
|
1308
1320
|
record = self.getVariable(command['name'])
|
|
1309
|
-
if 'widget' in record: record
|
|
1321
|
+
if 'widget' in record: self.getWidget(record).show()
|
|
1310
1322
|
return self.nextPC()
|
|
1311
1323
|
|
|
1312
1324
|
# Start the graphics
|
|
@@ -1401,38 +1413,38 @@ class Graphics(Handler):
|
|
|
1401
1413
|
symbolRecord = self.getVariable(symbolRecord['name'])
|
|
1402
1414
|
keyword = symbolRecord['keyword']
|
|
1403
1415
|
if keyword == 'pushbutton':
|
|
1404
|
-
pushbutton = self.
|
|
1416
|
+
pushbutton = self.getWidget(symbolRecord)
|
|
1405
1417
|
v = {}
|
|
1406
1418
|
v['type'] = 'text'
|
|
1407
1419
|
v['content'] = pushbutton.accessibleName()
|
|
1408
1420
|
return v
|
|
1409
1421
|
elif keyword == 'lineinput':
|
|
1410
|
-
lineinput = symbolRecord
|
|
1422
|
+
lineinput = self.getWidget(symbolRecord)
|
|
1411
1423
|
v = {}
|
|
1412
1424
|
v['type'] = 'text'
|
|
1413
1425
|
v['content'] = lineinput.displayText()
|
|
1414
1426
|
return v
|
|
1415
1427
|
elif keyword == 'multiline':
|
|
1416
|
-
multiline = symbolRecord
|
|
1428
|
+
multiline = self.getWidget(symbolRecord)
|
|
1417
1429
|
v = {}
|
|
1418
1430
|
v['type'] = 'text'
|
|
1419
1431
|
v['content'] = multiline.toPlainText()
|
|
1420
1432
|
return v
|
|
1421
1433
|
elif keyword == 'combobox':
|
|
1422
|
-
combobox = symbolRecord
|
|
1434
|
+
combobox = self.getWidget(symbolRecord)
|
|
1423
1435
|
v = {}
|
|
1424
1436
|
v['type'] = 'text'
|
|
1425
1437
|
v['content'] = combobox.currentText()
|
|
1426
1438
|
return v
|
|
1427
1439
|
elif keyword == 'listbox':
|
|
1428
|
-
listbox = symbolRecord
|
|
1440
|
+
listbox = self.getWidget(symbolRecord)
|
|
1429
1441
|
content = listbox.currentItem().text()
|
|
1430
1442
|
v = {}
|
|
1431
1443
|
v['type'] = 'text'
|
|
1432
1444
|
v['content'] = content
|
|
1433
1445
|
return v
|
|
1434
1446
|
elif keyword == 'checkbox':
|
|
1435
|
-
checkbox =
|
|
1447
|
+
checkbox =self.getWidget(symbolRecord)
|
|
1436
1448
|
content = checkbox.isChecked()
|
|
1437
1449
|
v = {}
|
|
1438
1450
|
v['type'] = 'boolean'
|
|
@@ -1449,7 +1461,7 @@ class Graphics(Handler):
|
|
|
1449
1461
|
def v_count(self, v):
|
|
1450
1462
|
record = self.getVariable(v['name'])
|
|
1451
1463
|
keyword = record['keyword']
|
|
1452
|
-
widget = record
|
|
1464
|
+
widget = self.getWidget(record)
|
|
1453
1465
|
if keyword in ['combobox', 'listbox']: content = widget.count()
|
|
1454
1466
|
value = {}
|
|
1455
1467
|
value['type'] = 'int'
|
|
@@ -1459,7 +1471,7 @@ class Graphics(Handler):
|
|
|
1459
1471
|
def v_current(self, v):
|
|
1460
1472
|
record = self.getVariable(v['name'])
|
|
1461
1473
|
keyword = record['keyword']
|
|
1462
|
-
widget = record
|
|
1474
|
+
widget = self.getWidget(record)
|
|
1463
1475
|
if keyword == 'listbox': content = widget.currentItem().text()
|
|
1464
1476
|
value = {}
|
|
1465
1477
|
value['type'] = 'text'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 251017.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,4 +1,4 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=
|
|
1
|
+
easycoder/__init__.py,sha256=kH5jBaQeBlgco2cxiX-wF-cNAyJKMFBk9IDhqF7iq_c,339
|
|
2
2
|
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
3
|
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
4
|
easycoder/ec_classes.py,sha256=bejrby7mLHTeAQXhhz-1l8iv6LSbNSy30lW21KJKjXE,1832
|
|
@@ -8,12 +8,12 @@ easycoder/ec_core.py,sha256=VTAnhdLp3ftZ1tLPhovKX0PQ1CplmC9x17jH_DfrJsQ,99650
|
|
|
8
8
|
easycoder/ec_handler.py,sha256=ED08ULiOlZkcs4XHxAguvdPZw_dFXuwGDFLbFuo0kLs,2317
|
|
9
9
|
easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
|
|
10
10
|
easycoder/ec_program.py,sha256=srVDRlELMElvnkjxmREczUVPkvPXPvanZglN4hKreLI,10324
|
|
11
|
-
easycoder/ec_pyside.py,sha256=
|
|
11
|
+
easycoder/ec_pyside.py,sha256=5mpf4LeweCw7H6wtfQPadDEO48ckhijQ3QRbwHO3WKI,56235
|
|
12
12
|
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
13
|
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
14
|
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
-
easycoder-
|
|
16
|
-
easycoder-
|
|
17
|
-
easycoder-
|
|
18
|
-
easycoder-
|
|
19
|
-
easycoder-
|
|
15
|
+
easycoder-251017.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
+
easycoder-251017.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
easycoder-251017.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
+
easycoder-251017.1.dist-info/METADATA,sha256=aJJGjDoaRdtHJdyHU6pcRyG-EVInGc1tDFsCCcWZVmY,6897
|
|
19
|
+
easycoder-251017.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|