Skip to content

Commit

Permalink
improved the print-out of the config to make more easily readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
KathleenLabrie committed May 4, 2019
1 parent d6cf00a commit e899b2c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions recipe_system/scripts/caldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from recipe_system.cal_service.localmanager import ERROR_CANT_READ, ERROR_DIDNT_FIND
# ------------------------------------------------------------------------------


def buildArgumentParser():

parser = ArgumentParser(description="Calibration Database Management Tool")
Expand Down Expand Up @@ -100,17 +99,18 @@ def usage(self, message):
usage(self._parser, message)

def _action_config(self, args):
isactive = "The 'standalone' flag is active, meaning that local "
isactive = "The 'standalone' flag is \033[1mactive\033[0m, meaning that local "
isactive += "calibrations will be used"
inactive = "The 'standalone' flag is not active, meaning that remote "
inactive += "calibrations will be downloaded"
inactive += "calibrations will be downloaded."

conf = get_calconf()
print("Using configuration file: {}".format(STANDARD_REDUCTION_CONF))
print()
print("The active database directory is: {}".format(conf.database_dir))
print('')
print("Using configuration file: \033[1m{}\033[0m".format(STANDARD_REDUCTION_CONF))
#print()
print("Active database directory: \033[1m{}\033[0m".format(conf.database_dir))
path = self._mgr._db_path
print("Thus the database file to be used: {}".format(path))
print("Database file: \033[1m{}\033[0m".format(path))
if not exists(path):
print(" NB: The database does not exist. Please initialize it.")
print(" (Read the help message about 'init' command)")
Expand All @@ -119,6 +119,7 @@ def _action_config(self, args):
print(isactive)
else:
print(inactive)
print('')

def _action_add(self, args):
for path in args.files:
Expand Down

0 comments on commit e899b2c

Please sign in to comment.