aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-16 13:49:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-16 13:49:59 -0300
commit4e935dbe2b86d887f38bdcddd6f00042f28d7b9a (patch)
tree4b43ac56b24daa369b4aaacc1acabb19641ef70c
parente1bb000864ffe7e303d1cb180d757dffb0328389 (diff)
downloadckandumper-4e935dbe2b86d887f38bdcddd6f00042f28d7b9a.tar.gz
ckandumper-4e935dbe2b86d887f38bdcddd6f00042f28d7b9a.tar.bz2
Put all package contents in a single async loop
-rwxr-xr-xckandumper8
1 files changed, 4 insertions, 4 deletions
diff --git a/ckandumper b/ckandumper
index bfb99d7..46c9a51 100755
--- a/ckandumper
+++ b/ckandumper
@@ -263,6 +263,8 @@ class CkanDumper:
stats = self.download.get(packages_downloads)
self.process_stats(stats)
+ print('Downloading contents of all packages...')
+
#
# Package contents
#
@@ -272,8 +274,6 @@ class CkanDumper:
package_file = package_folder + os.sep + 'package.json'
contents = self.load_json(package_file)
- print(f'Downloading contents of package {package}...')
-
for resource in contents['result']['resources']:
#if resource['name'] != None:
# name = resource['name']
@@ -290,8 +290,8 @@ class CkanDumper:
package_downloads.append([resource['url'], resource_file])
- stats = self.download.get(package_downloads)
- self.process_stats(stats)
+ stats = self.download.get(package_downloads)
+ self.process_stats(stats)
if __name__ == "__main__":
# Parse CLI