easycoder 250205.1__tar.gz → 250209.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-250205.1 → easycoder-250209.1}/PKG-INFO +1 -1
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/__init__.py +1 -1
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_core.py +10 -19
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_graphics.py +24 -15
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_gutils.py +26 -20
- {easycoder-250205.1 → easycoder-250209.1}/LICENSE +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/import.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/log.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/arg.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/args.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/cos.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/datime.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/decode.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/element.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/elements.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/empty.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/encode.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/error.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/files.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/float.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/from.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/hash.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/index.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/integer.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/json.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/keys.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/left.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/length.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/memory.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/modification.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/newline.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/now.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/position.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/property.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/random.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/right.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/sin.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/tab.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/tan.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/today.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/trim.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/type.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/value.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/doc/graphics/values/window.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_classes.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_compiler.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_handler.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_program.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/easycoder/ec_value.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/json/graphics-demo.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/ec_keyboard.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/ec_p100.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/4-function.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/4-function.png +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-0.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-0.png +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-1.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-1.png +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-2.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-2.png +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-3.json +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/keyboards/qwerty-3.png +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/plugins/points.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/pyproject.toml +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/README.md +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/config.ecg +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/connect.ecg +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/ec_keyboard.py +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/findxr.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/hello.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/points.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/test.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/testg.ecg +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/scripts/tests.ecs +0 -0
- {easycoder-250205.1 → easycoder-250209.1}/test.ecs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250209.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>
|
|
@@ -706,9 +706,12 @@ class Core(Handler):
|
|
|
706
706
|
def r_load(self, command):
|
|
707
707
|
target = self.getVariable(command['target'])
|
|
708
708
|
file = self.getRuntimeValue(command['file'])
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
709
|
+
try:
|
|
710
|
+
with open(file, 'r') as f:
|
|
711
|
+
content = f.read()
|
|
712
|
+
except:
|
|
713
|
+
content=None
|
|
714
|
+
if content != None and file.endswith('.json'): content = json.loads(content)
|
|
712
715
|
value = {}
|
|
713
716
|
value['type'] = 'text'
|
|
714
717
|
value['content'] = content
|
|
@@ -1217,9 +1220,9 @@ class Core(Handler):
|
|
|
1217
1220
|
def r_save(self, command):
|
|
1218
1221
|
content = self.getRuntimeValue(command['content'])
|
|
1219
1222
|
file = self.getRuntimeValue(command['file'])
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
+
if file.endswith('.json'): content = json.dumps(content)
|
|
1224
|
+
with open(file, 'w') as f:
|
|
1225
|
+
f.write(content)
|
|
1223
1226
|
return self.nextPC()
|
|
1224
1227
|
|
|
1225
1228
|
# Send a message to a module
|
|
@@ -2400,22 +2403,11 @@ class Core(Handler):
|
|
|
2400
2403
|
if self.nextToken() == 'with':
|
|
2401
2404
|
condition.value2 = self.nextValue()
|
|
2402
2405
|
return condition
|
|
2403
|
-
return None
|
|
2404
2406
|
|
|
2405
2407
|
if token == 'includes':
|
|
2406
2408
|
condition.value2 = self.nextValue()
|
|
2407
2409
|
return condition
|
|
2408
2410
|
|
|
2409
|
-
if token == 'does':
|
|
2410
|
-
self.nextToken()
|
|
2411
|
-
if self.nextIs('not'):
|
|
2412
|
-
if self.nextIs('include'):
|
|
2413
|
-
condition.value2 = self.nextValue()
|
|
2414
|
-
condition.type = 'includes'
|
|
2415
|
-
condition.negate = True
|
|
2416
|
-
return condition
|
|
2417
|
-
return None
|
|
2418
|
-
|
|
2419
2411
|
if token == 'is':
|
|
2420
2412
|
token = self.nextToken()
|
|
2421
2413
|
if self.peek() == 'not':
|
|
@@ -2503,8 +2495,7 @@ class Core(Handler):
|
|
|
2503
2495
|
def c_includes(self, condition):
|
|
2504
2496
|
value1 = self.getRuntimeValue(condition.value1)
|
|
2505
2497
|
value2 = self.getRuntimeValue(condition.value2)
|
|
2506
|
-
|
|
2507
|
-
return not test if condition.negate else test
|
|
2498
|
+
return value2 in value1
|
|
2508
2499
|
|
|
2509
2500
|
def c_is(self, condition):
|
|
2510
2501
|
comparison = self.program.compare(condition.value1, condition.value2)
|
|
@@ -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
|
|
|
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
|
|
File without changes
|