[tuxdroid-svn] r226 - svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment va
Status: Beta
Brought to you by:
ks156
From: svnlook:warning@affinitic.be:cannot s. L. l. <c2m...@c2...> - 2007-04-08 19:42:13
|
Author: svnlook: warning: cannot set LC_CTYPE locale Date: svnlook: warning: environment variable LANG is EN New Revision: 226 Modified: api/python/trunk/tuxapi_class.py Log: neimad 2007-04-08 21:41:43 +0200 (Sun, 08 Apr 2007) 209 * Make time_events_Thread() call time.localtime() only once when checking for event deadline. Still calls time.localtime() once per event in events_list. Maybe it should be called once for all events ? svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment variable LANG is EN svnlook: warning: please check that your locale name is correct Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-04-08 16:56:45 UTC (rev 225) +++ api/python/trunk/tuxapi_class.py 2007-04-08 19:41:43 UTC (rev 226) @@ -502,20 +502,22 @@ ## SYSTEM function #-------------------------------------------------------------------------- def time_events_Thread(self): + def event_due(event): + now = time.localtime() + return event[2] in [now[0], 9999] \ + and event[3] in [now[1], 99] \ + and event[4] in [now[2], 99] \ + and event[5] in [now[3], 99] \ + and event[6] in [now[4], 99] \ + and event[7] in [now[5], 99] while True: if self.parent.connected: for event in self.events_list: - if event[0]!=0: - if event[2]==9999 or event[2]==time.localtime()[0]: - if event[3]==99 or event[3]==time.localtime()[1]: - if event[4]==99 or event[4]==time.localtime()[2]: - if event[5]==99 or event[5]==time.localtime()[3]: - if event[6]==99 or event[6]==time.localtime()[4]: - if event[7]==99 or event[7]==time.localtime()[5]: - if event[0]==CT_SHELL: - self.shell_free(event[1]) - elif event[0]==CT_FUNCTION: - event[1]() + if event[0] != 0 and event_due(event): + if event[0] == CT_SHELL: + self.shell_free(event[1]) + elif event[0] == CT_FUNCTION: + event[1]() time.sleep(1) #============================================================================== |