easycoder 250809.3__py2.py3-none-any.whl → 250810.2__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 +10 -12
- easycoder/ec_pyside.py +74 -18
- {easycoder-250809.3.dist-info → easycoder-250810.2.dist-info}/METADATA +1 -1
- {easycoder-250809.3.dist-info → easycoder-250810.2.dist-info}/RECORD +8 -8
- {easycoder-250809.3.dist-info → easycoder-250810.2.dist-info}/LICENSE +0 -0
- {easycoder-250809.3.dist-info → easycoder-250810.2.dist-info}/WHEEL +0 -0
- {easycoder-250809.3.dist-info → easycoder-250810.2.dist-info}/entry_points.txt +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_keyboard.py
CHANGED
|
@@ -105,7 +105,6 @@ class Keyboard(Handler):
|
|
|
105
105
|
restore.append(receiver.getContent())
|
|
106
106
|
index += 1
|
|
107
107
|
self.restore = restore
|
|
108
|
-
self.selectedReceiver = receivers[0]
|
|
109
108
|
|
|
110
109
|
# Position at bottom of parent window
|
|
111
110
|
dialog.show() # Ensure geometry is calculated
|
|
@@ -119,22 +118,18 @@ class Keyboard(Handler):
|
|
|
119
118
|
|
|
120
119
|
def setClickSource(self, field):
|
|
121
120
|
receivers = self.receivers
|
|
122
|
-
index = 0
|
|
123
121
|
for receiver in receivers:
|
|
124
122
|
if receiver.field == field:
|
|
125
|
-
self.
|
|
126
|
-
|
|
127
|
-
index += 1
|
|
123
|
+
self.vk.setReceiver(receiver)
|
|
124
|
+
return
|
|
128
125
|
|
|
129
126
|
def reject(self):
|
|
130
|
-
selectedReceiver = self.
|
|
127
|
+
selectedReceiver = self.vk.getReceiver()
|
|
131
128
|
receivers = self.receivers
|
|
132
129
|
index = 0
|
|
133
130
|
for receiver in receivers:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
index += 1
|
|
137
|
-
receiver.setContent(self.restore[index])
|
|
131
|
+
receiver.setContent(self.restore[index])
|
|
132
|
+
index += 1
|
|
138
133
|
self.dialog.reject()
|
|
139
134
|
|
|
140
135
|
class TextReceiver():
|
|
@@ -144,7 +139,7 @@ class TextReceiver():
|
|
|
144
139
|
def addCharacter(self, char):
|
|
145
140
|
char = char.replace('&&', '&')
|
|
146
141
|
if len(char) == 1:
|
|
147
|
-
self.
|
|
142
|
+
self.setContent(self.getContent() + char)
|
|
148
143
|
else:
|
|
149
144
|
raise ValueError("Only single characters are allowed.")
|
|
150
145
|
|
|
@@ -436,8 +431,11 @@ class VirtualKeyboard(QStackedWidget):
|
|
|
436
431
|
container.setLayout(keyboardView)
|
|
437
432
|
self.addWidget(container)
|
|
438
433
|
|
|
439
|
-
def
|
|
434
|
+
def setReceiver(self, receiver):
|
|
440
435
|
self.receiver = receiver
|
|
436
|
+
|
|
437
|
+
def getReceiver(self):
|
|
438
|
+
return self.receiver
|
|
441
439
|
|
|
442
440
|
# Callback functions
|
|
443
441
|
def onClickChar(self,keycode):
|
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
|
-
'
|
|
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', '
|
|
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'] == '
|
|
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
|
|
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 == '
|
|
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
|
-
|
|
503
|
-
if
|
|
504
|
-
elif
|
|
505
|
-
elif
|
|
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
|
-
layout.setContentsMargins(5,
|
|
522
|
+
layout.setContentsMargins(5,5,5,5)
|
|
508
523
|
record['widget'] = layout
|
|
509
524
|
return self.nextPC()
|
|
510
525
|
|
|
511
526
|
def r_createGroupBox(self, command, record):
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
record['widget'] =
|
|
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 == '
|
|
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
|
|
688
|
+
def k_group(self, command):
|
|
673
689
|
return self.compileVariable(command, 'gui')
|
|
674
690
|
|
|
675
|
-
def
|
|
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:
|
|
3
|
+
Version: 250810.2
|
|
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,17 +1,17 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=
|
|
1
|
+
easycoder/__init__.py,sha256=5trkyV6t6J-kr5waXErvu0sL6T5hBTBWP7EjXdlVY7U,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
|
|
5
5
|
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
6
|
easycoder/ec_core.py,sha256=r0bFQV3LXCCh4CP6289h6UvK6gpq4L0BQDrEWkeVo_0,98040
|
|
7
7
|
easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
|
|
8
|
-
easycoder/ec_keyboard.py,sha256=
|
|
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=
|
|
10
|
+
easycoder/ec_pyside.py,sha256=B349_GlEaiytcaZPwWigFKPIh5OFXPs4C1kLsyBOynE,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-
|
|
14
|
-
easycoder-
|
|
15
|
-
easycoder-
|
|
16
|
-
easycoder-
|
|
17
|
-
easycoder-
|
|
13
|
+
easycoder-250810.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
14
|
+
easycoder-250810.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
easycoder-250810.2.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
16
|
+
easycoder-250810.2.dist-info/METADATA,sha256=j7lf8wuW-TsIDJPRaxCWvO4sfj_KXcs6zIi83RhQctY,6875
|
|
17
|
+
easycoder-250810.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|