Skip to content

Commit

Permalink
removed old method. oops.
Browse files Browse the repository at this point in the history
removed old method. oops.
  • Loading branch information
mickeyyawn committed Nov 20, 2023
1 parent dde5fa5 commit c0552d9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions polygon/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,26 @@ async def _unsubscribe(self, topics: Union[List[str], Set[str]]):
self.json.dumps({"action": "unsubscribe", "params": subs})
)


@staticmethod
def _parse_subscription(s: str):
s = s.strip()
split = s.split(".")
if len(split) != 2:
logger.warning("invalid subscription:", s)
return [None, None]
length = len(split)

match length:
case _ if length < 2:
logger.warning("invalid subscription:", s)
return [None, None]
case 3:
return split[0], split[1] + "." + split[2]
case _ if length > 3:
logger.warning("invalid subscription:", s)
return [None, None]
case _:
return split[0], split[1]


return split

def subscribe(self, *subscriptions: str):
"""
Expand Down

0 comments on commit c0552d9

Please sign in to comment.