Example #1
0
# end_date
options_parser.add_option( "-e", "--end_date", dest = my_article.PARAM_END_DATE, default = None, help = "End date of date range to collect, in YYYY-MM-DD format." )

# single_date
options_parser.add_option( "-d", "--single_date", dest = my_article.PARAM_SINGLE_DATE, default = None, help = "Single date to collect, in YYYY-MM-DD format." )

# flag to tell whether we do all processing.
options_parser.add_option( "-a", "--process_all", dest = "autoproc_all", action = "store_true", default = False, help = "If present, runs all possible processing for each article." )

# flag to tell whether we process authors.
options_parser.add_option( "-b", "--process_bylines", dest = "autoproc_authors", action = "store_true", default = False, help = "If present, runs author string processing routines." )

# parse options passed in on command line.
(options, args) = options_parser.parse_args()


#================================================================================
# Do work
#================================================================================


# set debug flag
DEBUG = True

# convert the options to a dictionary.
options_dict = vars( options )

# call the method on the articles.
status_message = Article.process_articles( **options_dict )