aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-08-29 18:25:14 +0200
committerJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-08-29 18:25:14 +0200
commit401ab7a946fffff4cf31769160838b7ad176ec23 (patch)
treec5a9c59ca5e4fb44cd1c56255d9e335e56d7d39f /gs_pypi
parentupstream layman supports g-sorcery now (diff)
downloadg-sorcery-401ab7a946fffff4cf31769160838b7ad176ec23.tar.gz
g-sorcery-401ab7a946fffff4cf31769160838b7ad176ec23.tar.bz2
g-sorcery-401ab7a946fffff4cf31769160838b7ad176ec23.zip
gs-pypi: correct directory structure in generated DB
Diffstat (limited to 'gs_pypi')
-rw-r--r--gs_pypi/gs_pypi_generate_db.py8
-rw-r--r--gs_pypi/pypi_db.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/gs_pypi/gs_pypi_generate_db.py b/gs_pypi/gs_pypi_generate_db.py
index 3f2fcd1..a4f8395 100644
--- a/gs_pypi/gs_pypi_generate_db.py
+++ b/gs_pypi/gs_pypi_generate_db.py
@@ -14,7 +14,8 @@
import os
import sys
-from g_sorcery.fileutils import FileJSON
+from g_sorcery.compatibility import TemporaryDirectory
+from g_sorcery.fileutils import copy_all, FileJSON
from g_sorcery.logger import Logger
from .pypi_db import PypiDBGenerator
@@ -45,7 +46,10 @@ def main():
generator = PypiDBGenerator()
db_name = sys.argv[1]
- pkg_db = generator(db_name, "pypi", config=config["repositories"]["pypi"])
+ temp_dir = TemporaryDirectory()
+ pkg_db = generator(temp_dir.name, "pypi", config=config["repositories"]["pypi"])
+ os.mkdir(db_name)
+ copy_all(os.path.join(temp_dir.name, "pypi/db"), db_name)
os.system('tar cvzf ' + db_name + '.tar.gz ' + db_name)
if __name__ == "__main__":
diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py
index f614c4a..b3e5854 100644
--- a/gs_pypi/pypi_db.py
+++ b/gs_pypi/pypi_db.py
@@ -53,7 +53,7 @@ class PypiDBGenerator(DBGenerator):
soup.decompose()
pkg_uries = self.decode_download_uries(pkg_uries)
- for uri in pkg_uries:
+ for uri in pkg_uries[:10]:
attempts = 0
while True:
try: