http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9962
Revision: 9962 Author: xqt Date: 2012-03-03 13:05:14 +0000 (Sat, 03 Mar 2012) Log Message: ----------- Do not create_user_config_file() when version.py is called
Modified Paths: -------------- trunk/pywikipedia/wikipediatools.py
Modified: trunk/pywikipedia/wikipediatools.py =================================================================== --- trunk/pywikipedia/wikipediatools.py 2012-03-03 07:13:04 UTC (rev 9961) +++ trunk/pywikipedia/wikipediatools.py 2012-03-03 13:05:14 UTC (rev 9962) @@ -47,6 +47,8 @@ raise RuntimeError("Directory '%s' does not exist." % base_dir) if not os.path.exists(os.path.join(base_dir, "user-config.py")): print("No user-config.py found in directory '%s'" % base_dir) - print("Creating...\n") - create_user_config_file(base_dir) + called = os.path.basename(sys.argv[0].strip()) + if not ('version' in called): + print("Creating...\n") + create_user_config_file(base_dir) return base_dir
pywikipedia-svn@lists.wikimedia.org