[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Bug in multiline append
From: |
Jeff Forcier |
Subject: |
Re: [Fab-user] Bug in multiline append |
Date: |
Fri, 22 May 2009 07:45:44 -0400 |
> Ideally I think this is a case where the internals should be messy to
> leave the external api clean. You do not want regexp in the high level
> file functions (append, replace, comment, etc.) or do we?
>
Well, in some cases we *do*, because of the heavy grep/awk/etc usage
in these functions -- i.e.comment() and contains() have to take
regexes because that's *all* they do: search for lines matching a
regex.
However, with append(), as you noted, I left things in the unfortunate
state where the same input string is used as *both* a regex (the
interal contains() call) *and* a non-regex (the actual append). That
was a mistake on my part, and wasn't caught since my use of the
function has so far been limited to strings not containing
regex-specific characters :)
This needs to be fixed such that every string argument is clearly
defined as being used as a regex, or not, and then the question is
whether we fix append() by implicitly trying to make its single string
argument regex-safe (hopefully by leveraging some builtin function
like something in the 're' module, if one exists); by splitting that
into two arguments; or simply by removing the contains() check
entirely.
-Jeff
- [Fab-user] Bug in multiline append, Jorge Vargas, 2009/05/21
- Re: [Fab-user] Bug in multiline append, Jeff Forcier, 2009/05/21
- Re: [Fab-user] Bug in multiline append, Jorge Vargas, 2009/05/21
- Re: [Fab-user] Bug in multiline append, Jorge Vargas, 2009/05/21
- Re: [Fab-user] Bug in multiline append,
Jeff Forcier <=
- Re: [Fab-user] Bug in multiline append, Christian Vest Hansen, 2009/05/22
- Re: [Fab-user] Bug in multiline append, Jeff Forcier, 2009/05/22
- Re: [Fab-user] Bug in multiline append, Jorge Vargas, 2009/05/22
- Re: [Fab-user] Bug in multiline append, Jeff Forcier, 2009/05/22
- Re: [Fab-user] Bug in multiline append, Jeff Forcier, 2009/05/24
- Re: [Fab-user] Bug in multiline append, Jorge Vargas, 2009/05/28