[HCoop-Discuss] Next-generation Domtool

Adam Chlipala adamc at hcoop.net
Thu Sep 7 11:14:52 EDT 2006


Terrence Brannon wrote:

> How can I create data with this new tool that is available for all 
> domains?

Oh, good, an easy question. :-)
Answer: The same way as you do in any programming language: define a 
variable that's in scope for all of the places you want to use it.

>
> For instance, all but one domain I serve  exists in 
> ~/domains
>
> Therefore in my domtool2 specs for any domain, I would like something 
> like:
>
> class MyDomains(domTool2.domains):
>   domain_root = $ENV{HOME} + "domains"

This should be easy to implement.  I would do it with a Domtool 
environment variable in place of your $ENV{HOME}, and I would choose to 
make this variable contain the exact root of your domain data, not your 
home directory.

>
> and it would be neat for instances of MyDomain to create directory 
> structures for my new domains. The directory structure in /etc/ is 
> made for me, but I have to create a parallel one in my home directory.

This should also be easy, though it requires changes to the interpreter 
code.  I would have both the client and server run your configuration 
program, where some commands only have effects on the client (like 
creating user-level directory structure) and the rest only have effects 
on the server (like anything that affects Apache config).

At the same time, is it really so hard to create a new directory when 
you'll be populating it with content shortly after?  There's no 
asymptotic penalty to requiring a single constant-time operation first!




More information about the HCoop-Discuss mailing list