def __init__(self, backup,*args, **kw): Fuse.__init__(self, *args, **kw) config = Config() self.provider = Provider.getInstance('Virgin Media', config) resulttype, result = self.provider.login( config.username, config.password, backup ) if resulttype != "ERROR": print 'Init complete.' else: print result[0]['message']
def loginSubmit(self): self.loginButton.setEnabled(False) global backupInstance, config backupInstance = Provider.getInstance( self.providerBox.currentText(), config ) resulttype, result = backupInstance.login( str(self.usernameEdit.text()), str(self.passwordEdit.text()), config.backupName ) if resulttype != "ERROR": # success self.hide() global mainwin, choosebackuplocation choosebackuplocation = BackupLocationWindow() choosebackuplocation.show() mainwin = choosebackuplocation else: KMessageBox.error(None, result[0]['message']) self.loginButton.setEnabled(True)