handle REFILTERROR in execm
This commit is contained in:
parent
dd6acb07cc
commit
8118002942
@ -9,13 +9,13 @@ try:
|
|||||||
from chm import chm,chmlib
|
from chm import chm,chmlib
|
||||||
except:
|
except:
|
||||||
print "RECFILTERROR HELPERNOTFOUND python:chm"
|
print "RECFILTERROR HELPERNOTFOUND python:chm"
|
||||||
exit(1);
|
sys.exit(1);
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from HTMLParser import HTMLParser
|
from HTMLParser import HTMLParser
|
||||||
except:
|
except:
|
||||||
print "RECFILTERROR HELPERNOTFOUND python:HTMLParser"
|
print "RECFILTERROR HELPERNOTFOUND python:HTMLParser"
|
||||||
exit(1);
|
sys.exit(1);
|
||||||
|
|
||||||
class ChmTopicsParser(HTMLParser):
|
class ChmTopicsParser(HTMLParser):
|
||||||
"""Parse the chm's Topic file which is basically
|
"""Parse the chm's Topic file which is basically
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class RclExecM:
|
|||||||
def rclog(self, s, doexit = 0, exitvalue = 1):
|
def rclog(self, s, doexit = 0, exitvalue = 1):
|
||||||
print >> sys.stderr, "RCLMFILT:", self.myname, ":", s
|
print >> sys.stderr, "RCLMFILT:", self.myname, ":", s
|
||||||
if doexit:
|
if doexit:
|
||||||
exit(exitvalue)
|
sys.exit(exitvalue)
|
||||||
# Our worker sometimes knows the mime types of the data it sends
|
# Our worker sometimes knows the mime types of the data it sends
|
||||||
def setmimetype(self, mt):
|
def setmimetype(self, mt):
|
||||||
self.mimetype = mt
|
self.mimetype = mt
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import rclexecm
|
import rclexecm
|
||||||
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from icalendar import Calendar, Event
|
from icalendar import Calendar, Event
|
||||||
except:
|
except:
|
||||||
print "RECFILTERROR HELPERNOTFOUND python:icalendar"
|
print "RECFILTERROR HELPERNOTFOUND python:icalendar"
|
||||||
exit(1);
|
sys.exit(1);
|
||||||
|
|
||||||
class IcalExtractor:
|
class IcalExtractor:
|
||||||
def __init__(self, em):
|
def __init__(self, em):
|
||||||
|
|||||||
@ -60,6 +60,7 @@ bool MimeHandlerExecMultiple::startCmd()
|
|||||||
m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
|
m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
|
||||||
"RECOLL_FILTER_FORPREVIEW=no");
|
"RECOLL_FILTER_FORPREVIEW=no");
|
||||||
if (m_cmd.startExec(cmd, myparams, 1, 1) < 0) {
|
if (m_cmd.startExec(cmd, myparams, 1, 1) < 0) {
|
||||||
|
m_reason = string("RECFILTERROR HELPERNOTFOUND ") + cmd;
|
||||||
missingHelper = true;
|
missingHelper = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -90,6 +91,15 @@ bool MimeHandlerExecMultiple::readDataElement(string& name, string &data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filters will sometimes abort before entering the real protocol, ie if
|
||||||
|
// a module can't be loaded. Check the special filter error first word:
|
||||||
|
if (ibuf.find("RECFILTERROR ") == 0) {
|
||||||
|
m_reason = ibuf;
|
||||||
|
if (ibuf.find("HELPERNOTFOUND") != string::npos)
|
||||||
|
missingHelper = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// We're expecting something like Name: len\n
|
// We're expecting something like Name: len\n
|
||||||
list<string> tokens;
|
list<string> tokens;
|
||||||
stringToTokens(ibuf, tokens);
|
stringToTokens(ibuf, tokens);
|
||||||
|
|||||||
@ -68,14 +68,14 @@ class MimeHandlerExecMultiple : public MimeHandlerExec {
|
|||||||
{}
|
{}
|
||||||
// No resources to clean up, the ExecCmd destructor does it.
|
// No resources to clean up, the ExecCmd destructor does it.
|
||||||
virtual ~MimeHandlerExecMultiple() {}
|
virtual ~MimeHandlerExecMultiple() {}
|
||||||
virtual bool next_document();
|
|
||||||
virtual void clear() {
|
|
||||||
MimeHandlerExec::clear();
|
|
||||||
}
|
|
||||||
virtual bool set_document_file(const string &file_path) {
|
virtual bool set_document_file(const string &file_path) {
|
||||||
m_filefirst = true;
|
m_filefirst = true;
|
||||||
return MimeHandlerExec::set_document_file(file_path);
|
return MimeHandlerExec::set_document_file(file_path);
|
||||||
}
|
}
|
||||||
|
virtual bool next_document();
|
||||||
|
|
||||||
|
// skip_to and clear inherited from MimeHandlerExec
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool startCmd();
|
bool startCmd();
|
||||||
bool readDataElement(string& name, string& data);
|
bool readDataElement(string& name, string& data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user