Fix bug to be able to run widget as standalone application
authorandrei1089 <andrei.mirestean@gmail.com>
Thu, 11 Feb 2010 22:16:05 +0000 (00:16 +0200)
committerandrei1089 <andrei.mirestean@gmail.com>
Thu, 11 Feb 2010 22:16:05 +0000 (00:16 +0200)
Logger was not yet initialized so an exception was thrown when the
widget was started as a standalone application

src/usr/lib/hildon-desktop/pedometer_widget_home.py

index 1251cdc..1bb81c0 100644 (file)
@@ -1512,16 +1512,6 @@ class PedometerHomePlugin(hildondesktop.HomePluginItem):
 
 hd_plugin_type = PedometerHomePlugin
 
-# The code below is just for testing purposes.
-# It allows to run the widget as a standalone process.
-if __name__ == "__main__":
-    import gobject
-    gobject.type_register(hd_plugin_type)
-    obj = gobject.new(hd_plugin_type, plugin_id="plugin_id")
-    obj.show_all()
-    gtk.main()
-
-############### old pedometer.py ###
 import math
 import logging
 
@@ -1533,3 +1523,11 @@ formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(messag
 ch.setFormatter(formatter)
 logger.addHandler(ch)
 
+# The code below is just for testing purposes.
+# It allows to run the widget as a standalone process.
+if __name__ == "__main__":
+    import gobject
+    gobject.type_register(hd_plugin_type)
+    obj = gobject.new(hd_plugin_type, plugin_id="plugin_id")
+    obj.show_all()
+    gtk.main()