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

convert ligolw_segment_query_dqsegdb to an entry_point

mainly so that its code is in the main library and we can test more easily, and measure coverage
parent 1a4888d1
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
......@@ -107,7 +105,7 @@ __formatted_date__ = __date__[0:10] + " " + __date__[11:19] + " +0000"
#
def parse_command_line():
def parse_command_line(args=None):
"""
Parse the command line, return an options object
"""
......@@ -148,7 +146,7 @@ def parse_command_line():
parser.add_option("-o", "--output-file", metavar = "output_file", help = "File to which output should be written. Defaults to stdout.")
#parser.add_option("-v", "--debug", metavar="debug", help= "Turn on debugging.")
options, others = parser.parse_args()
options, others = parser.parse_args(args=args)
# Make sure we have exactly one thing to do
count = 0
......@@ -691,7 +689,7 @@ def setup_files(dir_name, gps_start_time, gps_end_time):
# =============================================================================
#
if __name__ == '__main__':
def main(args=None):
options, database_location, file_location = parse_command_line()
# Ping the database and exit if requested
......@@ -762,3 +760,5 @@ if __name__ == '__main__':
os.remove(temp_db)
if __name__ == '__main__':
sys.exit(main())
......@@ -36,6 +36,11 @@ setup(name=PACKAGENAME,
packages=packagenames,
ext_modules=[],
scripts=scripts,
entry_points={
"console_scripts": [
"ligolw_segment_query_dqsegdb = dqsegdb.tools.ligolw_segment_query:main",
],
},
setup_requires=['setuptools'],
install_requires=[
'gwdatafind',
......
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