monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: ViewMTN multi-db


From: Grahame Bowland
Subject: [Monotone-devel] Re: ViewMTN multi-db
Date: Fri, 22 Feb 2008 00:47:40 +0000

Hi Roland

On 21/02/2008, Roland McGrath <address@hidden> wrote:
[ . .snip ..]
>  I had been imagining the option of:
>
>         dbfiles = lambda prefix: ...

Okay, I've just implemented something similar to this. You can provide
dbfiles as a function, taking zero arguments, and returning a tuple in
the normal format. I've put an example of how to do this in
config.py.example. Synced to monotone.ucc (rev [b5d299ba8b]).

The function with zero arguments is to avoid the list of databases
being computed every time something imports config.

>  What happens if I don't set a defaultdb?  What I'd really like is for the
>  top-level url to just get to the 'Change DB' page (with slightly different
>  titling and text for no db currently selected).  Really swift would be a
>  configurable inserted chunk of html for that page, so that could just be
>  the top-level page of a hosting site with some random local content above
>  the db selection list.

Done and synced to monotone.ucc, see [0ab839402dabfe75e..]. It's not
configurable; just edit the template. You can easily commit to viewmtn
on a private branch, and propagate from the main branch to yours to
upgrade.

The description is escaped, so you can't put HTML in. Easy to change,
just look at the #filter stuff in other templates.

>  The mod_wsgi glue magic in the rpm is via this .../viewmtn/__init__.py file:
>
>         from viewmtn import *
>         application = web.wsgifunc(web.webpyfunc(urls, globals()))
>
>  Maybe that idiom has changed?

That definitely won't work any more. urls is now built when the
ViewMTN instance starts up,
and globals() has been defined by a hash built the application.

Try replacing it with:
  from viewmtn import assemble_urls
  urls, fvars = assemble_urls()
  pplication = web.wsgifunc(web.webpyfunc(urls, fvars))

I haven't tested that - unfortunately I'm overseas and don't have a
convenient machine to try  and replicate the problem on. You'll need
the very latest rev, [0b434d71ff24d..]

I'll be traveling the next few days and possibly out of contact.

Have fun
Grahame




reply via email to

[Prev in Thread] Current Thread [Next in Thread]