mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-12-26 15:07:44 -06:00
initial commit
This commit is contained in:
11
env/lib/python3.10/site-packages/keyring/util/__init__.py
vendored
Normal file
11
env/lib/python3.10/site-packages/keyring/util/__init__.py
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import contextlib
|
||||
|
||||
|
||||
def suppress_exceptions(callables, exceptions=Exception):
|
||||
"""
|
||||
yield the results of calling each element of callables, suppressing
|
||||
any indicated exceptions.
|
||||
"""
|
||||
for callable in callables:
|
||||
with contextlib.suppress(exceptions):
|
||||
yield callable()
|
||||
BIN
env/lib/python3.10/site-packages/keyring/util/__pycache__/__init__.cpython-310.pyc
vendored
Normal file
BIN
env/lib/python3.10/site-packages/keyring/util/__pycache__/__init__.cpython-310.pyc
vendored
Normal file
Binary file not shown.
BIN
env/lib/python3.10/site-packages/keyring/util/__pycache__/platform_.cpython-310.pyc
vendored
Normal file
BIN
env/lib/python3.10/site-packages/keyring/util/__pycache__/platform_.cpython-310.pyc
vendored
Normal file
Binary file not shown.
40
env/lib/python3.10/site-packages/keyring/util/platform_.py
vendored
Normal file
40
env/lib/python3.10/site-packages/keyring/util/platform_.py
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
|
||||
|
||||
def _data_root_Windows():
|
||||
release, version, csd, ptype = platform.win32_ver()
|
||||
root = pathlib.Path(
|
||||
os.environ.get('LOCALAPPDATA', os.environ.get('ProgramData', '.'))
|
||||
)
|
||||
return root / 'Python Keyring'
|
||||
|
||||
|
||||
def _data_root_Linux():
|
||||
"""
|
||||
Use freedesktop.org Base Dir Specification to determine storage
|
||||
location.
|
||||
"""
|
||||
fallback = pathlib.Path.home() / '.local/share'
|
||||
root = os.environ.get('XDG_DATA_HOME', None) or fallback
|
||||
return pathlib.Path(root, 'python_keyring')
|
||||
|
||||
|
||||
_config_root_Windows = _data_root_Windows
|
||||
|
||||
|
||||
def _config_root_Linux():
|
||||
"""
|
||||
Use freedesktop.org Base Dir Specification to determine config
|
||||
location.
|
||||
"""
|
||||
fallback = pathlib.Path.home() / '.config'
|
||||
key = 'XDG_CONFIG_HOME'
|
||||
root = os.environ.get(key, None) or fallback
|
||||
return pathlib.Path(root, 'python_keyring')
|
||||
|
||||
|
||||
# by default, use Unix convention
|
||||
data_root = globals().get('_data_root_' + platform.system(), _data_root_Linux)
|
||||
config_root = globals().get('_config_root_' + platform.system(), _config_root_Linux)
|
||||
Reference in New Issue
Block a user