easycoder 250807.1__py2.py3-none-any.whl → 250809.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_keyboard.py +9 -8
- easycoder/ec_program.py +1 -1
- easycoder/ec_pyside.py +67 -17
- {easycoder-250807.1.dist-info → easycoder-250809.1.dist-info}/METADATA +3 -2
- easycoder-250809.1.dist-info/RECORD +17 -0
- {easycoder-250807.1.dist-info → easycoder-250809.1.dist-info}/WHEEL +1 -1
- easycoder-250807.1.dist-info/RECORD +0 -17
- {easycoder-250807.1.dist-info → easycoder-250809.1.dist-info}/entry_points.txt +0 -0
- {easycoder-250807.1.dist-info → easycoder-250809.1.dist-info/licenses}/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_keyboard.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import os
|
|
3
2
|
from .ec_handler import Handler
|
|
4
3
|
from PySide6.QtWidgets import (
|
|
@@ -14,7 +13,7 @@ from PySide6.QtWidgets import (
|
|
|
14
13
|
QSizePolicy,
|
|
15
14
|
QGraphicsDropShadowEffect
|
|
16
15
|
)
|
|
17
|
-
from PySide6.QtGui import QFont, QIcon, QPixmap, QPainter
|
|
16
|
+
from PySide6.QtGui import QFont, QIcon, QPixmap, QPainter
|
|
18
17
|
from PySide6.QtCore import Qt, QTimer, Signal, QRect
|
|
19
18
|
|
|
20
19
|
class Keyboard(Handler):
|
|
@@ -65,12 +64,13 @@ class Keyboard(Handler):
|
|
|
65
64
|
self._drag_active = False
|
|
66
65
|
super().mouseReleaseEvent(event)
|
|
67
66
|
|
|
68
|
-
def __init__(self, program, keyboardType,
|
|
67
|
+
def __init__(self, program, keyboardType, receiverLayout, receivers, caller = None, parent=None):
|
|
69
68
|
super().__init__(program.compiler)
|
|
70
69
|
|
|
71
70
|
self.program = program
|
|
72
71
|
self.keyboardType = keyboardType
|
|
73
|
-
self.
|
|
72
|
+
self.receivers = receivers
|
|
73
|
+
self.selectedReceiver = receivers[0]
|
|
74
74
|
|
|
75
75
|
dialog = QDialog(caller)
|
|
76
76
|
self.dialog = dialog
|
|
@@ -78,9 +78,9 @@ class Keyboard(Handler):
|
|
|
78
78
|
# dialog.setWindowTitle('')
|
|
79
79
|
dialog.setWindowFlags(Qt.FramelessWindowHint)
|
|
80
80
|
dialog.setModal(True)
|
|
81
|
-
dialog.
|
|
81
|
+
dialog.setFixedWidth(500)
|
|
82
82
|
dialog.setStyleSheet('background-color: white;border:1px solid black;')
|
|
83
|
-
self.originalText =
|
|
83
|
+
self.originalText = self.selectedReceiver.getContent()
|
|
84
84
|
|
|
85
85
|
# Add drop shadow
|
|
86
86
|
shadow = QGraphicsDropShadowEffect(dialog)
|
|
@@ -95,7 +95,8 @@ class Keyboard(Handler):
|
|
|
95
95
|
border = self.Border()
|
|
96
96
|
border.iconClicked.connect(self.reject)
|
|
97
97
|
layout.addWidget(border)
|
|
98
|
-
layout.
|
|
98
|
+
layout.addLayout(receiverLayout)
|
|
99
|
+
layout.addWidget(VirtualKeyboard(keyboardType, 42, self.selectedReceiver, dialog.accept))
|
|
99
100
|
|
|
100
101
|
# Position at bottom of parent window
|
|
101
102
|
dialog.show() # Ensure geometry is calculated
|
|
@@ -108,7 +109,7 @@ class Keyboard(Handler):
|
|
|
108
109
|
dialog.exec()
|
|
109
110
|
|
|
110
111
|
def reject(self):
|
|
111
|
-
self.
|
|
112
|
+
self.selectedReceiver.setContent(self.originalText)
|
|
112
113
|
self.dialog.reject()
|
|
113
114
|
|
|
114
115
|
class TextReceiver():
|
easycoder/ec_program.py
CHANGED
easycoder/ec_pyside.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
from .ec_handler import Handler
|
|
3
3
|
from .ec_classes import RuntimeError
|
|
4
|
-
from .
|
|
5
|
-
from PySide6.QtCore import Qt, QTimer
|
|
4
|
+
from PySide6.QtCore import Qt, QTimer, Signal
|
|
6
5
|
from PySide6.QtGui import QPixmap
|
|
7
6
|
from PySide6.QtWidgets import (
|
|
8
7
|
QApplication,
|
|
@@ -80,6 +79,38 @@ class Graphics(Handler):
|
|
|
80
79
|
def afterShown(self):
|
|
81
80
|
if 'action' in self.record: self.record['action']()
|
|
82
81
|
|
|
82
|
+
class ClickableLineEdit(QLineEdit):
|
|
83
|
+
clicked = Signal()
|
|
84
|
+
|
|
85
|
+
def __init__(self):
|
|
86
|
+
super().__init__()
|
|
87
|
+
self.program = None
|
|
88
|
+
|
|
89
|
+
def setCallback(self, program, pc):
|
|
90
|
+
self.program = program
|
|
91
|
+
self.pc = pc
|
|
92
|
+
|
|
93
|
+
def mousePressEvent(self, event):
|
|
94
|
+
self.clicked.emit()
|
|
95
|
+
super().mousePressEvent(event)
|
|
96
|
+
if self.program != None: self.program.run(self.pc)
|
|
97
|
+
|
|
98
|
+
class ClickablePlainTextEdit(QPlainTextEdit):
|
|
99
|
+
clicked = Signal()
|
|
100
|
+
|
|
101
|
+
def __init__(self):
|
|
102
|
+
super().__init__()
|
|
103
|
+
self.program = None
|
|
104
|
+
|
|
105
|
+
def setCallback(self, program, pc):
|
|
106
|
+
self.program = program
|
|
107
|
+
self.pc = pc
|
|
108
|
+
|
|
109
|
+
def mousePressEvent(self, event):
|
|
110
|
+
self.clicked.emit()
|
|
111
|
+
super().mousePressEvent(event)
|
|
112
|
+
if self.program != None: self.program.run(self.pc)
|
|
113
|
+
|
|
83
114
|
#############################################################################
|
|
84
115
|
# Keyword handlers
|
|
85
116
|
|
|
@@ -297,6 +328,7 @@ class Graphics(Handler):
|
|
|
297
328
|
|
|
298
329
|
def k_createLabel(self, command):
|
|
299
330
|
text = self.compileConstant('')
|
|
331
|
+
size = self.compileConstant(20)
|
|
300
332
|
while True:
|
|
301
333
|
token = self.peek()
|
|
302
334
|
if token == 'text':
|
|
@@ -304,7 +336,7 @@ class Graphics(Handler):
|
|
|
304
336
|
text = self.nextValue()
|
|
305
337
|
elif token == 'size':
|
|
306
338
|
self.nextToken()
|
|
307
|
-
|
|
339
|
+
size = self.nextValue()
|
|
308
340
|
elif token == 'align':
|
|
309
341
|
self.nextToken()
|
|
310
342
|
token = self.nextToken()
|
|
@@ -312,6 +344,7 @@ class Graphics(Handler):
|
|
|
312
344
|
command['align'] = token
|
|
313
345
|
else: break
|
|
314
346
|
command['text'] = text
|
|
347
|
+
command['size'] = size
|
|
315
348
|
self.add(command)
|
|
316
349
|
return True
|
|
317
350
|
|
|
@@ -340,11 +373,19 @@ class Graphics(Handler):
|
|
|
340
373
|
return True
|
|
341
374
|
|
|
342
375
|
def k_createLineEdit(self, command):
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
376
|
+
text = self.compileConstant('')
|
|
377
|
+
size = self.compileConstant(40)
|
|
378
|
+
while True:
|
|
379
|
+
token = self.peek()
|
|
380
|
+
if token == 'text':
|
|
381
|
+
self.nextToken()
|
|
382
|
+
text = self.nextValue()
|
|
383
|
+
elif token == 'size':
|
|
384
|
+
self.nextToken()
|
|
385
|
+
size = self.nextValue()
|
|
386
|
+
else: break;
|
|
347
387
|
command['size'] = size
|
|
388
|
+
command['text'] = text
|
|
348
389
|
self.add(command)
|
|
349
390
|
return True
|
|
350
391
|
|
|
@@ -479,6 +520,10 @@ class Graphics(Handler):
|
|
|
479
520
|
|
|
480
521
|
def r_createLabel(self, command, record):
|
|
481
522
|
label = QLabel(str(self.getRuntimeValue(command['text'])))
|
|
523
|
+
label.setStyleSheet("""
|
|
524
|
+
background-color: transparent;
|
|
525
|
+
border: none;
|
|
526
|
+
""")
|
|
482
527
|
if 'size' in command:
|
|
483
528
|
fm = label.fontMetrics()
|
|
484
529
|
c = label.contentsMargins()
|
|
@@ -500,7 +545,7 @@ class Graphics(Handler):
|
|
|
500
545
|
if 'size' in command:
|
|
501
546
|
fm = pushbutton.fontMetrics()
|
|
502
547
|
c = pushbutton.contentsMargins()
|
|
503
|
-
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) +c.left()+c.right()
|
|
548
|
+
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
|
|
504
549
|
pushbutton.setMaximumWidth(w)
|
|
505
550
|
record['widget'] = pushbutton
|
|
506
551
|
return self.nextPC()
|
|
@@ -511,7 +556,8 @@ class Graphics(Handler):
|
|
|
511
556
|
return self.nextPC()
|
|
512
557
|
|
|
513
558
|
def r_createLineEdit(self, command, record):
|
|
514
|
-
lineinput =
|
|
559
|
+
lineinput = self.ClickableLineEdit()
|
|
560
|
+
lineinput.setText(self.getRuntimeValue(command['text']))
|
|
515
561
|
fm = lineinput.fontMetrics()
|
|
516
562
|
m = lineinput.textMargins()
|
|
517
563
|
c = lineinput.contentsMargins()
|
|
@@ -521,7 +567,7 @@ class Graphics(Handler):
|
|
|
521
567
|
return self.nextPC()
|
|
522
568
|
|
|
523
569
|
def r_createMultiLineEdit(self, command, record):
|
|
524
|
-
textinput =
|
|
570
|
+
textinput = self.ClickablePlainTextEdit()
|
|
525
571
|
fontMetrics = textinput.fontMetrics()
|
|
526
572
|
charWidth = fontMetrics.horizontalAdvance('x')
|
|
527
573
|
charHeight = fontMetrics.height()
|
|
@@ -552,13 +598,13 @@ class Graphics(Handler):
|
|
|
552
598
|
mainLayout.addWidget(QLabel(prompt))
|
|
553
599
|
elif dialogType == 'lineedit':
|
|
554
600
|
mainLayout.addWidget(QLabel(prompt))
|
|
555
|
-
dialog.lineEdit =
|
|
601
|
+
dialog.lineEdit = self.ClickableLineEdit(dialog)
|
|
556
602
|
dialog.value = self.getRuntimeValue(command['value'])
|
|
557
603
|
dialog.lineEdit.setText(dialog.value)
|
|
558
604
|
mainLayout.addWidget(dialog.lineEdit)
|
|
559
605
|
elif dialogType == 'multiline':
|
|
560
606
|
mainLayout.addWidget(QLabel(prompt))
|
|
561
|
-
dialog.textEdit =
|
|
607
|
+
dialog.textEdit = self.ClickablePlainTextEdit(self)
|
|
562
608
|
dialog.textEdit.setText(dialog.value)
|
|
563
609
|
mainLayout.addWidget(dialog.textEdit)
|
|
564
610
|
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
|
|
@@ -690,7 +736,7 @@ class Graphics(Handler):
|
|
|
690
736
|
def r_multiline(self, command):
|
|
691
737
|
return self.nextPC()
|
|
692
738
|
|
|
693
|
-
# on click {pushbutton}
|
|
739
|
+
# on click {pushbutton}/{lineinput}/{multiline}
|
|
694
740
|
# on select {combobox}/{listbox}
|
|
695
741
|
# on tick
|
|
696
742
|
def k_on(self, command):
|
|
@@ -723,7 +769,7 @@ class Graphics(Handler):
|
|
|
723
769
|
if token == 'click':
|
|
724
770
|
if self.nextIsSymbol():
|
|
725
771
|
record = self.getSymbolRecord()
|
|
726
|
-
if record['keyword']
|
|
772
|
+
if record['keyword'] in ['pushbutton', 'lineinput', 'multiline']:
|
|
727
773
|
command['name'] = record['name']
|
|
728
774
|
setupOn()
|
|
729
775
|
return True
|
|
@@ -770,6 +816,8 @@ class Graphics(Handler):
|
|
|
770
816
|
keyword = record['keyword']
|
|
771
817
|
if keyword == 'pushbutton':
|
|
772
818
|
widget.clicked.connect(lambda: self.run(command['goto']))
|
|
819
|
+
if keyword in ['lineinput', 'multiline']:
|
|
820
|
+
widget.setCallback(self.program, command['goto'])
|
|
773
821
|
elif keyword == 'combobox':
|
|
774
822
|
widget.currentIndexChanged.connect(lambda: self.run(command['goto']))
|
|
775
823
|
elif keyword == 'listbox':
|
|
@@ -895,7 +943,7 @@ class Graphics(Handler):
|
|
|
895
943
|
self.skip('of')
|
|
896
944
|
if self.nextIsSymbol():
|
|
897
945
|
record = self.getSymbolRecord()
|
|
898
|
-
if record['keyword'] in ['label', 'pushbutton', 'lineinput', 'multiline']:
|
|
946
|
+
if record['keyword'] in ['label', 'pushbutton', 'lineinput', 'multiline', 'element']:
|
|
899
947
|
command['name'] = record['name']
|
|
900
948
|
self.skip('to')
|
|
901
949
|
command['value'] = self.nextValue()
|
|
@@ -967,9 +1015,11 @@ class Graphics(Handler):
|
|
|
967
1015
|
record = self.getVariable(command['name'])
|
|
968
1016
|
widget = self.getVariable(command['name'])['widget']
|
|
969
1017
|
text = self.getRuntimeValue(command['value'])
|
|
970
|
-
|
|
1018
|
+
keyword = record['keyword']
|
|
1019
|
+
setText = getattr(widget, "setText", None)
|
|
1020
|
+
if callable(setText):
|
|
971
1021
|
widget.setText(text)
|
|
972
|
-
elif
|
|
1022
|
+
elif keyword == 'multiline':
|
|
973
1023
|
widget.setPlainText(text)
|
|
974
1024
|
if record['keyword'] == 'pushbutton':
|
|
975
1025
|
widget.setAccessibleName(text)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250809.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
|
|
9
10
|
Requires-Dist: pytz
|
|
10
11
|
Requires-Dist: requests
|
|
11
12
|
Requires-Dist: psutil
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
easycoder/__init__.py,sha256=yCmbJj3iBAuc4_Qo8WLUH9lm120e1pCe1cznbaPk6rY,314
|
|
2
|
+
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
+
easycoder/ec_classes.py,sha256=PWPaJuTfaWD4-tgT-2WWOgeFV_jXxlxyKCxvXyylCUU,1824
|
|
4
|
+
easycoder/ec_compiler.py,sha256=-uuXDbfgFBGXSrr7EneDnnneFOFsU-UuCIpNHsCqY0s,5289
|
|
5
|
+
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
+
easycoder/ec_core.py,sha256=r0bFQV3LXCCh4CP6289h6UvK6gpq4L0BQDrEWkeVo_0,98040
|
|
7
|
+
easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
|
|
8
|
+
easycoder/ec_keyboard.py,sha256=NaQBXIpzclcKHKVdZ-tSOTAZnl0OD-iYV3Zjqu98e7Y,19546
|
|
9
|
+
easycoder/ec_program.py,sha256=IxebQZtTuoUJitfel-CxTAOdbDEV_aD18adooQWxtfc,9981
|
|
10
|
+
easycoder/ec_pyside.py,sha256=N0Pt-nzcPQvZTljnX2BL48nqrDCkR0xIHZ-c82YMV50,47029
|
|
11
|
+
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
12
|
+
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
13
|
+
easycoder-250809.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
14
|
+
easycoder-250809.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
easycoder-250809.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
16
|
+
easycoder-250809.1.dist-info/METADATA,sha256=UYoPl_bioC6zlzjWyUiw3fjjxTYTmdlE0SrWthx8TrM,6897
|
|
17
|
+
easycoder-250809.1.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=OKAW03fRaJ8kMPDfZifiPRwpamjjXeqH4End9wF6nIw,314
|
|
2
|
-
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
-
easycoder/ec_classes.py,sha256=PWPaJuTfaWD4-tgT-2WWOgeFV_jXxlxyKCxvXyylCUU,1824
|
|
4
|
-
easycoder/ec_compiler.py,sha256=-uuXDbfgFBGXSrr7EneDnnneFOFsU-UuCIpNHsCqY0s,5289
|
|
5
|
-
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
-
easycoder/ec_core.py,sha256=r0bFQV3LXCCh4CP6289h6UvK6gpq4L0BQDrEWkeVo_0,98040
|
|
7
|
-
easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
|
|
8
|
-
easycoder/ec_keyboard.py,sha256=q_ALcZ7C5lgwGXQbKaXBsrzr7OyNHvWdv8ZoVKbpoEQ,19420
|
|
9
|
-
easycoder/ec_program.py,sha256=gt9qhz37kBVovh8LJbQEuwcbRvIi7_I9pyVvBGG-Hm4,9980
|
|
10
|
-
easycoder/ec_pyside.py,sha256=AF00ZgwbbUmKL9ViIsP4xUJ-65di7kf4qDOO0O8G7RY,45350
|
|
11
|
-
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
12
|
-
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
13
|
-
easycoder-250807.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
14
|
-
easycoder-250807.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
-
easycoder-250807.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
16
|
-
easycoder-250807.1.dist-info/METADATA,sha256=wJ9qalZczJ8ru4rCadb4OdaFFuAs62kdxf-wDAnsExg,6875
|
|
17
|
-
easycoder-250807.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|