Skip to content

Commit 58a8070

Browse files
authored
Merge pull request #206 from cclauss/use-str.splitlines
Split lines of text with `str.splitlines()`
2 parents 46629e5 + 2a727cc commit 58a8070

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- run: python --version ; pip --version ; pwd ; ls -l
2020
- run: pip install black codespell ruff
2121
- run: codespell -L queenland,uint,assertin
22-
- run: ruff .
22+
- run: ruff check
2323
- run: black . --check
2424

2525

new_units.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010

1111
UNIT_LOOKUP = dict()
12-
for entry in pkgutil.get_data("sc2reader.data", "unit_lookup.csv").split("\n"):
12+
for entry in pkgutil.get_data("sc2reader.data", "unit_lookup.csv").splitlines():
1313
if not entry:
1414
continue
1515
str_id, title = entry.strip().split(",")
@@ -25,7 +25,7 @@
2525
print("")
2626

2727
ABIL_LOOKUP = dict()
28-
for entry in pkgutil.get_data("sc2reader.data", "ability_lookup.csv").split("\n"):
28+
for entry in pkgutil.get_data("sc2reader.data", "ability_lookup.csv").splitlines():
2929
if not entry:
3030
continue
3131
str_id, abilities = entry.split(",", 1)

sc2reader/data/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
ABIL_LOOKUP = dict()
1717
for entry in (
18-
pkgutil.get_data("sc2reader.data", "ability_lookup.csv").decode("utf8").split("\n")
18+
pkgutil.get_data("sc2reader.data", "ability_lookup.csv").decode("utf8").splitlines()
1919
):
2020
if not entry:
2121
continue
@@ -24,7 +24,7 @@
2424

2525
UNIT_LOOKUP = dict()
2626
for entry in (
27-
pkgutil.get_data("sc2reader.data", "unit_lookup.csv").decode("utf8").split("\n")
27+
pkgutil.get_data("sc2reader.data", "unit_lookup.csv").decode("utf8").splitlines()
2828
):
2929
if not entry:
3030
continue
@@ -401,7 +401,7 @@ def load_build(expansion, version):
401401

402402
unit_file = f"{expansion}/{version}_units.csv"
403403
for entry in (
404-
pkgutil.get_data("sc2reader.data", unit_file).decode("utf8").split("\n")
404+
pkgutil.get_data("sc2reader.data", unit_file).decode("utf8").splitlines()
405405
):
406406
if not entry:
407407
continue
@@ -421,7 +421,7 @@ def load_build(expansion, version):
421421
abil_file = f"{expansion}/{version}_abilities.csv"
422422
build.add_ability(ability_id=0, name="RightClick", title="Right Click")
423423
for entry in (
424-
pkgutil.get_data("sc2reader.data", abil_file).decode("utf8").split("\n")
424+
pkgutil.get_data("sc2reader.data", abil_file).decode("utf8").splitlines()
425425
):
426426
if not entry:
427427
continue

sc2reader/objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def lineup(self):
4848
return "".join(sorted(p.play_race[0].upper() for p in self.players))
4949

5050
@property
51-
def hash(self):
51+
def hash(self): # noqa: F811
5252
raw_hash = ",".join(sorted(p.url for p in self.players))
5353
return hashlib.sha256(raw_hash).hexdigest()
5454

0 commit comments

Comments
 (0)