Exemple #1
0
 def h_authorize(self, _):
     """
     Bus message handler
     """
     ahandler=AuthResponseAgent()
     Bus.publish(self, "method_call", {"method":"auth.getToken"}, 
                 {"c":ahandler.h_apicb, "e":ahandler.h_apieb})
Exemple #2
0
 def on_cenable_toggled(self, wcenable):
     """
     DBus API enable checkbox
     """
     state=wcenable.props.active
     Bus.publish(self, "user_params", {"dbus_enable": str(state)})
     return True
Exemple #3
0
 def h_apieb(self, response):
     """
     API response errback
     """
     _,code, msg=response
     tcode=self._msgTable.get(code, "unknown")
     Bus.publish(self, "error", tcode)
     Bus.publish(self, "log", "Authorization error, code(%s) msg(%s)" % (code, msg))
Exemple #4
0
 def _publishParams(self, params={}):
     """
     Publish any change
     """
     for param in self._paramsList:
         wgt=self.builder.get_object("e%s"%param)
         value=wgt.get_text()
         params[param]=value
     Bus.publish(self, "user_params", params)
Exemple #5
0
 def on_bauth_clicked(self, wbauth):
     Bus.publish(self, "authorize")
     return True
Exemple #6
0
 def show(self):
     Bus.publish(self, "user_params?")
     self.bapply.props.sensitive=False 
     self.window.present()
Exemple #7
0
 def gatePublish(self, *pa):
     if self._enable:
         Bus.publish(self, *pa)        
Exemple #8
0
 def __init__(self):
     bus_name = dbus.service.BusName('fm.lastfm.api', bus=dbus.SessionBus())
     dbus.service.Object.__init__(self, bus_name, '/account')
     self._cache={}
     self._enable=False
     Bus.publish(self, "user_params?")