def getStaticContactList(): contacts_to_get_too = os.path.join(OPT.files_dir, 'contacts_to_get_too') if os.path.exists(contacts_to_get_too): content = readFile(contacts_to_get_too) return filter(lambda line: '@' in line, content.split('\n')) return []
def loadToken(api, token_file): token = None # try to read the token file token = readFile(token_file) # check if the token is still ok if token: token = checkToken(api, token) # if we don't have any token, we generate one if not token: token = getToken(api, token_file) return token