comparison getan/main.py @ 458:2707676cfd03

check source code style.
author Magnus Schieder <mschieder@intevation.de>
date Fri, 02 Feb 2018 13:21:36 +0100
parents 7fedbb73022e
children 2ab6fdde1010
comparison
equal deleted inserted replaced
457:7fedbb73022e 458:2707676cfd03
39 help='create databasefile if necessary and exit') 39 help='create databasefile if necessary and exit')
40 parser.add_argument('-d', '--debug', action='store_const', dest='loglevel', 40 parser.add_argument('-d', '--debug', action='store_const', dest='loglevel',
41 default=logging.INFO, const=logging.DEBUG, 41 default=logging.INFO, const=logging.DEBUG,
42 help='set verbosity to debug') 42 help='set verbosity to debug')
43 parser.add_argument('-l', '--logfile', dest='logfile', metavar='FILE', 43 parser.add_argument('-l', '--logfile', dest='logfile', metavar='FILE',
44 help='write log information to FILE [default: %(default)s]', 44 help='''write log information to FILE [default:
45 default='getan.log') 45 %(default)s]''', default='getan.log')
46
47 46
48 args = parser.parse_args() 47 args = parser.parse_args()
49 48
50 config.initialize(args.loglevel, args.logfile) 49 config.initialize(args.loglevel, args.logfile)
51 global logger 50 global logger
52 51
53 if args.filename != DEFAULT_DATABASE : 52 if args.filename != DEFAULT_DATABASE:
54 database = args.filename 53 database = args.filename
55 else: 54 else:
56 if os.path.isfile(DEFAULT_DATABASE): 55 if os.path.isfile(DEFAULT_DATABASE):
57 database = os.path.abspath(DEFAULT_DATABASE) 56 database = os.path.abspath(DEFAULT_DATABASE)
58 else: 57 else:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)