r51552 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51551‎ | r51552 | r51553 >
Date:18:51, 6 June 2009
Author:kim
Status:deferred
Tags:
Comment:
* Update documentation
* Add a new installer called intelligent installer, which (often)
obviates the need to specify whether you mean mediawiki: or extension:
* set intelligent_installer as the default for ls, install, and uninstall for now
Modified paths:
  • /trunk/testing/installer/combined_installer.py (modified) (history)
  • /trunk/testing/installer/extension_installer2.py (modified) (history)
  • /trunk/testing/installer/installer_util.py (modified) (history)
  • /trunk/testing/installer/installers.py (modified) (history)
  • /trunk/testing/installer/intelligent_installer.py (added) (history)

Diff [purge]

Index: trunk/testing/installer/installer_util.py
@@ -43,7 +43,8 @@
4444 print "check_isolation <instance name>: shows all changes made to mediawiki or database since it was installed."
4545 print "update_self: updates the installer and restarts in interactive mode"
4646 print "update_tags: manually force an update of the tag cache (do this from time to time, if you're referring to things by tag)"
47 - print "duplicate <source_instance> <destination_instance> make a duplicate mediawiki instance, with copies of configuration, database, and extensions"
 47+ print "duplicate <source_instance> <destination_instance> [language <language_code>] make a duplicate mediawiki instance, with copies of configuration, database, and extensions"
 48+ print "maintenance_update <instance> run maintenance/update_settings.php on an instance to update the database. (run this after you are done installing,updating, and making changes to extensions)"
4849 print "TODO: Implement help path , for now, see documentation for info on how to specify <path>"
4950 print
5051 print "instead of interactive mode, you can also access commands directly from the shell:"
Index: trunk/testing/installer/intelligent_installer.py
@@ -0,0 +1,19 @@
 2+# This software, copyright (C) 2008-2009 by Wikiation.
 3+# This software is developed by Kim Bruning.
 4+#
 5+# Distributed under the terms of the MIT license.
 6+
 7+from combined_installer import Combined_Installer
 8+from extension_installer2 import extension_installer2
 9+from mediawiki_installer import Mediawiki_Installer
 10+
 11+def intelligent_installer():
 12+ """factory: returns a combined installer that installs extensions from either scripted or naive
 13+
 14+ technical detail:
 15+ For use with installers.get_system(system_name)
 16+ we exploit the fact that instantiation has the same semantics as a function call"""
 17+ mediawiki=Mediawiki_Installer()
 18+ extension2=extension_installer2()
 19+ combined=Combined_Installer([mediawiki,extension2])
 20+ return combined
Index: trunk/testing/installer/combined_installer.py
@@ -177,6 +177,8 @@
178178 we also set the same attribute locally.
179179 Be careful when reading back!"""
180180 self.__dict__[name]=value
 181+ if name=="systemlist": # prevent infinite recursion
 182+ return
181183 if self.systemlist:
182184 for system in self.systemlist:
183185 system.__setattr__(name,value)
Index: trunk/testing/installer/extension_installer2.py
@@ -7,7 +7,6 @@
88 from scripted_installer import Scripted_Installer
99 from naive_installer import Naive_Installer
1010
11 -
1211 def extension_installer2():
1312 """factory: returns a combined installer that installs extensions from either scripted or naive
1413
Index: trunk/testing/installer/installers.py
@@ -19,6 +19,7 @@
2020 from installation_system import Installer_Exception
2121 from download_installer import Download_Installer
2222 from extension_installer2 import extension_installer2
 23+from intelligent_installer import intelligent_installer
2324 from test_system import Test_System,Test_Exception
2425
2526 from tags import Tags, TagsException
@@ -79,7 +80,7 @@
8081 if ppath["installer"]==None:
8182 return ls_systems()
8283 else:
83 - ppath["system"]="mediawiki" # XXX hardcoded default
 84+ ppath["system"]="intelligent" # XXX hardcoded default
8485
8586 return ls_installed_in_system(ppath)
8687
@@ -218,7 +219,7 @@
219220
220221 ppath=None
221222 try:
222 - ppath=parse_path(" ".join(args[1:]), defaults={'ai':'available','system':'mediawiki'})
 223+ ppath=parse_path(" ".join(args[1:]), defaults={'ai':'available','system':'intelligent'})
223224 except Parse_Exception,e:
224225 print str(e)
225226 return
@@ -272,7 +273,7 @@
273274
274275 ppath=None
275276 try:
276 - ppath=parse_path(" ".join(args[1:]),defaults={'ai':'installed','system':'mediawiki'})
 277+ ppath=parse_path(" ".join(args[1:]),defaults={'ai':'installed','system':'intelligent'})
277278 except Parse_Exception,e:
278279 print str(e)
279280 return
@@ -463,7 +464,7 @@
464465
465466 # Constants
466467
467 -systems={'toolkit':Toolkit_Installer,'scripted': Scripted_Installer, 'mediawiki':Mediawiki_Installer,'naive': Naive_Installer, 'download':Download_Installer, 'extension':extension_installer2}
 468+systems={'toolkit':Toolkit_Installer,'scripted': Scripted_Installer, 'mediawiki':Mediawiki_Installer,'naive': Naive_Installer, 'download':Download_Installer, 'extension':extension_installer2, 'intelligent':intelligent_installer}
468469
469470
470471 if __name__=="__main__":

Status & tagging log