From 398caabab95a002cf321131c3686151f51801b57 Mon Sep 17 00:00:00 2001 From: "Morten W. Hansen" Date: Wed, 10 Jul 2019 22:28:24 +0200 Subject: [PATCH] #30: changed std output from process command --- .../management/commands/process_sentinel1_wind.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/geospaas_wind/management/commands/process_sentinel1_wind.py b/geospaas_wind/management/commands/process_sentinel1_wind.py index 1815b12..cbf2492 100644 --- a/geospaas_wind/management/commands/process_sentinel1_wind.py +++ b/geospaas_wind/management/commands/process_sentinel1_wind.py @@ -46,6 +46,7 @@ def handle(self, *args, **options): failed = 0 reprocessed = 0 ingested = 0 + already_processed = 0 numds = len(s1ds) print('Processing %d datasets' %numds) for i,ds in enumerate(s1ds): @@ -59,12 +60,17 @@ def handle(self, *args, **options): self.stdout.write('Successfully processed (%d/%d): %s\n' % (i+1, numds, dsuri.uri)) ingested += 1 elif not cr and wds: - self.stdout.write('Successfully reprocessed (%d/%d): %s\n' % (i+1, numds, dsuri.uri)) - reprocessed += 1 + if options['force_reprocessing']: + self.stdout.write('Successfully reprocessed (%d/%d): %s\n' % (i+1, numds, dsuri.uri)) + reprocessed += 1 + else: + self.stdout.write('Already processed (%d/%d): %s\n' % (i+1, numds, dsuri.uri)) + already_processed +=1 elif not cr and not wds: failed += 1 self.stdout.write('Successfully processed %d/%d datasets.\n' % (ingested, numds)) + self.stdout.write('%d/%d datasets were already processed.\n' % (already_processed, numds)) if options['force_reprocessing']: self.stdout.write('Successfully reprocessed %d/%d datasets.\n' % (reprocessed, numds)) self.stdout.write('Failed at processing %d/%d datasets.\n' % (failed, numds))