Revision: 48152 Author: kim Date: 2009-03-07 23:57:19 +0000 (Sat, 07 Mar 2009)
Log Message: ----------- Added a debug flag to settings.py, to aid in debugging scripts. Modified Paths: -------------- trunk/wikiation/installer/installation_system.py trunk/wikiation/installer/settings.py.example trunk/wikiation/installer/settings_handler.py Modified: trunk/wikiation/installer/installation_system.py =================================================================== --- trunk/wikiation/installer/installation_system.py 2009-03-07 23:45:55 UTC (rev 48151) +++ trunk/wikiation/installer/installation_system.py 2009-03-07 23:57:19 UTC (rev 48152) @@ -80,9 +80,16 @@ if filename.startswith(task2[0]): task2[0]=os.path.join(installdir,filename) try: - #print task2,env #useful for debugging. Might want to make a flag! :-) + if settings.debug: + print " === " +task+" === " + print "environment",env + print "task",task2 process=subprocess.Popen(task2 ,stdout=subprocess.PIPE, env=env) stdout,stderr=process.communicate() + if settings.debug: + print "stdout:",stdout + print "stderr:",stderr + print except Exception, e: #reraise with task and env info included, to give us a clue where we went wrong raise Exception((e,task2,env)) Modified: trunk/wikiation/installer/settings.py.example =================================================================== --- trunk/wikiation/installer/settings.py.example 2009-03-07 23:45:55 UTC (rev 48151) +++ trunk/wikiation/installer/settings.py.example 2009-03-07 23:57:19 UTC (rev 48152) @@ -37,10 +37,15 @@ # what mysql command should be used. (Who us? Use horrible hacks?) -mysql_command="mysql -uwiki -pwiki1234" +mysql_command="mysql -uroot" # run automated tests during installation # this is useful if you are in a testing environment. # If you are running production, you might want to leave # this set to False. run_automated_tests=False + + +# Print debugging messages when executing insatller scripts +# (off by default) +debug=False Modified: trunk/wikiation/installer/settings_handler.py =================================================================== --- trunk/wikiation/installer/settings_handler.py 2009-03-07 23:45:55 UTC (rev 48151) +++ trunk/wikiation/installer/settings_handler.py 2009-03-07 23:57:19 UTC (rev 48152) @@ -2,10 +2,14 @@ # This software is developed by Kim Bruning. # # Distributed under the terms of the MIT license. -# ====================================== -#Default settings file. DO NOT EDIT (edit settings.py instead) -# ======================================= +# +# ============================================================= +# Default settings file. DO NOT EDIT (edit settings.py instead) +# ============================================================= +# Provides sane defauls and backwards compatibility for +# settings.py. + import os # "You Are Here" @@ -46,8 +50,8 @@ # this set to False. run_automated_tests=False +debug=False - if os.path.exists(os.path.join(installerdir, 'settings.py')): from settings import * _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs