Skip to content

Commit 4edfbe8

Browse files
committed
v250111.1
1 parent 6afcad2 commit 4edfbe8

File tree

12 files changed

+17
-12
lines changed

12 files changed

+17
-12
lines changed
35.1 KB
Binary file not shown.
2.74 MB
Binary file not shown.

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
from .ec_timestamp import *
1111
from .ec_value import *
1212

13-
__version__ = "250110.1"
13+
__version__ = "250111.1"

easycoder/ec_program.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Program:
1818

1919
def __init__(self, argv):
2020
global queue
21+
print(f'EasyCoder version {version("easycoder")}')
2122
if len(argv) == 0:
2223
print('No script supplied')
2324
exit()
@@ -106,7 +107,7 @@ def processClasses(self):
106107
handler = clazz(self.compiler)
107108
self.domains.append(handler)
108109
self.domainIndex[handler.getName()] = handler
109-
110+
110111
# Get the domain list
111112
def getDomains(self):
112113
return self.domains
@@ -278,7 +279,7 @@ def tokenise(self, script):
278279
script.tokens.append(Token(lino, token))
279280
token = ''
280281
return
281-
282+
282283
def releaseParent(self):
283284
if self.parent.waiting and self.parent.program.running:
284285
self.parent.waiting = False
@@ -288,7 +289,7 @@ def releaseParent(self):
288289
def flush(self, pc):
289290
global queue
290291
self.pc = pc
291-
while True:
292+
while self.running:
292293
command = self.code[self.pc]
293294
domainName = command['domain']
294295
if domainName == None:
@@ -323,7 +324,7 @@ def run(self, pc):
323324
item.program = self
324325
item.pc = pc
325326
queue.append(item)
326-
327+
327328
def kill(self):
328329
self.running = False
329330

@@ -374,7 +375,7 @@ def compare(self, value1, value2):
374375
if v1 < v2:
375376
return -1
376377
return 0
377-
378+
378379
# Set up a message handler
379380
def onMessage(self, pc):
380381
self.onMessagePC = pc
@@ -386,7 +387,6 @@ def handleMessage(self, message):
386387

387388
# This is the program launcher
388389
def Main():
389-
print(f'EasyCoder version {version("easycoder")}')
390390
if (len(sys.argv) > 1):
391391
Program(sys.argv[1]).start()
392392
else:

plugins/ec_keyboard.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def r_render(self, command):
9999
else: count += 1.0
100100
if count > max: max = count
101101
# Divide the keyboard width by the number of buttons to get the button size
102-
# The basic key is always a square
102+
# The basic key is a square (1:1)
103103
bs = w / max
104104
# Compute the keyboard height
105105
h = bs * nrows
@@ -114,6 +114,7 @@ def r_render(self, command):
114114
spec['height'] = h
115115
buttons = []
116116
list = []
117+
spans = [0] * nrows
117118
by = h
118119
for r in range(0, nrows):
119120
by -= bs
@@ -134,6 +135,11 @@ def r_render(self, command):
134135
buttons.append(button)
135136
list.append(id)
136137
bx += width
138+
spans[r] = round(bx)
139+
# Check the rows are all the same length
140+
for r in range(1, nrows):
141+
if spans[r] != spans[0]:
142+
RuntimeError(self.program, f'Row {r} has a different span to previous row(s)')
137143
spec['#'] = list
138144
for n in range(0, len(list)):
139145
spec[list[n]] = buttons[n]

plugins/keyboards/qwerty.json renamed to plugins/keyboards/qwerty-0.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
[
32
{
43
"face": "plugins/keyboards/qwerty-0.png",

plugins/keyboards/qwerty-0.png

-4.12 KB
Loading

plugins/keyboards/qwerty-1.png

133 KB
Loading

plugins/keyboards/qwerty-2.png

151 KB
Loading

plugins/keyboards/qwerty-3.png

141 KB
Loading

0 commit comments

Comments
 (0)