scripts: Remove unused imports.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2019-02-02 14:53:23 -08:00
committed by Tim Abbott
parent c109690cf8
commit e984107966
13 changed files with 13 additions and 21 deletions

View File

@@ -1,12 +1,10 @@
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_tools import get_environment, parse_cache_script_args
from scripts.lib.zulip_tools import parse_cache_script_args
from scripts.lib import clean_venv_cache, clean_node_cache, clean_emoji_cache
def main():

View File

@@ -9,8 +9,8 @@ if False:
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_tools import generate_sha1sum_emoji, \
get_caches_to_be_purged, get_environment, get_recent_deployments, \
from scripts.lib.zulip_tools import \
get_environment, get_recent_deployments, \
parse_cache_script_args, purge_unused_caches
ENV = get_environment()

View File

@@ -10,8 +10,7 @@ if False:
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.node_cache import generate_sha1sum_node_modules
from scripts.lib.zulip_tools import get_caches_to_be_purged, \
from scripts.lib.zulip_tools import \
get_environment, get_recent_deployments, parse_cache_script_args, \
purge_unused_caches

View File

@@ -10,7 +10,7 @@ if False:
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.hash_reqs import expand_reqs, hash_deps
from scripts.lib.zulip_tools import get_caches_to_be_purged, \
from scripts.lib.zulip_tools import \
get_environment, get_recent_deployments, parse_cache_script_args, \
purge_unused_caches

View File

@@ -5,7 +5,7 @@ import json
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Optional, List, IO, Tuple, Any
from typing import Optional, List, IO, Any
from scripts.lib.zulip_tools import subprocess_text_output, run

View File

@@ -11,7 +11,7 @@ TARBALL_ARCHIVE_PATH = "/home/zulip/archives"
os.environ["PYTHONUNBUFFERED"] = "y"
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, FAIL, WARNING, ENDC, \
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, FAIL, ENDC, \
su_to_zulip, get_deployment_lock, release_deployment_lock, assert_running_as_root, \
get_config_file, get_deploy_options

View File

@@ -1,18 +1,16 @@
#!/usr/bin/env python3
import os
import configparser
import sys
import subprocess
import logging
import time
import argparse
import configparser
LOCAL_GIT_CACHE_DIR = '/srv/zulip.git'
os.environ["PYTHONUNBUFFERED"] = "y"
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, FAIL, WARNING, ENDC, make_deploy_path, \
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, make_deploy_path, \
get_deployment_lock, overwrite_symlink, release_deployment_lock, su_to_zulip, assert_running_as_root, \
get_config_file, get_deploy_options, get_config

View File

@@ -21,7 +21,7 @@ os.environ["LANG"] = "en_US.UTF-8"
os.environ["LANGUAGE"] = "en_US.UTF-8"
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, FAIL, WARNING, ENDC, su_to_zulip, assert_running_as_root
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, su_to_zulip, assert_running_as_root
assert_running_as_root()

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
import datetime
import errno
import hashlib
import logging
import os
@@ -19,7 +18,7 @@ import configparser
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Sequence, Set, Any, Dict, List, Optional
from typing import Sequence, Set, Any, Dict, List
DEPLOYMENTS_DIR = "/home/zulip/deployments"
LOCK_DIR = os.path.join(DEPLOYMENTS_DIR, "lock")

View File

@@ -10,7 +10,7 @@ import subprocess
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Any, Dict, Optional, Union
from typing import Dict
states = {
0: "OK",
@@ -49,7 +49,6 @@ output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'],
consumers = defaultdict(int) # type: Dict[str, int]
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
from scripts.lib.zulip_tools import su_to_zulip
queues = {
'deferred_work'
'digest_emails',

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env python3
import sys
import re
import time
import os

View File

@@ -11,7 +11,7 @@ if False:
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, get_recent_deployments, \
may_be_perform_purging, TIMESTAMP_FORMAT
may_be_perform_purging
def parse_args():
# type: () -> argparse.Namespace

View File

@@ -5,7 +5,7 @@ import sys
import os
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Dict, List, Optional
from typing import Dict, List
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(BASE_DIR)