easycoder 251104.1__py2.py3-none-any.whl → 251105.1__py2.py3-none-any.whl
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.
- easycoder/__init__.py +1 -1
- easycoder/ec_border.py +15 -11
- easycoder/ec_classes.py +7 -2
- easycoder/ec_compiler.py +2 -1
- easycoder/ec_core.py +2 -9
- easycoder/ec_debug.py +781 -0
- easycoder/ec_handler.py +1 -0
- easycoder/ec_keyboard.py +50 -50
- easycoder/ec_program.py +44 -10
- easycoder/ec_pyside.py +82 -95
- easycoder/ec_timestamp.py +2 -1
- easycoder/icons/exit.png +0 -0
- easycoder/icons/run.png +0 -0
- easycoder/icons/step.png +0 -0
- easycoder/icons/stop.png +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/METADATA +1 -1
- easycoder-251105.1.dist-info/RECORD +24 -0
- easycoder-251104.1.dist-info/RECORD +0 -19
- /easycoder/{close.png → icons/close.png} +0 -0
- /easycoder/{tick.png → icons/tick.png} +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/WHEEL +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/entry_points.txt +0 -0
- {easycoder-251104.1.dist-info → easycoder-251105.1.dist-info}/licenses/LICENSE +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_border.py
CHANGED
|
@@ -9,34 +9,38 @@ class Border(QWidget):
|
|
|
9
9
|
|
|
10
10
|
def __init__(self):
|
|
11
11
|
super().__init__()
|
|
12
|
-
self.
|
|
13
|
-
self.setFixedHeight(self.
|
|
12
|
+
self._size = 40
|
|
13
|
+
self.setFixedHeight(self._size)
|
|
14
14
|
self._drag_active = False
|
|
15
15
|
self._drag_start_pos = None
|
|
16
|
+
self._tick: QPixmap = QPixmap()
|
|
17
|
+
self._close_icon: QPixmap = QPixmap()
|
|
16
18
|
|
|
17
19
|
def paintEvent(self, event):
|
|
18
20
|
painter = QPainter(self)
|
|
19
|
-
painter.setRenderHint(QPainter.Antialiasing)
|
|
21
|
+
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
20
22
|
# Draw the tick icon
|
|
21
|
-
self.
|
|
23
|
+
self._tick = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/icons/tick.png').scaled(
|
|
24
|
+
self._size, self._size, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation)
|
|
22
25
|
x = 0
|
|
23
26
|
y = 0
|
|
24
|
-
painter.drawPixmap(x, y, self.
|
|
27
|
+
painter.drawPixmap(x, y, self._tick)
|
|
25
28
|
# Draw the close icon
|
|
26
|
-
self.
|
|
27
|
-
|
|
29
|
+
self._close_icon = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/icons/close.png').scaled(
|
|
30
|
+
self._size, self._size, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation)
|
|
31
|
+
x = self.width() - self._close_icon.width()
|
|
28
32
|
y = 0
|
|
29
|
-
painter.drawPixmap(x, y, self.
|
|
33
|
+
painter.drawPixmap(x, y, self._close_icon)
|
|
30
34
|
|
|
31
35
|
def mousePressEvent(self, event):
|
|
32
36
|
# Tick icon
|
|
33
37
|
x = 0
|
|
34
38
|
y = 0
|
|
35
|
-
tickRect = self.
|
|
39
|
+
tickRect = self._tick.rect().translated(x, y)
|
|
36
40
|
# Close icon
|
|
37
|
-
x = self.width() - self.
|
|
41
|
+
x = self.width() - self._close_icon.width()
|
|
38
42
|
y = 0
|
|
39
|
-
closeRect = self.
|
|
43
|
+
closeRect = self._close_icon.rect().translated(x, y)
|
|
40
44
|
if tickRect.contains(event.pos()):
|
|
41
45
|
self.tickClicked.emit()
|
|
42
46
|
if closeRect.contains(event.pos()):
|
easycoder/ec_classes.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
|
|
3
|
-
class FatalError:
|
|
3
|
+
class FatalError(BaseException):
|
|
4
4
|
def __init__(self, compiler, message):
|
|
5
5
|
compiler.showWarnings()
|
|
6
6
|
lino = compiler.tokens[compiler.index].lino
|
|
@@ -58,4 +58,9 @@ class Token:
|
|
|
58
58
|
self.token = token
|
|
59
59
|
|
|
60
60
|
class Object():
|
|
61
|
-
|
|
61
|
+
"""Dynamic object that allows arbitrary attribute assignment"""
|
|
62
|
+
def __setattr__(self, name: str, value) -> None:
|
|
63
|
+
self.__dict__[name] = value
|
|
64
|
+
|
|
65
|
+
def __getattr__(self, name: str):
|
|
66
|
+
return self.__dict__.get(name)
|
easycoder/ec_compiler.py
CHANGED
|
@@ -85,6 +85,7 @@ class Compiler:
|
|
|
85
85
|
|
|
86
86
|
# Add a command to the code list
|
|
87
87
|
def addCommand(self, command):
|
|
88
|
+
command['bp'] = False
|
|
88
89
|
self.code.append(command)
|
|
89
90
|
|
|
90
91
|
# Test if the current token is a symbol
|
|
@@ -191,7 +192,7 @@ class Compiler:
|
|
|
191
192
|
if not token:
|
|
192
193
|
return False
|
|
193
194
|
if len(self.code) == 0:
|
|
194
|
-
if self.program.parent == None and
|
|
195
|
+
if self.program.parent == None and self.program.usingGraphics:
|
|
195
196
|
cmd = {'domain': 'graphics', 'keyword': 'init', 'debug': False}
|
|
196
197
|
self.code.append(cmd)
|
|
197
198
|
mark = self.getIndex()
|
easycoder/ec_core.py
CHANGED
|
@@ -1771,15 +1771,8 @@ class Core(Handler):
|
|
|
1771
1771
|
return False
|
|
1772
1772
|
else:
|
|
1773
1773
|
token = self.nextToken()
|
|
1774
|
-
if token
|
|
1775
|
-
|
|
1776
|
-
print('Loading graphics module')
|
|
1777
|
-
from .ec_pyside import Graphics
|
|
1778
|
-
self.program.graphics = Graphics
|
|
1779
|
-
self.program.useClass(Graphics)
|
|
1780
|
-
self.program.usingGraphics = True
|
|
1781
|
-
if token == 'debugger': self.program.debugging = True
|
|
1782
|
-
return True
|
|
1774
|
+
if token == 'graphics':
|
|
1775
|
+
return self.program.useGraphics()
|
|
1783
1776
|
return False
|
|
1784
1777
|
|
|
1785
1778
|
# Declare a general-purpose variable
|