http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9964
Revision: 9964 Author: xqt Date: 2012-03-04 10:09:53 +0000 (Sun, 04 Mar 2012) Log Message: ----------- extract the module name by splitting
Modified Paths: -------------- trunk/pywikipedia/wikipediatools.py
Modified: trunk/pywikipedia/wikipediatools.py =================================================================== --- trunk/pywikipedia/wikipediatools.py 2012-03-03 13:05:53 UTC (rev 9963) +++ trunk/pywikipedia/wikipediatools.py 2012-03-04 10:09:53 UTC (rev 9964) @@ -47,8 +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) - called = os.path.basename(sys.argv[0].strip()) - if not ('version' in called): + called = os.path.basename(sys.argv[0].strip()).split('.')[0] + if called != 'version': print("Creating...\n") create_user_config_file(base_dir) return base_dir
pywikipedia-svn@lists.wikimedia.org