コード例 #1
0
ファイル: auth_agent.py プロジェクト: jldupont/dbus_lastfm
 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})
コード例 #2
0
ファイル: config.py プロジェクト: jldupont/dbus_lastfm
 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
コード例 #3
0
ファイル: auth_agent.py プロジェクト: jldupont/dbus_lastfm
 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))
コード例 #4
0
ファイル: config.py プロジェクト: jldupont/dbus_lastfm
 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)
コード例 #5
0
ファイル: config.py プロジェクト: jldupont/dbus_lastfm
 def on_bauth_clicked(self, wbauth):
     Bus.publish(self, "authorize")
     return True
コード例 #6
0
ファイル: config.py プロジェクト: jldupont/dbus_lastfm
 def show(self):
     Bus.publish(self, "user_params?")
     self.bapply.props.sensitive=False 
     self.window.present()
コード例 #7
0
ファイル: account.py プロジェクト: jldupont/dbus_lastfm
 def gatePublish(self, *pa):
     if self._enable:
         Bus.publish(self, *pa)        
コード例 #8
0
ファイル: account.py プロジェクト: jldupont/dbus_lastfm
 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?")