py3: Switch almost all shebang lines to use `python3`.
This causes `upgrade-zulip-from-git`, as well as a no-option run of
`tools/build-release-tarball`, to produce a Zulip install running
Python 3, rather than Python 2. In particular this means that the
virtualenv we create, in which all application code runs, is Python 3.
One shebang line, on `zulip-ec2-configure-interfaces`, explicitly
keeps Python 2, and at least one external ops script, `wal-e`, also
still runs on Python 2. See discussion on the respective previous
commits that made those explicit. There may also be some other
third-party scripts we use, outside of this source tree and running
outside our virtualenv, that still run on Python 2.
2017-08-02 23:15:16 +02:00
|
|
|
#!/usr/bin/env python3
|
2017-02-19 22:18:18 +01:00
|
|
|
import argparse
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2017-09-22 08:15:01 +02:00
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
2017-02-19 22:18:18 +01:00
|
|
|
sys.path.append(BASE_DIR)
|
2020-01-08 00:06:39 +01:00
|
|
|
from scripts.lib.setup_path import setup_path
|
|
|
|
|
|
|
|
setup_path()
|
2017-02-19 22:18:18 +01:00
|
|
|
|
|
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
|
|
|
|
|
|
|
|
import django
|
2020-06-11 00:54:34 +02:00
|
|
|
|
2017-02-19 22:18:18 +01:00
|
|
|
django.setup()
|
|
|
|
from zerver.worker.queue_processors import get_active_worker_queues
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
parser = argparse.ArgumentParser()
|
2020-09-02 04:49:02 +02:00
|
|
|
parser.add_argument('--queue-type', action='store', default=None,
|
2017-02-19 22:18:18 +01:00
|
|
|
help="Specify which types of queues to list")
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2017-02-20 04:34:15 +01:00
|
|
|
for worker in sorted(get_active_worker_queues(args.queue_type)):
|
|
|
|
print(worker)
|