def get_note_store(auth_token=None): if not auth_token: auth_token = get_auth_token() user_store_uri = "https://" + HOST + "/edam/user" user_store_http_client = THttpClient.THttpClient(user_store_uri, http_proxy=get_proxy_config(urlparse(user_store_uri).scheme)) user_store_protocol = TBinaryProtocol.TBinaryProtocol(user_store_http_client) user_store = UserStore.Client(user_store_protocol) note_store_url = user_store.getNoteStoreUrl(auth_token) note_store_http_client = THttpClient.THttpClient(note_store_url, http_proxy=get_proxy_config(urlparse(note_store_url).scheme)) note_store_protocol = TBinaryProtocol.TBinaryProtocol(note_store_http_client) return NoteStore.Client(note_store_protocol)
def get_note_store(auth_token=None): if not auth_token: auth_token = get_auth_token() user_store = get_user_store(auth_token) note_store_url = user_store.getNoteStoreUrl(auth_token) note_store_http_client = THttpClient.THttpClient(note_store_url, http_proxy=get_proxy_config(urlparse(note_store_url).scheme)) note_store_protocol = TBinaryProtocol.TBinaryProtocol(note_store_http_client) return NoteStore.Client(note_store_protocol)
def get_note_store(auth_token=None): if not auth_token: auth_token = get_auth_token() user_store = get_user_store(auth_token) note_store_url = user_store.getNoteStoreUrl(auth_token) note_store_http_client = THttpClient.THttpClient( note_store_url, http_proxy=get_proxy_config(urlparse(note_store_url).scheme)) note_store_protocol = TBinaryProtocol.TBinaryProtocol( note_store_http_client) return NoteStore.Client(note_store_protocol)
def get_oauth_proxy(scheme): proxy = get_proxy_config(scheme) if proxy is None: return None proxy = urlparse.urlparse(proxy) return ProxyInfo( proxy_type=PROXY_TYPE_HTTP, proxy_host=proxy.hostname, proxy_port=proxy.port, proxy_user=proxy.username or None, proxy_pass=proxy.password or None, )