Imported Upstream version 0.0.9
authorPali Rohár <pali.rohar@gmail.com>
Fri, 22 Jun 2012 12:11:05 +0000 (14:11 +0200)
committerPali Rohár <pali.rohar@gmail.com>
Fri, 22 Jun 2012 12:11:05 +0000 (14:11 +0200)
debian/changelog
debian/control
debian/copyright
src/usr/lib/hildon-desktop/CallNotify.py

index de3866f..4967ff2 100644 (file)
@@ -1,5 +1,6 @@
-callnotify (0.0.8-1) stable; urgency=low
+callnotify (0.0.9-1) stable; urgency=low
 
-  * Add dependency for hildon-desktop-python-loader
+  * Fixed bug with float regional settings differences
+  * umask for configuration file sets write permissions for group and other.
 
- -- Omer Agmon <omeriko9@gmail.com>  Tue, 06 Apr 2010 18:03:26 +0000
+ -- Omer Agmon <omeriko9@gmail.com>  Thu, 08 Apr 2010 14:15:37 +0000
index 9bd9d9e..db2413a 100644 (file)
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
 
 Package: callnotify
 Architecture: armel
-Depends: python2.5, python2.5-osso, python2.5-dbus, python2.5-hildon, python2.5-gtk2, python2.5-hildondesktop, python-hildondesktop, hildon-desktop-python-loader
+Depends: python2.5, python2.5-osso, python2.5-dbus, python2.5-hildon, python2.5-gtk2, python2.5-hildondesktop, python-hildondesktop, hildon-desktop-python-loader, python-xml
 Description: Missed calls and SMS notifier.
  Will display a small status bar icon for missed Calls and SMS.
  The icon will disappear after closing the yellow notification or viewing the SMS.
index 25e0fb3..9dcb8ae 100644 (file)
@@ -1,5 +1,5 @@
 This package was py2debianized(0.5.3) by Omer Agmon <omeriko9@gmail.com> on
-Tue, 06 Apr 2010 18:03:26 +0000.
+Thu, 08 Apr 2010 14:15:37 +0000.
 
 It was downloaded from 
 
index 4fda0ab..2838f51 100755 (executable)
@@ -13,9 +13,10 @@ class CallNotify(hildondesktop.StatusMenuItem):
     def __init__(self):
                hildondesktop.StatusMenuItem.__init__(self)
                # Set members
-               self.Debug = False
                self.configDir = "/home/user/.config/CallNotify/"
                self.configFile = "conf.txt"
+               self.Debug = False
+               self.dbg("debugging started")
                self.readConfigurationFile()
                self.msgType = ""               
                self.toShow = True
@@ -61,25 +62,33 @@ class CallNotify(hildondesktop.StatusMenuItem):
 
     def checkForConfigFile(self):
                self.dbg('checkForConfigFile started')
+               os.umask(0)
                if not os.path.exists(self.configDir):
                        os.mkdir(self.configDir)
                if not os.path.exists(self.configDir+self.configFile):
-                       a = open(self.configDir+self.configFile,'w')
-                       a.write('y;y;y;5')
+                       a = open(self.configDir+self.configFile,'w+')
+                       a.write('y;y;y;5.0\n')
                        a.close()
+               # set proper permissions
+               os.system("chmod 766 " + self.configDir)
+               os.system("chmod 766" + self.configDir+self.configFile)
 
                 
     def readConfigurationFile(self):
-               self.dbg('readConfigurationFile started')
-               self.checkForConfigFile()
-               f = open(self.configDir+self.configFile, 'r')
-               raw_set = f.readline().rsplit(';')
-               self.visual = raw_set[0] in ('y')
-               self.sound = raw_set[1] in ('y')
-               self.vibration = raw_set[2] in ('y')
-               self.interval = float(raw_set[3])
-               f.close()
-                       
+               try:
+                       self.dbg('readConfigurationFile started')
+                       self.checkForConfigFile()
+                       f = open(self.configDir+self.configFile, 'r')
+                       raw_set = f.readline().rsplit(';')
+                       self.visual = raw_set[0] in ('y')
+                       self.sound = raw_set[1] in ('y')
+                       self.vibration = raw_set[2] in ('y')
+                       self.interval = float(raw_set[3].replace(',','.'))
+                       f.close()
+               except:
+                       os.remove(self.configDir+self.configFile)
+                       self.checkForConfigFile()
+       
     def saveConfigurationFile(self):
                self.dbg('saveConfigurationFile started')
                f = open(self.configDir+self.configFile, "w")
@@ -383,3 +392,13 @@ class CallNotify(hildondesktop.StatusMenuItem):
                
 hd_plugin_type = CallNotify
 
+
+# Uncomment from "if __name__..." to "gtk.main()" if running from CLI as:
+# "run-standalone.sh python CallNotify.py"
+
+#if __name__=="__main__":
+#              gobject.type_register(hd_plugin_type)
+#              obj = gobject.new(hd_plugin_type, plugin_id="plugid_id")
+#              obj.show_all()
+#              gtk.main()
+