import: Move SubscriberHandler to import_util.

This commit is contained in:
Vishnu Ks
2019-03-20 18:06:09 +05:30
committed by Tim Abbott
parent 6e3720e0b7
commit d921fd25e4
3 changed files with 15 additions and 16 deletions

View File

@@ -19,6 +19,20 @@ from zerver.lib.parallel import run_parallel
# stubs
ZerverFieldsT = Dict[str, Any]
class SubscriberHandler:
def __init__(self) -> None:
self.stream_info = dict() # type: Dict[int, Set[int]]
def set_info(self,
stream_id: int,
users: Set[int]) -> None:
self.stream_info[stream_id] = users
def get_users(self,
stream_id: int) -> Set[int]:
users = self.stream_info[stream_id]
return users
def build_zerver_realm(realm_id: int, realm_subdomain: str, time: float,
other_product: str) -> List[ZerverFieldsT]:
realm = Realm(id=realm_id, date_created=time,