Last modified: 2014-11-02 12:25:40 UTC
If script cfd is run with family wikidata, it throws NoSuchSite. Traceback (most recent call last): File "pwb.py", line 157, in <module> run_python_file(fn, argv, argvu) File "pwb.py", line 67, in run_python_file exec(compile(source, filename, "exec"), main_mod.__dict__) File "scripts/cfd.py", line 178, in <module> main() File "scripts/cfd.py", line 69, in main for line in page.get().split("\n"): File ".../pywikibot/__init__.py", line 432, in wrapper return method(*__args, **__kw) File ".../pywikibot/__init__.py", line 432, in wrapper return method(*__args, **__kw) File ".../pywikibot/page.py", line 315, in get self._getInternals(sysop) File ".../pywikibot/page.py", line 339, in _getInternals self.site.loadrevisions(self, getText=True, sysop=sysop) File ".../pywikibot/page.py", line 121, in site return self._link.site File ".../pywikibot/page.py", line 3750, in site self.parse() File ".../pywikibot/page.py", line 3673, in parse newsite = pywikibot.Site(otherlang, familyName) File ".../pywikibot/__init__.py", line 483, in Site _sites[key] = __Site(code=code, fam=fam, user=user, sysop=sysop) File ".../pywikibot/site.py", line 635, in __init__ BaseSite.__init__(self, code, fam, user, sysop) File ".../pywikibot/site.py", line 166, in __init__ % (self.__code, self.__family.name)) pywikibot.exceptions.NoSuchSite: Language wikidata does not exist in family wikipedia <class 'pywikibot.exceptions.NoSuchSite'> CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
Same for commons.
It looks like the script is supposed to work only on wikipedia. # The location of the CFD working page. 24 cfdPage = u'Wikipedia:Categories for discussion/Working'
Seems it's a single purpose bot for en-wiki.
So we should add a check in main() to exit if the config/args site is not en.wp? Or ignore the config/args and use en.wp anyway?
I'd recommend the first, so someone doesn't accidentally execute it on en.wp, and if someone does want to use it on en.wp they could use -family: and -code: or change the user-config depending on their preference.