def configure(self, data=None): if data is None: data = {} plugin.ensure_plugin_config_store_exist(PLUGIN_NAME) token = self.li.getRequestToken(None); data['token'] = token url = self.li.getAuthorizeUrl(token); data[plugin.PLUGIN_CONF_INFO] = "visit the provided url to authorize Zourite to access your LinkedIn account." \ " LinkedIn will give you a verifierNote the verifier number that Zourite will ask you for." data[plugin.PLUGIN_CONF_WEBBROWSER] = url data['verifier'] = None data[plugin.PLUGIN_CONF_STEP] = "VERIFIER" return data elif data[plugin.PLUGIN_CONF_STEP] == 'VERIFIER': verifier = int(data["verifier"]) token = data['token'] access_token = self.li.getAccessToken(token, verifier); try: access_token_file = open(plugin.get_plugin_file_location(PLUGIN_NAME,'li_access_token'),'wb'); pickle.dump(access_token,access_token_file) access_token_file.close() except IOError: logging.warning("the access token could not be saved") return {} else : raise plugin.ConfigurationRequiredExeption() # may raise a specific
def configure(self, data=None): ''' launch the configuration wizard ''' STEP_GMAIL_ACCOUNT = 'GMAIL_ACCOUNT' STEP_CONTACT_GROUP = 'STEP_CONTACT_GROUP' if data is None: data = {} plugin.ensure_plugin_config_store_exist(PLUGIN_NAME) # ask for user and password data['user'] = None data['password'] = None data[plugin.PLUGIN_CONF_INFO] = "Enter your gmail credentiel. The user must NOT include the @gmail.com part." data[plugin.PLUGIN_CONF_STEP] = STEP_GMAIL_ACCOUNT return data elif data[plugin.PLUGIN_CONF_STEP] == STEP_GMAIL_ACCOUNT : data['group'] = None data[plugin.PLUGIN_CONF_INFO] = "Contact group. Leave blanck to grab all contacts" data[plugin.PLUGIN_CONF_STEP] = STEP_CONTACT_GROUP return data elif data[plugin.PLUGIN_CONF_STEP] == STEP_CONTACT_GROUP : user = data['user'] password = data['password'] contact_group = data['group'] self.gmail_credential = self._configure_gmail_account(user, password, contact_group) return {}
def configure(self, data=None): ''' launch the configuration wizard ''' STEP_GMAIL_ACCOUNT = 'GMAIL_ACCOUNT' if data is None: data = {} plugin.ensure_plugin_config_store_exist(PLUGIN_NAME) # ask for user and password data['user'] = None data['password'] = None data[plugin.PLUGIN_CONF_INFO] = "Enter your gmail credentiel. The user must NOT include the @gmail.com part." data[plugin.PLUGIN_CONF_STEP] = STEP_GMAIL_ACCOUNT return data elif data[plugin.PLUGIN_CONF_STEP] == STEP_GMAIL_ACCOUNT : user = data['user'] password = data['password'] self.gmail_credential = self._configure_gmail_account(user, password) return {}
def configure(self): plugin.ensure_plugin_config_store_exist(PLUGIN_NAME) self.gmail_credential = self._configure_gmail_account()
def configure(self): plugin.ensure_plugin_config_store_exist(PLUGIN_NAME) access_token = self.generate_new_access_token();