Skip to content

Commit ea26d57

Browse files
authored
Merge pull request #2635 from wereii/fix-syntax-warnings
Fix invalid escape syntax warnings
2 parents 08d4e85 + 45f0743 commit ea26d57

File tree

15 files changed

+40
-40
lines changed

15 files changed

+40
-40
lines changed

db_update.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ def processEveTypes():
141141
(row['typeName_en-us'].startswith('Civilian') and "Shuttle" not in row['typeName_en-us'])
142142
or row['typeName_en-us'] == 'Capsule'
143143
or row['groupID'] == 4033 # destructible effect beacons
144-
or re.match('AIR .+Booster.*', row['typeName_en-us'])
144+
or re.match(r'AIR .+Booster.*', row['typeName_en-us'])
145145
):
146146
row['published'] = True
147147
# Nearly useless and clutter search results too much
148148
elif (
149149
row['typeName_en-us'].startswith('Limited Synth ')
150150
or row['typeName_en-us'].startswith('Expired ')
151-
or re.match('Mining Blitz .+ Booster Dose .+', row['typeName_en-us'])
151+
or re.match(r'Mining Blitz .+ Booster Dose .+', row['typeName_en-us'])
152152
or row['typeName_en-us'].endswith(' Filament') and (
153153
"'Needlejack'" not in row['typeName_en-us'] and
154154
"'Devana'" not in row['typeName_en-us'] and

dist_assets/win/dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
os.environ["PYFA_DIST_DIR"] = os.path.join(os.getcwd(), 'dist')
1515

1616
os.environ["PYFA_VERSION"] = version
17-
iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
17+
iscc = r"C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
1818

1919
source = os.path.join(os.environ["PYFA_DIST_DIR"], "pyfa")
2020

eos/db/migrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# loop through python files, extracting update number and function, and
2222
# adding it to a list
2323
modname_tail = modName.rsplit('.', 1)[-1]
24-
m = re.match("^upgrade(?P<index>\d+)$", modname_tail)
24+
m = re.match(r"^upgrade(?P<index>\d+)$", modname_tail)
2525
if not m:
2626
continue
2727
index = int(m.group("index"))

graphs/gui/canvasPanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def addYMark(val):
273273
legendLines = []
274274
for i, iData in enumerate(legendData):
275275
color, lineStyle, label = iData
276-
legendLines.append(Line2D([0], [0], color=color, linestyle=lineStyle, label=label.replace('$', '\$')))
276+
legendLines.append(Line2D([0], [0], color=color, linestyle=lineStyle, label=label.replace('$', r'\$')))
277277

278278
if len(legendLines) > 0 and self.graphFrame.ctrlPanel.showLegend:
279279
legend = self.subplot.legend(handles=legendLines)

gui/builtinItemStatsViews/itemDescription.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def __init__(self, parent, stuff, item):
2222

2323
desc = item.description.replace("\n", "<br>")
2424
# Strip font tags
25-
desc = re.sub("<( *)font( *)color( *)=(.*?)>(?P<inside>.*?)<( *)/( *)font( *)>", "\g<inside>", desc)
25+
desc = re.sub("<( *)font( *)color( *)=(.*?)>(?P<inside>.*?)<( *)/( *)font( *)>", r"\g<inside>", desc)
2626
# Strip URLs
27-
desc = re.sub("<( *)a(.*?)>(?P<inside>.*?)<( *)/( *)a( *)>", "\g<inside>", desc)
27+
desc = re.sub("<( *)a(.*?)>(?P<inside>.*?)<( *)/( *)a( *)>", r"\g<inside>", desc)
2828
desc = "<body bgcolor='{}' text='{}'>{}</body>".format(
2929
bgcolor.GetAsString(wx.C2S_HTML_SYNTAX),
3030
fgcolor.GetAsString(wx.C2S_HTML_SYNTAX),

gui/builtinViews/implantEditor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414

1515
def stripHtml(text):
16-
text = re.sub('<\s*br\s*/?\s*>', '\n', text)
17-
text = re.sub('</?[^/]+?(/\s*)?>', '', text)
16+
text = re.sub(r'<\s*br\s*/?\s*>', '\n', text)
17+
text = re.sub(r'</?[^/]+?(/\s*)?>', '', text)
1818
return text
1919

2020

gui/updateDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def __init__(self, parent, release, version):
6666
self.browser.Bind(wx.html2.EVT_WEBVIEW_NEWWINDOW, self.OnNewWindow)
6767

6868
link_patterns = [
69-
(re.compile("#(\d+)", re.I), r"https://github.com/pyfa-org/Pyfa/issues/\1"),
70-
(re.compile("@(\w+)", re.I), r"https://github.com/\1")
69+
(re.compile(r"#(\d+)", re.I), r"https://github.com/pyfa-org/Pyfa/issues/\1"),
70+
(re.compile(r"@(\w+)", re.I), r"https://github.com/\1")
7171
]
7272

7373
markdowner = markdown2.Markdown(

gui/utils/inputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def OnText(self, event):
9696
if currentValue == self._storedValue:
9797
event.Skip()
9898
return
99-
if currentValue == '' or re.match('^\d*\.?\d*$', currentValue):
99+
if currentValue == '' or re.match(r'^\d*\.?\d*$', currentValue):
100100
self._storedValue = currentValue
101101
self.updateColor()
102102
event.Skip()
@@ -131,7 +131,7 @@ def OnText(self, event):
131131
if currentValue == self._storedValue:
132132
event.Skip()
133133
return
134-
if currentValue == '' or re.match('^\d*\.?\d*-?\d*\.?\d*$', currentValue):
134+
if currentValue == '' or re.match(r'^\d*\.?\d*-?\d*\.?\d*$', currentValue):
135135
self._storedValue = currentValue
136136
event.Skip()
137137
else:

scripts/dump_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __secure_name(self, name):
117117
# Prefer safe way - replace any characters besides
118118
# alphanumeric and few special characters with
119119
# underscore
120-
writer_safe_name = re.sub('[^\w\-.,() ]', '_', name, flags=re.UNICODE)
120+
writer_safe_name = re.sub(r'[^\w\-.,() ]', '_', name, flags=re.UNICODE)
121121
return writer_safe_name
122122

123123

scripts/effectUsedBy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def validate_string(s):
395395

396396
with open(effects_path) as f:
397397
for line in f:
398-
m = re.match("class Effect(\d+)\(", line)
398+
m = re.match(r"class Effect(\d+)\(", line)
399399
if m:
400400
effectid = int(m.group(1))
401401
effectids_eos.add(effectid)

0 commit comments

Comments
 (0)