Skip to content

Commit f2d13c8

Browse files
Kai Kreuzermariobodemann
Kai Kreuzer
authored andcommitted
adding Kais changes
1 parent 9bade04 commit f2d13c8

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

.configuration

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
emojis=🐔,🐶,😺,🌭,🦺
2-
font=quick sand
3-
event=5g eap 4.0
1+
emojis=t.png
2+
font=nimbussans
3+
event=T Phone Hackathon

badge.py

+18
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ def print(self, badge):
8989
except bluetooth.btcommon.BluetoothError:
9090
print("Bluetooth error, please try again")
9191

92+
def battery():
93+
if printer_mac:
94+
try:
95+
if not self.printer:
96+
print("New printer found")
97+
self.printer = ppa6.Printer(printer_mac)
98+
99+
if not self.printer.isConnected():
100+
print("Connecting to printer")
101+
self.printer.connect()
102+
103+
return self.printer.getDeviceBattery()
104+
except bluetooth.btcommon.BluetoothError:
105+
return -2
106+
107+
else:
108+
return -1
109+
92110

93111
def draw_centered_text(self, text, text_color, background_color, font, target, target_rect):
94112
target_width = (target_rect[2] - target_rect[0]) * 0.9

menu.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,10 @@ def user_start(self):
262262
continue
263263

264264
prompt(f"Thank you, {name}.")
265-
prompt(f"What is your favorite number?")
266-
prompt("", "you", False)
267-
number = input()
268-
269-
try:
270-
number = int(number) % len(self.emoji_list)
271-
except ValueError:
272-
number = random.randint(0, len(self.emoji_list)-1)
273265

274266
prompt(f"Creating your badge ...")
275267
try:
276-
emoji = self.emoji_list[number]
268+
emoji = self.emoji_list[0]
277269
except IndexError:
278270
emoji = self.emoji_list[0]
279271

t.png

12.9 KB
Loading

0 commit comments

Comments
 (0)