Last modified: 2014-11-02 12:44:51 UTC
$ python generate_family_file.py http://translatewiki.net/w/api.php twn Generating family file from https://translatewiki.net/w/api.php *** WARNING: Api does not seem to be enabled on https://translatewiki.net/w/api.php Traceback (most recent call last): File "generate_family_file.py", line 339, in <module> FamilyFileGenerator(*sys.argv[1:]).run() File "generate_family_file.py", line 73, in run w = Wiki(self.base_url) File "generate_family_file.py", line 284, in __init__ self._parse_pre_117(data) File "generate_family_file.py", line 296, in _parse_pre_117 self.server = self.REwgServer.search(data).groups()[0] AttributeError: 'NoneType' object has no attribute 'groups' $ python --version Python 2.7.3 $ python version.py Pywikibot [https] r/pywikibot/compat (r10331, 445623d, 2013/10/01, 18:00:37, ok) Release version: 1.0b1 Python: 2.7.3 (default, Aug 9 2012, 17:23:58) [GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] config-settings: use_api = True use_api_login = True unicode test: ok It's the same with Pywikipedia trunk/pywikipedia/ (r11781, 2013/07/20, 11:39:29, ok)
Note that I gave http as input and it used https, despite no redirect being in place.
Use the link http://translatewiki.net/wiki/Main_Page the generate_family_file.py is designed to use the main url of the wiki to generate the family file not the api url.
It would also be useful to understand direct api urls. Re-opening as feature request.
In core, the logic in FamilyFileGenerator can be migrated into AutoFamily and APISite, which already understands /api.php URLs, and can access the API.