mypy: Use Python 3 type syntax in zerver/lib/export.py

This commit is contained in:
greysome
2017-12-14 17:32:15 +08:00
committed by showell
parent da9c808db4
commit fb7ee942c4

View File

@@ -191,14 +191,13 @@ class Config:
'''
def __init__(self, table=None, model=None,
normal_parent=None, virtual_parent=None,
filter_args=None, custom_fetch=None, custom_tables=None,
post_process_data=None,
concat_and_destroy=None, id_source=None, source_filter=None,
parent_key=None, use_all=False, is_seeded=False, exclude=None):
# type: (str, Any, Config, Config, FilterArgs, CustomFetch, List[TableName], PostProcessData, List[TableName], IdSource, SourceFilter, Field, bool, bool, List[Field]) -> None
def __init__(self, table: str=None, model: Any=None,
normal_parent: 'Config'=None, virtual_parent: 'Config'=None,
filter_args: FilterArgs=None, custom_fetch: CustomFetch=None,
custom_tables: List[TableName]=None, post_process_data: PostProcessData=None,
concat_and_destroy: List[TableName]=None, id_source: IdSource=None,
source_filter: SourceFilter=None, parent_key: Field=None,
use_all: bool=False, is_seeded: bool=False, exclude: List[Field]=None) -> None:
assert table or custom_tables
self.table = table
self.model = model
@@ -773,10 +772,9 @@ def export_partial_message_files(realm: Realm,
return all_message_ids
def write_message_partial_for_query(realm, message_query, dump_file_id,
all_message_ids, output_dir,
chunk_size, user_profile_ids):
# type: (Realm, Any, int, Set[int], Path, int, Set[int]) -> int
def write_message_partial_for_query(realm: Realm, message_query: Any, dump_file_id: int,
all_message_ids: Set[int], output_dir: Path,
chunk_size: int, user_profile_ids: Set[int]) -> int:
min_id = -1
while True: