Commit Graph

18 Commits

Author SHA1 Message Date
Tarek Ziadé 2b66da7d15 massive import cleaning in Distutils 2009-12-21 01:22:46 +00:00
Tarek Ziadé 90b7d56d91 moved distutils.text_file tests into a real unittest class 2009-02-22 19:58:12 +00:00
Guido van Rossum 8bc0965adf Removed uses of dict.has_key() from distutils, and uses of
callable() from copy_reg.py, so the interpreter now starts up
without warnings when '-3' is given.  More work like this needs to
be done in the rest of the stdlib.
2008-02-21 18:18:37 +00:00
Andrew M. Kuchling a6483d2e9a Remove 'created by' lines; people can use CVS for this, and the information is often out of date 2002-11-14 02:25:42 +00:00
Fred Drake b94b849d65 Whitespace normalization. 2001-12-06 20:51:35 +00:00
Greg Ward acff0b3f3b Changed so lines that are all comment (or just whitespace + comment)
are completely skipped, rather than being treated as blank lines
(and then subject to the 'skip_blanks' flag).  This allows us
to process old-style Setup files, which rely on
  hello \\
  # boo!
  there
coming out as "hello there".
2000-09-16 18:33:36 +00:00
Greg Ward 3d05c16003 Andrew Kuchling:
Fixed precendence bug that meant setting skip_blanks to false didn't work
under some circumstances.
2000-09-16 18:09:22 +00:00
Greg Ward f11296bdea [change from 2000/08/11, propagating now to distutils copy]
Factored the guts of 'warn()' out to 'gen_error()', and added the
'error()' method (trivial thanks to the refactoring).
2000-09-16 18:06:31 +00:00
Greg Ward 60cd2864fe [change from 2000/04/17, propagating now to distutils copy]
Dropped the 'collapse_ws' option and replaced it with 'collapse_join' --
it's *much* faster (no 're.sub()') and this is the reason I really added
'collapse_ws', ie. to remove leading whitespace from a line being joined
to the previous line.
2000-09-16 18:04:55 +00:00
Greg Ward 274ad9dc81 Added all documentation.
Slightly improved the code for dealing with newline on a comment line,
  and for stripping whitespace.
1999-09-29 13:03:32 +00:00
Greg Ward abc2f960d4 Allow comment characters (#) to be escaped:
- did away with 'comment_re' option -- it's just not that simple anymore
  - heavily revised the main logic in 'readline()' to accomodate this
Beefed up 'warn()': 'line' can be list or tuple, and 'msg' is
  automatically converted to a string.
1999-08-10 20:09:38 +00:00
Greg Ward 4e5a7c7056 'warn()' method now takes an optional line number. 1999-04-15 17:50:19 +00:00
Greg Ward 91c488c1fc Replaced the last attempt at an "unreadline" with one that actually
works on non-seekable file-like objects, such as URLs.  (Oops.)
1999-03-29 18:01:49 +00:00
Greg Ward 787451b65f Added 'linestart' array and 'unreadline()' method (makes parsing a lot easier). 1999-03-26 21:48:59 +00:00
Greg Ward 782cdfe9f3 Changes to allow passing an open file to the constructor (to support
ProcessHierarchy's changes to support reading from a remote URL in
ProcessDatabase).
1999-03-23 14:00:06 +00:00
Greg Ward db75afe6e5 Added collapse_ws option. 1999-03-08 21:46:11 +00:00
Greg Ward f6cdcd509d Added 'warn' method. 1999-01-18 17:08:16 +00:00
Greg Ward d1dc47558c Added: mems.lib.text_file: provides TextFile class for parsing text
files with (optional) comment stripping, blank line skipping, whitespace
removal, and line joining with trailing backslashes.
1999-01-13 16:12:04 +00:00