Revision: 6984 Author: nicdumz Date: 2009-06-22 15:18:46 +0000 (Mon, 22 Jun 2009)
Log Message: ----------- code cleanup, removing unused variables, imports.
Modified Paths: -------------- branches/rewrite/pywikibot/login.py
Modified: branches/rewrite/pywikibot/login.py =================================================================== --- branches/rewrite/pywikibot/login.py 2009-06-22 15:05:00 UTC (rev 6983) +++ branches/rewrite/pywikibot/login.py 2009-06-22 15:18:46 UTC (rev 6984) @@ -42,14 +42,12 @@ # # Distributed under the terms of the MIT license. # -__version__='$Id$' +__version__ = '$Id$'
import logging -import re -import urllib2 import pywikibot from pywikibot import config -from pywikibot.exceptions import * +from pywikibot.exceptions import NoSuchSite, NoUsername
logger = logging.getLogger("wiki.login")
@@ -221,7 +219,7 @@ pass
def main(*args): - username = password = None + password = None sysop = False logall = False forceLogin = False @@ -251,13 +249,12 @@ try: site = pywikibot.getSite(code=lang, fam=familyName) if not forceLogin and (site.logged_in(sysop) and site.user()) != None: - pywikibot.output(u'Already logged in on %(site)s' - % locals()) + pywikibot.output(u'Already logged in on %s' % site) else: loginMan = LoginManager(password, sysop=sysop, site=site) loginMan.login() - except pywikibot.NoSuchSite: + except NoSuchSite: pywikibot.output( lang + u'.' + familyName + u' is not a valid site, please remove it from your config')
pywikipedia-svn@lists.wikimedia.org