easycoder 250729.1__tar.gz → 250805.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-250729.1 → easycoder-250805.1}/PKG-INFO +2 -3
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/__init__.py +1 -1
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_core.py +11 -1
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_keyboard.py +10 -2
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_pyside.py +94 -26
- {easycoder-250729.1 → easycoder-250805.1}/.gitignore +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/LICENSE +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/README.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/backdrop.jpg +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/README.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/README.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/import.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/log.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/on.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/send.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/shuffle.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/use.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/arg.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/args.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/cos.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/datime.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/decode.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/element.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/elements.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/empty.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/encode.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/error.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/files.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/float.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/from.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/hash.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/index.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/integer.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/json.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/keys.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/left.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/length.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/memory.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/modification.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/newline.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/now.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/position.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/property.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/random.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/right.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/sin.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/tab.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/tan.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/today.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/trim.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/type.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/value.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/README.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/doc/graphics/values/window.md +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/close.png +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_classes.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_compiler.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_handler.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_program.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/easycoder/ec_value.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/json/graphics-demo.json +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/plugins/ec_keyboard.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/plugins/ec_p100.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/plugins/ec_pyside6.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/plugins/points.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/plugins/sql.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/pyproject.toml +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/config.ecg +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/ec_keyboard.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/findxr.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/hello.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/points.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/test.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/scripts/tests.ecs +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/test.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/testrc.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/testsql.py +0 -0
- {easycoder-250729.1 → easycoder-250805.1}/testui.py +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250805.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: psutil
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import json, math, hashlib, threading, os, subprocess,
|
|
1
|
+
import json, math, hashlib, threading, os, subprocess, time
|
|
2
2
|
import numbers, base64, binascii, random, requests, paramiko
|
|
3
3
|
from psutil import Process
|
|
4
4
|
from datetime import datetime
|
|
@@ -771,6 +771,11 @@ class Core(Handler):
|
|
|
771
771
|
with sftp.open(path, 'r') as remote_file: content = remote_file.read().decode()
|
|
772
772
|
except:
|
|
773
773
|
errorReason = f'Unable to read from {path}'
|
|
774
|
+
if command['or'] != None:
|
|
775
|
+
print(f'Exception "{errorReason}": Running the "or" clause')
|
|
776
|
+
return command['or']
|
|
777
|
+
else:
|
|
778
|
+
RuntimeError(self.program, f'Error: {errorReason}')
|
|
774
779
|
else:
|
|
775
780
|
filename = self.getRuntimeValue(command['file'])
|
|
776
781
|
try:
|
|
@@ -1291,6 +1296,11 @@ class Core(Handler):
|
|
|
1291
1296
|
with sftp.open(path, 'w') as remote_file: remote_file.write(content)
|
|
1292
1297
|
except:
|
|
1293
1298
|
errorReason = 'Unable to write to {path}'
|
|
1299
|
+
if command['or'] != None:
|
|
1300
|
+
print(f'Exception "{errorReason}": Running the "or" clause')
|
|
1301
|
+
return command['or']
|
|
1302
|
+
else:
|
|
1303
|
+
RuntimeError(self.program, f'Error: {errorReason}')
|
|
1294
1304
|
else:
|
|
1295
1305
|
filename = self.getRuntimeValue(command['file'])
|
|
1296
1306
|
if filename.endswith('.json'): content = json.dumps(content)
|
|
@@ -6,6 +6,8 @@ from PySide6.QtWidgets import (
|
|
|
6
6
|
QVBoxLayout,
|
|
7
7
|
QHBoxLayout,
|
|
8
8
|
QPushButton,
|
|
9
|
+
QLineEdit,
|
|
10
|
+
QPlainTextEdit,
|
|
9
11
|
QWidget,
|
|
10
12
|
QStackedWidget,
|
|
11
13
|
QSpacerItem,
|
|
@@ -126,10 +128,16 @@ class TextReceiver():
|
|
|
126
128
|
self.field.setText(current_text[:-1])
|
|
127
129
|
|
|
128
130
|
def setContent(self, text):
|
|
129
|
-
self.field
|
|
131
|
+
if isinstance(self.field, QLineEdit):
|
|
132
|
+
self.field.setText(text)
|
|
133
|
+
elif isinstance(self.field, QPlainTextEdit):
|
|
134
|
+
self.field.setPlainText(text)
|
|
130
135
|
|
|
131
136
|
def getContent(self):
|
|
132
|
-
|
|
137
|
+
if isinstance(self.field, QLineEdit):
|
|
138
|
+
return self.field.text()
|
|
139
|
+
elif isinstance(self.field, QPlainTextEdit):
|
|
140
|
+
return self.field.toPlainText()
|
|
133
141
|
|
|
134
142
|
class KeyboardButton(QPushButton):
|
|
135
143
|
def __init__(self, width, height, onClick, text=None, icon=None):
|
|
@@ -16,6 +16,7 @@ from PySide6.QtWidgets import (
|
|
|
16
16
|
QLabel,
|
|
17
17
|
QLCDNumber,
|
|
18
18
|
QLineEdit,
|
|
19
|
+
QPlainTextEdit,
|
|
19
20
|
QListWidget,
|
|
20
21
|
QMainWindow,
|
|
21
22
|
QProgressBar,
|
|
@@ -52,7 +53,20 @@ class Graphics(Handler):
|
|
|
52
53
|
print('window closed')
|
|
53
54
|
|
|
54
55
|
def isWidget(self, keyword):
|
|
55
|
-
return keyword in [
|
|
56
|
+
return keyword in [
|
|
57
|
+
'layout',
|
|
58
|
+
'groupbox',
|
|
59
|
+
'label',
|
|
60
|
+
'pushbutton',
|
|
61
|
+
'checkbox',
|
|
62
|
+
'lineinput',
|
|
63
|
+
'multiline',
|
|
64
|
+
'listbox',
|
|
65
|
+
'combobox'
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
def dialogTypes(self):
|
|
69
|
+
return ['confirm', 'lineedit', 'multiline']
|
|
56
70
|
|
|
57
71
|
class ECDialog(QDialog):
|
|
58
72
|
def __init__(self, parent, record):
|
|
@@ -334,6 +348,23 @@ class Graphics(Handler):
|
|
|
334
348
|
self.add(command)
|
|
335
349
|
return True
|
|
336
350
|
|
|
351
|
+
def k_createMultiLineEdit(self, command):
|
|
352
|
+
cols = self.compileConstant(30)
|
|
353
|
+
rows = self.compileConstant(5)
|
|
354
|
+
while True:
|
|
355
|
+
next = self.peek()
|
|
356
|
+
if next == 'cols':
|
|
357
|
+
self.nextToken()
|
|
358
|
+
cols = self.nextValue()
|
|
359
|
+
elif next == 'rows':
|
|
360
|
+
self.nextToken()
|
|
361
|
+
rows = self.nextValue()
|
|
362
|
+
else: break;
|
|
363
|
+
command['cols'] = cols
|
|
364
|
+
command['rows'] = rows
|
|
365
|
+
self.add(command)
|
|
366
|
+
return True
|
|
367
|
+
|
|
337
368
|
def k_createListWidget(self, command):
|
|
338
369
|
self.add(command)
|
|
339
370
|
return True
|
|
@@ -351,7 +382,9 @@ class Graphics(Handler):
|
|
|
351
382
|
while True:
|
|
352
383
|
if self.peek() == 'type':
|
|
353
384
|
self.nextToken()
|
|
354
|
-
|
|
385
|
+
dialogType = self.nextToken()
|
|
386
|
+
if dialogType in self.dialogTypes(): command['type'] = dialogType
|
|
387
|
+
else: return False
|
|
355
388
|
elif self.peek() == 'title':
|
|
356
389
|
self.nextToken()
|
|
357
390
|
command['title'] = self.nextValue()
|
|
@@ -406,6 +439,7 @@ class Graphics(Handler):
|
|
|
406
439
|
elif keyword == 'pushbutton': return self.k_createPushbutton(command)
|
|
407
440
|
elif keyword == 'checkbox': return self.k_createCheckBox(command)
|
|
408
441
|
elif keyword == 'lineinput': return self.k_createLineEdit(command)
|
|
442
|
+
elif keyword == 'multiline': return self.k_createMultiLineEdit(command)
|
|
409
443
|
elif keyword == 'listbox': return self.k_createListWidget(command)
|
|
410
444
|
elif keyword == 'combobox': return self.k_createComboBox(command)
|
|
411
445
|
elif keyword == 'dialog': return self.k_createDialog(command)
|
|
@@ -486,6 +520,16 @@ class Graphics(Handler):
|
|
|
486
520
|
record['widget'] = lineinput
|
|
487
521
|
return self.nextPC()
|
|
488
522
|
|
|
523
|
+
def r_createMultiLineEdit(self, command, record):
|
|
524
|
+
textinput = QPlainTextEdit()
|
|
525
|
+
fontMetrics = textinput.fontMetrics()
|
|
526
|
+
charWidth = fontMetrics.horizontalAdvance('x')
|
|
527
|
+
charHeight = fontMetrics.height()
|
|
528
|
+
textinput.setFixedWidth(charWidth * self.getRuntimeValue(command['cols']))
|
|
529
|
+
textinput.setFixedHeight(charHeight * self.getRuntimeValue(command['rows']))
|
|
530
|
+
record['widget'] = textinput
|
|
531
|
+
return self.nextPC()
|
|
532
|
+
|
|
489
533
|
def r_createListWidget(self, command, record):
|
|
490
534
|
record['widget'] = QListWidget()
|
|
491
535
|
return self.nextPC()
|
|
@@ -504,18 +548,22 @@ class Graphics(Handler):
|
|
|
504
548
|
dialogType = command['type'].lower()
|
|
505
549
|
dialog.dialogType = dialogType
|
|
506
550
|
prompt = self.getRuntimeValue(command['prompt'])
|
|
507
|
-
if dialogType
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
551
|
+
if dialogType == 'confirm':
|
|
552
|
+
mainLayout.addWidget(QLabel(prompt))
|
|
553
|
+
elif dialogType == 'lineedit':
|
|
554
|
+
mainLayout.addWidget(QLabel(prompt))
|
|
555
|
+
dialog.lineEdit = QLineEdit(dialog)
|
|
556
|
+
dialog.value = self.getRuntimeValue(command['value'])
|
|
557
|
+
dialog.lineEdit.setText(dialog.value)
|
|
558
|
+
mainLayout.addWidget(dialog.lineEdit)
|
|
559
|
+
elif dialogType == 'multiline':
|
|
560
|
+
mainLayout.addWidget(QLabel(prompt))
|
|
561
|
+
dialog.textEdit = QPlainTextEdit(self)
|
|
562
|
+
dialog.textEdit.setText(dialog.value)
|
|
563
|
+
mainLayout.addWidget(dialog.textEdit)
|
|
564
|
+
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
|
|
565
|
+
buttonBox.accepted.connect(self.accept)
|
|
566
|
+
buttonBox.rejected.connect(self.reject)
|
|
519
567
|
mainLayout.addWidget(buttonBox, alignment=Qt.AlignHCenter)
|
|
520
568
|
record['dialog'] = dialog
|
|
521
569
|
return self.nextPC()
|
|
@@ -540,6 +588,7 @@ class Graphics(Handler):
|
|
|
540
588
|
elif keyword == 'pushbutton': return self.r_createPushbutton(command, record)
|
|
541
589
|
elif keyword == 'checkbox': return self.r_createCheckBox(command, record)
|
|
542
590
|
elif keyword == 'lineinput': return self.r_createLineEdit(command, record)
|
|
591
|
+
elif keyword == 'multiline': return self.r_createMultiLineEdit(command, record)
|
|
543
592
|
elif keyword == 'listbox': return self.r_createListWidget(command, record)
|
|
544
593
|
elif keyword == 'combobox': return self.r_createComboBox(command, record)
|
|
545
594
|
elif keyword == 'dialog': return self.r_createDialog(command, record)
|
|
@@ -634,6 +683,13 @@ class Graphics(Handler):
|
|
|
634
683
|
def r_messagebox(self, command):
|
|
635
684
|
return self.nextPC()
|
|
636
685
|
|
|
686
|
+
# Declare a multiline input variable
|
|
687
|
+
def k_multiline(self, command):
|
|
688
|
+
return self.compileVariable(command, 'gui')
|
|
689
|
+
|
|
690
|
+
def r_multiline(self, command):
|
|
691
|
+
return self.nextPC()
|
|
692
|
+
|
|
637
693
|
# on click {pushbutton}
|
|
638
694
|
# on select {combobox}/{listbox}
|
|
639
695
|
# on tick
|
|
@@ -794,8 +850,8 @@ class Graphics(Handler):
|
|
|
794
850
|
# set [the] width/height [of] {widget} [to] {value}
|
|
795
851
|
# set [the] layout of {window} to {layout}
|
|
796
852
|
# set [the] spacing of {layout} to {value}
|
|
797
|
-
# set [the] text [of] {label}/{button}/{lineinput} [to] {text}
|
|
798
|
-
# set [the] color [of] {label}/{button}/{lineinput} [to] {color}
|
|
853
|
+
# set [the] text [of] {label}/{button}/{lineinput}/{multiline} [to] {text}
|
|
854
|
+
# set [the] color [of] {label}/{button}/{lineinput}/{multiline} [to] {color}
|
|
799
855
|
# set [the] state [of] {checkbox} [to] {color}
|
|
800
856
|
# set {listbox} to {list}
|
|
801
857
|
# set blocked true/false
|
|
@@ -839,7 +895,7 @@ class Graphics(Handler):
|
|
|
839
895
|
self.skip('of')
|
|
840
896
|
if self.nextIsSymbol():
|
|
841
897
|
record = self.getSymbolRecord()
|
|
842
|
-
if record['keyword'] in ['label', 'pushbutton', 'lineinput']:
|
|
898
|
+
if record['keyword'] in ['label', 'pushbutton', 'lineinput', 'multiline']:
|
|
843
899
|
command['name'] = record['name']
|
|
844
900
|
self.skip('to')
|
|
845
901
|
command['value'] = self.nextValue()
|
|
@@ -870,7 +926,7 @@ class Graphics(Handler):
|
|
|
870
926
|
self.skip('of')
|
|
871
927
|
if self.nextIsSymbol():
|
|
872
928
|
record = self.getSymbolRecord()
|
|
873
|
-
if record['keyword'] in ['label', 'pushbutton', 'lineinput']:
|
|
929
|
+
if record['keyword'] in ['label', 'pushbutton', 'lineinput', 'multiline']:
|
|
874
930
|
command['name'] = record['name']
|
|
875
931
|
self.skip('to')
|
|
876
932
|
command['value'] = self.nextValue()
|
|
@@ -911,7 +967,10 @@ class Graphics(Handler):
|
|
|
911
967
|
record = self.getVariable(command['name'])
|
|
912
968
|
widget = self.getVariable(command['name'])['widget']
|
|
913
969
|
text = self.getRuntimeValue(command['value'])
|
|
914
|
-
widget
|
|
970
|
+
if isinstance(widget, QLineEdit):
|
|
971
|
+
widget.setText(text)
|
|
972
|
+
elif isinstance(widget, QPlainTextEdit):
|
|
973
|
+
widget.setPlainText(text)
|
|
915
974
|
if record['keyword'] == 'pushbutton':
|
|
916
975
|
widget.setAccessibleName(text)
|
|
917
976
|
elif what == 'state':
|
|
@@ -996,13 +1055,16 @@ class Graphics(Handler):
|
|
|
996
1055
|
elif 'dialog' in command:
|
|
997
1056
|
record = self.getVariable(command['dialog'])
|
|
998
1057
|
dialog = record['dialog']
|
|
999
|
-
if dialog.dialogType
|
|
1000
|
-
if dialog.
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1058
|
+
if dialog.dialogType == 'confirm':
|
|
1059
|
+
record['result'] = True if dialog.exec() == QDialog.Accepted else False
|
|
1060
|
+
elif dialog.dialogType == 'lineedit':
|
|
1061
|
+
if dialog.exec() == QDialog.Accepted:
|
|
1062
|
+
record['result'] = dialog.lineEdit.text()
|
|
1063
|
+
else: record['result'] = dialog.value
|
|
1064
|
+
elif dialog.dialogType == 'multiline':
|
|
1065
|
+
if dialog.exec() == QDialog.Accepted:
|
|
1066
|
+
record['result'] = dialog.textEdit.toPlainText()
|
|
1067
|
+
else: record['result'] = dialog.value
|
|
1006
1068
|
return self.nextPC()
|
|
1007
1069
|
|
|
1008
1070
|
# Start the graphics
|
|
@@ -1101,6 +1163,12 @@ class Graphics(Handler):
|
|
|
1101
1163
|
v['type'] = 'text'
|
|
1102
1164
|
v['content'] = lineinput.displayText()
|
|
1103
1165
|
return v
|
|
1166
|
+
elif keyword == 'multiline':
|
|
1167
|
+
multiline = symbolRecord['widget']
|
|
1168
|
+
v = {}
|
|
1169
|
+
v['type'] = 'text'
|
|
1170
|
+
v['content'] = multiline.toPlainText()
|
|
1171
|
+
return v
|
|
1104
1172
|
elif keyword == 'combobox':
|
|
1105
1173
|
combobox = symbolRecord['widget']
|
|
1106
1174
|
v = {}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|