From 70fecd947459f26a063715da8bc74dd70b7655aa Mon Sep 17 00:00:00 2001 From: meator Date: Wed, 19 Jun 2024 18:42:54 +0200 Subject: [PATCH] Fix invalid escape sequences These escape sequences cause SyntaxWarnings in some environments. --- terminatorlib/plugins/maven.py | 6 +++--- terminatorlib/plugins/mousefree_url_handler.py | 2 +- terminatorlib/plugins/url_handlers.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/terminatorlib/plugins/maven.py b/terminatorlib/plugins/maven.py index bcc21d794..8138f5231 100644 --- a/terminatorlib/plugins/maven.py +++ b/terminatorlib/plugins/maven.py @@ -32,9 +32,9 @@ class MavenPluginURLHandler(plugin.URLHandler): maven_filters = {} maven_filters['apache_maven_plugin_shortname'] = 'clean|compiler|deploy|failsafe|install|resources|site|surefire|verifier|ear|ejb|jar|rar|war|shade|changelog|changes|checkstyle|clover|doap|docck|javadoc|jxr|linkcheck|pmd|project-info-reports|surefire-report|ant|antrun|archetype|assembly|dependency|enforcer|gpg|help|invoker|jarsigner|one|patch|pdf|plugin|release|reactor|remote-resources|repository|scm|source|stage|toolchains|eclipse|idea' maven_filters['codehaus_maven_plugin_shortname'] = 'jboss|jboss-packaging|tomcat|was6|antlr|antlr3|aspectj|axistools|castor|commons-attributes|gwt|hibernate3|idlj|javacc|jaxb2|jpox|jspc|openjpa|rmic|sablecc|sqlj|sysdeo-tomcat|xmlbeans|xdoclet|netbeans-freeform|nbm|clirr|cobertura|taglist|scmchangelog|findbugs|fitnesse|selenium|animal-sniffer|appassembler|build-helper|exec|keytool|latex|ounce|rpm|sql|versions|apt|cbuilds|jspc|native|retrotranslator|springws|smc|ideauidesigner|dita|docbook|javancss|jdepend|dashboard|emma|sonar|jruby|dbunit|shitty|batik|buildnumber|ianal|jalopy|jasperreports|l10n|minijar|native2ascii|osxappbundle|properties|solaris|truezip|unix|virtualization|wagon|webstart|xml|argouml|dbupgrade|chronos|ckjm|codenarc|deb|ec2|enchanter|ejbdoclet|graphing|j2me|javascript tools|jardiff|kodo|macker|springbeandoc|mock-repository|nsis|pomtools|setup|simian-report|syslog|visibroker|weblogic|webdoclet|xjc|xsltc' - maven_filters['apache_maven_plugin_artifact_id'] = 'maven\-(%(apache_maven_plugin_shortname)s)\-plugin' % maven_filters - maven_filters['codehaus_maven_plugin_artifact_id'] = '(%(codehaus_maven_plugin_shortname)s)\-maven\-plugin' % maven_filters - maven_filters['maven_plugin_version'] = '[a-zA-Z0-9\.-]+' + maven_filters['apache_maven_plugin_artifact_id'] = r'maven\-(%(apache_maven_plugin_shortname)s)\-plugin' % maven_filters + maven_filters['codehaus_maven_plugin_artifact_id'] = r'(%(codehaus_maven_plugin_shortname)s)\-maven\-plugin' % maven_filters + maven_filters['maven_plugin_version'] = r'[a-zA-Z0-9\.-]+' maven_filters['maven_plugin_goal'] = '[a-zA-Z-]+' maven_filters['maven_plugin'] = '(%(apache_maven_plugin_artifact_id)s|%(codehaus_maven_plugin_artifact_id)s)(:%(maven_plugin_version)s:%(maven_plugin_goal)s)?' % maven_filters maven_filters['maven_plugin_named_groups'] = '(?P%(apache_maven_plugin_artifact_id)s|%(codehaus_maven_plugin_artifact_id)s)(:%(maven_plugin_version)s:(?P%(maven_plugin_goal)s))?' % maven_filters diff --git a/terminatorlib/plugins/mousefree_url_handler.py b/terminatorlib/plugins/mousefree_url_handler.py index e69dd40d8..cd0b80f30 100644 --- a/terminatorlib/plugins/mousefree_url_handler.py +++ b/terminatorlib/plugins/mousefree_url_handler.py @@ -51,7 +51,7 @@ class MouseFreeURLHandler(plugin.Plugin): vte = None cur_term = None #basic pattern - searchtext = "https?\:\/\/[^\s]+[\/\w]" + searchtext = r"https?\:\/\/[^\s]+[\/\w]" def __init__(self): self.connect_signals() diff --git a/terminatorlib/plugins/url_handlers.py b/terminatorlib/plugins/url_handlers.py index 436406e06..6100e59f1 100644 --- a/terminatorlib/plugins/url_handlers.py +++ b/terminatorlib/plugins/url_handlers.py @@ -13,7 +13,7 @@ class LaunchpadBugURLHandler(plugin.URLHandler): Launchpad Bug URL""" capabilities = ['url_handler'] handler_name = 'launchpad_bug' - match = '\\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\\b' + match = r'\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\b' nameopen = "Open Launchpad bug" namecopy = "Copy bug URL" @@ -36,7 +36,7 @@ class LaunchpadCodeURLHandler(plugin.URLHandler): lpfilters['series'] = lpfilters['project'] lpfilters['branch'] = '[a-zA-Z0-9]{1}[a-zA-Z0-9_+@.-]+' - match = '\\b((lp|LP):%(project)s(/%(series)s)?|(lp|LP):%(group)s/(%(project)s|\+junk)/%(branch)s)\\b' % lpfilters + match = r'\b((lp|LP):%(project)s(/%(series)s)?|(lp|LP):%(group)s/(%(project)s|\+junk)/%(branch)s)\b' % lpfilters def callback(self, url): """Look for the number in the supplied string and return it as a URL"""