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
This commit is contained in:
Angus Leeming 2005-07-27 10:58:59 +00:00
parent 3c4ec7b6d5
commit feef280c5a

View File

@ -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)