Skip to content
Snippets Groups Projects
Verified Commit 0967d01e authored by Duncan Macleod's avatar Duncan Macleod Committed by Duncan Macleod
Browse files

convert ligolw_segments_from_cats_dqsegdb to an entry_point

parent 86daa430
No related branches found
No related tags found
1 merge request!117Convert scripts to entry_points
#!/usr/bin/env python3
# Copyright (C) 2009 Larne Pekowsky # Copyright (C) 2009 Larne Pekowsky
# 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. # 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.
# #
...@@ -93,7 +92,7 @@ __verbose_msg__ = "version: " + get_versions()['version'] + "\nfull-revisionid: ...@@ -93,7 +92,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 Parse the command line, return an options object
""" """
...@@ -123,7 +122,7 @@ def parse_command_line(): ...@@ -123,7 +122,7 @@ def parse_command_line():
parser.add_option("-e", "--gps-end-time", metavar = "gps_end_time", help = "End of GPS time range.") parser.add_option("-e", "--gps-end-time", metavar = "gps_end_time", help = "End of GPS time range.")
parser.add_option("-g", "--debug", metavar = "debug", help = "Print debug information.") parser.add_option("-g", "--debug", metavar = "debug", help = "Print debug information.")
options, others = parser.parse_args() options, others = parser.parse_args(args=args)
if not options.veto_file: if not options.veto_file:
raise ValueError("missing required argument --veto-file") raise ValueError("missing required argument --veto-file")
...@@ -262,12 +261,12 @@ class ContentHandler(ligolw.LIGOLWContentHandler): ...@@ -262,12 +261,12 @@ class ContentHandler(ligolw.LIGOLWContentHandler):
# ============================================================================= # =============================================================================
# #
if __name__ == '__main__': def main(args=None):
# Settings # Settings
dbtables.get_column_info = kludge_get_column_info dbtables.get_column_info = kludge_get_column_info
options, db_location, file_location, loaded_file, debug = parse_command_line() options, db_location, file_location, loaded_file, debug = parse_command_line(args=args)
if options.non_integer: if options.non_integer:
allow_non_int=True allow_non_int=True
...@@ -456,3 +455,7 @@ if __name__ == '__main__': ...@@ -456,3 +455,7 @@ if __name__ == '__main__':
if debug: if debug:
print("If you see this message, your call to ligolw_segments_from_cats was successful.") print("If you see this message, your call to ligolw_segments_from_cats was successful.")
print("You may want to follow up on any warnings printed before this point; they will indicate any flags that didn't exist in the database but were in the veto definer file.") print("You may want to follow up on any warnings printed before this point; they will indicate any flags that didn't exist in the database but were in the veto definer file.")
if __name__ == "__main__":
sys.exit(main())
...@@ -40,6 +40,7 @@ setup(name=PACKAGENAME, ...@@ -40,6 +40,7 @@ setup(name=PACKAGENAME,
"console_scripts": [ "console_scripts": [
"ligolw_dq_query_dqsegdb = dqsegdb.tools.ligolw_dq_query:main", "ligolw_dq_query_dqsegdb = dqsegdb.tools.ligolw_dq_query:main",
"ligolw_segment_query_dqsegdb = dqsegdb.tools.ligolw_segment_query:main", "ligolw_segment_query_dqsegdb = dqsegdb.tools.ligolw_segment_query:main",
"ligolw_segments_from_cats_dqsegdb = dqsegdb.tools.ligolw_segments_from_cats:main",
], ],
}, },
setup_requires=['setuptools'], setup_requires=['setuptools'],
......
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