Skip to content

Commit d4044b9

Browse files
committed
Hide internal functions from the API documentation.
1 parent 655e7a3 commit d4044b9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/pygobbler/fetch_directory.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from . import _utils as ut
88

99

10-
def local_registry(cache: Optional[str], url: str) -> str:
10+
def _local_registry(cache: Optional[str], url: str) -> str:
1111
if cache is None:
1212
import appdirs
1313
cache = appdirs.user_data_dir("gobbler", "aaron")
1414
return os.path.join(cache, urllib.parse.quote_plus(url))
1515

1616

17-
def acquire_file(cache: str, path: str, name: str, url: str, overwrite: bool) -> str:
17+
def _acquire_file(cache: str, path: str, name: str, url: str, overwrite: bool) -> str:
1818
target = os.path.join(cache, "REGISTRY", path, name)
1919

2020
if overwrite or not os.path.exists(target):
@@ -79,7 +79,7 @@ def fetch_directory(path: str, registry: str, url: str, cache: Optional[str] = N
7979
if not force_remote and os.path.exists(registry):
8080
return os.path.join(registry, path)
8181

82-
cache = local_registry(cache, url)
82+
cache = _local_registry(cache, url)
8383
final = os.path.join(cache, "REGISTRY", path)
8484
ok = os.path.join(cache, "SUCCESS", path, "....OK")
8585
if not overwrite and os.path.exists(ok) and os.path.exists(final):
@@ -92,12 +92,12 @@ def fetch_directory(path: str, registry: str, url: str, cache: Optional[str] = N
9292

9393
if concurrent == 1:
9494
for y in listing:
95-
acquire_file(cache, name=y, path=path, url=url, overwrite=overwrite)
95+
_acquire_file(cache, name=y, path=path, url=url, overwrite=overwrite)
9696
else:
9797
import multiprocessing
9898
import functools
9999
with multiprocessing.Pool(concurrent) as p:
100-
p.map(functools.partial(acquire_file, cache, path, url=url, overwrite=overwrite), listing)
100+
p.map(functools.partial(_acquire_file, cache, path, url=url, overwrite=overwrite), listing)
101101

102102
# We use a directory-level OK file to avoid having to scan through all
103103
# the directory contents to indicate that it's complete.

src/pygobbler/fetch_manifest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def fetch_manifest(project: str, asset: str, version: str, registry: str, url: s
5252
if not force_remote and os.path.exists(registry):
5353
path = os.path.join(registry, project, asset, version, "..manifest")
5454
else:
55-
cache = fd.local_registry(cache, url)
56-
path = fd.acquire_file(cache, project + "/" + asset + "/" + version, "..manifest", url=url, overwrite=overwrite)
55+
cache = fd._local_registry(cache, url)
56+
path = fd._acquire_file(cache, project + "/" + asset + "/" + version, "..manifest", url=url, overwrite=overwrite)
5757

5858
with open(path, "r") as handle:
5959
out = json.load(handle)

src/pygobbler/fetch_summary.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def fetch_summary(project: str, asset: str, version: str, registry: str, url: st
5151
if not force_remote and os.path.exists(registry):
5252
path = os.path.join(registry, project, asset, version, "..summary")
5353
else:
54-
cache = fd.local_registry(cache, url)
55-
path = fd.acquire_file(cache, project + "/" + asset + "/" + version, "..summary", url=url, overwrite=overwrite)
54+
cache = fd._local_registry(cache, url)
55+
path = fd._acquire_file(cache, project + "/" + asset + "/" + version, "..summary", url=url, overwrite=overwrite)
5656

5757
with open(path, "r") as handle:
5858
out = json.load(handle)

0 commit comments

Comments
 (0)