easycoder 250508.2__tar.gz → 250517.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.
- {easycoder-250508.2 → easycoder-250517.1}/PKG-INFO +2 -1
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/__init__.py +1 -1
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_core.py +3 -3
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_pyside.py +27 -3
- easycoder-250517.1/plugins/rbr_ui.py +82 -0
- {easycoder-250508.2 → easycoder-250517.1}/pyproject.toml +1 -0
- easycoder-250517.1/rbr_ui.code-workspace +3 -0
- easycoder-250517.1/rbrconf.code-workspace +3 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/config.ecg +1 -1
- easycoder-250517.1/scripts/rbr_ui.ecs +24 -0
- easycoder-250508.2/test.py → easycoder-250517.1/scripts/rbr_ui.py +1 -1
- {easycoder-250508.2 → easycoder-250517.1/scripts}/rbrconf.ecs +14 -7
- easycoder-250517.1/test.py +3 -0
- easycoder-250517.1/testrc.py +3 -0
- easycoder-250517.1/ui.py +84 -0
- easycoder-250508.2/plugins/keyboards/4-function.json +0 -62
- easycoder-250508.2/plugins/keyboards/4-function.png +0 -0
- easycoder-250508.2/plugins/keyboards/qwerty-0.json +0 -179
- easycoder-250508.2/plugins/keyboards/qwerty-0.png +0 -0
- easycoder-250508.2/plugins/keyboards/qwerty-1.json +0 -179
- easycoder-250508.2/plugins/keyboards/qwerty-1.png +0 -0
- easycoder-250508.2/plugins/keyboards/qwerty-2.json +0 -179
- easycoder-250508.2/plugins/keyboards/qwerty-2.png +0 -0
- easycoder-250508.2/plugins/keyboards/qwerty-3.json +0 -180
- easycoder-250508.2/plugins/keyboards/qwerty-3.png +0 -0
- easycoder-250508.2/q1.py +0 -50
- easycoder-250508.2/q2.py +0 -70
- easycoder-250508.2/rbrconf.py +0 -3
- easycoder-250508.2/test.ecs +0 -13
- easycoder-250508.2/test.txt +0 -2
- {easycoder-250508.2 → easycoder-250517.1}/.gitignore +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/LICENSE +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/import.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/log.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/arg.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/args.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/cos.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/datime.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/decode.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/element.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/elements.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/empty.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/encode.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/error.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/files.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/float.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/from.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/hash.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/index.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/integer.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/json.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/keys.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/left.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/length.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/memory.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/modification.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/newline.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/now.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/position.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/property.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/random.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/right.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/sin.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/tab.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/tan.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/today.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/trim.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/type.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/value.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/doc/graphics/values/window.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_classes.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_compiler.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_graphics.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_gutils.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_handler.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_program.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/easycoder/ec_value.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/json/graphics-demo.json +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/plugins/ec_keyboard.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/plugins/ec_p100.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/plugins/ec_pyside6.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/plugins/points.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/README.md +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/connect.ecg +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/ec_keyboard.py +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/findxr.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/hello.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/points.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/test.ecs +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/testg.ecg +0 -0
- {easycoder-250508.2 → easycoder-250517.1}/scripts/tests.ecs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250517.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>
|
|
@@ -8,6 +8,7 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Requires-Dist: pytz
|
|
11
|
+
Requires-Dist: requests
|
|
11
12
|
Requires-Dist: pyside6
|
|
12
13
|
Project-URL: Home, https://github.com/easycoder/easycoder-py
|
|
13
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import json, math, hashlib, threading, os, subprocess, sys,
|
|
1
|
+
import json, math, hashlib, threading, os, subprocess, sys, time, numbers, base64, binascii, random, requests
|
|
2
2
|
from psutil import Process
|
|
3
|
-
from datetime import datetime
|
|
3
|
+
from datetime import datetime
|
|
4
4
|
from random import randrange
|
|
5
5
|
from .ec_classes import FatalError, RuntimeWarning, RuntimeError, AssertionError, NoValueError, NoValueRuntimeError, Condition, Object
|
|
6
6
|
from .ec_handler import Handler
|
|
@@ -381,7 +381,7 @@ class Core(Handler):
|
|
|
381
381
|
|
|
382
382
|
def r_exit(self, command):
|
|
383
383
|
if self.program.graphics != None:
|
|
384
|
-
self.program.graphics.force_exit()
|
|
384
|
+
self.program.graphics.force_exit(None)
|
|
385
385
|
return -1
|
|
386
386
|
|
|
387
387
|
# Declare a file variable
|
|
@@ -386,9 +386,13 @@ class Graphics(Handler):
|
|
|
386
386
|
if y == None: y = (self.screenHeight - h) / 2
|
|
387
387
|
else: y = self.getRuntimeValue(x)
|
|
388
388
|
window.setGeometry(x, y, w, h)
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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)
|
|
392
396
|
record['window'] = window
|
|
393
397
|
return self.nextPC()
|
|
394
398
|
|
|
@@ -712,6 +716,7 @@ class Graphics(Handler):
|
|
|
712
716
|
return self.nextPC()
|
|
713
717
|
|
|
714
718
|
# set [the] width/height [of] {widget} [to] {value}
|
|
719
|
+
# set [the] layout of {window} to {layout}
|
|
715
720
|
# set [the] text [of] {label}/{button}/{lineinput} [to] {text}
|
|
716
721
|
# set [the] color [of] {label}/{button}/{lineinput} [to] {color}
|
|
717
722
|
# set [the] state [of] {checkbox} [to] {color}
|
|
@@ -730,6 +735,18 @@ class Graphics(Handler):
|
|
|
730
735
|
command['value'] = self.nextValue()
|
|
731
736
|
self.add(command)
|
|
732
737
|
return True
|
|
738
|
+
elif token == 'layout':
|
|
739
|
+
self.skip('of')
|
|
740
|
+
if self.nextIsSymbol():
|
|
741
|
+
record = self.getSymbolRecord()
|
|
742
|
+
if record['keyword'] == 'window':
|
|
743
|
+
command['name'] = record['name']
|
|
744
|
+
self.skip('to')
|
|
745
|
+
if self.nextIsSymbol():
|
|
746
|
+
record = self.getSymbolRecord()
|
|
747
|
+
command['layout'] = record['name']
|
|
748
|
+
self.add(command)
|
|
749
|
+
return True
|
|
733
750
|
elif token == 'text':
|
|
734
751
|
self.skip('of')
|
|
735
752
|
if self.nextIsSymbol():
|
|
@@ -790,6 +807,13 @@ class Graphics(Handler):
|
|
|
790
807
|
elif what == 'width':
|
|
791
808
|
widget = self.getVariable(command['name'])['widget']
|
|
792
809
|
widget.setFixedWidth(self.getRuntimeValue(command['value']))
|
|
810
|
+
elif what == 'layout':
|
|
811
|
+
window = self.getVariable(command['name'])['window']
|
|
812
|
+
layout = self.getVariable(command['layout'])
|
|
813
|
+
content = self.getVariable(command['layout'])['widget']
|
|
814
|
+
container = QWidget()
|
|
815
|
+
container.setLayout(content)
|
|
816
|
+
window.setCentralWidget(container)
|
|
793
817
|
elif what == 'text':
|
|
794
818
|
record = self.getVariable(command['name'])
|
|
795
819
|
widget = self.getVariable(command['name'])['widget']
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -218,7 +218,8 @@
|
|
|
218
218
|
gosub to OK
|
|
219
219
|
add StatusLabel to RightPanel
|
|
220
220
|
|
|
221
|
-
create Window title `RBR-Now configurator` size 700 500
|
|
221
|
+
create Window title `RBR-Now configurator` size 700 500
|
|
222
|
+
set the layout of Window to MainPanel
|
|
222
223
|
show Window
|
|
223
224
|
|
|
224
225
|
start graphics
|
|
@@ -629,9 +630,9 @@ GetFirmware:
|
|
|
629
630
|
ScanForDevicesClick:
|
|
630
631
|
gosub to SetBusy
|
|
631
632
|
put `Scanning for new devices...` into StatusMessage
|
|
632
|
-
log StatusMessage
|
|
633
633
|
gosub to Working
|
|
634
634
|
put system `nmcli device wifi list` into SystemCallResult
|
|
635
|
+
log SystemCallResult
|
|
635
636
|
split SystemCallResult
|
|
636
637
|
put json `[]` into List
|
|
637
638
|
put 1 into N
|
|
@@ -672,7 +673,7 @@ ScanForDevicesClick:
|
|
|
672
673
|
SFDC2:
|
|
673
674
|
increment N
|
|
674
675
|
end
|
|
675
|
-
|
|
676
|
+
log `SSIDs: ` cat List
|
|
676
677
|
if the count of List is 0
|
|
677
678
|
begin
|
|
678
679
|
put `No new devices were found` into StatusMessage
|
|
@@ -734,7 +735,8 @@ SelectSSIDFromList:
|
|
|
734
735
|
end
|
|
735
736
|
add CancelButton to HLayout
|
|
736
737
|
add HLayout to Layout
|
|
737
|
-
create Dialog title Title
|
|
738
|
+
create Dialog title Title size 250 200
|
|
739
|
+
set the layout of Dialog to Layout
|
|
738
740
|
center Dialog on Window
|
|
739
741
|
show Dialog
|
|
740
742
|
stop
|
|
@@ -908,6 +910,7 @@ PopulateSystemInfo:
|
|
|
908
910
|
begin
|
|
909
911
|
put SystemHostSSID into HostSSID
|
|
910
912
|
put Password into HostPassword
|
|
913
|
+
system `nmcli connection delete ` cat HostSSID
|
|
911
914
|
put system `nmcli dev wifi connect ` cat HostSSID cat ` password ` cat HostPassword into SystemCallResult
|
|
912
915
|
split SystemCallResult on ` `
|
|
913
916
|
if the elements of SystemCallResult is greater than 2
|
|
@@ -1102,7 +1105,8 @@ GetRequestedText:
|
|
|
1102
1105
|
return
|
|
1103
1106
|
end
|
|
1104
1107
|
add CancelButton to HLayout
|
|
1105
|
-
create Dialog title Title
|
|
1108
|
+
create Dialog title Title size 300 80
|
|
1109
|
+
set the layout of Dialog to VLayout
|
|
1106
1110
|
center Dialog on Window
|
|
1107
1111
|
show Dialog
|
|
1108
1112
|
stop
|
|
@@ -1147,6 +1151,7 @@ GetAccessPoints:
|
|
|
1147
1151
|
ConnectToHost:
|
|
1148
1152
|
put `Connect to host ` cat HostSSID cat ` with password ` cat HostPassword into StatusMessage
|
|
1149
1153
|
gosub to Working
|
|
1154
|
+
system `nmcli connection delete ` cat HostSSID
|
|
1150
1155
|
put system `nmcli dev wifi connect ` cat HostSSID cat ` password ` cat HostPassword into SystemCallResult
|
|
1151
1156
|
split SystemCallResult on ` `
|
|
1152
1157
|
if the elements of SystemCallResult is greater than 2
|
|
@@ -1183,6 +1188,7 @@ FailedToConnect:
|
|
|
1183
1188
|
ConnectToDevice:
|
|
1184
1189
|
put `Connect to device ` cat SSID cat ` with password 00000000` into StatusMessage
|
|
1185
1190
|
gosub to Working
|
|
1191
|
+
system `nmcli connection delete ` cat SSID
|
|
1186
1192
|
put system `nmcli dev wifi connect ` cat SSID cat ` password 00000000` into SystemCallResult
|
|
1187
1193
|
put SystemCallResult into Value
|
|
1188
1194
|
split Value on ` `
|
|
@@ -1309,7 +1315,8 @@ SendFileToDevice:
|
|
|
1309
1315
|
put the length of Segment into Length
|
|
1310
1316
|
add Length to Total
|
|
1311
1317
|
put encode Segment into Segment
|
|
1312
|
-
put `Send ` cat FileName cat `, part ` cat Sequence
|
|
1318
|
+
put `Send ` cat FileName cat `, part ` cat Sequence into StatusMessage
|
|
1319
|
+
if Attempt is not 1 put StatusMessage cat ` (attempt ` cat Attempt cat `)` into StatusMessage
|
|
1313
1320
|
gosub to Working
|
|
1314
1321
|
put `part:` cat Sequence cat `,text:` cat Segment into Message
|
|
1315
1322
|
gosub to SendMessageToDevice
|
|
@@ -1412,7 +1419,7 @@ CheckDevice2:
|
|
|
1412
1419
|
put Uptime cat ` sec` into Uptime
|
|
1413
1420
|
end
|
|
1414
1421
|
else put `Unknown` into Uptime
|
|
1415
|
-
log Name cat ` uptime: ` cat Uptime
|
|
1422
|
+
! log Name cat ` uptime: ` cat Uptime
|
|
1416
1423
|
set the text of UptimeLabel to Uptime
|
|
1417
1424
|
go to OK
|
|
1418
1425
|
|
easycoder-250517.1/ui.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from PySide6.QtWidgets import (
|
|
2
|
+
QApplication, QMainWindow, QVBoxLayout, QLabel, QPushButton, QWidget, QHBoxLayout, QSpacerItem, QSizePolicy
|
|
3
|
+
)
|
|
4
|
+
from PySide6.QtGui import QPixmap, QFont, QPalette, QBrush
|
|
5
|
+
from PySide6.QtCore import Qt
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
class MainWindow(QMainWindow):
|
|
9
|
+
def __init__(self):
|
|
10
|
+
super().__init__()
|
|
11
|
+
self.setWindowTitle("Custom UI")
|
|
12
|
+
self.setFixedSize(600, 1024) # Set the window size to 600x1024
|
|
13
|
+
|
|
14
|
+
# Set the background image
|
|
15
|
+
palette = QPalette()
|
|
16
|
+
background_pixmap = QPixmap("/home/graham/dev/rbr/ui/main/backdrop.jpg")
|
|
17
|
+
palette.setBrush(QPalette.Window, QBrush(background_pixmap))
|
|
18
|
+
self.setPalette(palette)
|
|
19
|
+
|
|
20
|
+
# Main layout
|
|
21
|
+
main_widget = QWidget()
|
|
22
|
+
main_layout = QVBoxLayout(main_widget)
|
|
23
|
+
main_layout.setSpacing(10) # Set spacing between rows to 10
|
|
24
|
+
|
|
25
|
+
# Create 5 rows
|
|
26
|
+
for _ in range(5):
|
|
27
|
+
row = self.create_row()
|
|
28
|
+
main_layout.addWidget(row)
|
|
29
|
+
|
|
30
|
+
# Add a stretch below the last row
|
|
31
|
+
main_layout.addSpacerItem(QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding))
|
|
32
|
+
|
|
33
|
+
self.setCentralWidget(main_widget)
|
|
34
|
+
|
|
35
|
+
def create_row(self):
|
|
36
|
+
"""Create a single row with the specified elements."""
|
|
37
|
+
row_widget = QWidget()
|
|
38
|
+
row_widget.setFixedHeight(1024 // 12) # Each row is 1/12 the height of the window
|
|
39
|
+
row_widget.setStyleSheet("background-color: #ffffcc; border: 2px solid gray;") # Set background and border
|
|
40
|
+
|
|
41
|
+
row_layout = QHBoxLayout(row_widget)
|
|
42
|
+
row_layout.setContentsMargins(10, 0, 10, 0) # Add margins for spacing
|
|
43
|
+
row_layout.setSpacing(10) # Add spacing between elements
|
|
44
|
+
|
|
45
|
+
# Icon 1: Clock
|
|
46
|
+
clock_icon = QLabel()
|
|
47
|
+
clock_pixmap = QPixmap("/home/graham/dev/rbr/ui/main/clock.png").scaled(1024 // 12 * 3 // 4, 1024 // 12 * 3 // 4, Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
|
48
|
+
clock_icon.setPixmap(clock_pixmap)
|
|
49
|
+
clock_icon.setStyleSheet("border-left: none; border-right: none;")
|
|
50
|
+
|
|
51
|
+
# Name label
|
|
52
|
+
name_label = QLabel("Room Name")
|
|
53
|
+
name_label.setAlignment(Qt.AlignVCenter | Qt.AlignLeft)
|
|
54
|
+
name_label.setStyleSheet("background-color: transparent; border: none;") # Transparent background
|
|
55
|
+
font = QFont()
|
|
56
|
+
font.setPointSize(16) # Adjust font size to fit at least 20 characters
|
|
57
|
+
font.setBold(True) # Make the font bold
|
|
58
|
+
name_label.setFont(font)
|
|
59
|
+
|
|
60
|
+
# Button with white text and blue background
|
|
61
|
+
button = QPushButton("20.0°C")
|
|
62
|
+
button.setStyleSheet("color: white; background-color: blue; border: none;")
|
|
63
|
+
button.setFixedSize(80, 40) # Adjust button size
|
|
64
|
+
button.setFont(font) # Use the same font as the label
|
|
65
|
+
|
|
66
|
+
# Icon 2: Edit
|
|
67
|
+
edit_icon = QLabel()
|
|
68
|
+
edit_pixmap = QPixmap("/home/graham/dev/rbr/ui/main/edit.png").scaled(1024 // 12 * 3 // 4, 1024 // 12 * 3 // 4, Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
|
69
|
+
edit_icon.setPixmap(edit_pixmap)
|
|
70
|
+
edit_icon.setStyleSheet("border-left: none; border-right: none;")
|
|
71
|
+
|
|
72
|
+
# Add elements to the row layout
|
|
73
|
+
row_layout.addWidget(clock_icon)
|
|
74
|
+
row_layout.addWidget(name_label, 1) # Expand the name label to use all spare space
|
|
75
|
+
row_layout.addWidget(button)
|
|
76
|
+
row_layout.addWidget(edit_icon)
|
|
77
|
+
|
|
78
|
+
return row_widget
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
app = QApplication(sys.argv)
|
|
82
|
+
window = MainWindow()
|
|
83
|
+
window.show()
|
|
84
|
+
sys.exit(app.exec())
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"face": "plugins/keyboards/4-function.png",
|
|
3
|
-
"rows":
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
{
|
|
7
|
-
"id": "1"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "2"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "3"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "+"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
[
|
|
20
|
-
{
|
|
21
|
-
"id": "4"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "5"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"id": "6"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": "-"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
[
|
|
34
|
-
{
|
|
35
|
-
"id": "7"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "8"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"id": "9"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"id": "*"
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
[
|
|
48
|
-
{
|
|
49
|
-
"id": "0"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "C"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"id": "="
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "/"
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
]
|
|
62
|
-
}
|
|
Binary file
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"face": "plugins/keyboards/qwerty-0.png",
|
|
3
|
-
"rows":
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
{
|
|
7
|
-
"id": "`"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "1"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "2"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "3"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "4"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "5"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "6"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "7"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "8"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "9"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": "0"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "-"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"id": "="
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "bs",
|
|
47
|
-
"span": "1.5"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
{
|
|
52
|
-
"id": "tab",
|
|
53
|
-
"span": "1.5"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"id": "q"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"id": "w"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "e"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"id": "r"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"id": "t"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"id": "y"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "u"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"id": "i"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"id": "o"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"id": "p"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"id": "["
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"id": "]"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"id": "\\"
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
[
|
|
96
|
-
{
|
|
97
|
-
"id": "caps",
|
|
98
|
-
"span": "2.0"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"id": "a"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"id": "s"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"id": "d"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"id": "f"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"id": "g"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "h"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"id": "j"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"id": "k"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"id": "l"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"id": ";"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"id": "'"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "enter",
|
|
135
|
-
"span": "1.5"
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
[
|
|
139
|
-
{
|
|
140
|
-
"id": "shift",
|
|
141
|
-
"span": "2.5"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"id": "z"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"id": "x"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"id": "c"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"id": "v"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"id": "b"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"id": "n"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"id": "m"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"id": ","
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"id": "."
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"id": "/"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"id": "space",
|
|
175
|
-
"span": "2.0"
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
]
|
|
179
|
-
}
|
|
Binary file
|