Editing User:Nbc/W32g

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 114: Line 114:
   def is_on_call():
   def is_on_call():
       output = commands.getoutput(dbus_test_call)
       output = commands.getoutput(dbus_test_call)
-
       return "uint32 0" in output
+
       if (re.match(".*uint32 0", output)):
 +
          return True
 +
      return False
    
    
   def wait_or_exit_on_call():
   def wait_or_exit_on_call():
Line 121: Line 123:
       if choice > 0:
       if choice > 0:
           end = time.time() + choice
           end = time.time() + choice
-
           while end > time.time():
+
           while (end > time.time()):
               if is_on_call(): return
               if is_on_call(): return
-
               if debug: print "wait"
+
               if (debug): print "wait"
               time.sleep(1)
               time.sleep(1)
           sys.exit()
           sys.exit()
Line 130: Line 132:
            
            
   if state == 'CONNECTED':
   if state == 'CONNECTED':
-
       if debug: print "CONNECTED STATE"
+
       if (debug): print "CONNECTED STATE"
       # we verified that the connection works
       # we verified that the connection works
       if config['connection_test']:
       if config['connection_test']:
Line 145: Line 147:
    
    
   elif state == 'IDLE' and config['change_on_idle']:
   elif state == 'IDLE' and config['change_on_idle']:
-
       if debug: print "IDLE STATE"
+
       if (debug): print "IDLE STATE"
       dual = "2"
       dual = "2"
       if config['change_to_dual']: dual = "0"
       if config['change_to_dual']: dual = "0"

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)