easycoder 250517.1__tar.gz → 250520.1__tar.gz

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.

Files changed (179) hide show
  1. easycoder-250520.1/.gitignore +4 -0
  2. {easycoder-250517.1 → easycoder-250520.1}/PKG-INFO +2 -3
  3. easycoder-250520.1/backdrop.jpg +0 -0
  4. {easycoder-250517.1 → easycoder-250520.1}/easycoder/__init__.py +1 -1
  5. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_compiler.py +3 -2
  6. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_core.py +9 -2
  7. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_pyside.py +36 -29
  8. easycoder-250520.1/testrc.py +5 -0
  9. easycoder-250517.1/.gitignore +0 -1
  10. easycoder-250517.1/plugins/rbr_ui.py +0 -82
  11. easycoder-250517.1/rbr_ui.code-workspace +0 -3
  12. easycoder-250517.1/rbrconf.code-workspace +0 -3
  13. easycoder-250517.1/scripts/README.md +0 -16
  14. easycoder-250517.1/scripts/connect.ecg +0 -62
  15. easycoder-250517.1/scripts/rbr_ui.ecs +0 -24
  16. easycoder-250517.1/scripts/rbr_ui.py +0 -3
  17. easycoder-250517.1/scripts/rbrconf.ecs +0 -1693
  18. easycoder-250517.1/scripts/testg.ecg +0 -48
  19. easycoder-250517.1/test.py +0 -3
  20. easycoder-250517.1/testrc.py +0 -3
  21. easycoder-250517.1/ui.py +0 -84
  22. {easycoder-250517.1 → easycoder-250520.1}/LICENSE +0 -0
  23. {easycoder-250517.1 → easycoder-250520.1}/README.md +0 -0
  24. {easycoder-250517.1 → easycoder-250520.1}/doc/README.md +0 -0
  25. {easycoder-250517.1 → easycoder-250520.1}/doc/core/README.md +0 -0
  26. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/boolean.md +0 -0
  27. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/empty.md +0 -0
  28. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/ends.md +0 -0
  29. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/even.md +0 -0
  30. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/exists.md +0 -0
  31. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/greater.md +0 -0
  32. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/hasProperty.md +0 -0
  33. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/includes.md +0 -0
  34. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/is.md +0 -0
  35. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/less.md +0 -0
  36. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/list.md +0 -0
  37. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/none.md +0 -0
  38. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/not.md +0 -0
  39. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/numeric.md +0 -0
  40. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/object.md +0 -0
  41. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/odd.md +0 -0
  42. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/starts.md +0 -0
  43. {easycoder-250517.1 → easycoder-250520.1}/doc/core/conditions/string.md +0 -0
  44. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/add.md +0 -0
  45. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/append.md +0 -0
  46. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/assert.md +0 -0
  47. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/begin.md +0 -0
  48. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/clear.md +0 -0
  49. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/close.md +0 -0
  50. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/create.md +0 -0
  51. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/debug.md +0 -0
  52. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/decrement.md +0 -0
  53. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/delete.md +0 -0
  54. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/divide.md +0 -0
  55. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/exit.md +0 -0
  56. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/file.md +0 -0
  57. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/fork.md +0 -0
  58. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/get.md +0 -0
  59. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/go.md +0 -0
  60. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/gosub.md +0 -0
  61. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/if.md +0 -0
  62. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/import.md +0 -0
  63. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/increment.md +0 -0
  64. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/index.md +0 -0
  65. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/init.md +0 -0
  66. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/input.md +0 -0
  67. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/load.md +0 -0
  68. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/lock.md +0 -0
  69. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/log.md +0 -0
  70. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/module.md +0 -0
  71. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/multiply.md +0 -0
  72. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/negate.md +0 -0
  73. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/open.md +0 -0
  74. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/pop.md +0 -0
  75. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/post.md +0 -0
  76. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/print.md +0 -0
  77. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/push.md +0 -0
  78. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/put.md +0 -0
  79. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/read.md +0 -0
  80. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/release.md +0 -0
  81. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/replace.md +0 -0
  82. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/return.md +0 -0
  83. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/run.md +0 -0
  84. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/save.md +0 -0
  85. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/script.md +0 -0
  86. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/set.md +0 -0
  87. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/split.md +0 -0
  88. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/stack.md +0 -0
  89. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/stop.md +0 -0
  90. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/system.md +0 -0
  91. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/take.md +0 -0
  92. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/toggle.md +0 -0
  93. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/truncate.md +0 -0
  94. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/unlock.md +0 -0
  95. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/variable.md +0 -0
  96. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/wait.md +0 -0
  97. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/while.md +0 -0
  98. {easycoder-250517.1 → easycoder-250520.1}/doc/core/keywords/write.md +0 -0
  99. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/arg.md +0 -0
  100. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/args.md +0 -0
  101. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/cos.md +0 -0
  102. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/datime.md +0 -0
  103. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/decode.md +0 -0
  104. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/element.md +0 -0
  105. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/elements.md +0 -0
  106. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/empty.md +0 -0
  107. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/encode.md +0 -0
  108. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/error.md +0 -0
  109. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/files.md +0 -0
  110. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/float.md +0 -0
  111. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/from.md +0 -0
  112. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/hash.md +0 -0
  113. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/index.md +0 -0
  114. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/integer.md +0 -0
  115. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/json.md +0 -0
  116. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/keys.md +0 -0
  117. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/left.md +0 -0
  118. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/length.md +0 -0
  119. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/lowercase.md +0 -0
  120. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/memory.md +0 -0
  121. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/modification.md +0 -0
  122. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/modulo.md +0 -0
  123. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/newline.md +0 -0
  124. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/now.md +0 -0
  125. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/position.md +0 -0
  126. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/property.md +0 -0
  127. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/random.md +0 -0
  128. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/right.md +0 -0
  129. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/sin.md +0 -0
  130. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/stringify.md +0 -0
  131. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/tab.md +0 -0
  132. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/tan.md +0 -0
  133. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/timestamp.md +0 -0
  134. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/today.md +0 -0
  135. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/trim.md +0 -0
  136. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/type.md +0 -0
  137. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/uppercase.md +0 -0
  138. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/value.md +0 -0
  139. {easycoder-250517.1 → easycoder-250520.1}/doc/core/values/weekday.md +0 -0
  140. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/README.md +0 -0
  141. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/attach.md +0 -0
  142. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/close.md +0 -0
  143. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/create.md +0 -0
  144. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/ellipse.md +0 -0
  145. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/image.md +0 -0
  146. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/move.md +0 -0
  147. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/on.md +0 -0
  148. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/rectangle.md +0 -0
  149. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/render.md +0 -0
  150. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/run.md +0 -0
  151. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/set.md +0 -0
  152. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/keywords/text.md +0 -0
  153. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/values/attribute.md +0 -0
  154. {easycoder-250517.1 → easycoder-250520.1}/doc/graphics/values/window.md +0 -0
  155. {easycoder-250517.1 → easycoder-250520.1}/easycoder/README.md +0 -0
  156. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_classes.py +0 -0
  157. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_condition.py +0 -0
  158. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_graphics.py +0 -0
  159. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_gutils.py +0 -0
  160. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_handler.py +0 -0
  161. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_program.py +0 -0
  162. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_timestamp.py +0 -0
  163. {easycoder-250517.1 → easycoder-250520.1}/easycoder/ec_value.py +0 -0
  164. {easycoder-250517.1 → easycoder-250520.1}/images/Semoigo Dawn.jpg +0 -0
  165. {easycoder-250517.1 → easycoder-250520.1}/json/graphics-demo.json +0 -0
  166. {easycoder-250517.1 → easycoder-250520.1}/plugins/ec_keyboard.py +0 -0
  167. {easycoder-250517.1 → easycoder-250520.1}/plugins/ec_p100.py +0 -0
  168. {easycoder-250517.1 → easycoder-250520.1}/plugins/ec_pyside6.py +0 -0
  169. {easycoder-250517.1 → easycoder-250520.1}/plugins/points.py +0 -0
  170. {easycoder-250517.1 → easycoder-250520.1}/pyproject.toml +0 -0
  171. {easycoder-250517.1 → easycoder-250520.1}/scripts/benchmark.ecs +0 -0
  172. {easycoder-250517.1 → easycoder-250520.1}/scripts/config.ecg +0 -0
  173. {easycoder-250517.1 → easycoder-250520.1}/scripts/ec_keyboard.py +0 -0
  174. {easycoder-250517.1 → easycoder-250520.1}/scripts/findxr.ecs +0 -0
  175. {easycoder-250517.1 → easycoder-250520.1}/scripts/fizzbuzz.ecs +0 -0
  176. {easycoder-250517.1 → easycoder-250520.1}/scripts/hello.ecs +0 -0
  177. {easycoder-250517.1 → easycoder-250520.1}/scripts/points.ecs +0 -0
  178. {easycoder-250517.1 → easycoder-250520.1}/scripts/test.ecs +0 -0
  179. {easycoder-250517.1 → easycoder-250520.1}/scripts/tests.ecs +0 -0
@@ -0,0 +1,4 @@
1
+ */__pycache__/*
2
+ *.code-workspace
3
+ *.py
4
+ *.ecs
@@ -1,12 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250517.1
3
+ Version: 250520.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
10
9
  Requires-Dist: pytz
11
10
  Requires-Dist: requests
12
11
  Requires-Dist: pyside6
Binary file
@@ -9,4 +9,4 @@ from .ec_program import *
9
9
  from .ec_timestamp import *
10
10
  from .ec_value import *
11
11
 
12
- __version__ = "250517.1"
12
+ __version__ = "250520.1"
@@ -16,6 +16,7 @@ class Compiler:
16
16
  self.program.compiler = self
17
17
  self.addCommand = self.program.add
18
18
  self.compileConstant = self.value.compileConstant
19
+ self.debugCompile = False
19
20
 
20
21
  def getPC(self):
21
22
  return len(self.program.code)
@@ -174,7 +175,7 @@ class Compiler:
174
175
  self.rewindTo(mark)
175
176
  else:
176
177
  self.rewindTo(mark)
177
- FatalError(self, f'Unable to compile this "{token}" command. Perhaps a syntax error?')
178
+ FatalError(self, f'Unable to compile this "{token}" command')
178
179
 
179
180
  # Compile a single command
180
181
  def compileOne(self):
@@ -196,7 +197,7 @@ class Compiler:
196
197
  while True:
197
198
  token = self.tokens[self.index]
198
199
  keyword = token.token
199
- # line = self.script.lines[token.lino]
200
+ if self.debugCompile: print(self.script.lines[token.lino])
200
201
  # print(f'{keyword} - {line}')
201
202
  # if keyword != 'else':
202
203
  if self.compileOne() == True:
@@ -202,7 +202,11 @@ class Core(Handler):
202
202
  # Debug the script
203
203
  def k_debug(self, command):
204
204
  token = self.peek()
205
- if token in ['step', 'stop', 'program', 'custom']:
205
+ if token == 'compile':
206
+ self.compiler.debugCompile = True
207
+ self.nextToken()
208
+ return True
209
+ elif token in ['step', 'stop', 'program', 'custom']:
206
210
  command['mode'] = token
207
211
  self.nextToken()
208
212
  elif token == 'stack':
@@ -222,7 +226,9 @@ class Core(Handler):
222
226
  return True
223
227
 
224
228
  def r_debug(self, command):
225
- if command['mode'] == 'step':
229
+ if command['mode'] == 'compile':
230
+ self.program.debugStep = True
231
+ elif command['mode'] == 'step':
226
232
  self.program.debugStep = True
227
233
  elif command['mode'] == 'stop':
228
234
  self.program.debugStep = False
@@ -1455,6 +1461,7 @@ class Core(Handler):
1455
1461
  content = value['content'].split(self.getRuntimeValue(command['on']))
1456
1462
  elements = len(content)
1457
1463
  target['elements'] = elements
1464
+ target['index'] = 0
1458
1465
  target['value'] = [None] * elements
1459
1466
 
1460
1467
  for index, item in enumerate(content):
@@ -37,13 +37,9 @@ from PySide6.QtWidgets import (
37
37
 
38
38
  class Graphics(Handler):
39
39
 
40
- class MainWindow(QMainWindow):
41
-
42
- def __init__(self):
43
- super().__init__()
44
-
45
40
  def __init__(self, compiler):
46
41
  Handler.__init__(self, compiler)
42
+ self.blocked = False
47
43
 
48
44
  def getName(self):
49
45
  return 'graphics'
@@ -88,13 +84,14 @@ class Graphics(Handler):
88
84
  elif self.isSymbol():
89
85
  record = self.getSymbolRecord()
90
86
  if record['extra'] == 'gui':
91
- if self.peek() == 'to':
92
- # (2)
93
- record = self.getSymbolRecord()
94
- command['widget'] = record['name']
95
- self.nextToken()
96
- return addToLayout()
97
- return False
87
+ if record['keyword'] in ['layout', 'groupbox', 'label', 'pushbutton', 'checkbox', 'lineinput', 'listbox', 'combobox']:
88
+ if self.peek() == 'to':
89
+ # (2)
90
+ record = self.getSymbolRecord()
91
+ command['widget'] = record['name']
92
+ self.nextToken()
93
+ return addToLayout()
94
+ else: return False
98
95
  # (1)
99
96
  command['value'] = self.getValue()
100
97
  self.skip('to')
@@ -375,24 +372,17 @@ class Graphics(Handler):
375
372
  return False
376
373
 
377
374
  def r_createWindow(self, command, record):
378
- window = self.MainWindow()
375
+ window = QMainWindow()
379
376
  window.setWindowTitle(self.getRuntimeValue(command['title']))
380
377
  w = self.getRuntimeValue(command['w'])
381
378
  h = self.getRuntimeValue(command['h'])
382
379
  x = command['x']
383
380
  y = command['y']
384
- if x == None: x = (self.screenWidth - w) / 2
381
+ if x == None: x = (self.program.screenWidth - w) / 2
385
382
  else: x = self.getRuntimeValue(x)
386
- if y == None: y = (self.screenHeight - h) / 2
383
+ if y == None: y = (self.program.screenHeight - h) / 2
387
384
  else: y = self.getRuntimeValue(x)
388
385
  window.setGeometry(x, y, w, h)
389
- # content = self.getVariable(command['layout'])['widget']
390
- # if isinstance(content, QWidget):
391
- # container = content
392
- # else:
393
- # container = QWidget()
394
- # container.setLayout(content)
395
- # window.setCentralWidget(container)
396
386
  record['window'] = window
397
387
  return self.nextPC()
398
388
 
@@ -549,9 +539,9 @@ class Graphics(Handler):
549
539
  def r_init(self, command):
550
540
  self.app = QApplication(sys.argv)
551
541
  screen = QApplication.screens()[0].size().toTuple()
552
- self.screenWidth = screen[0]
553
- self.screenHeight = screen[1]
554
- print(f'Screen: {self.screenWidth}x{self.screenHeight}')
542
+ self.program.screenWidth = screen[0]
543
+ self.program.screenHeight = screen[1]
544
+ print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
555
545
  return self.nextPC()
556
546
 
557
547
  # Declare a label variable
@@ -717,10 +707,12 @@ class Graphics(Handler):
717
707
 
718
708
  # set [the] width/height [of] {widget} [to] {value}
719
709
  # set [the] layout of {window} to {layout}
710
+ # set [the] spacing of {layout} to {value}
720
711
  # set [the] text [of] {label}/{button}/{lineinput} [to] {text}
721
712
  # set [the] color [of] {label}/{button}/{lineinput} [to] {color}
722
713
  # set [the] state [of] {checkbox} [to] {color}
723
714
  # set {listbox} to {list}
715
+ # set blocked true/false
724
716
  def k_set(self, command):
725
717
  self.skip('the')
726
718
  token = self.nextToken()
@@ -747,6 +739,16 @@ class Graphics(Handler):
747
739
  command['layout'] = record['name']
748
740
  self.add(command)
749
741
  return True
742
+ elif token == 'spacing':
743
+ self.skip('of')
744
+ if self.nextIsSymbol():
745
+ record = self.getSymbolRecord()
746
+ if record['keyword'] == 'layout':
747
+ command['name'] = record['name']
748
+ self.skip('to')
749
+ command['value'] = self.nextValue()
750
+ self.add(command)
751
+ return True
750
752
  elif token == 'text':
751
753
  self.skip('of')
752
754
  if self.nextIsSymbol():
@@ -788,6 +790,9 @@ class Graphics(Handler):
788
790
  command['value'] = self.nextValue()
789
791
  self.add(command)
790
792
  return True
793
+ elif token == 'blocked':
794
+ self.blocked = True if self.nextToken() == 'true' else False
795
+ return True
791
796
  elif self.isSymbol():
792
797
  record = self.getSymbolRecord()
793
798
  if record['keyword'] == 'listbox':
@@ -809,11 +814,13 @@ class Graphics(Handler):
809
814
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
810
815
  elif what == 'layout':
811
816
  window = self.getVariable(command['name'])['window']
812
- layout = self.getVariable(command['layout'])
813
817
  content = self.getVariable(command['layout'])['widget']
814
818
  container = QWidget()
815
819
  container.setLayout(content)
816
820
  window.setCentralWidget(container)
821
+ elif what == 'spacing':
822
+ layout = self.getVariable(command['name'])['widget']
823
+ layout.setSpacing(self.getRuntimeValue(command['value']))
817
824
  elif what == 'text':
818
825
  record = self.getVariable(command['name'])
819
826
  widget = self.getVariable(command['name'])['widget']
@@ -903,14 +910,14 @@ class Graphics(Handler):
903
910
  def r_start(self, command):
904
911
  def on_last_window_closed():
905
912
  self.program.kill()
906
- def resume():
913
+ def init():
907
914
  self.program.flush(self.nextPC())
908
915
  def flush():
909
- self.program.flushCB()
916
+ if not self.blocked: self.program.flushCB()
910
917
  timer = QTimer()
911
918
  timer.timeout.connect(flush)
912
919
  timer.start(10)
913
- QTimer.singleShot(500, resume)
920
+ QTimer.singleShot(500, init)
914
921
  self.app.lastWindowClosed.connect(on_last_window_closed)
915
922
  self.app.exec()
916
923
 
@@ -0,0 +1,5 @@
1
+ #!/bin/python3
2
+
3
+ from easycoder import Program
4
+
5
+ Program('../../rbr/rbrconf.ecs').start()
@@ -1 +0,0 @@
1
- */__pycache__/*
@@ -1,82 +0,0 @@
1
- from easycoder import Handler, FatalError, RuntimeError
2
- from PySide6.QtWidgets import (
3
- QApplication, QMainWindow, QVBoxLayout, QLabel, QPushButton, QWidget, QHBoxLayout, QSpacerItem, QSizePolicy
4
- )
5
- from PySide6.QtGui import QPixmap, QFont, QPalette, QBrush
6
- from PySide6.QtCore import Qt
7
-
8
- # This is the package that handles the RBR user interface.
9
-
10
- class RBR_UI(Handler):
11
-
12
- def __init__(self, compiler):
13
- Handler.__init__(self, compiler)
14
-
15
- def getName(self):
16
- return 'points'
17
-
18
- #############################################################################
19
- # Keyword handlers
20
-
21
- def k_rbr_ui(self, command):
22
- return self.compileVariable(command, False)
23
-
24
- def r_rbr_ui(self, command):
25
- return self.nextPC()
26
-
27
- # create the main UI
28
- def k_create(self, command):
29
- if self.nextIsSymbol():
30
- record = self.getSymbolRecord()
31
- if record['keyword'] == 'rbr_ui':
32
- command['name'] = record['name']
33
- self.skip('in')
34
- if self.nextIsSymbol():
35
- record = self.getSymbolRecord()
36
- if record['keyword'] == 'window':
37
- command['window'] = record['name']
38
- self.addCommand(command)
39
- return True
40
- return False
41
-
42
- def r_create(self, command):
43
- record = self.getVariable(command['name'])
44
- window = self.getVariable(command['window'])['window']
45
- # Set the background image
46
- palette = QPalette()
47
- background_pixmap = QPixmap("/home/graham/dev/rbr/ui/main/backdrop.jpg")
48
- palette.setBrush(QPalette.Window, QBrush(background_pixmap))
49
- window.setPalette(palette)
50
-
51
- # Main layout
52
- main_widget = QWidget()
53
- main_layout = QVBoxLayout(main_widget)
54
- main_layout.setSpacing(10) # Set spacing between rows to 10
55
-
56
- record['layout'] = main_widget
57
- return self.nextPC()
58
-
59
- #############################################################################
60
- # Compile a value in this domain
61
- def compileValue(self):
62
- return None
63
-
64
- #############################################################################
65
- # Modify a value or leave it unchanged.
66
- def modifyValue(self, value):
67
- return value
68
-
69
- #############################################################################
70
- # Value handlers
71
-
72
- def v_none(self, v):
73
- return None
74
-
75
- #############################################################################
76
- # Compile a condition
77
- def compileCondition(self):
78
- condition = {}
79
- return condition
80
-
81
- #############################################################################
82
- # Condition handlers
@@ -1,3 +0,0 @@
1
- {
2
- "folders": []
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "folders": []
3
- }
@@ -1,16 +0,0 @@
1
- # EasyCoder example scripts
2
- The scripts in this folder are as follows:
3
-
4
- `hello.ecs` is everybody's first program.
5
-
6
- `fizzbuzz.ecs` is often set as a rather trivial programming challenge at job interviews.
7
-
8
- `benchmark.ecs` is a program that can be translated into other languages and used to compare runtime performance.
9
-
10
- `tests.ecs` is a selection of tests to verify the various language features. It could do with a major expansion to cover more of the language.
11
-
12
- `points.ecs` shows how to use a plugin module, in this case one that manages points (pairs of values). This one is aimed at Python programmers wishing to extend the language.
13
-
14
- `graphics-demo.ecg` demonstrates various features of the **_EasyCoder_** graphics system. Note that the filename extension is `.ecg` instead of `.ecs`, this being to signal to **_EasyCoder_** that it needs to call in the graphics module.
15
-
16
- `wave.ecg` is a simulation of the "Mexican Wave".
@@ -1,62 +0,0 @@
1
- ! Connect to an AP
2
-
3
- script Connect
4
-
5
- layout Layout
6
- layout Row
7
- column Column
8
- window Window
9
- variable Value
10
- variable Connected
11
- variable IPAddr
12
- variable HostName
13
- variable HostSSID
14
- variable HostPassword
15
- variable DevicePassword
16
- variable List
17
- variable SSID
18
- variable AccessPoints
19
- variable N
20
- variable P
21
-
22
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23
- ! Specify an access point
24
- Connect:
25
- init Layout
26
-
27
- init Row
28
- put stringify AccessPoints into Value
29
- add Listbox key `-APLIST-` and size `20 5` to Row
30
- add Text text `Device SSID` and expand_x true to Row
31
- add Input key `-SSID-` and size `20 1` to Row
32
- add Row to Layout
33
-
34
- init Row
35
- add Button button_text `Connect` to Row
36
- add Row to Layout
37
-
38
- create Window `Connect`
39
- layout Layout
40
-
41
- on event `Connect` in Window
42
- begin
43
- put property `-SSID-` of the event into SSID
44
- go to OpenConnection
45
- end
46
-
47
- stop
48
-
49
-
50
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
51
- ! Connect to the access point
52
- OpenConnection:
53
- system `nmcli dev wifi connect ` cat SSID cat ` password 00000000`
54
- put system `hostname -I` into IPAddr
55
- put the position of the last `.` in IPAddr into N
56
- increment N
57
- put left N of IPAddr into IPAddr
58
- put IPAddr cat `1` into IPAddr
59
- print `Connected to ` cat IPAddr
60
- close Window
61
- set Connected
62
- stop
@@ -1,24 +0,0 @@
1
-
2
- ! rbr-ui.ecs
3
-
4
- script RBR_UI
5
-
6
- use graphics
7
-
8
- import plugin RBR_UI from plugins/rbr_ui.py
9
-
10
- window Window
11
- rbr_ui MainPanel
12
-
13
- debug step
14
-
15
- init graphics
16
-
17
- create Window title `Room By Room` size 600 1024
18
-
19
- create MainPanel in Window
20
- ! set the layout of Window to MainPanel
21
- show Window
22
-
23
- start graphics
24
- stop
@@ -1,3 +0,0 @@
1
- from easycoder import Program
2
-
3
- Program('rbr-ui.ecs').start()