From 98f2a4ffc9f5987cd0ea3cda245a8bbf2c5ee97b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 13 Dec 2013 18:42:31 +1100 Subject: [PATCH] dialer.py - minor cosmetic things remove some white space 'changed' should expect an arg, because it gets one --- utils/dialer.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/utils/dialer.py b/utils/dialer.py index faa29ef..e1dfeef 100644 --- a/utils/dialer.py +++ b/utils/dialer.py @@ -13,7 +13,7 @@ # Number, or DTMF send # Name/number (time-of-call) # Keypad: -# +# # 1 2 3 BS # 4 5 6 BS # 7 8 9 Ca @@ -54,7 +54,6 @@ def recall(key): l = "" return l.strip() - sel_number = None clips = {} def clip_get_data(clip, sel, info, data): @@ -76,7 +75,6 @@ def send_number(sel, num): c.set_with_data([(gtk.gdk.SELECTION_TYPE_STRING, 0, 0)], clip_get_data, clip_clear_data, None) - class Dialer(gtk.Window): def __init__(self): gtk.Window.__init__(self) @@ -258,6 +256,9 @@ class Dialer(gtk.Window): self.cb.set_with_data(self.targets, self.get, self.got_clip, None) self.present() + def get(self, sel,deldata, info, data): + seldata.set_text("Number Please") + def incoming(self, num): self.BS.child.set_text("En") @@ -286,9 +287,6 @@ class Dialer(gtk.Window): n = recall('incoming') self.set_incoming(n) - def get(self, sel, info, data): - sel.set_text("Number Please") - def check_status(self, f): l = recall('status') if l == 'INCOMING': @@ -319,7 +317,6 @@ class Dialer(gtk.Window): self.nfont_size = s self.num.modify_font(self.nfont) - def check_callee_font(self): n = self.callee.get_text() l = len(n) @@ -334,7 +331,6 @@ class Dialer(gtk.Window): self.cfont_size = s self.callee.modify_font(self.cfont) - def makecall(self): n = self.num.get_text() self.num.select_region(0,-1) @@ -380,7 +376,6 @@ class Dialer(gtk.Window): def do_dtmf(self, ch): record('dtmf',ch) - import dnotify class incoming_list: # present as a list of received calls @@ -392,7 +387,7 @@ class incoming_list: self.notify = notify self.watch = dnotify.dir("/var/log") self.fwatch = self.watch.watch(file, self.changed) - self.changed() + self.changed(None) def __len__(self): return len(self.list) def __getitem__(self, ind): @@ -400,7 +395,7 @@ class incoming_list: def flush_one(self, start, end, number): if start: self.lst.append((start, end, number)) - def changed(self): + def changed(self, f1): self.lst = [] try: @@ -439,7 +434,7 @@ class outgoing_list(incoming_list): def __init__(self, notify = None): incoming_list.__init__(self, notify, file='outgoing') - def changed(self): + def changed(self, f1): self.lst = [] try: f = open("/var/log/outgoing") @@ -468,7 +463,5 @@ class outgoing_list(incoming_list): if self.notify: self.notify() - - o = Dialer() gtk.main() -- 2.39.5