Skip to content
Snippets Groups Projects
Unverified Commit 03727828 authored by Duncan Macleod's avatar Duncan Macleod Committed by Duncan Macleod
Browse files

convert ligolw_dq_query_dqsegdb to a console script

parent c2630051
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# Copyright (C) 2014-2020 Syracuse University, European Gravitational Observatory, and Christopher Newport University. Written by Ryan Fisher and Gary Hemming. See the NOTICE file distributed with this work for additional information regarding copyright ownership.
#
# This program is free software: you can redistribute it and/or modify
......@@ -77,7 +76,7 @@ __verbose_msg__ = "version: " + get_versions()['version'] + "\nfull-revisionid:
#
def parse_command_line():
def parse_command_line(args=None):
"""
Parse the command line, return an options object
"""
......@@ -106,7 +105,7 @@ def parse_command_line():
parser.add_option("-f", "--tom-formatting", action = "store_true", help = "Tom Dent requested formatting option: condensed output into single lines.")
parser.add_option("-b", "--seperate-good-from-bad", action = "store_true", help = "Seperates flags marked by the database as being active when the ifo is in a bad state from those that are active when the ifo is in a good state.")
options, time = parser.parse_args()
options, time = parser.parse_args(args=args)
# Make sure we have required arguments
if options.segment_url:
......@@ -291,8 +290,9 @@ def get_full_name(ifo, name, version):
# =============================================================================
#
if __name__ == '__main__':
options, database_location, time = parse_command_line()
def main(args=None):
options, database_location, time = parse_command_line(args=args)
o=urlparse(options.segment_url)
protocol=o.scheme
......@@ -474,4 +474,5 @@ if __name__ == '__main__':
fh.close()
if __name__ == "__main__":
sys.exit(main())
......@@ -38,6 +38,7 @@ setup(name=PACKAGENAME,
scripts=scripts,
entry_points={
"console_scripts": [
"ligolw_dq_query_dqsegdb = dqsegdb.tools.ligolw_dq_query:main",
"ligolw_segment_query_dqsegdb = dqsegdb.tools.ligolw_segment_query:main",
],
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment