Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TryFinally body Expr Call AttributeLoad NameLoad attr NameLoad Expr Yield NameLoad finalbody If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore NameLoad Return Call NameLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict If BoolOpAnd NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore NameLoad If NameLoad body If CompareEq NameLoad NameLoad body Assign NameStore NameLoad orelse Raise Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpAdd NameLoad AttributeLoad NameLoad attr attr Return Dict Str Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpAdd AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Dict Str Str NameLoad Str If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Dict If AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr orelse Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Return SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore IfExp NameLoad Call NameLoad NameLoad Dict Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Break orelse If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr orelse Raise Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If NameLoad body Raise Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body FunctionDef arguments args defaults body Return Call NameLoad NameLoad NameLoad decorator_list Assign NameStore Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body With Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Return AttributeLoad NameLoad attr decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A Wrapper to call Phabricator's Conduit API. __future__ absolute_import __future__ division __future__ print_function N/A contextlib N/A hashlib N/A json N/A logging N/A time N/A urllib N/A urllib2 N/A urlparse N/A phldef_conduit N/A phlsys_multiprocessing N/A _URLLIB_TIMEOUT 600 act_as_user_context N/A N/A conduit user N/A N/A N/A Manage the context of impersonating another user.

    Restore the original act_as_user_context value when the context expires
    or if an exception is raised.  The context manager itself is exception
    neutral.

    Usage Example:
        # Impersonate alice
        conduit = make_phab_example_conduit()
        with act_as_user_context(conduit, 'alice'):            conduit("user.whoami")["userName"]
        u'alice'

        # Impersonate bob
        conduit = make_phab_example_conduit()
        with act_as_user_context(conduit, 'bob'):            conduit("user.whoami")["userName"]
        u'bob'

        # Impersonate bob, revert to phab when context expires
        conduit = make_phab_example_conduit()
        with act_as_user_context(conduit, 'bob'): pass
        conduit("user.whoami")["userName"]
        u'phab'

     N/A prevUser N/A N/A conduit get_act_as_user N/A N/A N/A N/A N/A conduit set_act_as_user user N/A N/A conduit N/A N/A prevUser N/A N/A N/A N/A conduit set_act_as_user prevUser N/A N/A N/A N/A conduit clear_act_as_user N/A N/A contextlib contextmanager make_conduit_uri N/A N/A uri N/A N/A N/A Return the expected conduit uri based on the supplied 'uri'.

    Usage examples:
        >>> make_conduit_uri('http://127.0.0.1')
        'http://127.0.0.1/api/'

        >>> make_conduit_uri('http://127.0.0.1/')
        'http://127.0.0.1/api/'

        >>> make_conduit_uri('http://127.0.0.1/conduit/')
        'http://127.0.0.1/api/'

    :uri: a uri to the Phabricator instance
    :returns: the expected conduit uri

     N/A url N/A N/A urlparse urlparse uri N/A expected N/A N/A N/A N/A url scheme :// N/A url netloc /api/ N/A expected N/A make_phab_example_conduit N/A N/A N/A N/A N/A Return a new Conduit constructed from phldef_conduit test_uri and phab.

    :returns: a new Conduit constructed from phldef_conduit test_uri and phab

     N/A test_data phldef_conduit N/A N/A Conduit N/A test_data TEST_URI N/A N/A test_data PHAB user N/A N/A test_data PHAB certificate N/A ConduitException N/A Exception N/A __init__ N/A N/A self method error errormsg result obj uri actAsUser N/A N/A N/A Construct from an error returned by conduit.

        :method: the conduit method that was being called
        :error: the type of error
        :message: the error message
        :response: the response field (expected to be empty)
        :obj: the object that was passed to conduit
        :uri: the URI to conduit
        :actAsUser: user that was being impersonated or None

         N/A message N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A phlsys_conduit.Conduit
 method: ' N/A str method '
 error: ' N/A str error '
 errormsg: ' N/A str errormsg '
 result: ' N/A str result '
 object: ' N/A str obj '
 uri: ' N/A str uri '
 actAsUser: ' N/A str actAsUser '
 N/A N/A N/A N/A super ConduitException self __init__ message N/A N/A self method method N/A N/A self error error N/A N/A self errormsg errormsg N/A N/A self result result N/A N/A self obj obj N/A N/A self uri uri N/A N/A self actAsUser actAsUser N/A N/A N/A SESSION_ERROR ERR-INVALID-SESSION N/A CONDUITPROXY_ERROR_CONNECT CONDUITPROXY-ERR-REDUNDANT-CONNECT N/A CONDUITPROXY_ERROR_BADAUTH CONDUITPROXY-ERR-BADAUTH Conduit N/A object N/A N/A testUri N/A phldef_conduit TEST_URI __init__ N/A N/A self conduitUri user certificate actAsUser http_proxy https_proxy N/A None None None None None N/A N/A N/A self _conduit_uri conduitUri N/A N/A self _act_as_user actAsUser N/A N/A self _timeout 5 N/A N/A self _username user N/A N/A self _certificate certificate N/A N/A self _client phlsys_conduit N/A N/A self _client_version 1 N/A N/A self _http_proxy http_proxy N/A N/A self _https_proxy https_proxy N/A N/A self _conduit N/A N/A N/A user certificate N/A N/A N/A N/A self _authenticate N/A set_act_as_user N/A N/A self user N/A N/A N/A N/A self _act_as_user user N/A N/A N/A self _conduit N/A actAsUser N/A self _act_as_user N/A clear_act_as_user N/A N/A self N/A N/A N/A N/A self _act_as_user None N/A N/A N/A self _conduit N/A actAsUser N/A get_act_as_user N/A N/A self N/A N/A N/A N/A self _act_as_user N/A conduit_uri N/A N/A self N/A N/A N/A N/A self _conduit_uri N/A property _authenticate N/A N/A self N/A N/A N/A message_dict N/A N/A self _authenticate_make_message N/A method conduit.connect N/A response N/A N/A self _communicate method message_dict N/A error N/A response N/A error_code N/A error_message N/A response N/A error_info N/A result N/A response N/A result N/A is_conduitproxy False N/A error N/A N/A N/A error CONDUITPROXY_ERROR_CONNECT N/A N/A is_conduitproxy True N/A N/A N/A ConduitException method method error error errormsg error_message result result obj message_dict uri N/A self _conduit_uri actAsUser N/A self _act_as_user N/A is_conduitproxy N/A N/A N/A self _conduit N/A user cert N/A self _username N/A self _certificate N/A N/A N/A self _conduit N/A sessionKey connectionID N/A result N/A sessionKey N/A result N/A connectionID N/A N/A self _act_as_user N/A N/A N/A N/A self _conduit N/A actAsUser N/A self _act_as_user N/A _authenticate_make_message N/A N/A self N/A N/A N/A token N/A str N/A int N/A N/A time time N/A signature N/A N/A N/A N/A hashlib sha1 N/A token N/A self _certificate hexdigest N/A N/A user host client clientVersion authToken authSignature N/A self _username N/A self _conduit_uri N/A self _client N/A self _client_version token signature N/A _communicate N/A N/A self method message_dict N/A N/A N/A path N/A N/A self _conduit_uri method N/A params N/A N/A json dumps message_dict N/A body N/A N/A urllib urlencode N/A params output params json N/A N/A N/A self _https_proxy N/A self _http_proxy N/A N/A proxy N/A N/A N/A self _https_proxy N/A N/A N/A proxy N/A https N/A self _https_proxy N/A N/A self _http_proxy N/A N/A N/A proxy N/A http N/A self _http_proxy N/A proxy_handler N/A N/A urllib2 ProxyHandler proxy N/A opener N/A N/A urllib2 build_opener proxy_handler N/A data N/A N/A N/A N/A opener open path body _URLLIB_TIMEOUT read N/A N/A data N/A N/A N/A N/A urllib2 urlopen path body _URLLIB_TIMEOUT read N/A N/A N/A json loads data N/A __call__ N/A N/A self method param_dict_in N/A None N/A N/A N/A N/A N/A self raw_call method param_dict_in N/A result N/A raw_call N/A N/A self method param_dict_in N/A None N/A N/A attempts 3 N/A x N/A range attempts N/A N/A param_dict N/A param_dict_in N/A dict param_dict_in N/A N/A N/A param_dict N/A __conduit__ N/A self _conduit N/A response N/A N/A self _communicate method param_dict N/A error N/A response N/A error_code N/A error_message N/A response N/A error_info N/A result N/A response N/A result N/A N/A error N/A N/A N/A N/A N/A error SESSION_ERROR N/A N/A N/A N/A logging warning N/A N/A phlsys_conduit: SESSION-ERROR (try {0}) format x N/A N/A N/A self _authenticate N/A N/A N/A ConduitException method method error error errormsg error_message result result obj param_dict uri N/A self _conduit_uri actAsUser N/A self _act_as_user N/A error N/A N/A N/A ConduitException method method error error errormsg error_message result result obj param_dict uri N/A self _conduit_uri actAsUser N/A self _act_as_user N/A response N/A ping N/A N/A self N/A N/A N/A N/A self conduit.ping N/A N/A MultiConduit N/A object N/A N/A A conduit that supports multi-processing. __init__ N/A N/A self N/A args kwargs N/A factory N/A N/A N/A N/A N/A N/A Conduit args kwargs N/A N/A max_sessions_per_user 5 N/A N/A self _conduits N/A N/A phlsys_multiprocessing MultiResource max_sessions_per_user factory N/A call_as_user N/A N/A self user N/A args kwargs N/A N/A N/A N/A N/A self _conduits resource_context conduit N/A N/A N/A act_as_user_context conduit user N/A N/A N/A conduit args kwargs N/A __call__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A self _conduits resource_context conduit N/A N/A N/A conduit args kwargs N/A conduit_uri N/A N/A self N/A N/A N/A N/A N/A N/A self _conduits resource_context conduit N/A N/A N/A conduit conduit_uri N/A property N/A CallMultiConduitAsUser N/A object N/A N/A A proxy for calling a MultiConduit as a particular user. __init__ N/A N/A self conduit as_user N/A N/A N/A N/A N/A N/A super CallMultiConduitAsUser self __init__ N/A N/A self _conduit conduit N/A N/A self _as_user as_user N/A __call__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A self _conduit call_as_user N/A self _as_user args kwargs N/A N/A