[Pywikipedia-svn] SVN: [7232] trunk/pywikipedia/test.py
filnik at svn.wikimedia.org
filnik at svn.wikimedia.org
Sun Sep 13 10:03:17 UTC 2009
Revision: 7232
Author: filnik
Date: 2009-09-13 10:03:17 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
Bugfix by xqt to bug: #2845036
Modified Paths:
--------------
trunk/pywikipedia/test.py
Modified: trunk/pywikipedia/test.py
===================================================================
--- trunk/pywikipedia/test.py 2009-09-13 09:51:48 UTC (rev 7231)
+++ trunk/pywikipedia/test.py 2009-09-13 10:03:17 UTC (rev 7232)
@@ -11,16 +11,20 @@
#
import re,sys,wikipedia
-for arg in wikipedia.handleArgs():
+def main():
+ for arg in wikipedia.handleArgs():
wikipedia.output(u"Unknown argument: %s" % arg)
wikipedia.stopme()
sys.exit(1)
-mysite = wikipedia.getSite()
-if mysite.loggedInAs():
+ mysite = wikipedia.getSite()
+ if mysite.loggedInAs():
wikipedia.output(u"You are logged in on %s as %s." % (repr(mysite), mysite.loggedInAs()))
-else:
+ else:
wikipedia.output(u"You are not logged in on %s." % repr(mysite))
-wikipedia.stopme()
-
+if __name__ == "__main__":
+ try:
+ main()
+ finally:
+ wikipedia.stopme()
More information about the Pywikipedia-svn
mailing list