easycoder 251104.1__py2.py3-none-any.whl → 251105.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.
- easycoder/__init__.py +1 -1
- easycoder/ec_border.py +15 -11
- easycoder/ec_classes.py +7 -2
- easycoder/ec_compiler.py +2 -1
- easycoder/ec_core.py +2 -9
- easycoder/ec_debug.py +781 -0
- easycoder/ec_handler.py +1 -0
- easycoder/ec_keyboard.py +50 -50
- easycoder/ec_program.py +44 -10
- easycoder/ec_pyside.py +82 -95
- easycoder/ec_timestamp.py +2 -1
- easycoder/icons/exit.png +0 -0
- easycoder/icons/run.png +0 -0
- easycoder/icons/step.png +0 -0
- easycoder/icons/stop.png +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/METADATA +1 -1
- easycoder-251105.1.dist-info/RECORD +24 -0
- easycoder-251104.1.dist-info/RECORD +0 -19
- /easycoder/{close.png → icons/close.png} +0 -0
- /easycoder/{tick.png → icons/tick.png} +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/WHEEL +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/entry_points.txt +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/licenses/LICENSE +0 -0
easycoder/ec_pyside.py
CHANGED
|
@@ -3,6 +3,7 @@ from functools import partial
|
|
|
3
3
|
from .ec_handler import Handler
|
|
4
4
|
from .ec_classes import RuntimeError, Object
|
|
5
5
|
from .ec_border import Border
|
|
6
|
+
from .ec_debug import Debugger
|
|
6
7
|
from PySide6.QtCore import Qt, QTimer, Signal, QRect
|
|
7
8
|
from PySide6.QtGui import QPixmap, QPainter
|
|
8
9
|
from PySide6.QtWidgets import (
|
|
@@ -202,10 +203,10 @@ class Graphics(Handler):
|
|
|
202
203
|
value = self.getRuntimeValue(command['value'])
|
|
203
204
|
record = self.getVariable(command['widget'])
|
|
204
205
|
if record['keyword'] == 'listbox':
|
|
205
|
-
self.getWidget(record).addItem(value)
|
|
206
|
+
self.getWidget(record).addItem(value) # type: ignore
|
|
206
207
|
elif record['keyword'] == 'combobox':
|
|
207
208
|
if isinstance(value, list): record['widget'].addItems(value)
|
|
208
|
-
else: self.getWidget(record).addItem(value)
|
|
209
|
+
else: self.getWidget(record).addItem(value) # type: ignore
|
|
209
210
|
elif 'row' in command and 'col' in command:
|
|
210
211
|
layout = self.getVariable(command['layout'])['widget']
|
|
211
212
|
record = self.getVariable(command['widget'])
|
|
@@ -220,9 +221,9 @@ class Graphics(Handler):
|
|
|
220
221
|
layoutRecord = self.getVariable(command['layout'])
|
|
221
222
|
widget = command['widget']
|
|
222
223
|
if widget == 'stretch':
|
|
223
|
-
self.getWidget(layoutRecord).addStretch()
|
|
224
|
+
self.getWidget(layoutRecord).addStretch() # type: ignore
|
|
224
225
|
elif widget == 'spacer':
|
|
225
|
-
self.getWidget(layoutRecord).addSpacing(self.getRuntimeValue(command['size']))
|
|
226
|
+
self.getWidget(layoutRecord).addSpacing(self.getRuntimeValue(command['size'])) # type: ignore
|
|
226
227
|
else:
|
|
227
228
|
widgetRecord = self.getVariable(widget)
|
|
228
229
|
layoutRecord = self.getVariable(command['layout'])
|
|
@@ -313,12 +314,12 @@ class Graphics(Handler):
|
|
|
313
314
|
clearLayout(layout)
|
|
314
315
|
layout.deleteLater()
|
|
315
316
|
# Clear any remaining child widgets
|
|
316
|
-
child_widgets = widget.findChildren(QWidget, "", Qt.FindDirectChildrenOnly)
|
|
317
|
+
child_widgets = widget.findChildren(QWidget, "", Qt.FindChildOption.FindDirectChildrenOnly)
|
|
317
318
|
for child in child_widgets:
|
|
318
319
|
child.deleteLater()
|
|
319
320
|
|
|
320
321
|
widget = self.getWidget(self.getVariable(command['name']))
|
|
321
|
-
clearWidget(widget)
|
|
322
|
+
clearWidget(widget) # type: ignore
|
|
322
323
|
return self.nextPC()
|
|
323
324
|
|
|
324
325
|
return self.nextPC()
|
|
@@ -587,7 +588,7 @@ class Graphics(Handler):
|
|
|
587
588
|
|
|
588
589
|
def r_createGroupBox(self, command, record):
|
|
589
590
|
group = QGroupBox(self.getRuntimeValue(command['title']))
|
|
590
|
-
group.setAlignment(Qt.AlignLeft)
|
|
591
|
+
group.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
591
592
|
record['widget'] = group
|
|
592
593
|
return self.nextPC()
|
|
593
594
|
|
|
@@ -604,12 +605,12 @@ class Graphics(Handler):
|
|
|
604
605
|
label.setMaximumWidth(w)
|
|
605
606
|
if 'align' in command:
|
|
606
607
|
alignment = command['align']
|
|
607
|
-
if alignment == 'left': label.setAlignment(Qt.AlignLeft)
|
|
608
|
-
elif alignment == 'right': label.setAlignment(Qt.AlignRight)
|
|
609
|
-
elif alignment in ['center', 'centre']: label.setAlignment(Qt.AlignHCenter)
|
|
610
|
-
elif alignment == 'justify': label.setAlignment(Qt.AlignJustify)
|
|
608
|
+
if alignment == 'left': label.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
609
|
+
elif alignment == 'right': label.setAlignment(Qt.AlignmentFlag.AlignRight)
|
|
610
|
+
elif alignment in ['center', 'centre']: label.setAlignment(Qt.AlignmentFlag.AlignHCenter)
|
|
611
|
+
elif alignment == 'justify': label.setAlignment(Qt.AlignmentFlag.AlignJustify)
|
|
611
612
|
if 'expand' in command:
|
|
612
|
-
label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
|
613
|
+
label.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred)
|
|
613
614
|
self.setWidget(record, label)
|
|
614
615
|
return self.nextPC()
|
|
615
616
|
|
|
@@ -622,7 +623,7 @@ class Graphics(Handler):
|
|
|
622
623
|
pixmap = QPixmap(iconPath)
|
|
623
624
|
if pixmap.isNull():
|
|
624
625
|
RuntimeError(self.program, f'Icon not found: {iconPath}')
|
|
625
|
-
icon = pixmap.scaledToHeight(size if size != None else 24, Qt.SmoothTransformation)
|
|
626
|
+
icon = pixmap.scaledToHeight(size if size != None else 24, Qt.TransformationMode.SmoothTransformation)
|
|
626
627
|
pushbutton = QPushButton()
|
|
627
628
|
pushbutton.setIcon(icon)
|
|
628
629
|
pushbutton.setIconSize(icon.size())
|
|
@@ -657,7 +658,7 @@ class Graphics(Handler):
|
|
|
657
658
|
background: transparent;
|
|
658
659
|
}
|
|
659
660
|
""")
|
|
660
|
-
checkbox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
|
|
661
|
+
checkbox.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Preferred)
|
|
661
662
|
self.setWidget(record, checkbox)
|
|
662
663
|
return self.nextPC()
|
|
663
664
|
|
|
@@ -713,12 +714,12 @@ class Graphics(Handler):
|
|
|
713
714
|
win = self.getVariable(win)['window']
|
|
714
715
|
dialog = ECDialog(win, record)
|
|
715
716
|
dialogType = command['type'].lower()
|
|
716
|
-
dialog.dialogType = dialogType
|
|
717
|
+
dialog.dialogType = dialogType # type: ignore
|
|
717
718
|
mainLayout = QVBoxLayout(dialog)
|
|
718
719
|
if dialogType == 'generic':
|
|
719
720
|
dialog.setFixedWidth(500)
|
|
720
721
|
dialog.setFixedHeight(500)
|
|
721
|
-
dialog.setWindowFlags(Qt.FramelessWindowHint)
|
|
722
|
+
dialog.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
722
723
|
dialog.setModal(True)
|
|
723
724
|
dialog.setStyleSheet('background-color: white;border:1px solid black;')
|
|
724
725
|
|
|
@@ -737,19 +738,19 @@ class Graphics(Handler):
|
|
|
737
738
|
mainLayout.addWidget(QLabel(prompt))
|
|
738
739
|
elif dialogType == 'lineedit':
|
|
739
740
|
mainLayout.addWidget(QLabel(prompt))
|
|
740
|
-
dialog.lineEdit = self.ClickableLineEdit(dialog)
|
|
741
|
-
dialog.value = self.getRuntimeValue(command['value'])
|
|
742
|
-
dialog.lineEdit.setText(dialog.value)
|
|
743
|
-
mainLayout.addWidget(dialog.lineEdit)
|
|
741
|
+
dialog.lineEdit = self.ClickableLineEdit(dialog) # type: ignore
|
|
742
|
+
dialog.value = self.getRuntimeValue(command['value']) # type: ignore
|
|
743
|
+
dialog.lineEdit.setText(dialog.value) # type: ignore
|
|
744
|
+
mainLayout.addWidget(dialog.lineEdit) # type: ignore
|
|
744
745
|
elif dialogType == 'multiline':
|
|
745
746
|
mainLayout.addWidget(QLabel(prompt))
|
|
746
|
-
dialog.textEdit = self.ClickablePlainTextEdit(self)
|
|
747
|
-
dialog.textEdit.setText(dialog.value)
|
|
748
|
-
mainLayout.addWidget(dialog.textEdit)
|
|
749
|
-
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
|
|
747
|
+
dialog.textEdit = self.ClickablePlainTextEdit(self) # type: ignore
|
|
748
|
+
dialog.textEdit.setText(dialog.value) # type: ignore
|
|
749
|
+
mainLayout.addWidget(dialog.textEdit) # type: ignore
|
|
750
|
+
buttonBox = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
|
|
750
751
|
buttonBox.accepted.connect(dialog.accept)
|
|
751
752
|
buttonBox.rejected.connect(dialog.reject)
|
|
752
|
-
mainLayout.addWidget(buttonBox, alignment=Qt.AlignHCenter)
|
|
753
|
+
mainLayout.addWidget(buttonBox, alignment=Qt.AlignmentFlag.AlignHCenter)
|
|
753
754
|
record['dialog'] = dialog
|
|
754
755
|
return self.nextPC()
|
|
755
756
|
|
|
@@ -797,7 +798,7 @@ class Graphics(Handler):
|
|
|
797
798
|
return False
|
|
798
799
|
|
|
799
800
|
def r_disable(self, command):
|
|
800
|
-
self.getWidget(self.getVariable(command['name'])).setEnabled(False)
|
|
801
|
+
self.getWidget(self.getVariable(command['name'])).setEnabled(False) # type: ignore
|
|
801
802
|
return self.nextPC()
|
|
802
803
|
|
|
803
804
|
# Enable a widget
|
|
@@ -809,7 +810,7 @@ class Graphics(Handler):
|
|
|
809
810
|
return False
|
|
810
811
|
|
|
811
812
|
def r_enable(self, command):
|
|
812
|
-
self.getWidget(self.getVariable(command['name'])).setEnabled(True)
|
|
813
|
+
self.getWidget(self.getVariable(command['name'])).setEnabled(True) # type: ignore
|
|
813
814
|
return self.nextPC()
|
|
814
815
|
|
|
815
816
|
# Create a group box
|
|
@@ -831,7 +832,7 @@ class Graphics(Handler):
|
|
|
831
832
|
|
|
832
833
|
def r_hide(self, command):
|
|
833
834
|
record = self.getVariable(command['widget'])
|
|
834
|
-
if 'widget' in record: self.getWidget(record).hide()
|
|
835
|
+
if 'widget' in record: self.getWidget(record).hide() # type: ignore
|
|
835
836
|
return self.nextPC()
|
|
836
837
|
|
|
837
838
|
# Initialize the graphics environment
|
|
@@ -840,8 +841,8 @@ class Graphics(Handler):
|
|
|
840
841
|
def r_init(self, command):
|
|
841
842
|
self.app = QApplication(sys.argv)
|
|
842
843
|
screen = QApplication.screens()[0].size().toTuple()
|
|
843
|
-
self.program.screenWidth = screen[0]
|
|
844
|
-
self.program.screenHeight = screen[1]
|
|
844
|
+
self.program.screenWidth = screen[0] # type: ignore
|
|
845
|
+
self.program.screenHeight = screen[1] # type: ignore
|
|
845
846
|
print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
|
|
846
847
|
# return self.nextPC()
|
|
847
848
|
def on_last_window_closed():
|
|
@@ -857,6 +858,7 @@ class Graphics(Handler):
|
|
|
857
858
|
timer.timeout.connect(flush)
|
|
858
859
|
timer.start(10)
|
|
859
860
|
QTimer.singleShot(500, init)
|
|
861
|
+
if self.program.debugging: self.program.debugger = Debugger(self.program)
|
|
860
862
|
self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
861
863
|
self.app.exec()
|
|
862
864
|
|
|
@@ -989,11 +991,11 @@ class Graphics(Handler):
|
|
|
989
991
|
keyword = record['keyword']
|
|
990
992
|
if keyword == 'pushbutton':
|
|
991
993
|
handler = partial(run, widget, record)
|
|
992
|
-
widget.clicked.connect(handler)
|
|
994
|
+
widget.clicked.connect(handler) # type: ignore
|
|
993
995
|
elif keyword == 'combobox':
|
|
994
|
-
widget.currentIndexChanged.connect(lambda: self.run(command['goto']))
|
|
996
|
+
widget.currentIndexChanged.connect(lambda: self.run(command['goto'])) # type: ignore
|
|
995
997
|
elif keyword == 'listbox':
|
|
996
|
-
widget.itemClicked.connect(lambda: self.run(command['goto']))
|
|
998
|
+
widget.itemClicked.connect(lambda: self.run(command['goto'])) # type: ignore
|
|
997
999
|
return self.nextPC()
|
|
998
1000
|
|
|
999
1001
|
# Declare a pushbutton variable
|
|
@@ -1030,13 +1032,13 @@ class Graphics(Handler):
|
|
|
1030
1032
|
if variant == 'current':
|
|
1031
1033
|
if record['keyword'] == 'combobox':
|
|
1032
1034
|
widget = self.getWidget(record)
|
|
1033
|
-
widget.removeItem(widget.currentIndex())
|
|
1035
|
+
widget.removeItem(widget.currentIndex()) # type: ignore
|
|
1034
1036
|
if record['keyword'] == 'listbox':
|
|
1035
1037
|
widget = self.getWidget(record)
|
|
1036
|
-
selectedItem = widget.currentItem()
|
|
1038
|
+
selectedItem = widget.currentItem() # type: ignore
|
|
1037
1039
|
if selectedItem:
|
|
1038
|
-
row = widget.row(selectedItem)
|
|
1039
|
-
widget.takeItem(row)
|
|
1040
|
+
row = widget.row(selectedItem) # type: ignore
|
|
1041
|
+
widget.takeItem(row) # type: ignore
|
|
1040
1042
|
return self.nextPC()
|
|
1041
1043
|
|
|
1042
1044
|
# select index {n} [of] {combobox]}
|
|
@@ -1062,9 +1064,9 @@ class Graphics(Handler):
|
|
|
1062
1064
|
index = self.getRuntimeValue(command['index'])
|
|
1063
1065
|
else:
|
|
1064
1066
|
name = self.getRuntimeValue(command['name'])
|
|
1065
|
-
index = widget.findText(name, Qt.MatchFixedString)
|
|
1067
|
+
index = widget.findText(name, Qt.MatchFlag.MatchFixedString) # type: ignore
|
|
1066
1068
|
if index >= 0:
|
|
1067
|
-
widget.setCurrentIndex(index)
|
|
1069
|
+
widget.setCurrentIndex(index) # type: ignore
|
|
1068
1070
|
return self.nextPC()
|
|
1069
1071
|
|
|
1070
1072
|
# set [the] width/height [of] {widget} [to] {value}
|
|
@@ -1212,10 +1214,10 @@ class Graphics(Handler):
|
|
|
1212
1214
|
what = command['what']
|
|
1213
1215
|
if what == 'height':
|
|
1214
1216
|
widget = self.getWidget(self.getVariable(command['name']))
|
|
1215
|
-
widget.setFixedHeight(self.getRuntimeValue(command['value']))
|
|
1217
|
+
widget.setFixedHeight(self.getRuntimeValue(command['value'])) # type: ignore
|
|
1216
1218
|
elif what == 'width':
|
|
1217
1219
|
widget = self.getWidget(self.getVariable(command['name']))
|
|
1218
|
-
widget.setFixedWidth(self.getRuntimeValue(command['value']))
|
|
1220
|
+
widget.setFixedWidth(self.getRuntimeValue(command['value'])) # type: ignore
|
|
1219
1221
|
elif what == 'layout':
|
|
1220
1222
|
record = self.getVariable(command['layout'])
|
|
1221
1223
|
layout = record['widget']
|
|
@@ -1228,10 +1230,10 @@ class Graphics(Handler):
|
|
|
1228
1230
|
window.setCentralWidget(container)
|
|
1229
1231
|
elif keyword == 'widget':
|
|
1230
1232
|
widget = self.getWidget(record)
|
|
1231
|
-
widget.setLayout(layout)
|
|
1233
|
+
widget.setLayout(layout) # type: ignore
|
|
1232
1234
|
elif what == 'spacing':
|
|
1233
1235
|
layout = self.getWidget(self.getVariable(command['name']))
|
|
1234
|
-
layout.setSpacing(self.getRuntimeValue(command['value']))
|
|
1236
|
+
layout.setSpacing(self.getRuntimeValue(command['value'])) # type: ignore
|
|
1235
1237
|
elif what == 'text':
|
|
1236
1238
|
record = self.getVariable(command['name'])
|
|
1237
1239
|
widget = self.getWidget(record)
|
|
@@ -1239,50 +1241,50 @@ class Graphics(Handler):
|
|
|
1239
1241
|
keyword = record['keyword']
|
|
1240
1242
|
setText = getattr(widget, "setText", None)
|
|
1241
1243
|
if callable(setText):
|
|
1242
|
-
widget.setText(text)
|
|
1244
|
+
widget.setText(text) # type: ignore
|
|
1243
1245
|
elif keyword == 'multiline':
|
|
1244
|
-
widget.setPlainText(text)
|
|
1246
|
+
widget.setPlainText(text) # type: ignore
|
|
1245
1247
|
if record['keyword'] == 'pushbutton':
|
|
1246
|
-
widget.setAccessibleName(text)
|
|
1248
|
+
widget.setAccessibleName(text) # type: ignore
|
|
1247
1249
|
elif what == 'state':
|
|
1248
1250
|
record = self.getVariable(command['name'])
|
|
1249
1251
|
if record['keyword'] == 'checkbox':
|
|
1250
1252
|
state = self.getRuntimeValue(command['value'])
|
|
1251
|
-
self.getWidget(record).setChecked(state)
|
|
1253
|
+
self.getWidget(record).setChecked(state) # type: ignore
|
|
1252
1254
|
elif what == 'alignment':
|
|
1253
1255
|
widget = self.getVariable(command['name'])['widget']
|
|
1254
1256
|
flags = command['value']
|
|
1255
1257
|
alignment = 0
|
|
1256
1258
|
for flag in flags:
|
|
1257
|
-
if flag == 'left': alignment |= Qt.AlignLeft
|
|
1258
|
-
elif flag == 'hcenter': alignment |= Qt.AlignHCenter
|
|
1259
|
-
elif flag == 'right': alignment |= Qt.AlignRight
|
|
1260
|
-
elif flag == 'top': alignment |= Qt.AlignTop
|
|
1261
|
-
elif flag == 'vcenter': alignment |= Qt.AlignVCenter
|
|
1262
|
-
elif flag == 'bottom': alignment |= Qt.AlignBottom
|
|
1263
|
-
elif flag == 'center': alignment |= Qt.AlignCenter
|
|
1259
|
+
if flag == 'left': alignment |= Qt.AlignmentFlag.AlignLeft
|
|
1260
|
+
elif flag == 'hcenter': alignment |= Qt.AlignmentFlag.AlignHCenter
|
|
1261
|
+
elif flag == 'right': alignment |= Qt.AlignmentFlag.AlignRight
|
|
1262
|
+
elif flag == 'top': alignment |= Qt.AlignmentFlag.AlignTop
|
|
1263
|
+
elif flag == 'vcenter': alignment |= Qt.AlignmentFlag.AlignVCenter
|
|
1264
|
+
elif flag == 'bottom': alignment |= Qt.AlignmentFlag.AlignBottom
|
|
1265
|
+
elif flag == 'center': alignment |= Qt.AlignmentFlag.AlignCenter
|
|
1264
1266
|
widget.setAlignment(alignment)
|
|
1265
1267
|
elif what == 'style':
|
|
1266
1268
|
record = self.getVariable(command['name'])
|
|
1267
1269
|
widget = self.getWidget(record)
|
|
1268
1270
|
styles = self.getRuntimeValue(command['value'])
|
|
1269
|
-
widget.setStyleSheet(styles)
|
|
1271
|
+
widget.setStyleSheet(styles) # type: ignore
|
|
1270
1272
|
elif what == 'color':
|
|
1271
1273
|
record = self.getVariable(command['name'])
|
|
1272
1274
|
widget = self.getWidget(record)
|
|
1273
1275
|
color = self.getRuntimeValue(command['value'])
|
|
1274
|
-
widget.setStyleSheet(f"color: {color};")
|
|
1276
|
+
widget.setStyleSheet(f"color: {color};") # type: ignore
|
|
1275
1277
|
elif what == 'background-color':
|
|
1276
1278
|
record = self.getVariable(command['name'])
|
|
1277
1279
|
widget = self.getWidget(record)
|
|
1278
1280
|
bg_color = self.getRuntimeValue(command['value'])
|
|
1279
|
-
widget.setStyleSheet(f"background-color: {bg_color};")
|
|
1281
|
+
widget.setStyleSheet(f"background-color: {bg_color};") # type: ignore
|
|
1280
1282
|
elif what == 'listbox':
|
|
1281
1283
|
record = self.getVariable(command['name'])
|
|
1282
1284
|
widget = self.getWidget(record)
|
|
1283
1285
|
value = self.getRuntimeValue(command['value'])
|
|
1284
|
-
widget.clear()
|
|
1285
|
-
widget.addItems(value)
|
|
1286
|
+
widget.clear() # type: ignore
|
|
1287
|
+
widget.addItems(value) # type: ignore
|
|
1286
1288
|
return self.nextPC()
|
|
1287
1289
|
|
|
1288
1290
|
# show {window}
|
|
@@ -1324,23 +1326,23 @@ class Graphics(Handler):
|
|
|
1324
1326
|
message = data['message']
|
|
1325
1327
|
if style == 'question':
|
|
1326
1328
|
choice = QMessageBox.question(window, title, message)
|
|
1327
|
-
result = 'Yes' if choice == QMessageBox.Yes else 'No'
|
|
1329
|
+
result = 'Yes' if choice == QMessageBox.StandardButton.Yes else 'No'
|
|
1328
1330
|
elif style == 'yesnocancel':
|
|
1329
1331
|
choice = QMessageBox.question(
|
|
1330
1332
|
window,
|
|
1331
1333
|
title,
|
|
1332
1334
|
message,
|
|
1333
|
-
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel
|
|
1335
|
+
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No | QMessageBox.StandardButton.Cancel
|
|
1334
1336
|
)
|
|
1335
|
-
if choice == QMessageBox.Yes:
|
|
1337
|
+
if choice == QMessageBox.StandardButton.Yes:
|
|
1336
1338
|
result = 'Yes'
|
|
1337
|
-
elif choice == QMessageBox.No:
|
|
1339
|
+
elif choice == QMessageBox.StandardButton.No:
|
|
1338
1340
|
result = 'No'
|
|
1339
1341
|
else:
|
|
1340
1342
|
result = 'Cancel'
|
|
1341
1343
|
elif style == 'warning':
|
|
1342
1344
|
choice = QMessageBox.warning(window, title, message)
|
|
1343
|
-
if choice == QMessageBox.Ok: result = 'OK'
|
|
1345
|
+
if choice == QMessageBox.StandardButton.Ok: result = 'OK'
|
|
1344
1346
|
else: result = ''
|
|
1345
1347
|
else: result = 'Cancel'
|
|
1346
1348
|
v = {}
|
|
@@ -1356,18 +1358,18 @@ class Graphics(Handler):
|
|
|
1356
1358
|
if dialog.dialogType == 'generic':
|
|
1357
1359
|
record['result'] = dialog.exec()
|
|
1358
1360
|
elif dialog.dialogType == 'confirm':
|
|
1359
|
-
record['result'] = True if dialog.exec() == QDialog.Accepted else False
|
|
1361
|
+
record['result'] = True if dialog.exec() == QDialog.DialogCode.Accepted else False
|
|
1360
1362
|
elif dialog.dialogType == 'lineedit':
|
|
1361
|
-
if dialog.exec() == QDialog.Accepted:
|
|
1362
|
-
record['result'] = dialog.lineEdit.text()
|
|
1363
|
-
else: record['result'] = dialog.value
|
|
1363
|
+
if dialog.exec() == QDialog.DialogCode.Accepted:
|
|
1364
|
+
record['result'] = dialog.lineEdit.text() # type: ignore
|
|
1365
|
+
else: record['result'] = dialog.value # type: ignore
|
|
1364
1366
|
elif dialog.dialogType == 'multiline':
|
|
1365
|
-
if dialog.exec() == QDialog.Accepted:
|
|
1366
|
-
record['result'] = dialog.textEdit.toPlainText()
|
|
1367
|
-
else: record['result'] = dialog.value
|
|
1367
|
+
if dialog.exec() == QDialog.DialogCode.Accepted:
|
|
1368
|
+
record['result'] = dialog.textEdit.toPlainText() # type: ignore
|
|
1369
|
+
else: record['result'] = dialog.value # type: ignore
|
|
1368
1370
|
elif 'name' in command:
|
|
1369
1371
|
record = self.getVariable(command['name'])
|
|
1370
|
-
if 'widget' in record: self.getWidget(record).show()
|
|
1372
|
+
if 'widget' in record: self.getWidget(record).show() # type: ignore
|
|
1371
1373
|
return self.nextPC()
|
|
1372
1374
|
|
|
1373
1375
|
# Start the graphics
|
|
@@ -1379,21 +1381,6 @@ class Graphics(Handler):
|
|
|
1379
1381
|
|
|
1380
1382
|
def r_start(self, command):
|
|
1381
1383
|
return self.nextPC()
|
|
1382
|
-
# def on_last_window_closed():
|
|
1383
|
-
# self.program.kill()
|
|
1384
|
-
# def init():
|
|
1385
|
-
# self.program.flush(self.nextPC())
|
|
1386
|
-
# def flush():
|
|
1387
|
-
# if not self.blocked:
|
|
1388
|
-
# if self.runOnTick != 0:
|
|
1389
|
-
# self.program.run(self.runOnTick)
|
|
1390
|
-
# self.program.flushCB()
|
|
1391
|
-
# timer = QTimer()
|
|
1392
|
-
# timer.timeout.connect(flush)
|
|
1393
|
-
# timer.start(10)
|
|
1394
|
-
# QTimer.singleShot(500, init)
|
|
1395
|
-
# self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
1396
|
-
# self.app.exec()
|
|
1397
1384
|
|
|
1398
1385
|
# Declare a widget variable
|
|
1399
1386
|
def k_widget(self, command):
|
|
@@ -1466,36 +1453,36 @@ class Graphics(Handler):
|
|
|
1466
1453
|
pushbutton = self.getWidget(symbolRecord)
|
|
1467
1454
|
v = {}
|
|
1468
1455
|
v['type'] = 'text'
|
|
1469
|
-
v['content'] = pushbutton.accessibleName()
|
|
1456
|
+
v['content'] = pushbutton.accessibleName() # type: ignore
|
|
1470
1457
|
return v
|
|
1471
1458
|
elif keyword == 'lineinput':
|
|
1472
1459
|
lineinput = self.getWidget(symbolRecord)
|
|
1473
1460
|
v = {}
|
|
1474
1461
|
v['type'] = 'text'
|
|
1475
|
-
v['content'] = lineinput.displayText()
|
|
1462
|
+
v['content'] = lineinput.displayText() # type: ignore
|
|
1476
1463
|
return v
|
|
1477
1464
|
elif keyword == 'multiline':
|
|
1478
1465
|
multiline = self.getWidget(symbolRecord)
|
|
1479
1466
|
v = {}
|
|
1480
1467
|
v['type'] = 'text'
|
|
1481
|
-
v['content'] = multiline.toPlainText()
|
|
1468
|
+
v['content'] = multiline.toPlainText() # type: ignore
|
|
1482
1469
|
return v
|
|
1483
1470
|
elif keyword == 'combobox':
|
|
1484
1471
|
combobox = self.getWidget(symbolRecord)
|
|
1485
1472
|
v = {}
|
|
1486
1473
|
v['type'] = 'text'
|
|
1487
|
-
v['content'] = combobox.currentText()
|
|
1474
|
+
v['content'] = combobox.currentText() # type: ignore
|
|
1488
1475
|
return v
|
|
1489
1476
|
elif keyword == 'listbox':
|
|
1490
1477
|
listbox = self.getWidget(symbolRecord)
|
|
1491
|
-
content = listbox.currentItem().text()
|
|
1478
|
+
content = listbox.currentItem().text() # type: ignore
|
|
1492
1479
|
v = {}
|
|
1493
1480
|
v['type'] = 'text'
|
|
1494
1481
|
v['content'] = content
|
|
1495
1482
|
return v
|
|
1496
1483
|
elif keyword == 'checkbox':
|
|
1497
1484
|
checkbox =self.getWidget(symbolRecord)
|
|
1498
|
-
content = checkbox.isChecked()
|
|
1485
|
+
content = checkbox.isChecked() # type: ignore
|
|
1499
1486
|
v = {}
|
|
1500
1487
|
v['type'] = 'boolean'
|
|
1501
1488
|
v['content'] = content
|
|
@@ -1512,7 +1499,7 @@ class Graphics(Handler):
|
|
|
1512
1499
|
record = self.getVariable(v['name'])
|
|
1513
1500
|
keyword = record['keyword']
|
|
1514
1501
|
widget = self.getWidget(record)
|
|
1515
|
-
if keyword in ['combobox', 'listbox']: content = widget.count()
|
|
1502
|
+
if keyword in ['combobox', 'listbox']: content = widget.count() # type: ignore
|
|
1516
1503
|
value = {}
|
|
1517
1504
|
value['type'] = 'int'
|
|
1518
1505
|
value['content'] = content
|
|
@@ -1522,7 +1509,7 @@ class Graphics(Handler):
|
|
|
1522
1509
|
record = self.getVariable(v['name'])
|
|
1523
1510
|
keyword = record['keyword']
|
|
1524
1511
|
widget = self.getWidget(record)
|
|
1525
|
-
if keyword == 'listbox': content = widget.currentItem().text()
|
|
1512
|
+
if keyword == 'listbox': content = widget.currentItem().text() # type: ignore
|
|
1526
1513
|
value = {}
|
|
1527
1514
|
value['type'] = 'text'
|
|
1528
1515
|
value['content'] = content
|
easycoder/ec_timestamp.py
CHANGED
|
@@ -5,6 +5,7 @@ def getTimestamp(t):
|
|
|
5
5
|
tz = pytz.timezone('GB') # Localize this!
|
|
6
6
|
dt = datetime.fromtimestamp(t)
|
|
7
7
|
# print(f'{dt} + {tz.dst(dt).seconds}')
|
|
8
|
-
|
|
8
|
+
dst = tz.dst(dt)
|
|
9
|
+
return int(t) + (dst.seconds if dst else 0)
|
|
9
10
|
|
|
10
11
|
# Usage: print(getTimestamp(time.time()))
|
easycoder/icons/exit.png
ADDED
|
Binary file
|
easycoder/icons/run.png
ADDED
|
Binary file
|
easycoder/icons/step.png
ADDED
|
Binary file
|
easycoder/icons/stop.png
ADDED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 251105.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>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
easycoder/__init__.py,sha256=J24CvAOLaN6hXFU-dc1p6uzIScRoi-d26Fz4wHGfPrI,339
|
|
2
|
+
easycoder/ec_border.py,sha256=2qgGYxB-tIk_ZM0CmW3Yt7TotlUwxwrN9fL3cCvn8eE,2599
|
|
3
|
+
easycoder/ec_classes.py,sha256=EWpB3Wta_jvKZ8SNIWua_ElIbw1FzKMyM3_IiXBn-lg,1995
|
|
4
|
+
easycoder/ec_compiler.py,sha256=Q6a9nMmZogJzHu8OB4VeMzmBBarVEl3-RkqH2gW4LiU,6599
|
|
5
|
+
easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
|
|
6
|
+
easycoder/ec_core.py,sha256=TocIp8uyhT210OyF4Nj5nOswXywO0zl3mkh5HT2AmXk,100499
|
|
7
|
+
easycoder/ec_debug.py,sha256=nzcFxzFSbFkmCR6etGeSOAR7YeVkjGfk3rsY-3tPY2U,31877
|
|
8
|
+
easycoder/ec_handler.py,sha256=WRuvnUtaz71eiRHR5LTJHqUW8CcKjlLKDUcDp_Gtdyc,2351
|
|
9
|
+
easycoder/ec_keyboard.py,sha256=R6JvgUwvgj4pJiGwXbPrFmhC-DSxJbZQnPQ9pzabrMM,19705
|
|
10
|
+
easycoder/ec_program.py,sha256=jBTMaHab3k-3w9nLRNiT3tWdYx2psLcsNOKf0I1AC04,11422
|
|
11
|
+
easycoder/ec_pyside.py,sha256=sWGDtOInd0471M5ZpQpXPLTZPRNpmINa7KmiYD8e55I,59119
|
|
12
|
+
easycoder/ec_timestamp.py,sha256=z-HonUY7BDjgVVf2W_qQynnFjwGc_dAYultFjAmrXpg,307
|
|
13
|
+
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
+
easycoder/icons/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
15
|
+
easycoder/icons/exit.png,sha256=mVQQhMQQfboJTf4p11S0TR-8qwLgO9cFaCDxf20SsfI,3408
|
|
16
|
+
easycoder/icons/run.png,sha256=5hDyMPMlY9ypA_rR5gqM5hb4vGIg2A4_pcEmPCq0iaM,3937
|
|
17
|
+
easycoder/icons/step.png,sha256=r4XW-2GBVrYm7kb-xvth7jHMX3g9Ge-3onfpdOHyhyE,8224
|
|
18
|
+
easycoder/icons/stop.png,sha256=MoK6EbWFxDBdCH_ojTehjb7ty_Ax27n-8fKK_yBonfs,1832
|
|
19
|
+
easycoder/icons/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
20
|
+
easycoder-251105.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
21
|
+
easycoder-251105.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
22
|
+
easycoder-251105.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
23
|
+
easycoder-251105.1.dist-info/METADATA,sha256=bdVSksUKoHrEQCtq6NDDC4KMD08pzWe2JHi4TiuMBfs,6897
|
|
24
|
+
easycoder-251105.1.dist-info/RECORD,,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=7ZoWrgGr2R_dOw69Yis1-y0u8zR8AAQ24gN0GpfM5rc,339
|
|
2
|
-
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
-
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
|
-
easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
|
|
5
|
-
easycoder/ec_compiler.py,sha256=2bdB7Bb4Cn_Uj7g0wjDn_gO0gQivqeaFellbgbAT2Hg,6587
|
|
6
|
-
easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
|
|
7
|
-
easycoder/ec_core.py,sha256=K89KR1z_clnubQgq_-L3SiTTRI4qs2ue1MhuUkB9xoU,100888
|
|
8
|
-
easycoder/ec_handler.py,sha256=doGCMXBCQxvSaD3omKMlXoR_LvQODxV7dZyoWafecyg,2336
|
|
9
|
-
easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
|
|
10
|
-
easycoder/ec_program.py,sha256=aPuZOYWFqGd1jsLDl5M5YmLu5LfFAewF9EZh6zHIbyM,10308
|
|
11
|
-
easycoder/ec_pyside.py,sha256=DwHMsk5kDBXg8feSbkyUinGWPO1a4uH-rcT3F9J4Aiw,58287
|
|
12
|
-
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
|
-
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
-
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
-
easycoder-251104.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
-
easycoder-251104.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
-
easycoder-251104.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
-
easycoder-251104.1.dist-info/METADATA,sha256=jWlzWZY1kVcRNkxMiIn6SGBsgK3UESTSnMhp8KlG064,6897
|
|
19
|
-
easycoder-251104.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|