From 8b3792026fd1c3fbe4be09c17653174179420b5e Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes All the Python handlers share at least the
rclexecm.py module,
which handles the communication. Have a look at,
- for example, rclzip
- for a handler which uses rclexecm.py directly.rclzip.py for a handler which
+ uses rclexecm.py
+ directly.
Most Python handlers which process @@ -6633,7 +6634,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r "_top">Git repository (the sample not in the distributed release at the moment).
You can also have a look at the slightly more complex
- rclzip
+ rclzip.py
which uses Zip file paths as identifiers (ipath).
execm handlers sometimes
@@ -6726,7 +6727,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r
text/rtf = exec unrtf --nopict --html; charset=iso-8859-1; mimetype=text/html
- application/x-chm = execm rclchm
+ application/x-chm = execm rclchm.py
The fragment specifies that:
rclaudio in rclaudio.py in Recoll 1.23 and later for an example
of handler which outputs text/plain and uses zipUseSkippedNames
Use skippedNames inside Zip archives. Fetched
- directly by the rclzip handler. Skip the patterns
- defined by skippedNames inside Zip archives. Can
- be redefined for subdirectories. See
+ directly by the rclzip.py handler. Skip the
+ patterns defined by skippedNames inside Zip
+ archives. Can be redefined for subdirectories.
+ See
https://www.lesbonscomptes.com/recoll/faqsandhowtos/FilteringOutZipArchiveMembers.html
+ audio/mpeg) or handler names (e.g.
+ rclaudio.py).
All the Python handlers
share at least the rclexecm.py module, which
handles the communication. Have a look at, for
- example, rclzip for a handler which
+ example, rclzip.py for a handler which
uses rclexecm.py
directly. Most Python handlers
which process single-document files by executing another command
@@ -4994,7 +4994,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r
the moment).
You can also have a look at the slightly more complex
- rclzip which uses Zip
+ rclzip.py which uses Zip
file paths as identifiers (ipath ).
execm handlers sometimes need to make
@@ -5062,7 +5062,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r
text/rtf = exec unrtf --nopict --html; charset=iso-8859-1; mimetype=text/html
- application/x-chm = execm rclchm
+ application/x-chm = execm rclchm.py
The fragment specifies that:
@@ -5205,7 +5205,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r
method to produce metadata, by calling the
setfield() helper method. This avoids the
necessity to produce HTML, and any issue with HTML quoting. See,
- for example, rclaudio in &RCL; 1.23 and
+ for example, rclaudio.py in &RCL; 1.23 and
later for an example of handler which outputs
text/plain and uses
setfield() to produce metadata.
diff --git a/src/filters/rcl7z b/src/filters/rcl7z.py
similarity index 98%
rename from src/filters/rcl7z
rename to src/filters/rcl7z.py
index 7ba035ac..96022a30 100755
--- a/src/filters/rcl7z
+++ b/src/filters/rcl7z.py
@@ -3,7 +3,7 @@
# 7-Zip file filter for Recoll
# Thanks to Recoll user Martin Ziegler
-# This is a modified version of rclzip, with some help from rcltar
+# This is a modified version of rclzip.py, with some help from rcltar.py
#
# Normally using py7zr https://github.com/miurahr/py7zr
#
diff --git a/src/filters/rclaudio b/src/filters/rclaudio.py
similarity index 100%
rename from src/filters/rclaudio
rename to src/filters/rclaudio.py
diff --git a/src/filters/rclchm b/src/filters/rclchm.py
similarity index 100%
rename from src/filters/rclchm
rename to src/filters/rclchm.py
diff --git a/src/filters/rcldia b/src/filters/rcldia.py
similarity index 97%
rename from src/filters/rcldia
rename to src/filters/rcldia.py
index 3869bced..45dbeb16 100755
--- a/src/filters/rcldia
+++ b/src/filters/rcldia.py
@@ -6,7 +6,7 @@ from __future__ import print_function
# stefan.friedel@iwr.uni-heidelberg.de 2012
#
# add the following to ~/.recoll/mimeconf into the [index] section:
-# application/x-dia-diagram = execm rcldia;mimetype=text/plain;charset=utf-8
+# application/x-dia-diagram = execm rcldia.py;mimetype=text/plain;charset=utf-8
# and into the [icons] section:
# application/x-dia-diagram = drawing
# and finally under [categories]:
diff --git a/src/filters/rclepub b/src/filters/rclepub.py
similarity index 100%
rename from src/filters/rclepub
rename to src/filters/rclepub.py
diff --git a/src/filters/rclepub1 b/src/filters/rclepub1.py
similarity index 100%
rename from src/filters/rclepub1
rename to src/filters/rclepub1.py
diff --git a/src/filters/rclexecm.py b/src/filters/rclexecm.py
index 42d2ff76..1a68a4ce 100644
--- a/src/filters/rclexecm.py
+++ b/src/filters/rclexecm.py
@@ -372,7 +372,7 @@ def main(proto, extract):
params = {'filename' : makebytes(path)}
- # Some filters (e.g. rclaudio) need/get a MIME type from the indexer.
+ # Some filters (e.g. rclaudio.py) need/get a MIME type from the indexer.
# We make a half-assed attempt to emulate:
mimetype = _g_config.mimeType(path)
if not mimetype and not _g_mswindows:
diff --git a/src/filters/rclics b/src/filters/rclics.py
similarity index 100%
rename from src/filters/rclics
rename to src/filters/rclics.py
diff --git a/src/filters/rclinfo b/src/filters/rclinfo.py
similarity index 99%
rename from src/filters/rclinfo
rename to src/filters/rclinfo.py
index cdc1d4da..ff5d711d 100755
--- a/src/filters/rclinfo
+++ b/src/filters/rclinfo.py
@@ -141,7 +141,7 @@ class InfoSimpleSplitter:
if name == b'File':
infofile = value
except Exception as err:
- print("rclinfo: bad line in %s: [%s] %s\n" % \
+ print("rclinfo.py: bad line in %s: [%s] %s\n" % \
(infofile, line, err), file = sys.stderr)
nodename = prevnodename
node += line
diff --git a/src/filters/rclkar b/src/filters/rclkar.py
similarity index 100%
rename from src/filters/rclkar
rename to src/filters/rclkar.py
diff --git a/src/filters/rclrar b/src/filters/rclrar.py
similarity index 98%
rename from src/filters/rclrar
rename to src/filters/rclrar.py
index e6b38bb1..4c3fa766 100755
--- a/src/filters/rclrar
+++ b/src/filters/rclrar.py
@@ -60,7 +60,7 @@ except Exception as ex:
# (https://www.rarlab.com/rar_add.htm). The unrar-free version fails
# with the message "Failed the read enough data"
#
-# This is identical to rclzip except I did a search/replace from zip
+# This is identical to rclzip.py except I did a search/replace from zip
# to rar, and changed this comment.
class RarExtractor:
def __init__(self, em):
diff --git a/src/filters/rcltar b/src/filters/rcltar.py
similarity index 99%
rename from src/filters/rcltar
rename to src/filters/rcltar.py
index c6f2bf4f..1389c703 100755
--- a/src/filters/rcltar
+++ b/src/filters/rcltar.py
@@ -2,7 +2,7 @@
# Tar-file filter for Recoll
# Thanks to Recoll user Martin Ziegler
-# This is a modified version of /usr/share/recoll/filters/rclzip
+# This is a modified version of /usr/share/recoll/filters/rclzip.py
# It works not only for tar-files, but automatically for gzipped and
# bzipped tar-files at well.
diff --git a/src/filters/rclwar b/src/filters/rclwar.py
similarity index 100%
rename from src/filters/rclwar
rename to src/filters/rclwar.py
diff --git a/src/filters/rclzip b/src/filters/rclzip.py
similarity index 99%
rename from src/filters/rclzip
rename to src/filters/rclzip.py
index dc046fdf..116609db 100755
--- a/src/filters/rclzip
+++ b/src/filters/rclzip.py
@@ -51,7 +51,7 @@ if not hasrclconfig:
# and stores it in the catalog as an unicode object. Else it uses the
# binary string, which it decodes as CP437 (zip standard).
#
-# When reading the file, the input file name is used by rclzip
+# When reading the file, the input file name is used by rclzip.py
# directly as an index into the catalog.
#
# When we send the file name data to the indexer, we have to serialize
diff --git a/src/internfile/internfile.cpp b/src/internfile/internfile.cpp
index c60e1e21..19c4c44c 100644
--- a/src/internfile/internfile.cpp
+++ b/src/internfile/internfile.cpp
@@ -51,7 +51,7 @@ using namespace std;
// The internal path element separator. This can't be the same as the rcldb
// file to ipath separator : "|"
// We replace it with a control char if it comes out of a filter (ie:
-// rclzip or rclchm can do this). If you want the SOH control char
+// rclzip.py or rclchm.py can do this). If you want the SOH control char
// inside an ipath, you're out of luck (and a bit weird).
static const string cstr_isep(":");
diff --git a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp
index 47ad9db7..88097aa6 100644
--- a/src/internfile/mh_exec.cpp
+++ b/src/internfile/mh_exec.cpp
@@ -82,8 +82,7 @@ bool MimeHandlerExec::set_document_file_impl(const std::string& mt,
tpsread = true;
if (!nomd5tps.empty()) {
if (params.size() &&
- nomd5tps.find(path_getsimple(params[0])) !=
- nomd5tps.end()) {
+ nomd5tps.find(path_getsimple(params[0])) != nomd5tps.end()) {
m_handlernomd5 = true;
}
// On windows the 1st param is often a script interp
diff --git a/src/internfile/mh_execm.h b/src/internfile/mh_execm.h
index 7956de8e..27fcba20 100644
--- a/src/internfile/mh_execm.h
+++ b/src/internfile/mh_execm.h
@@ -73,7 +73,7 @@ text/plainData: 10
* time). Absent during indexing (ipaths are generated and sent back from
* the script)
* - Mimetype: this is the mime type for the (possibly container) file.
- * Can be useful to filters which handle multiple types, like rclaudio.
+ * Can be useful to filters which handle multiple types, like rclaudio.py.
*
* The script answers with messages having the following fields:
* - Document: translated document data.
diff --git a/src/qtgui/recoll-win.pro b/src/qtgui/recoll-win.pro
index fa478c4a..5e18edf2 100644
--- a/src/qtgui/recoll-win.pro
+++ b/src/qtgui/recoll-win.pro
@@ -209,30 +209,30 @@ mac {
../filters/openxml-word-body.xsl \
../filters/openxml-meta.xsl \
../filters/ppt-dump.py \
- ../filters/rcl7z \
+ ../filters/rcl7z.py \
../filters/rclaptosidman \
- ../filters/rclaudio \
+ ../filters/rclaudio.py \
../filters/rclbasehandler.py \
../filters/rclbibtex.sh \
../filters/rclcheckneedretry.sh \
- ../filters/rclchm \
- ../filters/rcldia \
+ ../filters/rclchm.py \
+ ../filters/rcldia.py \
../filters/rcldjvu.py \
../filters/rcldoc.py \
../filters/rcldvi \
- ../filters/rclepub \
- ../filters/rclepub1 \
+ ../filters/rclepub.py \
+ ../filters/rclepub1.py \
../filters/rclexec1.py \
../filters/rclexecm.py \
../filters/rclfb2.py \
../filters/rclgaim \
../filters/rclgenxslt.py \
../filters/rclhwp.py \
- ../filters/rclics \
+ ../filters/rclics.py \
../filters/rclimg \
../filters/rclimg.py \
- ../filters/rclinfo \
- ../filters/rclkar \
+ ../filters/rclinfo.py \
+ ../filters/rclkar.py \
../filters/rclkwd \
../filters/rcllatinclass.py \
../filters/rcllatinstops.zip \
@@ -250,21 +250,21 @@ mac {
../filters/rclpst.py \
../filters/rclpurple \
../filters/rclpython.py \
- ../filters/rclrar \
+ ../filters/rclrar.py \
../filters/rclrtf.py \
../filters/rclscribus \
../filters/rclshowinfo \
- ../filters/rcltar \
+ ../filters/rcltar.py \
../filters/rcltex \
../filters/rcltext.py \
../filters/rcluncomp \
../filters/rcluncomp.py \
- ../filters/rclwar \
+ ../filters/rclwar.py \
../filters/rclxls.py \
../filters/rclxml.py \
../filters/rclxmp.py \
../filters/rclxslt.py \
- ../filters/rclzip \
+ ../filters/rclzip.py \
../filters/recoll-we-move-files.py \
../filters/recollepub.zip \
../filters/svg.xsl \
diff --git a/src/sampleconf/mimeconf b/src/sampleconf/mimeconf
index f41e5d06..39bb54ca 100644
--- a/src/sampleconf/mimeconf
+++ b/src/sampleconf/mimeconf
@@ -148,25 +148,25 @@ application/vnd.sun.xml.writer.template = \
body content.xml opendoc-body.xsl
#application/x-mobipocket-ebook = execm rclmobi
-#application/x-tar = execm rcltar
+#application/x-tar = execm rcltar.py
-application/epub+zip = execm rclepub
+application/epub+zip = execm rclepub.py
application/x-ipynb+json = exec jupyter nbconvert --to script --stdout ; mimetype = text/plain
application/javascript = internal text/plain
-application/ogg = execm rclaudio
+application/ogg = execm rclaudio.py
application/pdf = execm rclpdf.py
application/postscript = exec rclps
application/sql = internal text/plain
application/vnd.wordperfect = exec wpd2html;mimetype=text/html
-application/x-7z-compressed = execm rcl7z
+application/x-7z-compressed = execm rcl7z.py
application/x-abiword = internal xsltproc abiword.xsl
application/x-awk = internal text/plain
-application/x-chm = execm rclchm
-application/x-dia-diagram = execm rcldia;mimetype=text/plain
+application/x-chm = execm rclchm.py
+application/x-dia-diagram = execm rcldia.py;mimetype=text/plain
application/x-dvi = exec rcldvi
-application/x-flac = execm rclaudio
+application/x-flac = execm rclaudio.py
application/x-gnote = execm rclxml.py
-application/x-gnuinfo = execm rclinfo
+application/x-gnuinfo = execm rclinfo.py
application/x-gnumeric = internal xsltproc gnumeric.xsl
application/x-hwp = execm rclhwp.py
application/x-kword = exec rclkwd
@@ -175,22 +175,22 @@ application/x-mimehtml = internal message/rfc822
application/x-okular-notes = internal xsltproc okular-note.xsl
application/x-perl = internal text/plain
application/x-php = internal text/plain
-application/x-rar = execm rclrar;charset=default
+application/x-rar = execm rclrar.py;charset=default
application/x-ruby = internal text/plain
application/x-scribus = exec rclscribus
application/x-shellscript = internal text/plain
application/x-tex = exec rcltex
-application/x-webarchive = execm rclwar
+application/x-webarchive = execm rclwar.py
application/x-zerosize = internal
-application/zip = execm rclzip;charset=default
-audio/aac = execm rclaudio
-audio/ape = execm rclaudio
-audio/mp4 = execm rclaudio
-audio/mpeg = execm rclaudio
-audio/ogg = execm rclaudio
-audio/x-karaoke = execm rclkar
-audio/x-musepack = execm rclaudio
-audio/x-wavpack = execm rclaudio
+application/zip = execm rclzip.py;charset=default
+audio/aac = execm rclaudio.py
+audio/ape = execm rclaudio.py
+audio/mp4 = execm rclaudio.py
+audio/mpeg = execm rclaudio.py
+audio/ogg = execm rclaudio.py
+audio/x-karaoke = execm rclkar.py
+audio/x-musepack = execm rclaudio.py
+audio/x-wavpack = execm rclaudio.py
image/gif = execm rclimg
image/jp2 = execm rclimg
image/jpeg = execm rclimg
@@ -203,7 +203,7 @@ image/x-xcf = execm rclimg
inode/symlink = internal
inode/x-empty = internal application/x-zerosize
message/rfc822 = internal
-text/calendar = execm rclics;mimetype=text/plain
+text/calendar = execm rclics.py;mimetype=text/plain
text/css = internal text/plain
text/html = internal
text/plain = internal
@@ -234,7 +234,7 @@ text/x-ruby = internal
text/x-shellscript = internal text/plain
text/x-srt = internal text/plain
text/x-tex = exec rcltex
-video/mp4 = execm rclaudio
+video/mp4 = execm rclaudio.py
video/x-msvideo = execm rclimg
diff --git a/src/sampleconf/mimemap b/src/sampleconf/mimemap
index ced4ecde..bc9ecf95 100644
--- a/src/sampleconf/mimemap
+++ b/src/sampleconf/mimemap
@@ -107,7 +107,7 @@
.maff = application/zip
.7z = application/x-7z-compressed
-# The rcltar module can handle compressed tar formats internally so we
+# The rcltar.py module can handle compressed tar formats internally so we
# use application/x-tar for all tar files compressed or not. Note that tar
# file indexing is disabled by default, you'll need to copy and uncomment
# the application/x-tar commented line from mimeconf into your personal config
diff --git a/src/sampleconf/recoll.conf b/src/sampleconf/recoll.conf
index aceba66a..96b4c245 100644
--- a/src/sampleconf/recoll.conf
+++ b/src/sampleconf/recoll.conf
@@ -155,7 +155,7 @@ skippedPaths = /media
#
#
# Use skippedNames inside Zip archives. Fetched
-# directly by the rclzip handler. Skip the patterns defined by skippedNames
+# directly by the rclzip.py handler. Skip the patterns defined by skippedNames
# inside Zip archives. Can be redefined for subdirectories.
# See https://www.lesbonscomptes.com/recoll/faqsandhowtos/FilteringOutZipArchiveMembers.html
#
@@ -206,9 +206,9 @@ skippedPaths = /media
# redefinition for subtrees). At the moment, it only has an effect for
# external handlers (exec and execm). The file types can be specified by
# listing either MIME types (e.g. audio/mpeg) or handler names
-# (e.g. rclaudio).
+# (e.g. rclaudio.py).
#
-nomd5types = rclaudio
+nomd5types = rclaudio.py
# Size limit for compressed
# files. We need to decompress these in a
diff --git a/src/windows/mimeconf b/src/windows/mimeconf
index 6bc6545e..6af57244 100644
--- a/src/windows/mimeconf
+++ b/src/windows/mimeconf
@@ -131,36 +131,36 @@ application/vnd.sun.xml.writer.template = \
body content.xml opendoc-body.xsl
#application/postscript = exec rclps
-#application/x-gnuinfo = execm python rclinfo
-#application/x-tar = execm python rcltar
+#application/x-gnuinfo = execm python rclinfo.py
+#application/x-tar = execm python rcltar.py
-application/epub+zip = execm python rclepub
+application/epub+zip = execm python rclepub.py
application/x-ipynb+json = execm python rclipynb.py
application/javascript = internal text/plain
-application/ogg = execm python rclaudio
+application/ogg = execm python rclaudio.py
application/pdf = execm python rclpdf.py
application/sql = internal text/plain
application/vnd.wordperfect = exec wpd/wpd2html;mimetype=text/html
-application/x-7z-compressed = execm python rcl7z
+application/x-7z-compressed = execm python rcl7z.py
application/x-abiword = internal xsltproc abiword.xsl
application/x-awk = internal text/plain
-application/x-chm = execm python rclchm
-application/x-dia-diagram = execm python rcldia;mimetype=text/plain
-application/x-flac = execm python rclaudio
+application/x-chm = execm python rclchm.py
+application/x-dia-diagram = execm python rcldia.py;mimetype=text/plain
+application/x-flac = execm python rclaudio.py
application/x-gnote = execm python rclxml.py
application/x-hwp = execm python rclhwp.py
application/x-mimehtml = internal message/rfc822
application/x-perl = internal text/plain
application/x-php = internal text/plain
-application/x-rar = execm python rclrar;charset=default
+application/x-rar = execm python rclrar.py;charset=default
application/x-shellscript = internal text/plain
-application/x-webarchive = execm python rclwar
+application/x-webarchive = execm python rclwar.py
application/x-zerosize = internal
-application/zip = execm python rclzip;charset=default
-audio/aac = execm python rclaudio
-audio/mp4 = execm python rclaudio
-audio/mpeg = execm python rclaudio
-audio/x-karaoke = execm python rclkar
+application/zip = execm python rclzip.py;charset=default
+audio/aac = execm python rclaudio.py
+audio/mp4 = execm python rclaudio.py
+audio/mpeg = execm python rclaudio.py
+audio/x-karaoke = execm python rclkar.py
image/gif = execm rclimg.exe
image/jp2 = execm rclimg.exe
image/jpeg = execm rclimg.exe
@@ -171,7 +171,7 @@ image/vnd.djvu = execm python rcldjvu.py
inode/symlink = internal
inode/x-empty = internal application/x-zerosize
message/rfc822 = internal
-text/calendar = execm python rclics;mimetype=text/plain
+text/calendar = execm python rclics.py;mimetype=text/plain
text/css = internal text/plain
text/html = internal
text/plain = internal
diff --git a/tests/config/mimeconf b/tests/config/mimeconf
index 974d09ce..b38b5fff 100644
--- a/tests/config/mimeconf
+++ b/tests/config/mimeconf
@@ -8,4 +8,4 @@
# values is identical.
[index]
-application/x-tar = execm rcltar
+application/x-tar = execm rcltar.py