Ian Bicking wrote:
Huy wrote:

Just wondering if Webware could do cherrypy like url mapping. Does the new WSGIKit support this either ?


In SVN there's URLParser, which allows for a number of kinds of URL parsing overrides -- look at WebKit.URLParser.URLParser.parseInit.


This works great. However, I had to change the _FileParser so I can access the default mapping without cutting and pasting too much code. It's very minimal. Can anyone see if there is any other way to do this.


=============================================================================
        def parse(self, trans, requestPath):
                [..snip comments...]

                # print "FP(%r) parses %r" % (self._path, requestPath)

                result = self.parseInit(trans, requestPath)
                if result is not None:
                        return result

                assert not requestPath or requestPath.startswith('/'), \
                       "Not what I expected: %s" % repr(requestPath)
                if not requestPath or requestPath == '/':
                        return self.parseIndex(trans, requestPath)

                return self.parseDefault(trans, requestPath)

        def parseDefault(self, trans, requestPath):
                [...the rest of what parse use to be...]

=============================================================================

I am using the urlParserHook. Because of the way webware handles the servlet i.e calling awake, respond etc. I had to set a custom attribute on my servlet and in my respond method, I called the method if it was set. Although it works, its pretty non standard stuff. Is there anyway of getting this into standard webware in a much more cleaner way. I think using filters like cherrypy is the way to go.

Huy


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to