Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions 15 polygon/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,24 @@ 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)
length = len(split)

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

return split

def subscribe(self, *subscriptions: str):
"""
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.