Annotate zephyr_mirror.py.

This commit is contained in:
Tim Abbott 2016-07-29 20:13:08 -07:00
parent f50548d644
commit 80a4826f49

View file

@ -34,9 +34,13 @@ from .zephyr_mirror_backend import parse_args
(options, args) = parse_args() (options, args) = parse_args()
sys.path[:0] = [os.path.join(options.root_path, 'api')] sys.path[:0] = [os.path.join(options.root_path, 'api')]
from types import FrameType
from typing import Any from typing import Any
def die(signal, frame): def die(signal, frame):
# type: (int, FrameType) -> None
# We actually want to exit, so run os._exit (so as not to be caught and restarted) # We actually want to exit, so run os._exit (so as not to be caught and restarted)
os._exit(1) os._exit(1)
@ -59,6 +63,7 @@ if options.forward_class_messages and not options.noshard:
print("Starting parallel zephyr class mirroring bot") print("Starting parallel zephyr class mirroring bot")
jobs = list("0123456789abcdef") jobs = list("0123456789abcdef")
def run_job(shard): def run_job(shard):
# type: (str) -> int
subprocess.call(args + ["--shard=%s" % (shard,)]) subprocess.call(args + ["--shard=%s" % (shard,)])
return 0 return 0
for (status, job) in run_parallel(run_job, jobs, threads=16): for (status, job) in run_parallel(run_job, jobs, threads=16):