Last active
May 9, 2018 16:44
-
-
Save craig8/42f53b59204310bc6fdec0dd5ec4d14a to your computer and use it in GitHub Desktop.
Revisions
-
craig8 revised this gist
May 9, 2018 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,6 @@ _log = logging.getLogger("main") def get_opts(): parser = argparse.ArgumentParser() # Add arguments to parse #parser.add_argument('--output-dir', default="crate_output", # help="Root directory to output data to.") -
craig8 created this gist
May 9, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ import argparse import logging import sys LOG_FORMAT = "%(asctime)s:%(levelname)s:%(processName)s - %(name)s %(message)s" logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=LOG_FORMAT) _log = logging.getLogger("main") def get_opts(): parser = argparse.ArgumentParser() parser = get_crate_parser(parser) # Add arguments to parse #parser.add_argument('--output-dir', default="crate_output", # help="Root directory to output data to.") #parser.add_argument('--start-date', required=True, # help="Date to start the export from.") #parser.add_argument('--days', default=1, type=int, # help="Days to export from the start date") #parser.add_argument('--gzip', default=False, action='store_true', # help="Output files should be gzip strings.") #parser.add_argument('--topics-file', required=True, # type=argparse.FileType('r'), # help="List of topics to extract from the database.") # Parse arguments and validate the opts if necessary below. opts = parser.parse_args() # Extra Validation here # return opts def _main(): # Retrieve options from passed arguments to the program opts = get_opts() # Main body of program here sys.exit(0) if __name__ == "__main__": _main()