Changeset 13210


Ignore:
Timestamp:
21 Aug 2015, 14:28:21 (9 years ago)
Author:
uli
Message:

Add a rudimentary argument parser.

At least we can call --help now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/scripts.py

    r13209 r13210  
    33To make this work, you have to pip install psutil in your local virtualenv.
    44"""
     5import argparse
    56import gc
    67import grok
     
    3435#: The name under which the exporter to use is registered.
    3536EXPORTER_NAME = "students"
     37
     38
     39def handle_options():
     40    """Handle commandline options.
     41    """
     42    parser = argparse.ArgumentParser(
     43        description="Export WAeUP kofa data")
     44    args = parser.parse_args()
     45    return args
    3646
    3747
     
    163173    """Main function.
    164174    """
     175    options = handle_options()
    165176    closables = init_dbs()
    166177    conn = closables[0].open()
Note: See TracChangeset for help on using the changeset viewer.