easycoder 251016.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 +61 -50
- {easycoder-251016.1.dist-info → easycoder-251017.1.dist-info}/METADATA +1 -1
- {easycoder-251016.1.dist-info → easycoder-251017.1.dist-info}/RECORD +7 -7
- {easycoder-251016.1.dist-info → easycoder-251017.1.dist-info}/WHEEL +0 -0
- {easycoder-251016.1.dist-info → easycoder-251017.1.dist-info}/entry_points.txt +0 -0
- {easycoder-251016.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()
|
|
@@ -187,19 +195,19 @@ class Graphics(Handler):
|
|
|
187
195
|
def r_add(self, command):
|
|
188
196
|
if 'value' in command:
|
|
189
197
|
value = self.getRuntimeValue(command['value'])
|
|
190
|
-
|
|
198
|
+
record = self.getVariable(command['widget'])
|
|
191
199
|
if widget['keyword'] == 'listbox':
|
|
192
|
-
|
|
193
|
-
elif
|
|
194
|
-
if isinstance(value, list):
|
|
195
|
-
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)
|
|
196
204
|
elif 'row' in command and 'col' in command:
|
|
197
205
|
layout = self.getVariable(command['layout'])['widget']
|
|
198
|
-
|
|
199
|
-
widget =
|
|
206
|
+
record = self.getVariable(command['widget'])
|
|
207
|
+
widget = self.getWidget(record)
|
|
200
208
|
row = self.getRuntimeValue(command['row'])
|
|
201
209
|
col = self.getRuntimeValue(command['col'])
|
|
202
|
-
if
|
|
210
|
+
if record['keyword'] == 'layout':
|
|
203
211
|
layout.addLayout(widget, row, col)
|
|
204
212
|
else:
|
|
205
213
|
layout.addWidget(widget, row, col)
|
|
@@ -273,7 +281,7 @@ class Graphics(Handler):
|
|
|
273
281
|
return False
|
|
274
282
|
|
|
275
283
|
def r_clear(self, command):
|
|
276
|
-
widget = self.getVariable(command['name'])
|
|
284
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
277
285
|
widget.clear()
|
|
278
286
|
return self.nextPC()
|
|
279
287
|
|
|
@@ -564,7 +572,7 @@ class Graphics(Handler):
|
|
|
564
572
|
elif alignment == 'justify': label.setAlignment(Qt.AlignJustify)
|
|
565
573
|
if 'expand' in command:
|
|
566
574
|
label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
|
567
|
-
record
|
|
575
|
+
self.setWidget(record, label)
|
|
568
576
|
return self.nextPC()
|
|
569
577
|
|
|
570
578
|
def r_createPushbutton(self, command, record):
|
|
@@ -590,7 +598,7 @@ class Graphics(Handler):
|
|
|
590
598
|
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
|
|
591
599
|
pushbutton.setMaximumWidth(w)
|
|
592
600
|
self.putSymbolValue(record, pushbutton)
|
|
593
|
-
record
|
|
601
|
+
self.setWidget(record, pushbutton)
|
|
594
602
|
return self.nextPC()
|
|
595
603
|
|
|
596
604
|
def r_createCheckBox(self, command, record):
|
|
@@ -612,7 +620,7 @@ class Graphics(Handler):
|
|
|
612
620
|
}
|
|
613
621
|
""")
|
|
614
622
|
checkbox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
|
|
615
|
-
record
|
|
623
|
+
self.setWidget(record, checkbox)
|
|
616
624
|
return self.nextPC()
|
|
617
625
|
|
|
618
626
|
def r_createLineEdit(self, command, record):
|
|
@@ -623,7 +631,7 @@ class Graphics(Handler):
|
|
|
623
631
|
c = lineinput.contentsMargins()
|
|
624
632
|
w = fm.horizontalAdvance('x') * self.getRuntimeValue(command['size']) +m.left()+m.right()+c.left()+c.right()
|
|
625
633
|
lineinput.setMaximumWidth(w)
|
|
626
|
-
record
|
|
634
|
+
self.setWidget(record, lineinput)
|
|
627
635
|
return self.nextPC()
|
|
628
636
|
|
|
629
637
|
def r_createMultiLineEdit(self, command, record):
|
|
@@ -633,19 +641,19 @@ class Graphics(Handler):
|
|
|
633
641
|
charHeight = fontMetrics.height()
|
|
634
642
|
textinput.setFixedWidth(charWidth * self.getRuntimeValue(command['cols']))
|
|
635
643
|
textinput.setFixedHeight(charHeight * self.getRuntimeValue(command['rows']))
|
|
636
|
-
record
|
|
644
|
+
self.setWidget(record, textinput)
|
|
637
645
|
return self.nextPC()
|
|
638
646
|
|
|
639
647
|
def r_createListWidget(self, command, record):
|
|
640
|
-
record
|
|
648
|
+
self.setWidget(record, QListWidget())
|
|
641
649
|
return self.nextPC()
|
|
642
650
|
|
|
643
651
|
def r_createComboBox(self, command, record):
|
|
644
|
-
record
|
|
652
|
+
self.setWidget(record, QComboBox())
|
|
645
653
|
return self.nextPC()
|
|
646
654
|
|
|
647
655
|
def r_createWidget(self, command, record):
|
|
648
|
-
record
|
|
656
|
+
self.setWidget(record, QWidget())
|
|
649
657
|
return self.nextPC()
|
|
650
658
|
|
|
651
659
|
def r_createDialog(self, command, record):
|
|
@@ -785,7 +793,7 @@ class Graphics(Handler):
|
|
|
785
793
|
|
|
786
794
|
def r_hide(self, command):
|
|
787
795
|
record = self.getVariable(command['widget'])
|
|
788
|
-
if 'widget' in record: record
|
|
796
|
+
if 'widget' in record: self.getWidget(record).hide()
|
|
789
797
|
return self.nextPC()
|
|
790
798
|
|
|
791
799
|
# Initialize the graphics environment
|
|
@@ -918,7 +926,7 @@ class Graphics(Handler):
|
|
|
918
926
|
|
|
919
927
|
def r_on(self, command):
|
|
920
928
|
def run(widget, record):
|
|
921
|
-
for i, w in enumerate(record['
|
|
929
|
+
for i, w in enumerate(record['widget']):
|
|
922
930
|
if w == widget:
|
|
923
931
|
record['index'] = i
|
|
924
932
|
self.run(command['goto'])
|
|
@@ -972,10 +980,10 @@ class Graphics(Handler):
|
|
|
972
980
|
record = self.getVariable(command['name'])
|
|
973
981
|
if variant == 'current':
|
|
974
982
|
if record['keyword'] == 'combobox':
|
|
975
|
-
widget = record
|
|
983
|
+
widget = self.getWidget(record)
|
|
976
984
|
widget.removeItem(widget.currentIndex())
|
|
977
985
|
if record['keyword'] == 'listbox':
|
|
978
|
-
widget = record
|
|
986
|
+
widget = self.getWidget(record)
|
|
979
987
|
selectedItem = widget.currentItem()
|
|
980
988
|
if selectedItem:
|
|
981
989
|
row = widget.row(selectedItem)
|
|
@@ -1000,7 +1008,7 @@ class Graphics(Handler):
|
|
|
1000
1008
|
return False
|
|
1001
1009
|
|
|
1002
1010
|
def r_select(self, command):
|
|
1003
|
-
widget = self.getVariable(command['widget'])
|
|
1011
|
+
widget = self.getWidget(self.getVariable(command['widget']))
|
|
1004
1012
|
if 'index' in command:
|
|
1005
1013
|
index = self.getRuntimeValue(command['index'])
|
|
1006
1014
|
else:
|
|
@@ -1043,9 +1051,10 @@ class Graphics(Handler):
|
|
|
1043
1051
|
self.skip('to')
|
|
1044
1052
|
if self.nextIsSymbol():
|
|
1045
1053
|
record = self.getSymbolRecord()
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1054
|
+
if record['keyword'] == 'layout':
|
|
1055
|
+
command['layout'] = record['name']
|
|
1056
|
+
self.add(command)
|
|
1057
|
+
return True
|
|
1049
1058
|
elif token == 'spacing':
|
|
1050
1059
|
self.skip('of')
|
|
1051
1060
|
if self.nextIsSymbol():
|
|
@@ -1153,25 +1162,26 @@ class Graphics(Handler):
|
|
|
1153
1162
|
def r_set(self, command):
|
|
1154
1163
|
what = command['what']
|
|
1155
1164
|
if what == 'height':
|
|
1156
|
-
widget = self.getVariable(command['name'])
|
|
1165
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
1157
1166
|
widget.setFixedHeight(self.getRuntimeValue(command['value']))
|
|
1158
1167
|
elif what == 'width':
|
|
1159
|
-
widget = self.getVariable(command['name'])
|
|
1168
|
+
widget = self.getWidget(self.getVariable(command['name']))
|
|
1160
1169
|
widget.setFixedWidth(self.getRuntimeValue(command['value']))
|
|
1161
1170
|
elif what == 'layout':
|
|
1162
|
-
|
|
1171
|
+
record = self.getVariable(command['layout'])
|
|
1172
|
+
layout = record['widget']
|
|
1163
1173
|
record = self.getVariable(command['name'])
|
|
1164
1174
|
keyword = record['keyword']
|
|
1165
1175
|
if keyword == 'window':
|
|
1166
1176
|
window = record['window']
|
|
1167
1177
|
container = QWidget()
|
|
1168
|
-
container.setLayout(
|
|
1178
|
+
container.setLayout(layout)
|
|
1169
1179
|
window.setCentralWidget(container)
|
|
1170
1180
|
elif keyword == 'widget':
|
|
1171
|
-
widget = record
|
|
1172
|
-
widget.setLayout(
|
|
1181
|
+
widget = self.getWidget(record)
|
|
1182
|
+
widget.setLayout(layout)
|
|
1173
1183
|
elif what == 'spacing':
|
|
1174
|
-
layout = self.getVariable(command['name'])
|
|
1184
|
+
layout = self.getWidget(self.getVariable(command['name']))
|
|
1175
1185
|
layout.setSpacing(self.getRuntimeValue(command['value']))
|
|
1176
1186
|
elif what == 'text':
|
|
1177
1187
|
record = self.getVariable(command['name'])
|
|
@@ -1189,7 +1199,7 @@ class Graphics(Handler):
|
|
|
1189
1199
|
record = self.getVariable(command['name'])
|
|
1190
1200
|
if record['keyword'] == 'checkbox':
|
|
1191
1201
|
state = self.getRuntimeValue(command['value'])
|
|
1192
|
-
record
|
|
1202
|
+
self.getWidget(record).setChecked(state)
|
|
1193
1203
|
elif what == 'alignment':
|
|
1194
1204
|
widget = self.getVariable(command['name'])['widget']
|
|
1195
1205
|
flags = command['value']
|
|
@@ -1228,6 +1238,7 @@ class Graphics(Handler):
|
|
|
1228
1238
|
|
|
1229
1239
|
# show {window}
|
|
1230
1240
|
# show {dialog}
|
|
1241
|
+
# show {widget}
|
|
1231
1242
|
# show {messagebox} giving {result}}
|
|
1232
1243
|
def k_show(self, command):
|
|
1233
1244
|
if self.nextIsSymbol():
|
|
@@ -1241,6 +1252,10 @@ class Graphics(Handler):
|
|
|
1241
1252
|
command['dialog'] = record['name']
|
|
1242
1253
|
self.add(command)
|
|
1243
1254
|
return True
|
|
1255
|
+
elif self.isWidget(keyword):
|
|
1256
|
+
command['name'] = record['name']
|
|
1257
|
+
self.add(command)
|
|
1258
|
+
return True
|
|
1244
1259
|
elif keyword == 'messagebox':
|
|
1245
1260
|
command['messagebox'] = record['name']
|
|
1246
1261
|
self.skip('giving')
|
|
@@ -1248,10 +1263,6 @@ class Graphics(Handler):
|
|
|
1248
1263
|
command['result'] = self.getSymbolRecord()['name']
|
|
1249
1264
|
self.add(command)
|
|
1250
1265
|
return True
|
|
1251
|
-
elif self.isWidget(keyword):
|
|
1252
|
-
command['name'] = record['name']
|
|
1253
|
-
self.add(command)
|
|
1254
|
-
return True
|
|
1255
1266
|
return False
|
|
1256
1267
|
|
|
1257
1268
|
def r_show(self, command):
|
|
@@ -1307,7 +1318,7 @@ class Graphics(Handler):
|
|
|
1307
1318
|
else: record['result'] = dialog.value
|
|
1308
1319
|
elif 'name' in command:
|
|
1309
1320
|
record = self.getVariable(command['name'])
|
|
1310
|
-
if 'widget' in record: record
|
|
1321
|
+
if 'widget' in record: self.getWidget(record).show()
|
|
1311
1322
|
return self.nextPC()
|
|
1312
1323
|
|
|
1313
1324
|
# Start the graphics
|
|
@@ -1402,38 +1413,38 @@ class Graphics(Handler):
|
|
|
1402
1413
|
symbolRecord = self.getVariable(symbolRecord['name'])
|
|
1403
1414
|
keyword = symbolRecord['keyword']
|
|
1404
1415
|
if keyword == 'pushbutton':
|
|
1405
|
-
pushbutton = self.
|
|
1416
|
+
pushbutton = self.getWidget(symbolRecord)
|
|
1406
1417
|
v = {}
|
|
1407
1418
|
v['type'] = 'text'
|
|
1408
1419
|
v['content'] = pushbutton.accessibleName()
|
|
1409
1420
|
return v
|
|
1410
1421
|
elif keyword == 'lineinput':
|
|
1411
|
-
lineinput = symbolRecord
|
|
1422
|
+
lineinput = self.getWidget(symbolRecord)
|
|
1412
1423
|
v = {}
|
|
1413
1424
|
v['type'] = 'text'
|
|
1414
1425
|
v['content'] = lineinput.displayText()
|
|
1415
1426
|
return v
|
|
1416
1427
|
elif keyword == 'multiline':
|
|
1417
|
-
multiline = symbolRecord
|
|
1428
|
+
multiline = self.getWidget(symbolRecord)
|
|
1418
1429
|
v = {}
|
|
1419
1430
|
v['type'] = 'text'
|
|
1420
1431
|
v['content'] = multiline.toPlainText()
|
|
1421
1432
|
return v
|
|
1422
1433
|
elif keyword == 'combobox':
|
|
1423
|
-
combobox = symbolRecord
|
|
1434
|
+
combobox = self.getWidget(symbolRecord)
|
|
1424
1435
|
v = {}
|
|
1425
1436
|
v['type'] = 'text'
|
|
1426
1437
|
v['content'] = combobox.currentText()
|
|
1427
1438
|
return v
|
|
1428
1439
|
elif keyword == 'listbox':
|
|
1429
|
-
listbox = symbolRecord
|
|
1440
|
+
listbox = self.getWidget(symbolRecord)
|
|
1430
1441
|
content = listbox.currentItem().text()
|
|
1431
1442
|
v = {}
|
|
1432
1443
|
v['type'] = 'text'
|
|
1433
1444
|
v['content'] = content
|
|
1434
1445
|
return v
|
|
1435
1446
|
elif keyword == 'checkbox':
|
|
1436
|
-
checkbox =
|
|
1447
|
+
checkbox =self.getWidget(symbolRecord)
|
|
1437
1448
|
content = checkbox.isChecked()
|
|
1438
1449
|
v = {}
|
|
1439
1450
|
v['type'] = 'boolean'
|
|
@@ -1450,7 +1461,7 @@ class Graphics(Handler):
|
|
|
1450
1461
|
def v_count(self, v):
|
|
1451
1462
|
record = self.getVariable(v['name'])
|
|
1452
1463
|
keyword = record['keyword']
|
|
1453
|
-
widget = record
|
|
1464
|
+
widget = self.getWidget(record)
|
|
1454
1465
|
if keyword in ['combobox', 'listbox']: content = widget.count()
|
|
1455
1466
|
value = {}
|
|
1456
1467
|
value['type'] = 'int'
|
|
@@ -1460,7 +1471,7 @@ class Graphics(Handler):
|
|
|
1460
1471
|
def v_current(self, v):
|
|
1461
1472
|
record = self.getVariable(v['name'])
|
|
1462
1473
|
keyword = record['keyword']
|
|
1463
|
-
widget = record
|
|
1474
|
+
widget = self.getWidget(record)
|
|
1464
1475
|
if keyword == 'listbox': content = widget.currentItem().text()
|
|
1465
1476
|
value = {}
|
|
1466
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
|