Пример #1
0
 def authenticate(self):
     # if this is first run open settings
     self.openSettings()
     # authentication is not permanent, so do this only when first launching plugin
     if (not sys.argv[2]):
         # get the users settings
         password = xbmcplugin.getSetting("user_password")
         # we can only authenticate if both email and password are entered
         if (self.email and password):
             # our client api
             from PicasaAPI.PicasaClient import PicasaClient
             client = PicasaClient()
             # make the authentication call
             authkey = client.authenticate(self.email, password)
             # if authentication succeeded, save it for later
             if (authkey):
                 xbmcplugin.setSetting("authkey", authkey)
 def authenticate( self ):
     # if this is first run open settings
     self.openSettings()
     # authentication is not permanent, so do this only when first launching plugin
     if ( not sys.argv[ 2 ] ):
         # get the users settings
         password = xbmcplugin.getSetting( "user_password" )
         # we can only authenticate if both email and password are entered
         if ( self.email and password ):
             # our client api
             from PicasaAPI.PicasaClient import PicasaClient
             client = PicasaClient()
             # make the authentication call
             authkey = client.authenticate( self.email, password )
             # if authentication succeeded, save it for later
             if ( authkey ):
                 xbmcplugin.setSetting( "authkey", authkey )