Improve hist_importer messages

This commit is contained in:
Florian Bruhin 2017-12-06 07:41:41 +01:00
parent 6ea250dc83
commit 549a3a8f70

View File

@ -66,9 +66,7 @@ def open_db(data_base):
conn = sqlite3.connect(data_base) conn = sqlite3.connect(data_base)
return conn return conn
else: else:
raise sys.exit('DataBaseNotFound: There was some error trying to to' sys.exit('The file {} does not exist.'.format(data_base))
' connect with the [{}] database. Verify if the'
' given file path is correct.'.format(data_base))
def extract(source, query): def extract(source, query):
@ -89,8 +87,8 @@ def extract(source, query):
conn.close() conn.close()
return history return history
except sqlite3.OperationalError as op_e: except sqlite3.OperationalError as op_e:
print('\nCould not perform queries into the source database: {}' sys.exit('Could not perform queries on the source database: '
.format(op_e)) '{}'.format(op_e))
def clean(history): def clean(history):