durusmail: quixote-users: Quixotic use of StaticFile...
Quixotic use of StaticFile...
Re: Quixotic use of StaticFile...
2004-03-10
Quixotic use of StaticFile...
Stuart Hungerford
2004-03-10
Hi all,

I have a question about the most Quixotic use of the
quixote.util.StaticFile class.

I've setup a series of classes to handle each part of
the URL path http://example.org/foo/bar/filename

In the class that handles the trailing "filename" part
of the URL path I have a _q_index() method that needs
to perform a test and based on the result either
return the contents of the file or a descriptive
error message.

Something like:

    class filenameUI:

        def __init__(self, filename):
         self._filename = filename

        def _q_index [html] (self, request):
            if sometest(self_.filename):
                # need to invoke StaticFile contents here
            else:
                '''HTML formatted strings'''


The question is: am I going about this in the most
Quixotic way or am I using the whole framework in the
wrong way?  E.g. Should all the testing logic be instead
in the class that handles the "bar" part of the URL path?
Or maybe I need another class that is returned by the
_q_lookup() function of filenameUI ?

Any advice much appreciated,


Cheers,

Stu

--
:: Stuart Hungerford (stuart.hungerford@anu.edu.au)
:: ANU Internet Futures Group



reply