Revision: 7687 Author: xqt Date: 2009-11-23 16:14:36 +0000 (Mon, 23 Nov 2009)
Log Message: ----------- small variant for user_config
Modified Paths: -------------- trunk/pywikipedia/generate_user_files.py
Modified: trunk/pywikipedia/generate_user_files.py =================================================================== --- trunk/pywikipedia/generate_user_files.py 2009-11-23 16:00:39 UTC (rev 7686) +++ trunk/pywikipedia/generate_user_files.py 2009-11-23 16:14:36 UTC (rev 7687) @@ -49,6 +49,10 @@ mylang = raw_input("The language code of the site we're working on (default: 'en'): ") or 'en' username = raw_input("Username (%s %s): " % (mylang, fam)) or 'UnnamedBot' username = unicode(username, console_encoding) + while True: + choice = raw_input("Which variant of user_config.py:\n[S]mall or [E]xtended (with further informations)? ").upper() + if choice in ['S','E']: + break
# # I don't like this solution. Temporary for me. @@ -67,7 +71,8 @@ config_text = '\n'.join(res)
f = codecs.open(_fnc, "w", "utf-8") - f.write("""# -*- coding: utf-8 -*- + if choice == 'E': + f.write("""# -*- coding: utf-8 -*-
# This is an automatically generated file. You can find more configuration parameters in 'config.py' file.
@@ -85,6 +90,12 @@
%s""" % (fam, mylang, fam, mylang, username, config_text)) + else: + f.write("""# -*- coding: utf-8 -*- +family = '%s' +mylang = '%s' +usernames['%s']['%s'] = u'%s' +""" % (fam, mylang, fam, mylang, username)) f.close() print("'%s' written." % _fnc)
pywikipedia-svn@lists.wikimedia.org