From fe923aea9c5b2354d5dd9ea908128bb3311546b5 Mon Sep 17 00:00:00 2001 From: Alexey Guseynov Date: Fri, 11 May 2012 17:31:23 +0400 Subject: [PATCH] Fix logging --- ussd-widget/build_ussd-widget.py | 2 +- .../src/usr/lib/hildon-desktop/ussd-widget.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ussd-widget/build_ussd-widget.py b/ussd-widget/build_ussd-widget.py index 35b47bd..11af6bf 100644 --- a/ussd-widget/build_ussd-widget.py +++ b/ussd-widget/build_ussd-widget.py @@ -38,7 +38,7 @@ chmod 666 /var/log/ussd-widget.log p.postrm="""#!/bin/sh rm /var/log/ussd-widget.log """ - version = "0.1.13" + version = "0.1.14" build = "0" changeloginformation = "Writable log. Create log file on installation." diff --git a/ussd-widget/src/usr/lib/hildon-desktop/ussd-widget.py b/ussd-widget/src/usr/lib/hildon-desktop/ussd-widget.py index bdd95eb..f586fba 100755 --- a/ussd-widget/src/usr/lib/hildon-desktop/ussd-widget.py +++ b/ussd-widget/src/usr/lib/hildon-desktop/ussd-widget.py @@ -26,8 +26,9 @@ from dbus.mainloop.glib import DBusGMainLoop # Would be truncated on every reboot, and shouldn't write # anythong if things go right way so it is OK not to have logrotate -log = open("/var/log/ussd-widget.log", "w") +log = open("/var/log/ussd-widget.log", "w", 0) print >> sys.stderr, "Writing log to /var/log/ussd-widget.log" +sys.stderr = log try : t = gettext.translation('ussd-widget', '/usr/share/locale') @@ -407,12 +408,12 @@ class USSD_Controller: stderr=subprocess.PIPE) process.stdin.close() gobject.io_add_watch( - p.stdout, gobject.IO_IN | gobject.IO_PRI | gobject.IO_HUP | gobject.IO_ERR, + process.stdout, gobject.IO_IN | gobject.IO_PRI | gobject.IO_HUP | gobject.IO_ERR, self.callback_ussd_data, process) self.error_message = ""; gobject.io_add_watch( - p.stderr, gobject.IO_IN | gobject.IO_PRI | gobject.IO_HUP | gobject.IO_ERR, + process.stderr, gobject.IO_IN | gobject.IO_PRI | gobject.IO_HUP | gobject.IO_ERR, self.callback_ussd_error) def ussd_renew(self, widget, event): @@ -446,7 +447,7 @@ class USSD_Controller: sms_reply = self.sms_reply.strip() if reply == "" or self.config[15] and sms_reply == "" : - self.widget.error = 1 + self.widget.error = 1 self.widget.set_text (_("Error"), 5000) if self.retry_state == len(self.config[7]): self.retry_version += 1 @@ -864,7 +865,7 @@ class UssdConfigDialog(gtk.Dialog): return self.font = pango.FontDescription (fontDialog.get_font_name()) - fontDialog.destroy() + fontDialog.destroy() def show_box_changed (self, event): if self.show_box.get_active(): @@ -934,7 +935,7 @@ def smart_split_string (str, reply1, reply2, reres1 = None, reres2 = None) : word = "" else : word += str[i] - bs = 0 + bs = 0 if subst == '&': if reres2 != None and num != 0 and num != -1: -- 1.7.9.5