durusmail: quixote-users: Introducing myself, a small bug and RPMs for Quixote
Introducing myself, a small bug and RPMs for Quixote
2001-11-12
2001-11-12
2001-11-13
Seeking a Small Example of Forms/Widget Usage
2001-11-13
2001-11-13
2001-11-22
2001-11-22
2001-11-22
2001-11-23
Re: Seeking a Small Example of Forms/Widget Usage
2001-11-26
2001-11-26
2001-11-27
Mystery re ZODB Technique in vfab
2001-11-28
2001-11-28
An Example of Quixote/ZODB/Grouch Usage
2001-11-29
2001-11-13
Grouch and ZODB
2001-11-20
2001-11-21
2001-11-21
2001-11-21
2001-11-21
Introducing myself, a small bug and RPMs for Quixote
Jeff Rush
2001-11-21
Neil Schemenauer wrote:
>
> On Tue, Nov 13, 2001 at 03:50:11AM -0600, Jeff Rush wrote:
> > * Quixote doesn't seem to put in BASE_URL directives in generated
> >   html output, making it a bit clumsy to construct relative URLs.
>
> How does having BASE_URL in the _output_ help you?   Sorry, I don't know
> beans about Zope so you have to explain this one.

With Quixote targeting near Zope, I'm surprised you're not well-versed
in Zope and therein the frustration that led to the creation of Quixote.
Know that which you're trying to improve on and all... ;-)

Anyway, I mispoke.  The 'magic' item that Zope inserts automatically is:

      

to tell the browser the base URL to which relative URLs apply.

You can read more about it here:

    http://www.w3.org/TR/html4/struct/links.html#idx-base_URI

Fitting into the no-magic principle of Quixote, I guess each designer
will need to add it to their standard_html_header.ptl.  I'm just
surprised no one has missed it so far.


> > * I'm looking for the equivalent of url_quote and html_quote to
> >   wrap strings in python-generated output.
>
> Look in the quixote.html module.

Found, thanks!


> > * not sure of correct way to handle URLs with '.' in them,
> >   as in programmatically generated .gif responses.  Looks like
> >   it requires _q_name() ?
>
> We never ran into this problem.  I guess _q_name would be the solution.
> Do you need to have a dot?  Couldn't you just set the content-type
> appropriately?

Yeah, I guess _q_name is it.  The need is that weblog analyzers, such
as webalizer (and a few search engines) rely upon the extension to
classify the datatype and keep stats on graphics vs html requests.
In the case of the weblog, the content-type is not present.


> > * I miss a whole set of URL path manipulation functions, although
> >   I think I can get by with os.path.XXX in most cases.  Mostly
> >   I just need a 'parent' or 'container' request attribute.
>
> We use request.get_path() and request.get_path(n) frequently to build
> URLs.  For example, to make a URL to the parent container:
>
>     request.get_path(1) + "/"

I think there is a bug here someplace.  The http_request.get_path()
constructs the path from:
    path = "%(SCRIPT_NAME)s%(PATH_INFO)s" % self.environ

but, via request.dump(), I see a SCRIPT_NAME of "/q/" and a PATH_INFO
of "", making a path of "/q/".  The URL I invoked was:

    http://vault.timecastle.net/cgi-bin/windmill/

where windmill is the CGI that invokes Quixote.  I have no idea where
the "/q/" came from.  Is that Quixote's shortname for "_q_index"?

I expected get_path() to return basically REQUEST_URI:

    /cgi-bin/windmill/

so that I could build relative URLs from it to my other pages:

    request.get_path(1) + "/menu"   --> /cgi-bin/windmill/menu
                          but I get --> /q/menu

Environment:
DOCUMENT_ROOT   /var/www/html
GATEWAY_INTERFACE CGI/1.1
HTTP_ACCEPT     image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*
HTTP_ACCEPT_CHARSET iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING gzip
HTTP_ACCEPT_LANGUAGE en
HTTP_CGI_AUTHORIZATION
HTTP_CONNECTION Keep-Alive
HTTP_COOKIE     dtpref_rows="20"; dtpref_cols="90"
HTTP_HOST       vault.timecastle.net
HTTP_PRAGMA     no-cache
HTTP_USER_AGENT Mozilla/4.76 [en] (X11; U; Linux 2.4.3-12tau i686)
PATH            /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PATH_INFO
PATH_TRANSLATED /var/www/cgi-bin/Zope/
QUERY_STRING
REMOTE_ADDR     192.168.200.250
REMOTE_PORT     56141
REQUEST_METHOD  GET
REQUEST_URI     /cgi-bin/windmill/
SCRIPT_FILENAME /var/www/cgi-bin/windmill
SCRIPT_NAME     /q/
SCRIPT_URI      http://vault.timecastle.net/cgi-bin/windmill/
SCRIPT_URL      /cgi-bin/windmill/
SERVER_ADDR     192.168.200.250
SERVER_ADMIN    sysadmin@taupro.com
SERVER_NAME     vault.timecastle.net
SERVER_PORT     80
SERVER_PROTOCOL HTTP/1.0
SERVER_SIGNATURE 
Apache/1.3.19 Server at vault.timecastle.net Port 80
-Jeff Rush