Skip to content

Commit

Permalink
Skips some phases of the installation whenever they are not required.
Browse files Browse the repository at this point in the history
git-svn-id: svn://cherokee-project.com/wizards2@6792 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Aug 7, 2011
1 parent 67e176d commit 4cd151e
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Wizard2_GUI.py
Expand Up @@ -338,7 +338,14 @@ def validation_download_url (value):
class Stage_Install_Directory (Phase_PrevNext): class Stage_Install_Directory (Phase_PrevNext):
def __init__ (self): def __init__ (self):
Phase_PrevNext.__init__ (self, _("Installation Directory")) Phase_PrevNext.__init__ (self, _("Installation Directory"))

def __build_GUI__ (self): def __build_GUI__ (self):
# Skip phase if it's configuring an already installed app
install_type = CTK.cfg.get_val ('%s!install_type'%(CFG_PREFIX))
if install_type == 'local_directory':
self += CTK.DruidContent_TriggerNext()
return

# Refresh # Refresh
refresh = CTK.Refreshable({'id': 'wizard2-stage-install-dir-type-refresh'}) refresh = CTK.Refreshable({'id': 'wizard2-stage-install-dir-type-refresh'})
refresh.register (lambda: self.Refresh_Content (refresh, self).Render()) refresh.register (lambda: self.Refresh_Content (refresh, self).Render())
Expand Down Expand Up @@ -408,8 +415,6 @@ def __init__ (self, refresh):
# #


def collect_arguments (installer_params): def collect_arguments (installer_params):
print "[0] installer_params", installer_params

# Set the installer parameters: # Set the installer parameters:
# #
for key in CTK.cfg.keys (CFG_PREFIX): for key in CTK.cfg.keys (CFG_PREFIX):
Expand Down Expand Up @@ -487,16 +492,27 @@ def __init__ (self, Install_Class, next_url):
self.next_url = next_url self.next_url = next_url


def __build_GUI__ (self): def __build_GUI__ (self):
install_type = CTK.cfg.get_val ('%s!install_type'%(CFG_PREFIX))

# Logic Installer # Logic Installer
self.installer_params = {} self.installer_params = {}


# Commands # Commands (first block)
commands = [ commands = [
({'function': collect_arguments, 'description': "Collecting arguments...", 'params': {'installer_params': self.installer_params}}), ({'function': collect_arguments, 'description': "Collecting arguments...", 'params': {'installer_params': self.installer_params}}),
({'function': check_params, 'description': "Checking parameters...", 'params': {'installer_params': self.installer_params, 'stage_obj': self, 'Install_Class': self.Install_Class}}), ({'function': check_params, 'description': "Checking parameters...", 'params': {'installer_params': self.installer_params, 'stage_obj': self, 'Install_Class': self.Install_Class}}),
({'function': check_prerequisites, 'description': "Checking requisites...", 'params': {'stage_obj': self}}), ({'function': check_prerequisites, 'description': "Checking requisites...", 'params': {'stage_obj': self}}),
({'function': download, 'description': "Downloading...", 'params': {'stage_obj': self}}), ]
({'function': unpack, 'description': "Unpacking...", 'params': {'stage_obj': self}}),
# Commands (Download and Unpack are optional)
if install_type != 'local_directory':
commands += [
({'function': download, 'description': "Downloading...", 'params': {'stage_obj': self}}),
({'function': unpack, 'description': "Unpacking...", 'params': {'stage_obj': self}}),
]

# Commands (second block)
commands += [
({'function': configure_cherokee, 'description': "Configuring...", 'params': {'stage_obj': self}}), ({'function': configure_cherokee, 'description': "Configuring...", 'params': {'stage_obj': self}}),
] ]


Expand Down

0 comments on commit 4cd151e

Please sign in to comment.