diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2024-02-25 17:40:19 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2024-07-08 10:12:07 -0700 |
commit | 815305b94864556c994934c7a7c830da7de1d94e (patch) | |
tree | 6d85f089b05520416eee1f51f80636b357cda73d /contrib | |
parent | 0b561c7304ec82807212bd070fc6a1684c67607b (diff) | |
download | fork-ledger-815305b94864556c994934c7a7c830da7de1d94e.tar.gz fork-ledger-815305b94864556c994934c7a7c830da7de1d94e.tar.bz2 fork-ledger-815305b94864556c994934c7a7c830da7de1d94e.zip |
Use Python raw strings for regex methods argument
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/non-profit-audit-reports/ooolib2/__init__.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/non-profit-audit-reports/ooolib2/__init__.py b/contrib/non-profit-audit-reports/ooolib2/__init__.py index 0b149e54..5ee3bee9 100644 --- a/contrib/non-profit-audit-reports/ooolib2/__init__.py +++ b/contrib/non-profit-audit-reports/ooolib2/__init__.py @@ -437,11 +437,11 @@ class CalcStyles(object): self.property_cell_hyphenate = value elif name == 'color': self.property_cell_fg_color = 'default' - redata = re.search("^(#[\da-fA-F]{6})$", value) + redata = re.search(r'^(#[\da-fA-F]{6})$', value) if redata: self.property_cell_fg_color = value.lower() elif name == 'background': self.property_cell_bg_color = 'default' - redata = re.search("^(#[\da-fA-F]{6})$", value) + redata = re.search(r'^(#[\da-fA-F]{6})$', value) if redata: self.property_cell_bg_color = value.lower() elif name == 'backgroundimage': self.property_cell_bg_image = value @@ -460,7 +460,7 @@ class CalcStyles(object): property = getattr(self, 'property_cell_%s' % key) if name == key: setattr(self, 'property_cell_%s' % key, [value] * 4) - match = re.match('%s-(top|right|bottom|left)' % key, name) + match = re.match(r'%s-(top|right|bottom|left)' % key, name) if match: property[self.cardinal.index(match.group(1))] = value @@ -606,9 +606,9 @@ class CalcStyles(object): tagline.append(['element', 'style:repeat-content', 'false']) elif name == 'wrap-option': tagline.append(['element', 'fo:wrap-option', value]) - elif re.match('border', name): + elif re.match(r'border', name): tagline.append(['element', 'fo:%s' % name, value]) - elif re.match('padding', name): + elif re.match(r'padding', name): tagline.append(['element', 'fo:%s' % name, value]) # Add any additional internal tags @@ -691,11 +691,11 @@ class CalcSheet(object): # '=IF((A5>A4);A4;"")' # datavalue = 'oooc:=IF(([.A5]>[.A4]);[.A4];"")' data = clean_string(data) - redata = re.search('^=([A-Z]+)(\(.*)$', data) + redata = re.search(r'^=([A-Z]+)(\(.*)$', data) if redata: # funct is the function name. The rest if the string will be the funct_args funct = redata.group(1) - funct_args = re.sub('([A-Z]+\d+)', '[.\\1]', redata.group(2)) + funct_args = re.sub(r'([A-Z]+\d+)', '[.\\1]', redata.group(2)) data = 'oooc:=%s%s' % (funct, funct_args) return data |