r48152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48151‎ | r48152 | r48153 >
Date:23:57, 7 March 2009
Author:kim
Status:deferred
Tags:
Comment:
Added a debug flag to settings.py, to aid in debugging scripts.
Modified paths:
  • /trunk/wikiation/installer/installation_system.py (modified) (history)
  • /trunk/wikiation/installer/settings.py.example (modified) (history)
  • /trunk/wikiation/installer/settings_handler.py (modified) (history)

Diff [purge]

Index: trunk/wikiation/installer/settings.py.example
@@ -37,10 +37,15 @@
3838
3939 # what mysql command should be used. (Who us? Use horrible hacks?)
4040
41 -mysql_command="mysql -uwiki -pwiki1234"
 41+mysql_command="mysql -uroot"
4242
4343 # run automated tests during installation
4444 # this is useful if you are in a testing environment.
4545 # If you are running production, you might want to leave
4646 # this set to False.
4747 run_automated_tests=False
 48+
 49+
 50+# Print debugging messages when executing insatller scripts
 51+# (off by default)
 52+debug=False
Index: trunk/wikiation/installer/settings_handler.py
@@ -2,10 +2,14 @@
33 # This software is developed by Kim Bruning.
44 #
55 # Distributed under the terms of the MIT license.
6 -# ======================================
7 -#Default settings file. DO NOT EDIT (edit settings.py instead)
8 -# =======================================
 6+#
 7+# =============================================================
 8+# Default settings file. DO NOT EDIT (edit settings.py instead)
 9+# =============================================================
910
 11+# Provides sane defauls and backwards compatibility for
 12+# settings.py.
 13+
1014 import os
1115
1216 # "You Are Here"
@@ -46,8 +50,8 @@
4751 # this set to False.
4852 run_automated_tests=False
4953
 54+debug=False
5055
51 -
5256 if os.path.exists(os.path.join(installerdir, 'settings.py')):
5357 from settings import *
5458
Index: trunk/wikiation/installer/installation_system.py
@@ -80,9 +80,16 @@
8181 if filename.startswith(task2[0]):
8282 task2[0]=os.path.join(installdir,filename)
8383 try:
84 - #print task2,env #useful for debugging. Might want to make a flag! :-)
 84+ if settings.debug:
 85+ print " === " +task+" === "
 86+ print "environment",env
 87+ print "task",task2
8588 process=subprocess.Popen(task2 ,stdout=subprocess.PIPE, env=env)
8689 stdout,stderr=process.communicate()
 90+ if settings.debug:
 91+ print "stdout:",stdout
 92+ print "stderr:",stderr
 93+ print
8794 except Exception, e:
8895 #reraise with task and env info included, to give us a clue where we went wrong
8996 raise Exception((e,task2,env))

Status & tagging log