diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:26:39 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:26:39 +0000 |
commit | 9132a2f13192aa950c022d6f73290526be5fc948 (patch) | |
tree | 57fd40907572b400d62b641281861090069ffe69 /gutenprint-python36syntax.patch | |
parent | 9ee120b570bedda33b1a484c5068dfe60d84f9a6 (diff) |
automatic import of gutenprintopeneuler24.03_LTS
Diffstat (limited to 'gutenprint-python36syntax.patch')
-rw-r--r-- | gutenprint-python36syntax.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/gutenprint-python36syntax.patch b/gutenprint-python36syntax.patch new file mode 100644 index 0000000..cd7e258 --- /dev/null +++ b/gutenprint-python36syntax.patch @@ -0,0 +1,94 @@ +--- gutenprint-5.2.12/src/cups/cups-genppdupdate.in.python36syntax ++++ gutenprint-5.2.12/src/cups/cups-genppdupdate.in +@@ -287,7 +287,7 @@ def update_ppd (ppd_source_filename): + for line in orig_lines: + line.rstrip () + if line.find ("*StpLocale:") != -1: +- match = re.search ("\*StpLocale:\s*\"(.*)\"$", line) ++ match = re.search (r'\*StpLocale:\s*"(.*)"$', line) + if match: + groups = match.groups () + if len (groups) >= 1: +@@ -295,26 +295,26 @@ def update_ppd (ppd_source_filename): + orig_locale = locale + valid = 1 + elif line.startswith ("*LanguageVersion"): +- match = re.search ("^\*LanguageVersion:\s*(.*)$", line) ++ match = re.search (r'^\*LanguageVersion:\s*(.*)$', line) + if match: + groups = match.groups () + if len (groups) >= 1: + lingo = groups[0] + elif line.startswith ("*StpDriverName:"): +- match = re.search ("^\*StpDriverName:\s*\"(.*)\"$", line) ++ match = re.search (r'^\*StpDriverName:\s*"(.*)"$', line) + if match: + groups = match.groups () + if len (groups) >= 1: + driver = groups[0] + valid = 1 + elif line.find ("*%End of ") != -1 and driver == "": +- match = re.search ("^\*%End of\s*(.*).ppd$", line) ++ match = re.search (r'^\*%End of\s*(.*).ppd$', line) + if match: + groups = match.groups () + if len (groups) >= 1: + driver = groups[0] + elif line.startswith ("*StpPPDLocation:"): +- match = re.search ("^\*StpPPDLocation:\s*\"(.*)\"$", line) ++ match = re.search (r'^\*StpPPDLocation:\s*"(.*)"$', line) + if match: + groups = match.groups () + if len (groups) >= 1: +@@ -436,7 +436,7 @@ def update_ppd (ppd_source_filename): + lines = source_data.rstrip ().split ("\n") + source_data = "" + for line in lines: +- m = re.search ("(\*StpLocale:\s*\")(.*)(\")", line) ++ m = re.search (r'(\*StpLocale:\s*")(.*)(")', line) + if m: + groups = m.groups () + line = groups[0] + orig_locale + groups[2] +@@ -689,7 +689,7 @@ def get_ppd_data (fh, types, opts, resolutions, defaults, data): + line = line.strip () + + if (types or opts) and line.startswith ("*OpenUI"): +- m = re.search ("^\*OpenUI\s\*(\w+).*:\s(\w+)", ++ m = re.search (r'^\*OpenUI\s\*(\w+).*:\s(\w+)', + line) + if m: + groups = m.groups () +@@ -704,7 +704,7 @@ def get_ppd_data (fh, types, opts, resolutions, defaults, data): + + optionlist = [] + elif opts and line.startswith ("*%s" % cur_opt): +- m = re.search ("^\*%s\s*(\w+)[\/:]" % cur_opt, line) ++ m = re.search (r'^\*%s\s*(\w+)[\/:]' % cur_opt, line) + if m: + groups = m.groups() + if len (groups) >= 1: +@@ -717,7 +717,7 @@ def get_ppd_data (fh, types, opts, resolutions, defaults, data): + old = s[2] + resolution_map[old] = new + elif defaults and line.startswith ("*Default"): +- m = re.search ("^\*(\w+):\s*(\w+)", line) ++ m = re.search (r'^\*(\w+):\s*(\w+)', line) + if m: + groups = m.groups () + key = groups[0] +@@ -844,13 +844,13 @@ def find_ppd (gutenprintfilename, drivername, lang, region): + global debug + + key = '^\\*FileVersion:[ ]*' + file_version +- match = re.search (".*/([^/]+\.[0-9]+\.[0-9]+)(\.sim)?(\.ppd)?(\.gz)?$", ++ match = re.search (r'.*/([^/]+\.[0-9]+\.[0-9]+)(\.sim)?(\.ppd)?(\.gz)?$', + gutenprintfilename) + if not match: + return None + + stored_name = match.groups ()[0] +- if re.search (".*/([^/]*)(\.sim)(\.ppd)?(\.gz)?$", gutenprintfilename): ++ if re.search (r'.*/([^/]*)(\.sim)(\.ppd)?(\.gz)?$', gutenprintfilename): + simplified = ".sim" + else: + simplified = "" |