From addfde73745ffc1c97334feedeef4974d5ac53df Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Mon, 14 May 2018 04:23:45 +0530 Subject: [PATCH] tools: Change use of typing.Text to str. --- tools/check-css | 2 +- tools/check-frontend-i18n | 4 ++-- tools/check-issue-labels | 4 ++-- tools/setup/generate_zulip_bots_static_files | 4 ++-- tools/test-queue-worker-reload | 2 +- tools/update-authors-json | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/check-css b/tools/check-css index 362f3aa011..f649df5575 100755 --- a/tools/check-css +++ b/tools/check-css @@ -1,6 +1,6 @@ #!/usr/bin/env python3 from lib.css_parser import parse, CssParserException -from typing import Iterable, Text +from typing import Iterable import sys import glob import subprocess diff --git a/tools/check-frontend-i18n b/tools/check-frontend-i18n index fced2e8faf..a980b74e2c 100755 --- a/tools/check-frontend-i18n +++ b/tools/check-frontend-i18n @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from typing import List, Text +from typing import List # check for the venv from lib import sanity_check sanity_check.check_venv(__file__) @@ -15,7 +15,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from scripts.lib.zulip_tools import WARNING, FAIL, ENDC def find_handlebars(translatable_strings): - # type: (List[Text]) -> List[Text] + # type: (List[str]) -> List[str] errored = [] for string in translatable_strings: if '{{' in string: diff --git a/tools/check-issue-labels b/tools/check-issue-labels index 08ecc411dd..897c6b98fc 100755 --- a/tools/check-issue-labels +++ b/tools/check-issue-labels @@ -7,7 +7,7 @@ import sys import os import ConfigParser -from typing import Any, Dict, MutableMapping, Optional, Text +from typing import Any, Dict, MutableMapping, Optional # Scans zulip repositary for issues that don't have any `area` labels. # GitHub API token is required as GitHub limits unauthenticated @@ -62,7 +62,7 @@ def check_issue_labels(): "your api token. If you want to continue without using a token use --force.") sys.exit(1) - next_page_url = 'https://api.github.com/repos/zulip/zulip/issues' # type: Optional[Text] + next_page_url = 'https://api.github.com/repos/zulip/zulip/issues' # type: Optional[str] unlabeled_issue_urls = [] while next_page_url: try: diff --git a/tools/setup/generate_zulip_bots_static_files b/tools/setup/generate_zulip_bots_static_files index 1ad95e68e3..513b4f39eb 100755 --- a/tools/setup/generate_zulip_bots_static_files +++ b/tools/setup/generate_zulip_bots_static_files @@ -9,7 +9,7 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__f if ZULIP_PATH not in sys.path: sys.path.append(ZULIP_PATH) -from typing import List, Text +from typing import List from zproject import settings from zulip_bots.lib import get_bots_directory_path @@ -29,7 +29,7 @@ if os.path.isdir(bots_dir): os.makedirs(bots_dir, exist_ok=True) def copyfiles(paths): - # type: (List[Text]) -> None + # type: (List[str]) -> None for src_path in paths: bot_name = os.path.basename(os.path.dirname(src_path)) diff --git a/tools/test-queue-worker-reload b/tools/test-queue-worker-reload index f95f6ac15b..582daf02be 100755 --- a/tools/test-queue-worker-reload +++ b/tools/test-queue-worker-reload @@ -12,7 +12,7 @@ import re from lib import sanity_check sanity_check.check_venv(__file__) -from typing import IO, Text +from typing import IO # TODO: Convert this to use scripts/lib/queue_workers.py TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tools/update-authors-json b/tools/update-authors-json index db7d9cc824..1820765af5 100755 --- a/tools/update-authors-json +++ b/tools/update-authors-json @@ -8,7 +8,7 @@ JSON data for the /team page contributors section. from lib import sanity_check sanity_check.check_venv(__file__) -from typing import Any, Dict, List, Optional, Union, Text, cast +from typing import Any, Dict, List, Optional, Union, cast from mypy_extensions import TypedDict import os