easycoder 250207.1__tar.gz → 250210.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-250207.1 → easycoder-250210.1}/PKG-INFO +1 -1
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/__init__.py +1 -1
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_core.py +10 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_graphics.py +24 -15
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_gutils.py +26 -20
- easycoder-250210.1/scripts/test.ecs +14 -0
- easycoder-250207.1/scripts/test.ecs +0 -12
- {easycoder-250207.1 → easycoder-250210.1}/LICENSE +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/import.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/log.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/arg.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/args.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/cos.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/datime.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/decode.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/element.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/elements.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/empty.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/encode.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/error.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/files.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/float.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/from.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/hash.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/index.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/integer.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/json.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/keys.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/left.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/length.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/memory.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/modification.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/newline.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/now.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/position.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/property.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/random.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/right.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/sin.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/tab.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/tan.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/today.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/trim.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/type.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/value.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/doc/graphics/values/window.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_classes.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_compiler.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_handler.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_program.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/easycoder/ec_value.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/json/graphics-demo.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/ec_keyboard.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/ec_p100.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/4-function.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/4-function.png +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-0.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-0.png +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-1.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-1.png +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-2.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-2.png +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-3.json +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/keyboards/qwerty-3.png +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/plugins/points.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/pyproject.toml +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/README.md +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/config.ecg +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/connect.ecg +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/ec_keyboard.py +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/findxr.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/hello.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/points.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/testg.ecg +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/scripts/tests.ecs +0 -0
- {easycoder-250207.1 → easycoder-250210.1}/test.ecs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250210.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>
|
|
@@ -711,6 +711,7 @@ class Core(Handler):
|
|
|
711
711
|
content = f.read()
|
|
712
712
|
except:
|
|
713
713
|
content=None
|
|
714
|
+
if content != None and file.endswith('.json'): content = json.loads(content)
|
|
714
715
|
value = {}
|
|
715
716
|
value['type'] = 'text'
|
|
716
717
|
value['content'] = content
|
|
@@ -1219,6 +1220,7 @@ class Core(Handler):
|
|
|
1219
1220
|
def r_save(self, command):
|
|
1220
1221
|
content = self.getRuntimeValue(command['content'])
|
|
1221
1222
|
file = self.getRuntimeValue(command['file'])
|
|
1223
|
+
if file.endswith('.json'): content = json.dumps(content)
|
|
1222
1224
|
with open(file, 'w') as f:
|
|
1223
1225
|
f.write(content)
|
|
1224
1226
|
return self.nextPC()
|
|
@@ -1997,6 +1999,10 @@ class Core(Handler):
|
|
|
1997
1999
|
base64_bytes = content.encode('ascii')
|
|
1998
2000
|
message_bytes = base64.b64decode(base64_bytes)
|
|
1999
2001
|
value['content'] = message_bytes.decode('ascii')
|
|
2002
|
+
elif self.encoding == 'hex':
|
|
2003
|
+
hex_bytes = content.encode('utf-8')
|
|
2004
|
+
message_bytes = binascii.unhexlify(hex_bytes)
|
|
2005
|
+
value['content'] = message_bytes.decode('utf-8')
|
|
2000
2006
|
else:
|
|
2001
2007
|
value = v
|
|
2002
2008
|
return value
|
|
@@ -2040,6 +2046,10 @@ class Core(Handler):
|
|
|
2040
2046
|
data_bytes = content.encode('ascii')
|
|
2041
2047
|
base64_bytes = base64.b64encode(data_bytes)
|
|
2042
2048
|
value['content'] = base64_bytes.decode('ascii')
|
|
2049
|
+
elif self.encoding == 'hex':
|
|
2050
|
+
data_bytes = content.encode('utf-8')
|
|
2051
|
+
hex_bytes = binascii.hexlify(data_bytes)
|
|
2052
|
+
value['content'] = hex_bytes.decode('utf-8')
|
|
2043
2053
|
else:
|
|
2044
2054
|
value = v
|
|
2045
2055
|
return value
|
|
@@ -29,7 +29,7 @@ class Graphics(Handler):
|
|
|
29
29
|
command['name'] = name
|
|
30
30
|
command['type'] = token
|
|
31
31
|
if self.peek() == 'to':
|
|
32
|
-
command['args'] =
|
|
32
|
+
command['args'] = name
|
|
33
33
|
else:
|
|
34
34
|
command['args'] = self.utils.getArgs(self)
|
|
35
35
|
else:
|
|
@@ -45,28 +45,37 @@ class Graphics(Handler):
|
|
|
45
45
|
return False
|
|
46
46
|
|
|
47
47
|
def r_add(self, command):
|
|
48
|
+
def create(type, layout, args2, target):
|
|
49
|
+
args = self.utils.getDefaultArgs(type)
|
|
50
|
+
for n in range(0, len(args2)):
|
|
51
|
+
try:
|
|
52
|
+
self.utils.decode(self, args, args2[n])
|
|
53
|
+
except Exception as e:
|
|
54
|
+
RuntimeError(self.program, e)
|
|
55
|
+
item = self.utils.createWidget(type, layout, args)
|
|
56
|
+
target['layout'].append(item)
|
|
57
|
+
|
|
48
58
|
target = self.getVariable(command['target'])
|
|
49
59
|
type = command['type']
|
|
50
60
|
args = command['args']
|
|
51
|
-
param= None
|
|
52
61
|
if not 'layout' in target:
|
|
53
62
|
target['layout'] = []
|
|
54
|
-
if args[0] == '{':
|
|
63
|
+
if len(args) > 0 and args[0] == '{':
|
|
64
|
+
args = json.loads(self.getRuntimeValue(json.loads(args)))
|
|
55
65
|
if type in ['Column', 'Frame', 'Tab']:
|
|
56
66
|
record = self.getVariable(command['name'])
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
try:
|
|
62
|
-
args = self.utils.decode(self, default, layout[n])
|
|
63
|
-
except Exception as e:
|
|
64
|
-
RuntimeError(self.program, e)
|
|
65
|
-
item = self.utils.createWidget(type, param, args)
|
|
66
|
-
target['layout'].append(item)
|
|
67
|
+
layout = record['layout']
|
|
68
|
+
create(type, layout, args, target)
|
|
69
|
+
else:
|
|
70
|
+
create(type, None, args, target)
|
|
67
71
|
else:
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
if type in ['Column', 'Frame', 'Tab']:
|
|
73
|
+
record = self.getVariable(command['name'])
|
|
74
|
+
layout = record['layout']
|
|
75
|
+
create(type, layout, args, target)
|
|
76
|
+
else:
|
|
77
|
+
v = self.getVariable(args)
|
|
78
|
+
target['layout'].append(v['layout'])
|
|
70
79
|
return self.nextPC()
|
|
71
80
|
|
|
72
81
|
def k_close(self, command):
|
|
@@ -44,8 +44,6 @@ class GUtils:
|
|
|
44
44
|
if value != None: value = value['content']
|
|
45
45
|
else: raise Exception('Variable has no value')
|
|
46
46
|
args[key] = value
|
|
47
|
-
return args
|
|
48
|
-
return None
|
|
49
47
|
|
|
50
48
|
# Reduce the event properties to a list of strings
|
|
51
49
|
def getEventProperties(self, window, values):
|
|
@@ -59,14 +57,14 @@ class GUtils:
|
|
|
59
57
|
values[key] = v
|
|
60
58
|
|
|
61
59
|
# Create a widget
|
|
62
|
-
def createWidget(self, type,
|
|
63
|
-
if type == 'Button': return self.createButton(
|
|
64
|
-
elif type == 'Checkbox': return self.createCheckbox(
|
|
65
|
-
elif type == 'Column': return self.createColumn(
|
|
66
|
-
elif type == 'Input': return self.createInput(
|
|
67
|
-
elif type == 'Listbox': return self.createListbox(
|
|
68
|
-
elif type == 'Multiline': return self.createMultiline(
|
|
69
|
-
elif type == 'Text': return self.createText(
|
|
60
|
+
def createWidget(self, type, layout, args):
|
|
61
|
+
if type == 'Button': return self.createButton(layout, args)
|
|
62
|
+
elif type == 'Checkbox': return self.createCheckbox(layout, args)
|
|
63
|
+
elif type == 'Column': return self.createColumn(layout, args)
|
|
64
|
+
elif type == 'Input': return self.createInput(layout, args)
|
|
65
|
+
elif type == 'Listbox': return self.createListbox(layout, args)
|
|
66
|
+
elif type == 'Multiline': return self.createMultiline(layout, args)
|
|
67
|
+
elif type == 'Text': return self.createText(layout, args)
|
|
70
68
|
else: return None
|
|
71
69
|
|
|
72
70
|
# Get the current value of a widget
|
|
@@ -97,6 +95,13 @@ class GUtils:
|
|
|
97
95
|
elif property == 'values':
|
|
98
96
|
element.update(values=value)
|
|
99
97
|
|
|
98
|
+
def getPad(self, args):
|
|
99
|
+
pad = args['pad']
|
|
100
|
+
if pad == (None, None):
|
|
101
|
+
return pad
|
|
102
|
+
pad = pad.split()
|
|
103
|
+
return (pad[0], pad[1])
|
|
104
|
+
|
|
100
105
|
def getSize(self, args):
|
|
101
106
|
size = args['size']
|
|
102
107
|
if size == (None, None):
|
|
@@ -109,7 +114,7 @@ class GUtils:
|
|
|
109
114
|
args['disabled'] = False
|
|
110
115
|
args['size'] = (None, None)
|
|
111
116
|
|
|
112
|
-
def createButton(self,
|
|
117
|
+
def createButton(self, layout, args):
|
|
113
118
|
return psg.Button(button_text=args['button_text'], disabled=args['disabled'], size=self.getSize(args))
|
|
114
119
|
|
|
115
120
|
def getDefaultCheckbox(self, args):
|
|
@@ -118,39 +123,40 @@ class GUtils:
|
|
|
118
123
|
args['size'] = (None, None)
|
|
119
124
|
args['expand_x'] = False
|
|
120
125
|
|
|
121
|
-
def createCheckbox(self,
|
|
126
|
+
def createCheckbox(self, layout, args):
|
|
122
127
|
return psg.Checkbox(args['text'], key=args['key'], expand_x=args['expand_x'], size=self.getSize(args))
|
|
123
128
|
|
|
124
129
|
def getDefaultColumn(self, args):
|
|
125
130
|
args['expand_x'] = False
|
|
126
|
-
args['pad'] = (
|
|
131
|
+
args['pad'] = (None, None)
|
|
127
132
|
|
|
128
|
-
def createColumn(self,
|
|
129
|
-
return psg.Column(
|
|
133
|
+
def createColumn(self, layout, args):
|
|
134
|
+
return psg.Column(layout, expand_x=args['expand_x'], pad=self.getPad(args))
|
|
130
135
|
|
|
131
136
|
def getDefaultInput(self, args):
|
|
132
137
|
args['default_text'] = ''
|
|
133
138
|
args['key'] = None
|
|
134
139
|
args['size'] = (None, None)
|
|
135
140
|
|
|
136
|
-
def createInput(self,
|
|
141
|
+
def createInput(self, layout, args):
|
|
137
142
|
return psg.Input(default_text=args['default_text'], key=args['key'], size=self.getSize(args))
|
|
138
143
|
|
|
139
144
|
def getDefaultListbox(self, args):
|
|
140
145
|
args['list'] = []
|
|
141
146
|
args['key'] = [None]
|
|
142
147
|
args['size'] = '10 2'
|
|
148
|
+
args['pad'] = (None, None)
|
|
143
149
|
args['select_mode'] = None
|
|
144
150
|
|
|
145
|
-
def createListbox(self,
|
|
146
|
-
return psg.Listbox([], key=args['key'], size=self.getSize(args))
|
|
151
|
+
def createListbox(self, layout, args):
|
|
152
|
+
return psg.Listbox([], key=args['key'], pad=self.getPad(args), size=self.getSize(args))
|
|
147
153
|
|
|
148
154
|
def getDefaultMultiline(self, args):
|
|
149
155
|
args['default_text'] = ''
|
|
150
156
|
args['key'] = None
|
|
151
157
|
args['size'] = (None, None)
|
|
152
158
|
|
|
153
|
-
def createMultiline(self,
|
|
159
|
+
def createMultiline(self, layout, args):
|
|
154
160
|
return psg.Multiline(default_text=args['default_text'], key=args['key'], size=self.getSize(args))
|
|
155
161
|
|
|
156
162
|
def getDefaultText(self, args):
|
|
@@ -159,6 +165,6 @@ class GUtils:
|
|
|
159
165
|
args['size'] = (None, None)
|
|
160
166
|
args['expand_x'] = False
|
|
161
167
|
|
|
162
|
-
def createText(self,
|
|
168
|
+
def createText(self, layouts, args):
|
|
163
169
|
return psg.Text(text=args['text'], expand_x=args['expand_x'], key=args['key'], size=self.getSize(args))
|
|
164
170
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
! A test script
|
|
2
|
+
|
|
3
|
+
script Test
|
|
4
|
+
|
|
5
|
+
variable File
|
|
6
|
+
variable Segment
|
|
7
|
+
|
|
8
|
+
set the encoding to `hex`
|
|
9
|
+
load File from `/data/Projects/rbr/roombyroom/Controller/home/orangepi/firmware/NOW/config.py`
|
|
10
|
+
put left 200 of File into Segment
|
|
11
|
+
print Segment
|
|
12
|
+
put encode Segment into Segment
|
|
13
|
+
print Segment
|
|
14
|
+
exit
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|