X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=blobdiff_plain;f=bin%2Ffind_avg_population_density;h=ef60d22df439add2308d6951f98252d86ca0612a;hp=712db20f96c3c53465d1b8131826cb37547fb88d;hb=d67b2e640133c45a31813ec853e58a866553134a;hpb=34556a43e5ba2725e00ce097dd2a1cfd3bf21e9e diff --git a/bin/find_avg_population_density b/bin/find_avg_population_density index 712db20..ef60d22 100755 --- a/bin/find_avg_population_density +++ b/bin/find_avg_population_density @@ -7,13 +7,13 @@ Find the average population density of a set of GPS coordinates. import sys import os import site -from optparse import OptionParser # Basically, add '../src' to our path. # Needed for the imports that follow. site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src') import Census +import CLI import Configuration.Defaults import ExitCodes import GPS @@ -38,27 +38,11 @@ for idx, value in enumerate(sys.argv): usage = '%prog [options] ' -# -h (help) Conflicts with -h HOSTNAME -parser = OptionParser(usage=usage, add_help_option = False) +parser = CLI.default_option_parser(usage) # Use this module's docstring as the description. parser.description = __doc__.strip() -parser.add_option('-h', - '--host', - help='The hostname/address where the database is located.', - default=Configuration.Defaults.DATABASE_HOST) - -parser.add_option('-d', - '--database', - help='The database in which the population data are stored.', - default=Configuration.Defaults.DATABASE_NAME) - -parser.add_option('-U', - '--username', - help='The username who has access to the database.', - default=Configuration.Defaults.DATABASE_USERNAME) - parser.add_option('-s', '--srid', type="int",