Added osso-alike module for non-maemo systems
[wifihood] / wifimap / osso_wrapper.py
1
2 import dbus
3
4 class Context :
5
6     def __init__ ( self , name , version , flag ) :
7         self.connection = dbus.SessionBus()
8         self.name = name
9         self.version = version
10
11     def get_connection ( self ) :
12         return self.connection
13
14 class Rpc :
15
16     def __init__ ( self , context ) :
17         self.context = context
18
19 #    def cosa ( self ) :
20 #        gps.GPSObject.__init__( self , widget )
21 #    #    self.osso_context = osso.Context("wifi_scanner", "2.0", False)
22 #    #    osso_rpc = osso.Rpc(self.osso_context)
23 #    #    scan_out = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "wakeup", wait_reply = True)
24 #        scan_out = rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "wakeup", wait_reply = True)
25 #        self._timer = None
26 #        self._info = None
27 #        self._status = None
28
29     def rpc_run ( self , object_name , object_path , object_iface , method , wait_reply=False ) :
30         connection = self.context.get_connection()
31         proxy = connection.get_object( object_name , object_path )
32         iface = dbus.Interface( proxy , object_iface )
33         iface = dbus.Interface( proxy , dbus_interface=object_iface )
34         callable = iface.get_dbus_method( method )
35         return callable()
36