templates-project_setup/python/template-main.py

36 lines
1.2 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
"""
Project - Application Title
TODO: Add a short explanation of the application here.
Author: Name <email@example.com>
Copyright: (c) Company Name/ Author, YEAR
Copyright: Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
Copyright: Licensed under the GNU GPLv3 License http://www.gnu.org/licenses/gpl-3.0.txt
"""
import argparse
import logging
if __name__ == "__main__":
log_format = '%(asctime)s %(levelname)s:%(name)s: %(message)s'
log_datefmt = '%Y-%m-%dT%H:%M:%S%z'
logging.basicConfig(format=log_format, datefmt=log_datefmt, level=logging.INFO)
logger = logging.getLogger()
parser = argparse.ArgumentParser(description='TODO Program Title')
parser.add_argument('-n', '--dryrun', action='store_true',
help='do not connect to the FMU')
parser.add_argument("-v", "--verbosity", action="count",
help="increase output and logging verbosity")
args = parser.parse_args()
if args.verbosity == 2:
logger.setLevel(logging.DEBUG)
elif args.verbosity == 1:
logger.setLevel(logging.INFO)
else:
logger.setLevel(logging.WARNING)