Author: chrisz
Date: Fri Apr 21 05:20:43 2006
New Revision: 5095
Modified:
Webware/trunk/COMKit/Properties.py
Webware/trunk/KidKit/Docs/UsersGuide.phtml
Webware/trunk/KidKit/Properties.py
Webware/trunk/KidKit/__init__.py
Log:
Lined up checks for requiredSoftware in KidKit and COMKit.
Modified: Webware/trunk/COMKit/Properties.py
==============================================================================
--- Webware/trunk/COMKit/Properties.py (original)
+++ Webware/trunk/COMKit/Properties.py Fri Apr 21 05:20:43 2006
@@ -19,17 +19,17 @@
]
def willRunFunc():
- # WebKit doesn't check requiredSoftware yet.
- # So we do so:
- success = 0
+ # WebKit doesn't check requiredSoftware yet. So we do so:
try:
- # For reasons described in the __init__.py, we can't actually import pythoncom
- # here, but we need to see if the module is available. We can use the "imp"
- # standard module to accomplish this.
+ # For reasons described in the __init__.py, we can't actually import
+ # pythoncom here, but we need to see if the module is available.
+ # We can use the "imp" standard module to accomplish this.
import imp
- imp.find_module('pythoncom')
- success = 1
+ for soft in requiredSoftware:
+ imp.find_module(soft['name'])
except ImportError:
- pass
+ success = 0
+ else:
+ success = 1
if not success:
- return 'The pythoncom module (pywin32 library) is required to work with COM.'
+ return 'The pythoncom module (pywin32 library) is required to use COMKit.'
Modified: Webware/trunk/KidKit/Docs/UsersGuide.phtml
==============================================================================
--- Webware/trunk/KidKit/Docs/UsersGuide.phtml (original)
+++ Webware/trunk/KidKit/Docs/UsersGuide.phtml Fri Apr 21 05:20:43 2006
@@ -20,16 +20,17 @@
<h2>Requirements</h2>
<p>Contrary to PSP, Kid itself is not included in Webware. You need to install
-the Kid package separately which in turn needs the ElementTree package and
-optionally makes use of the cElementTree package.</p>
+the Kid package separately. Note that Kid needs the ElementTree package and
+optionally makes use of the cElementTree package (future versions of Kid may
+also utilize the xml.etree package that comes shipped with Python 2.5).</p>
<p>You can download Kid from
<a href="http://kid.lesscode.org">kid.lesscode.org</a>,
and ElementTree from
<a href="http://effbot.org/downloads/#elementtree">effbot.org/downloads/#elementtree</a>.</p>
-<p>The current KidKit was tested with Kid versions from 0.6 up to 0.9.1,
-and Element Tree 1.2.6. Other versions may work as well.</p>
+<p>The current KidKit has been tested with Kid versions from 0.6 up to 0.9.1,
+and ElementTree version 1.2.6. Other versions may work as well.</p>
<h2>Feedback</h2>
Modified: Webware/trunk/KidKit/Properties.py
==============================================================================
--- Webware/trunk/KidKit/Properties.py (original)
+++ Webware/trunk/KidKit/Properties.py Fri Apr 21 05:20:43 2006
@@ -8,7 +8,7 @@
requiredPyVersion = (2, 3, 0)
-requiredKidVersion = (0, 6, 0)
+requiredSoftware = [ { 'name': 'kid', 'version': (0, 6, 0) } ]
synopsis = """KidKit is a Webware plug-in that allows Kid templates
to be automatically compiled and run as servlets by the WebKit application server.
@@ -21,3 +21,17 @@
'ServletInfo', 'SimpleForm', 'MandelbrotSet',
]
}
+
+def willRunFunc():
+ # WebKit doesn't check requiredSoftware yet. So we do so:
+ try:
+ import imp
+ for soft in requiredSoftware:
+ imp.find_module(soft['name'])
+ except ImportError:
+ success = 0
+ else:
+ # The required version will be checked in __init__.py.
+ success = 1
+ if not success:
+ return 'The kid package is required to use KidKit.'
Modified: Webware/trunk/KidKit/__init__.py
==============================================================================
--- Webware/trunk/KidKit/__init__.py (original)
+++ Webware/trunk/KidKit/__init__.py Fri Apr 21 05:20:43 2006
@@ -6,8 +6,14 @@
from WebKit.PlugIn import PlugInError
try:
try:
- from KidKit.Properties import requiredKidVersion
+ from KidKit.Properties import requiredSoftware
except ImportError:
+ raise PlugInError, 'Cannot determine required software.'
+ for soft in requiredSoftware:
+ if soft['name'] == 'kid':
+ requiredKidVersion = soft['version']
+ break
+ else:
raise PlugInError, 'Cannot determine required Kid version.'
try:
import kid
|