* lib/viewcvs.py

(MarkupEnscript.__init__): Revert a change made in r1255 which
    tweaked the sed expression.  The goal was to try to also strip out
    the <PRE> and </PRE> tags from the output, but the expression I
    used also had the undesired effect of dropping the whole last line
    of a non-newline-terminated file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1283 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/tags/1.0.0-rc1
cmpilato 2006-03-16 04:13:19 +00:00
parent 34d32b394e
commit 66923a4982
1 changed files with 6 additions and 1 deletions

View File

@ -1212,7 +1212,12 @@ class MarkupEnscript(MarkupShell):
'enscript')),
'--color', '--language=html', '--pretty-print',
'-o', '-', '-']
sed_cmd = ['sed', '-n', '1,/^<PRE>$/d;/<\\/PRE>/,$d;p']
### I'd like to also strip the <PRE> and </PRE> tags, too, but
### can't come up with a suitable sed expression. Using
### '1,/^<PRE>$/d;/<\\/PRE>/,$d;p' gets me most of the way, but
### will drop the last line of a non-newline-terminated filed.
sed_cmd = ['sed', '-n', '/^<PRE>$/,/<\\/PRE>$/p']
MarkupShell.__init__(self, fp, [enscript_cmd, sed_cmd])
self.filename = filename