[tahoe-dev] URL Generator
Brian Warner
warner at lothar.com
Mon Jul 25 15:21:01 PDT 2011
On 7/25/11 1:24 PM, Brandon Meskimen wrote:
> Does anyone know where the URL generater is in the source code or where
> the links to files in directories are located in the source code?
When you list a directory in the "WUI" (the Web User Interface), the
HTML is generated by an instance of the the DirectoryAsHTML class in
src/allmydata/web/directory.py . Each row of the directory listing is
generated by the "render_row()" method of that class (line 638). The URL
in the href= target of the <a> tag for the left-most column (i.e. what
you get when you click on the child file/dirname link) is filled in the
ctx.fillSlots("filename", what) calls, such as the immutable-file
download link at line 715, or the directory-listing link at line 726.
These URLs are derived by starting with a "root" that's basically a
bunch of "../" that get back up to the root of the web server's tree
(this helps when e.g. you've got an apache reverse-proxy in front of the
tahoe server, so "/path/to/xyz" means something different). Then it
appends some stuff, usually "/file/URI" and then some other stuff.
hope that helps,
-Brian
More information about the tahoe-dev
mailing list