Server IP : 66.29.132.122 / Your IP : 3.133.109.121 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cloudlinux/venv/lib64/python3.11/site-packages/virtualenv/app_data/ |
Upload File : |
""" Application data stored by virtualenv. """ import logging import os from platformdirs import user_data_dir from .na import AppDataDisabled from .read_only import ReadOnlyAppData from .via_disk_folder import AppDataDiskFolder from .via_tempdir import TempAppData def _default_app_data_dir(env): key = "VIRTUALENV_OVERRIDE_APP_DATA" if key in env: return env[key] else: return user_data_dir(appname="virtualenv", appauthor="pypa") def make_app_data(folder, **kwargs): is_read_only = kwargs.pop("read_only") env = kwargs.pop("env") if kwargs: # py3+ kwonly raise TypeError("unexpected keywords: {}") if folder is None: folder = _default_app_data_dir(env) folder = os.path.abspath(folder) if is_read_only: return ReadOnlyAppData(folder) if not os.path.isdir(folder): try: os.makedirs(folder) logging.debug("created app data folder %s", folder) except OSError as exception: logging.info("could not create app data folder %s due to %r", folder, exception) if os.access(folder, os.W_OK): return AppDataDiskFolder(folder) else: logging.debug("app data folder %s has no write access", folder) return TempAppData() __all__ = ( "AppDataDisabled", "AppDataDiskFolder", "ReadOnlyAppData", "TempAppData", "make_app_data", )