Skip to content

Commit

Permalink
Remove unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacna committed Feb 4, 2023
1 parent 607b392 commit e68545f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions slippi/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ def _parse(cls, stream):
try:
(match_id,) = unpack('50s', stream)
match_id = str(match_id.decode('utf-8')).rstrip('\x00')
print(match_id)
print(str(match_id))
except EOFError: match_id = None

stream.read(1)
Expand Down
4 changes: 1 addition & 3 deletions slippi/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Metadata(Base):
platform: Metadata.Platform #: Platform the game was played on (console/dolphin)
players: Tuple[Optional[Metadata.Player]] #: Player metadata by port (port 1 is at index 0; empty ports will contain None)
console_name: Optional[str] #: Name of the console the game was played on, if any
match_info: str

def __init__(self, date: datetime, duration: int, platform: Metadata.Platform, players: Tuple[Optional[Metadata.Player]], console_name: Optional[str] = None,):
self.date = date
Expand All @@ -28,7 +27,6 @@ def __init__(self, date: datetime, duration: int, platform: Metadata.Platform, p

@classmethod
def _parse(cls, json):
print(json)
d = json['startAt'].rstrip('\x00') # workaround for Nintendont/Slippi<1.5 bug
# timezone & fractional seconds aren't always provided, so parse the date manually (strptime lacks support for optional components)
m = [int(g or '0') for g in re.search(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:Z|\+(\d{2})(\d{2}))?$', d).groups()]
Expand All @@ -42,7 +40,7 @@ def _parse(cls, json):
for i in PORTS:
try: players[i] = cls.Player._parse(json['players'][str(i)])
except KeyError: pass
return cls(date=date, duration=duration, platform=platform, players=tuple(players), console_name=console_name,)
return cls(date=date, duration=duration, platform=platform, players=tuple(players), console_name=console_name)

def __eq__(self, other):
if not isinstance(other, self.__class__):
Expand Down

0 comments on commit e68545f

Please sign in to comment.