diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-09 11:50:04 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-09 11:50:04 +0500 |
| commit | fef7206fbaa12bf6c7d6add5a0cb2b82b97ebb0a (patch) | |
| tree | 033ad4cf0861f5ab9f7e488a505852de3d0b9aac /project/boost/download.py | |
| parent | move Pylint settings to pyproject.toml (diff) | |
| download | cmake-common-fef7206fbaa12bf6c7d6add5a0cb2b82b97ebb0a.tar.gz cmake-common-fef7206fbaa12bf6c7d6add5a0cb2b82b97ebb0a.zip | |
minor imports refactoring
Diffstat (limited to 'project/boost/download.py')
| -rw-r--r-- | project/boost/download.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/project/boost/download.py b/project/boost/download.py index 1576bab..2780be6 100644 --- a/project/boost/download.py +++ b/project/boost/download.py @@ -27,7 +27,7 @@ import urllib.request from project.boost.archive import Archive, PermanentStorage, TemporaryStorage from project.boost.version import Version -from project.utils import normalize_path, mkdir_parent, retry, setup_logging +from project import utils import project.version @@ -41,11 +41,11 @@ class Download: else: unpack_dir = cache_dir - unpack_dir = normalize_path(unpack_dir) - mkdir_parent(unpack_dir) + unpack_dir = utils.normalize_path(unpack_dir) + utils.mkdir_parent(unpack_dir) if cache_dir is not None: - cache_dir = normalize_path(cache_dir) - mkdir_parent(cache_dir) + cache_dir = utils.normalize_path(cache_dir) + utils.mkdir_parent(cache_dir) self.version = version self.unpack_dir = unpack_dir @@ -70,7 +70,7 @@ class Download: return request.read() @staticmethod - @retry(urllib.request.URLError) + @utils.retry(urllib.request.URLError) def _download_url_retry(url): return Download._download_url(url) @@ -135,14 +135,14 @@ def _parse_args(argv=None): "--unpack", metavar="DIR", dest="unpack_dir", - type=normalize_path, + type=utils.normalize_path, help="directory to unpack the archive to", ) parser.add_argument( "--cache", metavar="DIR", dest="cache_dir", - type=normalize_path, + type=utils.normalize_path, help="download directory (temporary file unless specified)", ) parser.add_argument( @@ -160,7 +160,7 @@ def _parse_args(argv=None): "dest_path", metavar="DIR", nargs="?", - type=normalize_path, + type=utils.normalize_path, help="rename the boost directory to DIR", ) @@ -169,7 +169,7 @@ def _parse_args(argv=None): def _main(argv=None): args = _parse_args(argv) - with setup_logging(): + with utils.setup_logging(): download(Download.from_args(args)) |
