Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

WIP: Adds a new PostUnpack internal phase

git-svn-id: svn://cherokee-project.com/wizards2@6796 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
commit 1a9ad5a65aed82677c6a3baf1b8858212e0afee0 1 parent 1241933
@alobbs alobbs authored
View
6 CommandProgress.py
@@ -125,7 +125,11 @@ def __init__ (self, command_progress):
if ret.get('command'):
title_error = CTK.escape_html (ret['command'])
elif command_entry.has_key ('function'):
- title_error = CTK.escape_html (command_entry['function'].__name__)
+ if command_entry.has_key('description'):
+ title_error = CTK.escape_html ('%s (%s)'%(command_entry['description'],
+ command_entry['function'].__name__))
+ else:
+ title_error = CTK.escape_html (command_entry['function'].__name__)
else:
title_error = _("Unknown Error")
View
30 Wizard2.py
@@ -30,7 +30,7 @@
class Wizard (object):
def __init__ (self, name, params=None):
- self.name = "Unnamed"
+ self.name = name or "Unnamed"
self.type = None # 'directory' or 'vserver'
self.vserver_num = None # 10, 20, ..
@@ -50,19 +50,22 @@ def __init__ (self, name, params=None):
# Public
#
def Check_Parameters (self):
- pass
+ return []
def Check_Prerequisites (self):
- pass
+ return []
def Download (self):
- pass
+ return []
def Unpack (self):
- pass
+ return []
+
+ def Check_PostUnpack (self):
+ return []
def Configure_Cherokee (self):
- pass
+ return []
#
# Private
@@ -196,6 +199,21 @@ def _Handle_Unpacking (self):
return []
+ #
+ # Checks
+ #
+ def _Check_File_Exists (self, filename):
+ assert self.app_dir
+ assert self.name
+
+ errors = []
+ fpath = os.path.join (self.app_dir, filename)
+
+ if not os.path.exists (fpath):
+ errors += [_("The '%(app_dir)s' directory does not look like a %(name)s directory: The %(filename)s file is missing.")
+ %({'app_dir': self.app_dir, 'name': self.name, 'filename': filename})]
+
+ return errors
def Load_Module (path):
tmp = path.split('/')
View
17 Wizard2_GUI.py
@@ -462,6 +462,16 @@ def unpack (stage_obj):
# Ok
return {'retcode': 0}
+def check_post_unpack (stage_obj):
+ installer = stage_obj.installer
+
+ errors = installer.Check_PostUnpack()
+ if errors:
+ return {'retcode': 1, 'stderr': errors[0]}
+
+ # Ok
+ return {'retcode': 0}
+
def configure_cherokee (stage_obj):
installer = stage_obj.installer
@@ -495,13 +505,14 @@ def __build_GUI__ (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}}),
+ ({'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': check_post_unpack, 'description': "Checking app...", 'params': {'stage_obj': self}}),
+ ({'function': configure_cherokee, 'description': "Configuring...", 'params': {'stage_obj': self}}),
]
# GUI
View
1  cherokee-wizard
@@ -56,6 +56,7 @@ def install (wizard_path, params):
installer.Check_Prerequisites,
installer.Download,
installer.Unpack,
+ installer.Check_PostUnpack,
installer.Configure_Cherokee):
errors = phase()
View
3  wizards/02-Content Management Systems/wordpress.py
@@ -113,6 +113,9 @@ def Check_Prerequisites (self):
errors += self._Prerequisite__MySQL()
return errors
+ def Check_PostUnpack (self):
+ errors = self._Check_File_Exists ('wp-comments-post.php')
+ return errors
#
# GUI
Please sign in to comment.
Something went wrong with that request. Please try again.