From feef280c5ac405fb3420944669167bd9f0f7a48a Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 27 Jul 2005 10:58:59 +0000 Subject: [PATCH] Ensure that the script generates a valid .dvi file without relying on dt2dv to clean up after it. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@10361 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/Win32/packaging/clean_dvi.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/development/Win32/packaging/clean_dvi.py b/development/Win32/packaging/clean_dvi.py index 18f7b1a3db..39fde890d2 100644 --- a/development/Win32/packaging/clean_dvi.py +++ b/development/Win32/packaging/clean_dvi.py @@ -45,16 +45,22 @@ def error(message): def manipulated_dtl(data): - psfile_re = re.compile(r'(.*PSfile=")(.*)(" llx=.*)') + psfile_re = re.compile(r'(special1 +)([0-9]+)( +\'PSfile=")(.*)(" llx=.*)') lines = data.split('\n') for i in range(len(lines)): line = lines[i] - match = psfile_re.search(line) + match = psfile_re.match(line) if match != None: - file = match.group(2).replace('"', '') - lines[i] = '%s%s%s' \ - % ( match.group(1), file, match.group(3) ) + file = match.group(4) + filelen = len(file) + file = file.replace('"', '') + # Don't forget to update the length of the string too... + strlen = int(match.group(2)) - (filelen - len(file)) + + lines[i] = '%s%d%s%s%s' \ + % ( match.group(1), strlen, match.group(3), + file, match.group(5) ) return '\n'.join(lines)