plumber

Plumber – a modern approach to plumbing
git clone git://r-36.net/plumber
Log | Files | Refs | README | LICENSE

commit 230307df481896e6690d95af5dc257b6576e982f
parent d86423ec9db30f32784ae6d1cde545974dbbc8d7
Author: Christoph Lohmann <20h@r-36.net>
Date:   Fri, 19 Jul 2024 15:30:15 +0200

Fix escape sequences in python scripts for regexp.

Diffstat:
Mbin/plumber | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/bin/plumber b/bin/plumber @@ -20,25 +20,25 @@ plumbrules = [ ["^/.*", "fileopener '%s'"], ["^> .*", "run '%s'"], ["^file://.*", "mailcapopener '%s'"], - ["^.*://.*wikipedia.*/.*\.(jpeg|jpg|png|gif|xpm|JPG|JPEG|PNG|XPM|GIF)$", \ + ["^.*://.*wikipedia.*/.*\\.(jpeg|jpg|png|gif|xpm|JPG|JPEG|PNG|XPM|GIF)$", \ "webopener '%s'"], - ["^.*://.*\.(jpeg|jpg|png|gif|xpm|JPG|JPEG|PNG|XPM|GIF|svg|SVG|svgz|SVGZ)$", \ + ["^.*://.*\\.(jpeg|jpg|png|gif|xpm|JPG|JPEG|PNG|XPM|GIF|svg|SVG|svgz|SVGZ|webp|WEBP)$", \ "imageopener '%s'"], - ["^.*://.*\.(pdf|PDF)$", "pdfopener '%s'"], - ["^gopher(|s)://.*\.(txt|TXT|patch|PATCH|diff|DIFF)$", "textgopheropener '%s'"], - ["^.*://.*\.(txt|TXT|patch|PATCH|diff|DIFF)$", "textwebopener '%s'"], - ["^.*://.*\.(mpg|MPG|mp3|MP3|mp4|MP4|FLAC|flac|ogg|OGG|m3u|M3U|m3u8|M3U8|flv|FLV|webm|WEBM|opus|OPUS|mov|MOV|mkv|MKV|ogv|OGV|wav|WAV|avi|AVI)$",\ + ["^.*://.*\\.(pdf|PDF)$", "pdfopener '%s'"], + ["^gopher(|s)://.*\\.(txt|TXT|patch|PATCH|diff|DIFF)$", "textgopheropener '%s'"], + ["^.*://.*\\.(txt|TXT|patch|PATCH|diff|DIFF)$", "textwebopener '%s'"], + ["^.*://.*\\.(mpg|MPG|mp3|MP3|mp4|MP4|FLAC|flac|ogg|OGG|m3u|M3U|m3u8|M3U8|flv|FLV|webm|WEBM|opus|OPUS|mov|MOV|mkv|MKV|ogv|OGV|wav|WAV|avi|AVI)$",\ "mediaopener '%s'"], ["^dvb://.*", "tvopener '%s'"], ["^geo:.*", "geoopener '%s'"], ["^gopher(|s)://.*", "gopheropener '%s'"], ["^http://sprunge.us/.*", "textwebopener '%s'"], ["^http://ix.io/.*", "textwebopener '%s'"], - ["^http(|s)://(|www\.)youtube.com/feeds/videos.xml\?channel_id=.*", "feedopener '%s'"], - ["^http(|s)://(|www\.)yewtu.be/feed/channel/.*", "feedopener '%s'"], - ["^http(|s)://(|www\.)youtube.com/(watch|embed).*", "ytopener '%s'"], - ["^http(|s)://(|www\.)youtu.be/[\w\-]{10,}\?t=\d+", "ytopener '%s'"], - ["^http(|s)://(|www\.)yewtu.be/(watch|embed).*", "ytopener '%s'"], + ["^http(|s)://(|www\\.)youtube.com/feeds/videos.xml\\?channel_id=.*", "feedopener '%s'"], + ["^http(|s)://(|www\\.)yewtu.be/feed/channel/.*", "feedopener '%s'"], + ["^http(|s)://(|www\\.)youtube.com/(watch|embed).*", "ytopener '%s'"], + ["^http(|s)://(|www\\.)youtu.be/[\\w\\-]{10,}\\?t=\\d+", "ytopener '%s'"], + ["^http(|s)://(|www\\.)yewtu.be/(watch|embed).*", "ytopener '%s'"], ["^http(|s)://.*", "webopener '%s'"], ["^mailto:.*", "mailcomposer '%s'"], ["^dance:.*", "danceopener '%s'"], @@ -108,7 +108,7 @@ def runmenu(menucmd, selectlines): return output.decode().strip() def parsetext(text): - urire = re.compile("[a-z0-9A-Z]+:[a-z0-9A-Z/\-\.?=%+_]+") + urire = re.compile("[a-z0-9A-Z]+:[a-z0-9A-Z/\\-\\.?=%+_]+") return re.findall(urire, text) def trimstr(s):