diff options
author | Frederick Muriuki Muriithi | 2024-10-24 15:54:24 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-24 15:56:41 -0500 |
commit | a52401e7191850c4a6542da1af5f2b2769312871 (patch) | |
tree | 52a9622b2f8461ef4074bd775460b22963ae10a5 /scripts/rqtl2/install_genotypes.py | |
parent | 80ae9ca56a34ae11c840bd6a7d24fbd9771c0c3e (diff) | |
download | gn-uploader-a52401e7191850c4a6542da1af5f2b2769312871.tar.gz |
Move logger creation to `build_main` function
Since the module-level loggers are built mostly the same, move the
creation of the logger to the more general function to reduce
repetition.
Diffstat (limited to 'scripts/rqtl2/install_genotypes.py')
-rw-r--r-- | scripts/rqtl2/install_genotypes.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/scripts/rqtl2/install_genotypes.py b/scripts/rqtl2/install_genotypes.py index 6b89142..abc3f07 100644 --- a/scripts/rqtl2/install_genotypes.py +++ b/scripts/rqtl2/install_genotypes.py @@ -5,7 +5,7 @@ from pathlib import Path from zipfile import ZipFile from functools import reduce from typing import Iterator, Optional -from logging import Logger, getLogger, StreamHandler +from logging import Logger, getLogger import MySQLdb as mdb from MySQLdb.cursors import DictCursor @@ -19,6 +19,8 @@ from scripts.rqtl2.entry import build_main from scripts.rqtl2.cli_parser import add_common_arguments from scripts.cli_parser import init_cli_parser, add_global_data_arguments +__MODULE__ = "scripts.rqtl2.install_genotypes" + def insert_markers( dbconn: mdb.Connection, speciesid: int, @@ -253,15 +255,5 @@ if __name__ == "__main__": return parser.parse_args() - thelogger = getLogger("install_genotypes") - thelogger.addHandler(StreamHandler(stream=sys.stderr)) - main = build_main( - cli_args(), - lambda dbconn, args: install_genotypes(dbconn, - args.speciesid, - args.populationid, - args.datasetid, - args.rqtl2bundle), - thelogger, - "INFO") + main = build_main(cli_args(), install_genotypes, __MODULE__) sys.exit(main()) |