|
a/src/filters/rclppt.py |
|
b/src/filters/rclppt.py |
|
... |
|
... |
4 |
import rclexec1
|
4 |
import rclexec1
|
5 |
import re
|
5 |
import re
|
6 |
import sys
|
6 |
import sys
|
7 |
import os
|
7 |
import os
|
8 |
|
8 |
|
9 |
# Processing the output from unrtf
|
|
|
10 |
class PPTProcessData:
|
9 |
class PPTProcessData:
|
11 |
def __init__(self, em):
|
10 |
def __init__(self, em):
|
12 |
self.em = em
|
11 |
self.em = em
|
13 |
self.out = ""
|
12 |
self.out = ""
|
14 |
self.gotdata = 0
|
13 |
self.gotdata = 0
|
15 |
|
14 |
|
16 |
# Some versions of unrtf put out a garbled charset line.
|
|
|
17 |
# Apart from this, we pass the data untouched.
|
|
|
18 |
def takeLine(self, line):
|
15 |
def takeLine(self, line):
|
19 |
if not self.gotdata:
|
16 |
if not self.gotdata:
|
20 |
self.out += '''<html><head>''' + \
|
17 |
self.out += '''<html><head>''' + \
|
21 |
'''<meta http-equiv="Content-Type" ''' + \
|
18 |
'''<meta http-equiv="Content-Type" ''' + \
|
22 |
'''content="text/html;charset=UTF-8">''' + \
|
19 |
'''content="text/html;charset=UTF-8">''' + \
|
23 |
'''</head><body><pre>'''
|
20 |
'''</head><body><pre>'''
|
24 |
self.gotdata = True
|
21 |
self.gotdata = True
|
25 |
self.out += self.em.htmlescape(line)
|
22 |
self.out += self.em.htmlescape(line) + "<br>\n"
|
26 |
|
23 |
|
27 |
def wrapData(self):
|
24 |
def wrapData(self):
|
28 |
return self.out + '''</pre></body></html>'''
|
25 |
return self.out + '''</pre></body></html>'''
|
29 |
|
26 |
|
30 |
class PPTFilter:
|
27 |
class PPTFilter:
|