Skip to content

Commit 5c78b72

Browse files
committed
strip the clan-related <sp/> nonsense in a more graylinic way
1 parent 8bd3102 commit 5c78b72

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

sc2reader/readers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ class DetailsReader_Base(Reader):
120120
PlayerData = namedtuple('PlayerData',['name','bnet','race','color','unknown1','unknown2','handicap','unknown3','result'])
121121
Details = namedtuple('Details',['players','map','unknown1','unknown2','os','file_time','utc_adjustment','unknown4','unknown5','unknown6','unknown7','unknown8','unknown9','unknown10'])
122122

123-
# '[OTZ]<sp/>Skull' --> 'Skull'
124-
def stripclan(self, name):
125-
return re.sub(r'.*<sp/>', '', name)
126-
127123
def __call__(self, data, replay):
128124
# The entire details file is just a serialized data structure
129125
#
@@ -178,7 +174,6 @@ def __call__(self, data, replay):
178174
# from the bottom up instead of in place from the top down.
179175
players = list()
180176
for pdata in details[0]:
181-
pdata[0] = self.stripclan(pdata[0])
182177
pdata[1] = BnetData(*ordered_values(pdata[1]))
183178
pdata[3] = ColorData(*ordered_values(pdata[3]))
184179
player = self.PlayerData(*ordered_values(pdata))

sc2reader/resources.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ def createObserver(pid, name, attributes):
346346
def createPlayer(pid, pdata, attributes):
347347
# make sure to strip the clan tag out of the name
348348
name = pdata.name.split("]")[-1]
349+
# sometimes there is also a <sp/> in the name, strip that too
350+
name = name.split(">")[-1]
349351
player = Player(pid, name)
350352

351353
# In some beta patches attribute information is missing

0 commit comments

Comments
 (0)