[Gimp-web] rewrite_attrs.py
Helvetix Victorinox
helvetix at mysterious.org
Sun Apr 20 04:15:20 2003
> (1) The way images are handled feels rather obscure. The current
You've offered a couple of comments on the attribute rewriter, so I
will give a quick overview of what has been going on behind the scenes
before now.
The attribute rewriter is just that, it rewrites attributes
in xml tags. There is a general text substituter sitting in
programmatic/tools/subst.py, but sed probably does a more efficient job
at the expense of syntax.
The very first attribute rewriter was written in xsl. A great beautiful
colossus of XSL which I realised at the end I would never get anyone
else to use. Especially since the XSL preprocessor was extraordinarily
terse when it found a syntax error: "Segmentation Fault"
At this point, in any case, It's all just a matter of software and
of education. Both of which are usually reduced to: Time * Caffeine
> (2) The attribute rewriter seems to reorder the attributes
> alphabetically. This is no problem but IMO it makes the generated
> source look rather strange.
Yes, unfortunately Python dicts don't give you the keys in the same
order as they were inserted. Instead of sorting, I could just leave
them in the order Python gives them back to me. But I think people
will like that ption least of all, since the attributes won't be in
the original order, and they won't be in any human understandable order.
> (3) If I regenerate the site locally I have to do "make
> DocumentRoot=`pwd`". IMO this should be the default so that
> simply typing 'make' would work. What is the DocumenRoot used for
> anyway? It doesn't look as if it is prepended to absolute links
> which is what I would have expected. It would also be nice to
> .cvsignore files so that I don't get all the html files listed
> when I 'cvs update' after using make.
Three points below. Please be sure to read each of them.
There is a lot of history embedded in the Makefile(s) and install.sh, and
considerable resistance to changing what already was working for people.
Nevertheless, your comments are well put. Keep in mind the web team is
comprise of developers and non-developers. The current state represents
this middle ground so speak.
There are, and will continue to be, some files that should not be installed
under DocumentRoot. DocumentRoot exists as a sort of ${INSTALLDIR}
or --prefix=<whatever> because it is not desirable to install the actual
site "on top" of the sources for the site. DocumentRoot is used in many
of the scripted web-pages.
The site is supposed to be installed by typing ./install.sh <dir>
(where <dir> is DocumentRoot). If you have been typing only make
DocumentRoot=<whatever> you've missed the steps embedded in install.sh.
There used to be a readme that said this. It was the one I read when I
irst started with the project. I see that it disappeared. Shame on us.
Before you comment that all of this should be the Makefile, see point
#1 above.
Ultimately the "right thing" will be happening with Makefiles, cvsignore,
ecurity, and so forth. In the meantime, if anyone is impatient, they
can help out. :-)
Helvetix