Skip to content

Instantly share code, notes, and snippets.

@craig8
Last active May 9, 2018 16:44
Show Gist options
  • Save craig8/42f53b59204310bc6fdec0dd5ec4d14a to your computer and use it in GitHub Desktop.
Save craig8/42f53b59204310bc6fdec0dd5ec4d14a to your computer and use it in GitHub Desktop.

Revisions

  1. craig8 revised this gist May 9, 2018. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,6 @@ _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.")
  2. craig8 created this gist May 9, 2018.
    50 changes: 50 additions & 0 deletions gistfile1.txt
    Original 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()