mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
import: Move SubscriberHandler to import_util.
This commit is contained in:
@@ -38,11 +38,11 @@ from zerver.data_import.import_util import (
|
||||
create_converted_data_files,
|
||||
make_subscriber_map,
|
||||
write_avatar_png,
|
||||
SubscriberHandler
|
||||
)
|
||||
|
||||
from zerver.data_import.hipchat_attachment import AttachmentHandler
|
||||
from zerver.data_import.hipchat_user import UserHandler
|
||||
from zerver.data_import.hipchat_subscriber import SubscriberHandler
|
||||
from zerver.data_import.sequencer import NEXT_ID, IdMapper
|
||||
|
||||
# stubs
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
from typing import Dict, Set
|
||||
|
||||
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
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user