package_cache_data#

用于管理包缓存(先前下载的包)的工具。

#

PackageCacheType

此元类对 PackageCache 实例对象执行基本缓存。

PackageCacheData

UrlsData

ProgressiveFetchExtract

函数#

do_cache_action(prec, cache_action, progress_bar[, ...])

此函数从 ProgressiveFetchExtract.execute 调用。

do_extract_action(prec, extract_action, progress_bar)

此函数在 do_cache_action 完成后调用。

do_cleanup(actions)

do_reverse(actions)

done_callback(future, actions, progress_bar, exceptions)

属性#

FileNotFoundError#
THREADSAFE_EXTRACT = False#
EXTRACT_THREADS#
class PackageCacheType#

基类: type

此元类对 PackageCache 实例对象执行基本缓存。

__call__(pkgs_dir: str | os.PathLike | pathlib.Path)#

将自身作为函数调用。

class PackageCacheData(pkgs_dir)#
property _package_cache_records#
property is_writable#
_cache_: dict[str, PackageCacheData]#
insert(package_cache_record)#
load()#
reload()#
get(package_ref, default=NULL)#
remove(package_ref, default=NULL)#
query(package_ref_or_match_spec)#
iter_records()#
classmethod query_all(package_ref_or_match_spec, pkgs_dirs=None)#
classmethod first_writable(pkgs_dirs=None)#
classmethod writable_caches(pkgs_dirs=None)#
classmethod read_only_caches(pkgs_dirs=None)#
classmethod all_caches_writable_first(pkgs_dirs=None)#
classmethod get_all_extracted_entries()#
classmethod get_entry_to_link(package_ref)#
classmethod tarball_file_in_cache(tarball_path, md5sum=None, exclude_caches=())#
classmethod clear()#
tarball_file_in_this_cache(tarball_path, md5sum=None)#
_check_writable()#
static _clean_tarball_path_and_get_md5sum(tarball_path, md5sum=None)#
_scan_for_dist_no_channel(dist_str)#
itervalues()#
values()#
__repr__()#

返回 repr(self)。

_make_single_record(package_filename)#
static _dedupe_pkgs_dir_contents(pkgs_dir_contents)#
class UrlsData(pkgs_dir)#
__contains__(url)#
__iter__()#
add_url(url)#
get_url(package_path)#
class ProgressiveFetchExtract(link_prefs)#
参数:

link_prefs (tuple[PackageRecord]) -- PackageRecord`s 序列,用于确保在已知的包缓存中可用,通常用于后续的 :class:`UnlinkLinkTransaction。 此处,“可用”是指包 tarball 已下载并解压到包目录。

property cache_actions#
property extract_actions#
static make_actions_for_record(pref_or_spec)#
prepare()#
execute()#

运行 self.paired_actions 中的每个操作。 cache_actions 中的每个操作都在其对应的 extract_actions 之前运行。

static _progress_bar(prec_or_spec, position=None, leave=False, context_manager=None) conda.plugins.types.ProgressBarBase#
__hash__()#

返回 hash(self)。

__eq__(other)#

返回 self==value。

do_cache_action(prec, cache_action, progress_bar, download_total=1.0, *, cancelled)#

此函数从 ProgressiveFetchExtract.execute 调用。

do_extract_action(prec, extract_action, progress_bar)#

此函数在 do_cache_action 完成后调用。

do_cleanup(actions)#
do_reverse(actions)#
done_callback(future: concurrent.futures.Future, actions: tuple[conda.core.path_actions.CacheUrlAction | conda.core.path_actions.ExtractPackageAction, Ellipsis], progress_bar: conda.plugins.types.ProgressBarBase, exceptions: list[Exception], finish: bool = False)#