/usr/lib/python3/dist-packages/keyring/__pycache__
Edit: /usr/lib/python3/dist-packages/keyring/__pycache__/backend.cpython-310.pyc (7632B)
o
a @ s d Z ddlZddlZddlZddlZddlmZ ddlZddl m
Z
mZmZ ddlm
Z
eeZedZdZG dd d ejZG d
d dedZG d
d dZG dd deZdd Zejdd ZdS )z
Keyring implementation support
N)Optional )credentialserrorsutil)
propertiespriorityc s e Zd ZdZ fddZ ZS )KeyringBackendMetazn
A metaclass that's both an ABCMeta and a type that keeps a registry of
all (non-abstract) types.
c s@ t ||| t| dst | _| j}| js|| d S d S )N_classes)super__init__hasattrsetr
__abstractmethods__add)clsnamebasesdictclasses __class__ 1/usr/lib/python3/dist-packages/keyring/backend.pyr s
zKeyringBackendMeta.__init__)__name__
__module____qualname____doc__r
__classcell__r r r r r s r c @ s e Zd ZdZdd Zdd Zejedd Z edd Z
ejed
d Zdd
Ze
jdededee fddZe
jdedededdfddZdededdfddZdedee deej fddZdd ZdS )KeyringBackendz]The abstract base class of the keyring, every backend must implement
this interface.
c C s | d S N)set_properties_from_env)selfr r r r , s zKeyringBackend.__init__c C dS )a
Each backend class must supply a priority, a number (float or integer)
indicating the priority of the backend relative to all other backends.
The priority need not be static -- it may (and should) vary based
attributes of the environment in which is runs (platform, available
packages, etc.).
A higher number indicates a higher priority. The priority should raise
a RuntimeError with a message indicating the underlying cause if the
backend is not suitable for the current environment.
As a rule of thumb, a priority between zero but less than one is
suitable, but a priority of one or greater is recommended.
Nr r r r r r 0 s zKeyringBackend.priorityc C s8 t
}| j W d | S 1 sw Y | S r )r ExceptionRaisedContextr )r excr r r viable@ s
zKeyringBackend.viablec C s t td| jS )z6
Return all subclasses deemed viable.
r' )filteroperator
attrgetterr
r$ r r r get_viable_backendsG s z"KeyringBackend.get_viable_backendsc C s. | j d\}}}|dd}d|| jgS )zr
The keyring name, suitable for display.
The name is derived from module and class name.
._ )r
rpartitionreplacejoinr )r parentsepmod_namer r r r N s zKeyringBackend.namec C s t | }d|j|j|jS )Nz{}.{} (priority: {:g}))typeformatr r r )r"
keyring_classr r r __str__Z s zKeyringBackend.__str__serviceusernamereturnc C r# )z,Get password of the username for the serviceNr r" r9 r: r r r get_password` zKeyringBackend.get_passwordpasswordNc C
t d)zSet password for the username of the service.
If the backend cannot store passwords, raise
PasswordSetError.
reason)r PasswordSetErrorr" r9 r: r? r r r set_passworde s
zKeyringBackend.set_passwordc C r@ )zDelete the password for the username of the service.
If the backend cannot delete passwords, raise
PasswordDeleteError.
rA )r PasswordDeleteErrorr<