prepare rclmpdf->rclmpdf.py for windows
This commit is contained in:
parent
2f4d88788d
commit
376e5485dc
@ -22,7 +22,6 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import rclexecm
|
import rclexecm
|
||||||
import subprocess
|
import subprocess
|
||||||
import distutils.spawn
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import atexit
|
import atexit
|
||||||
import signal
|
import signal
|
||||||
@ -39,10 +38,22 @@ def signal_handler(signal, frame):
|
|||||||
|
|
||||||
atexit.register(finalcleanup)
|
atexit.register(finalcleanup)
|
||||||
|
|
||||||
signal.signal(signal.SIGHUP, signal_handler)
|
try:
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGHUP, signal_handler)
|
||||||
signal.signal(signal.SIGQUIT, signal_handler)
|
except:
|
||||||
signal.signal(signal.SIGTERM, signal_handler)
|
pass
|
||||||
|
try:
|
||||||
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
signal.signal(signal.SIGQUIT, signal_handler)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def vacuumdir(dir):
|
def vacuumdir(dir):
|
||||||
if dir:
|
if dir:
|
||||||
@ -173,14 +184,14 @@ class PDFExtractor:
|
|||||||
self.currentindex = -1
|
self.currentindex = -1
|
||||||
self.attextractdone = False
|
self.attextractdone = False
|
||||||
|
|
||||||
if self.pdftotext == "":
|
if not self.pdftotext:
|
||||||
self.pdftotext = distutils.spawn.find_executable("pdftotext")
|
self.pdftotext = rclexecm.which("pdftotext")
|
||||||
if self.pdftotext is None:
|
if not self.pdftotext:
|
||||||
print("RECFILTERROR HELPERNOTFOUND pdftotext")
|
print("RECFILTERROR HELPERNOTFOUND pdftotext")
|
||||||
sys.exit(1);
|
sys.exit(1);
|
||||||
|
|
||||||
if self.pdftk == "":
|
if not self.pdftk:
|
||||||
self.pdftk = distutils.spawn.find_executable("pdftk")
|
self.pdftk = rclexecm.which("pdftk")
|
||||||
|
|
||||||
if self.pdftk:
|
if self.pdftk:
|
||||||
global tmpdir
|
global tmpdir
|
||||||
@ -63,7 +63,7 @@ application/vnd.ms-office = exec rcldoc
|
|||||||
|
|
||||||
application/ogg = execm rclaudio
|
application/ogg = execm rclaudio
|
||||||
application/pdf = exec rclpdf
|
application/pdf = exec rclpdf
|
||||||
# application/pdf = execm rclmpdf
|
# application/pdf = execm rclmpdf.py
|
||||||
application/postscript = exec pstotext;charset=iso-8859-1;mimetype=text/plain
|
application/postscript = exec pstotext;charset=iso-8859-1;mimetype=text/plain
|
||||||
application/vnd.ms-excel = exec rclxls
|
application/vnd.ms-excel = exec rclxls
|
||||||
application/vnd.ms-powerpoint = exec rclppt
|
application/vnd.ms-powerpoint = exec rclppt
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user