[Distutils] cleaning up packages

Greg Ward gward@python.net
Wed, 7 Jun 2000 22:43:49 -0400

On 07 June 2000, Michael Muller said:
> The patch that I submitted uses a format based on that of ConfigParser.  It
> allows for the definition of arbitrary nested syntaxes for defining data.
> The system currently supports the specification of data elements as simple
> strings (no embedded newlines or whitespace), lists of simple strings (one
> per line), lists of words (words being defined as "no embedded whitespace"),
> and two more specialized types for describing dependencies.  Alternate
> formats can be easily added.

We should probably resurrect this, then.  I know I was put off by the
complexity of the implementation, but I'm being totally unfair.  I
probably would have come up with something at *least* as complex.  ;-)
(A bad habit of mine.)

> I would have liked to have used indentation to define structure, but
> ConfigParser replaces all indentation in continuation lines with a single
> blank space.

I'm leaning towards "Steal ideas, not code" with respect to
ConfigParser.  (I've been leaning that way with getopt too for quite a
while.  Sigh.)

Anyone interested in Distutils data formats should give my TextFile
class (in distutils/text_file.py) a good, close read.  This is the class
that takes care of stripping comments, joining lines by backslashes, and
other common Unix-config-file-type tasks.  (TextFile is not a great
name, but I couldn't think of anything better.)  If possible, it would
be nice to add join-lines-by-whitespace a la rfc822.py and ConfigParser.
(This would be mutually exclusive with join-lines-by-backslash.)

Greg Ward - Linux weenie                                gward@python.net
All of life is a blur of Republicans and meat!