From 97b8bdf84e86ae52d085292df51ca9c9fd0a1655 Mon Sep 17 00:00:00 2001 From: fgau Date: Fri, 29 Aug 2008 21:29:30 +0000 Subject: [PATCH] add python foo with help from the master. autoscale for display is ... TODO: scrolling to left git-svn-id: http://www.neo1973-germany.de/svn@105 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/epydial.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/epydial/epydial.py b/epydial/epydial.py index aca9eb0..5c827aa 100755 --- a/epydial/epydial.py +++ b/epydial/epydial.py @@ -50,7 +50,6 @@ class MainScreen(EdjeGroup): def __init__(self, main): EdjeGroup.__init__(self, main, EDJE_GROUP_NAME) self.text = [] - self.pin_count = [] dbus_ml = e_dbus.DBusEcoreMainLoop() self.system_bus = SystemBus(mainloop=dbus_ml) @@ -115,23 +114,21 @@ class MainScreen(EdjeGroup): @edje.decorators.signal_callback("dialer_send", "*") def on_edje_signal_numberkey_triggered(self, emission, source): if self.res['code'] != 'READY': - if (len(self.text) < 4) and (source in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")): + if len(self.text) < 4 and '0'.isdigit(): self.text.append(source) - self.pin_count.append("*") print ''.join(self.text) - self.part_text_set("numberdisplay_text", "".join(self.pin_count)) + self.part_text_set("numberdisplay_text", '*' * len(self.text)) elif source == "backspace": self.text = self.text[:-1] - self.pin_count = self.pin_count[:-1] print ''.join(self.text) - self.part_text_set("numberdisplay_text", "".join(self.pin_count)) + self.part_text_set("numberdisplay_text", '*' * len(self.text)) elif source == "dial": print '---', 'send pin' self.part_text_set("numberdisplay_text", "register ...") self.keyring.Open(''.join(self.text), dbus_interface=DIN_KEYRING, ) self.nw_register() else: - if source in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "#", "*", ): + if source in '0'.isdigit(): self.text.append(source) print ''.join(self.text) self.part_text_set("numberdisplay_text", "".join(self.text))