From fe9b6335b4876cb8f02a306199ed13e787e2b1f4 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 12 Jun 2015 19:17:56 +0200 Subject: reproducible: *.py: from datetime import datetime, timedelta instead of all datetime --- bin/reproducible_db_maintenance.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin/reproducible_db_maintenance.py') diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py index b2947384..8b802200 100755 --- a/bin/reproducible_db_maintenance.py +++ b/bin/reproducible_db_maintenance.py @@ -13,7 +13,7 @@ from reproducible_common import * -now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S") +now = datetime.now().strftime("%Y-%m-%d-%H-%M-%S") # the original schema is here @@ -420,12 +420,12 @@ def db_update(): log.info('Found schema updates.') for update in range(current+1, last+1): log.info('Applying database update #' + str(update) + '. Queries:') - startTime = datetime.datetime.now() + startTime = datetime.now() for query in schema_updates[update]: log.info('\t' + query) query_db(query) log.info(str(len(schema_updates[update])) + ' queries executed in ' + - str(datetime.datetime.now() - startTime)) + str(datetime.now() - startTime)) return True @@ -440,7 +440,7 @@ if __name__ == '__main__': changed_created = db_create_tables() changed = db_update() if changed or changed_created: - log.info('Total execution time: ' + str(datetime.datetime.now() - - datetime.datetime.strptime(now, "%Y-%m-%d-%H-%M-%S"))) + log.info('Total execution time: ' + str(datetime.now() - + datetime.strptime(now, "%Y-%m-%d-%H-%M-%S"))) else: log.info('No pending updates.') -- cgit v1.2.3-54-g00ecf