easycoder 251013.1__py2.py3-none-any.whl → 251016.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 CHANGED
@@ -12,4 +12,4 @@ from .ec_pyside import *
12
12
  from .ec_timestamp import *
13
13
  from .ec_value import *
14
14
 
15
- __version__ = "251013.1"
15
+ __version__ = "251016.1"
easycoder/ec_keyboard.py CHANGED
@@ -158,6 +158,8 @@ class KeyboardView(QVBoxLayout):
158
158
  for row in rows:
159
159
  self.addLayout(row)
160
160
 
161
+ ###############################################################################
162
+ # VirtualKeyboard Class
161
163
  class VirtualKeyboard(QStackedWidget):
162
164
  def __init__(self, keyboardType, buttonHeight, receiver, onFinished):
163
165
  super().__init__()
@@ -173,6 +175,8 @@ class VirtualKeyboard(QStackedWidget):
173
175
  self.addKeyboardLayout2()
174
176
  self.addKeyboardLayout3()
175
177
 
178
+ ###########################################################################
179
+ # Add the first keyboard layout (lowercase letters)
176
180
  def addKeyboardLayout0(self):
177
181
  rowList = []
178
182
 
@@ -214,7 +218,7 @@ class VirtualKeyboard(QStackedWidget):
214
218
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickNumbers, None, 'img/numbers.png'),
215
219
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
216
220
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, ","),
217
- KeyboardButton(self.buttonHeight * 5, self.buttonHeight, self.onClickSpace, None, 'skeyboard/pace.png'),
221
+ KeyboardButton(self.buttonHeight * 5, self.buttonHeight, self.onClickSpace, None, 'keyboard/space.png'),
218
222
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, "."),
219
223
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
220
224
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickEnter, None, 'img/enter.png'),
@@ -228,6 +232,8 @@ class VirtualKeyboard(QStackedWidget):
228
232
  container.setLayout(keyboardView)
229
233
  self.addWidget(container)
230
234
 
235
+ ###########################################################################
236
+ # Add the second keyboard layout (uppercase letters)
231
237
  def addKeyboardLayout1(self):
232
238
  rowList = []
233
239
 
@@ -283,6 +289,8 @@ class VirtualKeyboard(QStackedWidget):
283
289
  container.setLayout(keyboardView)
284
290
  self.addWidget(container)
285
291
 
292
+ ###########################################################################
293
+ # Add the third keyboard layout (numbers and symbols)
286
294
  def addKeyboardLayout2(self):
287
295
  rowList = []
288
296
 
@@ -320,11 +328,11 @@ class VirtualKeyboard(QStackedWidget):
320
328
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickLetters, None, 'img/letters.png'),
321
329
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
322
330
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, ","),
323
- KeyboardButton(self.buttonHeight * 6, self.buttonHeight, self.onClickSpace, None, 'img/space.png'),
331
+ KeyboardButton(self.buttonHeight * 5.2, self.buttonHeight, self.onClickSpace, None, 'keyboard/space.png'),
324
332
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, "."),
325
333
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
326
334
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickEnter, None, 'img/enter.png'),
327
- QSpacerItem(20, 40, QSizePolicy.Expanding, QSizePolicy.Minimum)
335
+ QSpacerItem(10, 40, QSizePolicy.Expanding, QSizePolicy.Minimum)
328
336
  ])
329
337
  rowList.append(row4)
330
338
 
@@ -334,6 +342,8 @@ class VirtualKeyboard(QStackedWidget):
334
342
  container.setLayout(keyboardView)
335
343
  self.addWidget(container)
336
344
 
345
+ ###########################################################################
346
+ # Add the fourth keyboard layout (additional symbols)
337
347
  def addKeyboardLayout3(self):
338
348
  rowList = []
339
349
 
easycoder/ec_pyside.py CHANGED
@@ -114,7 +114,7 @@ class Graphics(Handler):
114
114
  # (2) add {widget} to {layout}
115
115
  # (3) add stretch {widget} to {layout}
116
116
  # (4) add stretch to {layout}
117
- # (5) add spacer {size} to {layout}
117
+ # (5) add spacer [size] {size} to {layout}
118
118
  # (6) add {widget} at {col} {row} in {grid layout}
119
119
  def k_add(self, command):
120
120
  def addToLayout():
@@ -146,6 +146,7 @@ class Graphics(Handler):
146
146
 
147
147
  elif token == 'spacer':
148
148
  self.nextToken()
149
+ self.skip('size')
149
150
  command['widget'] = 'spacer'
150
151
  command['size'] = self.nextValue()
151
152
  self.skip('to')
@@ -370,17 +371,18 @@ class Graphics(Handler):
370
371
  return True
371
372
 
372
373
  def k_createPushbutton(self, command):
373
- text = ''
374
374
  while True:
375
375
  token = self.peek()
376
376
  if token == 'text':
377
377
  self.nextToken()
378
- text = self.nextValue()
378
+ command['text'] = self.nextValue()
379
+ elif token == 'icon':
380
+ self.nextToken()
381
+ command['icon'] = self.nextValue()
379
382
  elif token == 'size':
380
383
  self.nextToken()
381
384
  command['size'] = self.nextValue()
382
385
  else: break
383
- command['text'] = text
384
386
  self.add(command)
385
387
  return True
386
388
 
@@ -566,14 +568,27 @@ class Graphics(Handler):
566
568
  return self.nextPC()
567
569
 
568
570
  def r_createPushbutton(self, command, record):
569
- text = self.getRuntimeValue(command['text'])
570
- pushbutton = QPushButton(text)
571
- pushbutton.setAccessibleName(text)
572
571
  if 'size' in command:
573
- fm = pushbutton.fontMetrics()
574
- c = pushbutton.contentsMargins()
575
- w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
576
- pushbutton.setMaximumWidth(w)
572
+ size = self.getRuntimeValue(command['size'])
573
+ else: size = None
574
+ if 'icon' in command:
575
+ iconPath = self.getRuntimeValue(command['icon'])
576
+ pixmap = QPixmap(iconPath)
577
+ if pixmap.isNull():
578
+ RuntimeError(self.program, f'Icon not found: {iconPath}')
579
+ icon = pixmap.scaledToHeight(size if size != None else 24, Qt.SmoothTransformation)
580
+ pushbutton = QPushButton()
581
+ pushbutton.setIcon(icon)
582
+ pushbutton.setIconSize(icon.size())
583
+ elif 'text' in command:
584
+ text = self.getRuntimeValue(command['text'])
585
+ pushbutton = QPushButton(text)
586
+ pushbutton.setAccessibleName(text)
587
+ if size != None:
588
+ fm = pushbutton.fontMetrics()
589
+ c = pushbutton.contentsMargins()
590
+ w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
591
+ pushbutton.setMaximumWidth(w)
577
592
  self.putSymbolValue(record, pushbutton)
578
593
  record['widget'] = pushbutton
579
594
  return self.nextPC()
@@ -758,6 +773,21 @@ class Graphics(Handler):
758
773
  def r_group(self, command):
759
774
  return self.nextPC()
760
775
 
776
+ # hide {widget}
777
+ def k_hide(self, command):
778
+ if self.nextIsSymbol():
779
+ record = self.getSymbolRecord()
780
+ if self.isWidget(record['keyword']):
781
+ command['widget'] = record['name']
782
+ self.add(command)
783
+ return True
784
+ return False
785
+
786
+ def r_hide(self, command):
787
+ record = self.getVariable(command['widget'])
788
+ if 'widget' in record: record['widget'].hide()
789
+ return self.nextPC()
790
+
761
791
  # Initialize the graphics environment
762
792
  def k_init(self, command):
763
793
  if self.nextIs('graphics'):
@@ -1218,6 +1248,10 @@ class Graphics(Handler):
1218
1248
  command['result'] = self.getSymbolRecord()['name']
1219
1249
  self.add(command)
1220
1250
  return True
1251
+ elif self.isWidget(keyword):
1252
+ command['name'] = record['name']
1253
+ self.add(command)
1254
+ return True
1221
1255
  return False
1222
1256
 
1223
1257
  def r_show(self, command):
@@ -1271,6 +1305,9 @@ class Graphics(Handler):
1271
1305
  if dialog.exec() == QDialog.Accepted:
1272
1306
  record['result'] = dialog.textEdit.toPlainText()
1273
1307
  else: record['result'] = dialog.value
1308
+ elif 'name' in command:
1309
+ record = self.getVariable(command['name'])
1310
+ if 'widget' in record: record['widget'].show()
1274
1311
  return self.nextPC()
1275
1312
 
1276
1313
  # Start the graphics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251013.1
3
+ Version: 251016.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=yGsSfsvUSQ6jOREWdAFcRgobGzEGezzHH1qLeahfkGs,339
1
+ easycoder/__init__.py,sha256=zZvFOpEZYrq776LhQb3DOF692KsHpQuwr0Si1ZSREbY,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
@@ -6,14 +6,14 @@ easycoder/ec_compiler.py,sha256=LYwGNs8dcHKXI_nnu1sVFe1N36vjvylcUO_tX_bLjrk,5359
6
6
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
7
7
  easycoder/ec_core.py,sha256=VTAnhdLp3ftZ1tLPhovKX0PQ1CplmC9x17jH_DfrJsQ,99650
8
8
  easycoder/ec_handler.py,sha256=ED08ULiOlZkcs4XHxAguvdPZw_dFXuwGDFLbFuo0kLs,2317
9
- easycoder/ec_keyboard.py,sha256=ru-HdWolBMZJPyck2s72In9tXFeLJQSPtR1TpjmIo90,18350
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=6z9ZHJIKKa44tkNJMAu1QCIsTyR-4TcM4TMcTslvxKI,54186
11
+ easycoder/ec_pyside.py,sha256=bZEV3yDINb7YdJqJ1OpYQ8WkObGB3EeHyHeogd3k9as,55717
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-251013.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
- easycoder-251013.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- easycoder-251013.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
- easycoder-251013.1.dist-info/METADATA,sha256=vdZi3i4JadVV3OZqjK81Qx-tmHoFy6NBo2C-bWNs-Bc,6897
19
- easycoder-251013.1.dist-info/RECORD,,
15
+ easycoder-251016.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
+ easycoder-251016.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
+ easycoder-251016.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
+ easycoder-251016.1.dist-info/METADATA,sha256=ZllPOSAy08_9d1dIcb1g1VTWuF9IbcCYmbGEsdTLk2E,6897
19
+ easycoder-251016.1.dist-info/RECORD,,