Revision: 4280 Author: misza13 Date: 2007-09-13 19:35:01 +0000 (Thu, 13 Sep 2007)
Log Message: ----------- Add timezone handling.
Modified Paths: -------------- trunk/pywikipedia/archivebot.py
Modified: trunk/pywikipedia/archivebot.py =================================================================== --- trunk/pywikipedia/archivebot.py 2007-09-13 19:14:34 UTC (rev 4279) +++ trunk/pywikipedia/archivebot.py 2007-09-13 19:35:01 UTC (rev 4280) @@ -414,11 +414,18 @@ help='calculate key for PAGE and exit', metavar='PAGE') parser.add_option('-l', '--locale', dest='locale', help='switch to locale LOCALE', metavar='LOCALE') + parser.add_option('-T', '--timezone', dest='timezone', + help='switch timezone to TIMEZONE', metavar='TIMEZONE') (options, args) = parser.parse_args()
if options.locale: locale.setlocale(locale.LC_TIME,options.locale) #Required for english month names
+ if options.timezone: + os.environ['TZ'] = options.timezone + #Or use the preset value + time.tzset() + if options.calc: if not options.salt: parser.error('you must specify a salt to calculate a key')