Added osso-alike module for non-maemo systems
authorjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:35:09 +0000 (11:35 +0000)
committerjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:35:09 +0000 (11:35 +0000)
git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@36 c51dfc6a-5949-4919-9c8e-f207a149c383

MANIFEST
wifimap/osso_wrapper.py [new file with mode: 0644]
wifimap/wifiscan.py

index 5a61b67..ed825ae 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -6,5 +6,6 @@ wifiview.desktop
 wifimap/__init__.py
 wifimap/gps.py
 wifimap/wifiscan.py
+wifimap/osso_wrapper.py
 wifimap/db.py
 wifimap/config.py
diff --git a/wifimap/osso_wrapper.py b/wifimap/osso_wrapper.py
new file mode 100644 (file)
index 0000000..4f85cbd
--- /dev/null
@@ -0,0 +1,36 @@
+
+import dbus
+
+class Context :
+
+    def __init__ ( self , name , version , flag ) :
+        self.connection = dbus.SessionBus()
+        self.name = name
+        self.version = version
+
+    def get_connection ( self ) :
+        return self.connection
+
+class Rpc :
+
+    def __init__ ( self , context ) :
+        self.context = context
+
+#    def cosa ( self ) :
+#        gps.GPSObject.__init__( self , widget )
+#    #    self.osso_context = osso.Context("wifi_scanner", "2.0", False)
+#    #    osso_rpc = osso.Rpc(self.osso_context)
+#    #    scan_out = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "wakeup", wait_reply = True)
+#        scan_out = rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "wakeup", wait_reply = True)
+#        self._timer = None
+#        self._info = None
+#        self._status = None
+
+    def rpc_run ( self , object_name , object_path , object_iface , method , wait_reply=False ) :
+        connection = self.context.get_connection()
+        proxy = connection.get_object( object_name , object_path )
+        iface = dbus.Interface( proxy , object_iface )
+        iface = dbus.Interface( proxy , dbus_interface=object_iface )
+        callable = iface.get_dbus_method( method )
+        return callable()
+
index 98c33ee..97a7754 100644 (file)
@@ -1,5 +1,8 @@
 
-import osso
+try :
+    import osso
+except :
+    import osso_wrapper as osso
 
 import time