A Diumenge, 4 de d'abril de 2010 09:35:25, Thomas Zimmermann va escriure:
> > Hi, see http://shr-project.org/trac/ticket/1040


As Gerhard Rieger said the bug is on busybox but this patch makes it work with 
coreutils and busybox.

We don't need the year part (shr-settings code only changes the time of the day)
and both dates accept MMddhhmm.ss as a valid time.

I have just tested it on a live system :P

--- /usr/lib/python2.6/site-packages/shr_settings_modules/shr_clock.py.old      
Wed Apr  7 11:48:09 2010
+++ /usr/lib/python2.6/site-packages/shr_settings_modules/shr_clock.py  Thu Apr 
 8 09:20:02 2010
@@ -31,7 +31,8 @@
     def clockset(self, obj, *args, **kargs):
            if self.editable:
                 now = datetime.datetime.now()
-                os.system("date 
"+str(now.year)+str(now.month).zfill(2)+str(now.day).zfill(2)+str(self.cl.time_get()[0]).zfill(2)+str(self.cl.time_get()[1]).zfill(2)+"."+str(self.cl.time_get()[2]).zfill(2))
+                #use a format valid for busybox and coreutils "date 
MMDDhhmm.ss"
+                os.system("date 
"+str(now.month).zfill(2)+str(now.day).zfill(2)+str(self.cl.time_get()[0]).zfill(2)+str(self.cl.time_get()[1]).zfill(2)+"."+str(self.cl.time_get()[2]).zfill(2))
                 self.cl.edit_set(False)
                 obj.label_set(_("Set time"))
                 self.editable = False
_______________________________________________
Shr-User mailing list
[email protected]
http://lists.shr-project.org/mailman/listinfo/shr-user

Reply via email to