Commit 6a331d76 authored by scmalte's avatar scmalte
Browse files

Turning moss.py into a proper script, available as mu-moss

parent effb461a
...@@ -34,8 +34,8 @@ def run_moss( ...@@ -34,8 +34,8 @@ def run_moss(
logging.info("Ignore limit: {}".format(ignore_limit)) logging.info("Ignore limit: {}".format(ignore_limit))
logging.info("Matches: {}".format(number_of_matching_files)) logging.info("Matches: {}".format(number_of_matching_files))
moss.setignore_limit(ignore_limit) moss.setIgnoreLimit(ignore_limit)
moss.setnumber_of_matching_files(number_of_matching_files) moss.setNumberOfMatchingFiles(number_of_matching_files)
# Add template file(s) # Add template file(s)
logging.info("Template: {}".format(template)) logging.info("Template: {}".format(template))
...@@ -127,17 +127,21 @@ def main(): ...@@ -127,17 +127,21 @@ def main():
configure_cli_parser(parser) configure_cli_parser(parser)
args = parser.parse_args() args = parser.parse_args()
# See https://docs.python.org/3.8/library/logging.html#logging-levels
log_levels = { log_levels = {
"OFF": logging.NOTSET, "OFF": logging.NOTSET,
"DEBUG": logging.DEBUG, "DEBUG": logging.DEBUG,
"INFO": logging.INFO, "INFO": logging.INFO,
"WARNING": logging.WARNING, "WARNING": logging.WARNING,
"ERROR": logging.CRITICAL "ERROR": logging.ERROR
} }
numeric_log_level = log_levels[args.log_level] log_level = log_levels[args.log_level]
logging.basicConfig(level=args.log_level) # See https://docs.python.org/3.8/library/logging.html#logrecord-attributes
log_format = "%(message)s"
logging.basicConfig(level=log_level, format=log_format)
run_moss( run_moss(
user_id=args.user_id, user_id=args.user_id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment