Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Yield Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr BoolOpOr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad Str attr ListLoad AttributeLoad NameLoad attr BoolOpOr NameLoad Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Dict Str AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Raise Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A 
Lock Object for easy locking

 N/A contextlib N/A logging N/A uuid consulate.api base consulate utils exceptions N/A LOGGER N/A N/A logging getLogger __name__ Lock N/A N/A base Endpoint N/A N/A Wrapper for easy :class:`~consulate.api.kv.KV` locks. Keys are
    automatically prefixed with ``consulate/locks/``. To change the prefix or
    remove it invoke the :meth:~consulate.api.lock.Lock.prefix` method.

    Example:

    .. code:: python

        import consulate

        consul = consulate.Consul()
        with consul.lock.acquire('my-key'):
            print('Locked: {}'.format(consul.lock.key))
            # Do stuff

    :raises: :exc:`~consulate.exception.LockError`

     N/A DEFAULT_PREFIX consulate/locks __init__ N/A N/A self uri adapter session datacenter token N/A None None N/A N/A Create a new instance of the Lock

        :param str uri: Base URI
        :param consul.adapters.Request adapter: Request adapter
        :param consul.api.session.Session session: Session endpoint instance
        :param str datacenter: datacenter
        :param str token: Access Token

         N/A N/A N/A N/A super Lock self __init__ uri adapter datacenter token N/A N/A self _base_uri N/A N/A {0}/kv format uri N/A N/A self _session session N/A N/A self _session_id None N/A N/A self _item N/A str N/A N/A uuid uuid4 N/A N/A self _prefix N/A self DEFAULT_PREFIX N/A acquire N/A N/A self key value N/A None None N/A N/A A context manager that allows you to acquire the lock, optionally
        passing in a key and/or value.

        :param str key: The key to lock
        :param str value: The value to set in the lock
        :raises: :exc:`~consulate.exception.LockError`

         N/A N/A N/A self _acquire key value N/A N/A N/A N/A N/A self _release N/A N/A contextlib contextmanager key N/A N/A self N/A N/A N/A Return the lock key

        :rtype: str

         N/A N/A self _item N/A property prefix N/A N/A self value N/A N/A N/A Override the path prefix for the lock key

        :param str value: The value to set the path prefix to

         N/A N/A self _prefix N/A value N/A _acquire N/A N/A self key value N/A None None N/A N/A N/A self _session_id N/A N/A N/A self _session create N/A N/A self _item N/A N/A / join N/A N/A self _prefix N/A key N/A str N/A N/A uuid uuid4 N/A N/A N/A LOGGER debug Acquiring a lock of %s for session %s N/A self _item N/A self _session_id N/A response N/A N/A self _put_response_body N/A N/A self _item N/A acquire N/A self _session_id value N/A N/A response N/A N/A N/A N/A N/A self _session destroy N/A self _session_id N/A N/A N/A exceptions LockFailure N/A _release N/A N/A self N/A N/A N/A Release the lock N/A N/A N/A self _put_response_body N/A N/A self _item N/A release N/A self _session_id N/A N/A N/A N/A self _adapter delete N/A N/A self _build_uri N/A N/A self _item N/A N/A N/A N/A self _session destroy N/A self _session_id N/A N/A N/A self _item N/A self _session_id N/A None None N/A N/A