| 1 | import base64scip-python python python-stdlib 3.11 base64/__init__: |
| 2 | import codecsscip-python python python-stdlib 3.11 codecs/__init__: |
| 3 | import copyscip-python python python-stdlib 3.11 copy/__init__: |
| 4 | import ioscip-python python python-stdlib 3.11 io/__init__: |
| 5 | import osscip-python python python-stdlib 3.11 os/__init__: |
| 6 | import picklescip-python python python-stdlib 3.11 pickle/__init__: |
| 7 | import sysscip-python python python-stdlib 3.11 sys/__init__: |
| 8 | |
| 9 | try: |
| 10 | import gdata.docs.service |
| 11 | except ImportErrorscip-python python python-stdlib 3.11 builtins/ImportError#: |
| 12 | pass |
| 13 | |
| 14 | from jaraco.classesscip-python python keyrings.alt 5.0.2 `jaraco.classes`/__init__: import propertiesscip-python python keyrings.alt 5.0.2 `jaraco.classes.properties`/__init__: |
| 15 | from jaraco.contextscip-python python keyrings.alt 5.0.2 `jaraco.context`/__init__: import ExceptionTrap |
| 16 | from keyringscip-python python keyring 25.7.0 keyring/__init__: import credentialsscip-python python keyring 25.7.0 `keyring.credentials`/__init__:, errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__: |
| 17 | from keyring.backendscip-python python keyring 25.7.0 `keyring.backend`/__init__: import KeyringBackend |
| 18 | |
| 19 | from . import keyczarscip-python python keyrings.alt 5.0.2 keyczar/__init__: |
| 20 | |
| 21 | |
| 22 | class EnvironCredentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/EnvironCredential#(credentialsscip-python python keyring 25.7.0 `keyring.credentials`/__init__:.EnvironCredential): |
| 23 | """Retrieve credentials from specifically named environment variables""" |
| 24 | |
| 25 | def __init__scip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/EnvironCredential#__init__().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/EnvironCredential#__init__().(self)): |
| 26 | superscip-python python python-stdlib 3.11 builtins/super#().__init__('GOOGLE_KEYRING_USER', 'GOOGLE_KEYRING_PASSWORD') |
| 27 | |
| 28 | |
| 29 | class DocsKeyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#(KeyringBackend): |
| 30 | """Backend that stores keyring on Google Docs. |
| 31 | Note that login and any other initialisation is deferred until it is |
| 32 | actually required to allow this keyring class to be added to the |
| 33 | global _all_keyring list. |
| 34 | """ |
| 35 | |
| 36 | keyring_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#keyring_title. = 'GoogleKeyring' |
| 37 | # status enums |
| 38 | OKscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#OK. = 1 |
| 39 | FAILscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#FAIL. = 0 |
| 40 | CONFLICTscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#CONFLICT. = -1 |
| 41 | |
| 42 | def __init__scip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().( |
| 43 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self), |
| 44 | credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(credential), |
| 45 | sourcescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(source), |
| 46 | crypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(crypter), |
| 47 | collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(collection)=None, |
| 48 | clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(client)=None, |
| 49 | can_createscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(can_create)=True, |
| 50 | input_getterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(input_getter)=input, |
| 51 | ): |
| 52 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential. = credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(credential) |
| 53 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self).crypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#crypter. = crypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(crypter) |
| 54 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self).sourcescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#source. = sourcescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(source) |
| 55 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_collection. = collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(collection) |
| 56 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self).can_createscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#can_create. = can_createscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(can_create) |
| 57 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self).input_getterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#input_getter. = input_getterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(input_getter) |
| 58 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. = None |
| 59 | |
| 60 | if not clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(client): |
| 61 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client. = gdata.docs.service.DocsService() |
| 62 | else: |
| 63 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client. = clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(client) |
| 64 | |
| 65 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..source = sourcescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(source) |
| 66 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..ssl = True |
| 67 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(self)._login_reqdscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_login_reqd. = True |
| 68 | |
| 69 | @propertiesscip-python python keyrings.alt 5.0.2 `jaraco.classes.properties`/__init__:.classproperty |
| 70 | def priorityscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#priority().(clsscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#priority().(cls)): |
| 71 | if not clsscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#priority().(cls)._has_gdatascip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_has_gdata().(): |
| 72 | raise RuntimeErrorscip-python python python-stdlib 3.11 builtins/RuntimeError#("Requires gdata") |
| 73 | if not keyczarscip-python python keyrings.alt 5.0.2 keyczar/__init__:.has_keyczarscip-python python keyrings.alt 5.0.2 `keyrings.alt.keyczar`/has_keyczar().(): |
| 74 | raise RuntimeErrorscip-python python python-stdlib 3.11 builtins/RuntimeError#("Requires keyczar") |
| 75 | return 3 |
| 76 | |
| 77 | # For Python 3.8 compatibility |
| 78 | passesscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#passes. = ExceptionTrap().passes |
| 79 | |
| 80 | @passesscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#passes. |
| 81 | @classmethodscip-python python python-stdlib 3.11 builtins/classmethod# |
| 82 | def _has_gdatascip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_has_gdata().(clsscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_has_gdata().(cls)): |
| 83 | gdata.__name__ |
| 84 | |
| 85 | def get_passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(self), servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(username)): |
| 86 | """Get password of the username for the service""" |
| 87 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(self)._get_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(self)._keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring()., servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(username)) |
| 88 | if result: |
| 89 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#get_password().(self)._decryptscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(result) |
| 90 | return result |
| 91 | |
| 92 | def set_passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self), servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username), passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password)): |
| 93 | """Set password for the username of the service""" |
| 94 | passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password) = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._encryptscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password) or '') |
| 95 | keyring_working_copy = copyscip-python python python-stdlib 3.11 copy/__init__:.deepcopyscip-python python python-stdlib 3.11 copy/deepcopy().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().) |
| 96 | service_entries = keyring_working_copy.get(servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service)) |
| 97 | if not service_entries: |
| 98 | service_entries = {} |
| 99 | keyring_working_copy[servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service)] = service_entries |
| 100 | service_entries[usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username)] = passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password) |
| 101 | save_result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._save_keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(keyring_working_copy) |
| 102 | if save_result == selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self).OKscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#OK.: |
| 103 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. = keyring_working_copy |
| 104 | return |
| 105 | elif save_result == selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self).CONFLICTscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#CONFLICT.: |
| 106 | # check if we can avoid updating |
| 107 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry., keyring_dict = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._readscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().() |
| 108 | existing_pwd = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._get_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring()., servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username)) |
| 109 | conflicting_pwd = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._get_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(keyring_dict, servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username)) |
| 110 | if conflicting_pwd == passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password): |
| 111 | # if someone else updated it to the same value then we are done |
| 112 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. = keyring_working_copy |
| 113 | return |
| 114 | elif conflicting_pwd is None or conflicting_pwd == existing_pwd: |
| 115 | # if doesn't already exist or is unchanged then update it |
| 116 | new_service_entries = keyring_dict.getscip-python python python-stdlib 3.11 builtins/dict#get().(servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service), {}) |
| 117 | new_service_entries[usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username)] = passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(password) |
| 118 | keyring_dict[servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service)] = new_service_entries |
| 119 | save_result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._save_keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(keyring_dict) |
| 120 | if save_result == selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self).OKscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#OK.: |
| 121 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. = keyring_dict |
| 122 | return |
| 123 | else: |
| 124 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.PasswordSetError( |
| 125 | 'Failed write after conflict detected' |
| 126 | ) |
| 127 | else: |
| 128 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.PasswordSetError( |
| 129 | f'Conflict detected, service:{servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(service)} and username:{usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#set_password().(username)} was ' |
| 130 | 'set to a different value by someone else' |
| 131 | ) |
| 132 | |
| 133 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.PasswordSetError('Could not save keyring') |
| 134 | |
| 135 | def delete_passwordscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(self), servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(username)): |
| 136 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(self)._del_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(self)._keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring()., servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#delete_password().(username)) |
| 137 | |
| 138 | @propertyscip-python python python-stdlib 3.11 builtins/property# |
| 139 | def clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)): |
| 140 | if not selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..GetClientLoginToken(): |
| 141 | try: |
| 142 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..ClientLogin( |
| 143 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..username, |
| 144 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..password, |
| 145 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..source, |
| 146 | ) |
| 147 | except gdata.service.CaptchaRequired: |
| 148 | sysscip-python python python-stdlib 3.11 sys/__init__:.stdoutscip-python python python-stdlib 3.11 sys/stdout.stdout..writescip-python python python-stdlib 3.11 typing/IO#write().('Please visit ' + selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..captcha_url) |
| 149 | answer = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).input_getterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#input_getter.('Answer to the challenge? ') |
| 150 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..email = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..username |
| 151 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..password = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..password |
| 152 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..ClientLogin( |
| 153 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..username, |
| 154 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..password, |
| 155 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..source, |
| 156 | captcha_token=selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client..captcha_token, |
| 157 | captcha_response=answer, |
| 158 | ) |
| 159 | except gdata.service.BadAuthentication: |
| 160 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError('Users credential were unrecognized') |
| 161 | except gdata.service.Error: |
| 162 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError('Login Error') |
| 163 | |
| 164 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client().(self)._clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_client. |
| 165 | |
| 166 | @propertyscip-python python python-stdlib 3.11 builtins/property# |
| 167 | def collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().(self)): |
| 168 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().(self)._collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_collection. or selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().(self).credentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#credential..username.split('@')[0] |
| 169 | |
| 170 | @propertyscip-python python python-stdlib 3.11 builtins/property# |
| 171 | def _keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self)): |
| 172 | if selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. is None: |
| 173 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry., selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self)._readscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().() |
| 174 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring().(self)._keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_keyring_dict. |
| 175 | |
| 176 | def _get_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(self), keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(keyring_dict), servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(username)): |
| 177 | result = None |
| 178 | service_entries = keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(keyring_dict).get(servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(service)) |
| 179 | if service_entries: |
| 180 | result = service_entries.get(usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_entry().(username)) |
| 181 | return result |
| 182 | |
| 183 | def _del_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(self), keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(keyring_dict), servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(service), usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(username)): |
| 184 | service_entries = keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(keyring_dict).get(servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(service)) |
| 185 | if not service_entries: |
| 186 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.PasswordDeleteError("No matching service") |
| 187 | try: |
| 188 | del service_entries[usernamescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(username)] |
| 189 | except KeyErrorscip-python python python-stdlib 3.11 builtins/KeyError#: |
| 190 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.PasswordDeleteError("Not found") |
| 191 | if not service_entries: |
| 192 | del keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(keyring_dict)[servicescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_del_entry().(service)] |
| 193 | |
| 194 | def _decryptscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(self), valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(value)): |
| 195 | if not valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(value): |
| 196 | return '' |
| 197 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(self).crypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#crypter..decrypt(valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_decrypt().(value)) |
| 198 | |
| 199 | def _encryptscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(self), valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(value)): |
| 200 | if not valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(value): |
| 201 | return '' |
| 202 | return selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(self).crypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#crypter..encrypt(valuescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_encrypt().(value)) |
| 203 | |
| 204 | def _get_doc_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().(self)): |
| 205 | return '%s' % selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().(self).keyring_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#keyring_title. |
| 206 | |
| 207 | def _readscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self)): |
| 208 | from gdata.docs.servicescip-python python keyrings.alt 5.0.2 `gdata.docs.service`/__init__: import DocumentQuery |
| 209 | |
| 210 | title_query = DocumentQuery(categories=[selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self).collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().]) |
| 211 | title_query['title'] = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self)._get_doc_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().() |
| 212 | title_query['title-exact'] = 'true' |
| 213 | docs = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..QueryDocumentListFeed(title_query.ToUri()) |
| 214 | |
| 215 | if not docs.entry: |
| 216 | if selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self).can_createscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#can_create.: |
| 217 | docs_entry = None |
| 218 | keyring_dict = {} |
| 219 | else: |
| 220 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError( |
| 221 | f'{selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self)._get_doc_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().()} not found in {selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self).collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().} and create not permitted' |
| 222 | ) |
| 223 | else: |
| 224 | docs_entry = docs.entry[0] |
| 225 | file_contents = '' |
| 226 | try: |
| 227 | url = docs_entry.content.src |
| 228 | url += '&exportFormat=txt' |
| 229 | server_response = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..request('GET', url) |
| 230 | if server_response.status != 200: |
| 231 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError( |
| 232 | 'Could not read existing Google Docs keyring' |
| 233 | ) |
| 234 | file_contents = server_response.read() |
| 235 | if file_contents.startswith(codecsscip-python python python-stdlib 3.11 codecs/__init__:.BOM_UTF8scip-python python python-stdlib 3.11 codecs/BOM_UTF8.BOM_UTF8.): |
| 236 | file_contents = file_contents[len(codecsscip-python python python-stdlib 3.11 codecs/__init__:.BOM_UTF8scip-python python python-stdlib 3.11 codecs/BOM_UTF8.BOM_UTF8.) :] |
| 237 | keyring_dict = picklescip-python python python-stdlib 3.11 pickle/__init__:.loadsscip-python python python-stdlib 3.11 pickle/loads().( |
| 238 | base64scip-python python python-stdlib 3.11 base64/__init__:.urlsafe_b64decodescip-python python python-stdlib 3.11 base64/urlsafe_b64decode().(file_contents.decode('string-escape')) |
| 239 | ) |
| 240 | except picklescip-python python python-stdlib 3.11 pickle/__init__:.UnpicklingErrorscip-python python python-stdlib 3.11 pickle/UnpicklingError# as ex: |
| 241 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError( |
| 242 | 'Could not unpickle existing Google Docs keyring', ex |
| 243 | ) |
| 244 | except TypeErrorscip-python python python-stdlib 3.11 builtins/TypeError# as ex: |
| 245 | raise errorsscip-python python keyring 25.7.0 `keyring.errors`/__init__:.InitError( |
| 246 | 'Could not decode existing Google Docs keyring', ex |
| 247 | ) |
| 248 | |
| 249 | return docs_entry, keyring_dict |
| 250 | |
| 251 | def _save_keyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self), keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(keyring_dict)): |
| 252 | """Helper to actually write the keyring to Google""" |
| 253 | import gdata |
| 254 | |
| 255 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).OKscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#OK. |
| 256 | file_contents = base64scip-python python python-stdlib 3.11 base64/__init__:.urlsafe_b64encodescip-python python python-stdlib 3.11 base64/urlsafe_b64encode().(picklescip-python python python-stdlib 3.11 pickle/__init__:.dumpsscip-python python python-stdlib 3.11 pickle/dumps().(keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(keyring_dict))) |
| 257 | try: |
| 258 | if selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry.: |
| 259 | extra_headers = { |
| 260 | 'Content-Type': 'text/plain', |
| 261 | 'Content-Length': len(file_contents), |
| 262 | } |
| 263 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry. = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..Put( |
| 264 | file_contents, |
| 265 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry..GetEditMediaLink().href, |
| 266 | extra_headers=extra_headers, |
| 267 | ) |
| 268 | else: |
| 269 | from gdata.docs.servicescip-python python keyrings.alt 5.0.2 `gdata.docs.service`/__init__: import DocumentQuery |
| 270 | |
| 271 | # check for existence of folder, create if required |
| 272 | folder_query = DocumentQuery(categories=['folder']) |
| 273 | folder_query['title'] = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection(). |
| 274 | folder_query['title-exact'] = 'true' |
| 275 | docs = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..QueryDocumentListFeed(folder_query.ToUri()) |
| 276 | if docs.entry: |
| 277 | folder_entry = docs.entry[0] |
| 278 | else: |
| 279 | folder_entry = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..CreateFolder(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).collectionscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#collection().) |
| 280 | file_handle = ioscip-python python python-stdlib 3.11 io/__init__:.BytesIOscip-python python python-stdlib 3.11 io/BytesIO#(file_contents) |
| 281 | media_source = gdata.MediaSource( |
| 282 | file_handle=file_handle, |
| 283 | content_type='text/plain', |
| 284 | content_length=len(file_contents), |
| 285 | file_name='temp', |
| 286 | ) |
| 287 | selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).docs_entryscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#docs_entry. = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).clientscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#client()..Upload( |
| 288 | media_source, selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self)._get_doc_titlescip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_get_doc_title().(), folder_or_uri=folder_entry |
| 289 | ) |
| 290 | except gdata.service.RequestError as ex: |
| 291 | try: |
| 292 | if ex.message['reason'].lower().find('conflict') != -1: |
| 293 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).CONFLICTscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#CONFLICT. |
| 294 | else: |
| 295 | # Google docs has a bug when updating a shared document |
| 296 | # using PUT from any account other that the owner. |
| 297 | # It returns an error 400 "Sorry, there was an error saving |
| 298 | # the file. Please try again" |
| 299 | # *despite* actually updating the document! |
| 300 | # Workaround by re-reading to see if it actually updated |
| 301 | msg = 'Sorry, there was an error saving the file' |
| 302 | if ex.message['body'].find(msg) != -1: |
| 303 | new_docs_entry, new_keyring_dict = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self)._readscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_read().() |
| 304 | if new_keyring_dict == keyring_dictscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(keyring_dict): |
| 305 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).OKscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#OK. |
| 306 | else: |
| 307 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).FAILscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#FAIL. |
| 308 | else: |
| 309 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).FAILscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#FAIL. |
| 310 | except Exceptionscip-python python python-stdlib 3.11 builtins/Exception#: |
| 311 | result = selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#_save_keyring().(self).FAILscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#FAIL. |
| 312 | |
| 313 | return result |
| 314 | |
| 315 | |
| 316 | class KeyczarDocsKeyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/KeyczarDocsKeyring#(DocsKeyringscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#): |
| 317 | """Google Docs keyring using keyczar initialized from environment |
| 318 | variables |
| 319 | """ |
| 320 | |
| 321 | def __init__scip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/KeyczarDocsKeyring#__init__().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/KeyczarDocsKeyring#__init__().(self)): |
| 322 | crypter = keyczarscip-python python keyrings.alt 5.0.2 keyczar/__init__:.EnvironCrypterscip-python python keyrings.alt 5.0.2 `keyrings.alt.keyczar`/EnvironCrypter#() |
| 323 | credential = EnvironCredentialscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/EnvironCredential#() |
| 324 | source = osscip-python python python-stdlib 3.11 os/__init__:.environscip-python python python-stdlib 3.11 os/environ.environ..getscip-python python python-stdlib 3.11 typing/Mapping#get().('GOOGLE_KEYRING_SOURCE') |
| 325 | superscip-python python python-stdlib 3.11 builtins/super#().__init__scip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/DocsKeyring#__init__().(credential, source, crypter) |
| 326 | |
| 327 | def supportedscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/KeyczarDocsKeyring#supported().(selfscip-python python keyrings.alt 5.0.2 `keyrings.alt.Google`/KeyczarDocsKeyring#supported().(self)): |
| 328 | """ |
| 329 | Return if this keyring supports current environment: |
| 330 | -1: not applicable |
| 331 | 0: suitable |
| 332 | 1: recommended |
| 333 | """ |
| 334 | try: |
| 335 | __import__('keyczar.keyczar') |
| 336 | return superscip-python python python-stdlib 3.11 builtins/super#().supported() |
| 337 | except ImportErrorscip-python python python-stdlib 3.11 builtins/ImportError#: |
| 338 | return -1 |