0.1.7 release
[ussd-widget] / ussd-widget / src / usr / lib / hildon-desktop / ussd-widget.py
index 79c92d3..3fbe088 100755 (executable)
@@ -14,6 +14,7 @@ import fcntl
 import dbus
 import subprocess
 import gsmdecode
+import sys
 from dbus.mainloop.glib import DBusGMainLoop
 
 try :
@@ -876,6 +877,7 @@ def smart_split_string (str, reply1, reply2, reres1 = None, reres2 = None) :
                                                word += reply1
                                ws = 0
                                num = -1
+                               subst = ''
                                # Delete backslash if it delimites usual numbers from % or &
                                if str[i] == '\\' and i < len(str)-1 and str[i+1] in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] :
                                        continue
@@ -1075,8 +1077,16 @@ hd_plugin_type = UssdWidgetPlugin
 # The code below is just for testing purposes.
 # It allows to run the widget as a standalone process.
 if __name__ == "__main__":
+       plugin_id = "ussd-widget.console"
+       if len(sys.argv) == 2:
+               try:
+                       plugin_id = "ussd-widget.desktop-"+str(int(sys.argv[1]))
+               except:
+                       print "Plugin id must be integer"
+                       sys.exit(-1)
+
        import gobject
        gobject.type_register(hd_plugin_type)
-       obj = gobject.new(hd_plugin_type, plugin_id="plugin_id")
+       obj = gobject.new(hd_plugin_type, plugin_id=plugin_id)
        obj.show_all()
        gtk.main()