Revision: 3937 Author: valhallasw Date: 2007-08-01 21:53:08 +0000 (Wed, 01 Aug 2007)
Log Message: ----------- Added version output when '-v' is used; added version output and doctest when wikipedia.py is called
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-01 21:37:41 UTC (rev 3936) +++ trunk/pywikipedia/wikipedia.py 2007-08-01 21:53:08 UTC (rev 3937) @@ -4203,6 +4203,9 @@ global logfile logfile = None elif arg == '-verbose' or arg == "-v": + import version + output('Pywikipediabot %s' % (version.getversion())) + output('Python %s' % (sys.version)) verbose += 1 else: # the argument is not global. Let the specific bot script care @@ -4648,3 +4651,11 @@ authhandler = urllib2.HTTPBasicAuthHandler(passman) authenticateURLopener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj),authhandler) urllib2.install_opener(authenticateURLopener) + +if __name__ == '__main__': + import version, doctest + print 'Pywikipediabot %s' % version.getversion() + print 'Python %s' % sys.version + doctest.testmod() + + \ No newline at end of file