Hi,
First, I just want to thank the developers/contributers of Webware for
their excellent work. I am pretty new to web application development
having only done small applications in the past. After looking at
several other platforms in Java and Python I have chosen Webware for
(what is to me) a fairly large project. I like Webware because it is
lightweight yet well designed so easy to understand, use, and extend. I
am also happy to see that there are others are currently active in its
ongoing development.
Below is a description of a problem with running the Component 0.2
examples and the fix I found:
- I checked out Component 0.2 from
http://webwareforpython.org/downloads/Component/Component-0.2.tar.gz and
experimented with it by creating a symbolic link to its Example
subdirectory in a new Webkit (0.91) instance and then adding
Contexts['Examples'] = 'Examples' in Application.config.
- I then restarted the Webware site and visited it using http://<local
webware uri>/Examples/ ->This showed the default Webware examples page
but nothing else.
- When I looked at Main.py in ./Examples I saw the line from
WebKit.Examples.ExamplePage. I added the following line under the Main
class definition just so I could play with the examples:
def respond(self, trans):
trans.application().forward(trans, '/Login' +
trans.request().extraURLPath() )
- This led to the following error when I refreshed http://<local webware
uri>/Examples/ :
....
....
File "/home/codehop-dev/Downloads/LoginKit-0.1/LoginKit/Examples/ExamplePage.py", line 19, in title [edit] <http://marigold.informatics.washington.edu:7000/Admin/EditFile?filename=/home/codehop-dev/Downloads/LoginKit-0.1/LoginKit/Examples/ExamplePage.py&line=19>
return CPage.title(self)
TypeError: unbound method title() must be called with CPage instance as first argument (got Login instance instead)
- After fiddling awhile I noticed that the ExamplePage class in ./Example did not inherit from CPage so I added it:
class ExamplePage(CPage, WebKitExamplePage):
- This fixed the problem and all the pages in Example worked fine.
Hope it helps,
Richard Boyce
|