diff options
author | davidovski <david@davidovski.xyz> | 2021-11-08 22:22:39 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2021-11-08 22:22:39 +0000 |
commit | d64fccae8d3ef5f39af0da1ccfd5712ad503c0bb (patch) | |
tree | e0143ba3ff6adc17f42479adf1c5e615dd0d61d3 /src/verbs | |
parent | a46c1d6cc58b847b9b140de2c59e1c7a8ba06655 (diff) |
separated verbs into submodules
Diffstat (limited to 'src/verbs')
-rw-r--r-- | src/verbs/__init__.py | 0 | ||||
-rw-r--r-- | src/verbs/sync.py | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/verbs/__init__.py b/src/verbs/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/verbs/__init__.py diff --git a/src/verbs/sync.py b/src/verbs/sync.py new file mode 100644 index 0000000..f23d4fc --- /dev/null +++ b/src/verbs/sync.py @@ -0,0 +1,20 @@ + + +# have separate list and download methods for each scheme +def sync_package_infos(source_name, url, repos): + scheme = url.split(":")[0] + + # TODO: add ftp + if scheme.startswith("http"): + sync_func = download_repo + else: + # Assume its a location on the file system + sync_func = copy_repo + + for repo in repos: + sync_func(output, url + f"/{repo}" if url[-1] == "/" else repo) + + +def sync(options, config): + sources = config["sources"] + print("Synced!") |