mirror of https://github.com/zulip/zulip.git
python: Remove redundant dest for argparse arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
4d583e3d41
commit
a5dbab8fb0
|
@ -33,20 +33,16 @@ usage = """Usage: send-receive.py [options] [config]
|
|||
|
||||
parser = argparse.ArgumentParser(usage=usage)
|
||||
parser.add_argument('--site',
|
||||
dest='site',
|
||||
default="https://api.zulip.com",
|
||||
action='store')
|
||||
|
||||
parser.add_argument('--nagios',
|
||||
dest='nagios',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('--insecure',
|
||||
dest='insecure',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('--munin',
|
||||
dest='munin',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('config', nargs='?', default=None)
|
||||
|
|
|
@ -54,10 +54,10 @@ from urllib.request import Request, urlopen
|
|||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('-r', '--recipient', dest="recipient", type=str, default='',
|
||||
parser.add_argument('-r', '--recipient', type=str, default='',
|
||||
help="Original recipient.")
|
||||
|
||||
parser.add_argument('-s', '--shared-secret', dest="shared_secret", type=str, default='',
|
||||
parser.add_argument('-s', '--shared-secret', type=str, default='',
|
||||
help="Secret access key.")
|
||||
|
||||
parser.add_argument('-d', '--dst-host', dest="host", type=str, default='https://127.0.0.1',
|
||||
|
@ -70,7 +70,7 @@ parser.add_argument('-u', '--dst-url', dest="url", type=str, default='/email_mir
|
|||
parser.add_argument('-n', '--not-verify-ssl', dest="verify_ssl", action='store_false', default=True,
|
||||
help="Disable ssl certificate verifying for self-signed certificates")
|
||||
|
||||
parser.add_argument('-t', '--test', dest="test", action='store_true', default=False,
|
||||
parser.add_argument('-t', '--test', action='store_true', default=False,
|
||||
help="Test mode.")
|
||||
|
||||
options = parser.parse_args()
|
||||
|
|
|
@ -18,7 +18,7 @@ from zerver.worker.queue_processors import get_active_worker_queues
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--queue-type', action='store', dest='queue_type', default=None,
|
||||
parser.add_argument('--queue-type', action='store', default=None,
|
||||
help="Specify which types of queues to list")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ logging.basicConfig(format="%(asctime)s upgrade-zulip-from-git: %(message)s",
|
|||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("refname", help="Git reference, e.g. a branch, tag, or commit ID.")
|
||||
parser.add_argument("--remote-url", dest="remote_url",
|
||||
parser.add_argument("--remote-url",
|
||||
help="Override the Git remote URL configured in /etc/zulip/zulip.conf.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -71,17 +71,17 @@ os.umask(0o22)
|
|||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("deploy_path", metavar="deploy_path",
|
||||
help="Path to deployment directory")
|
||||
parser.add_argument("--skip-puppet", dest="skip_puppet", action='store_true',
|
||||
parser.add_argument("--skip-puppet", action='store_true',
|
||||
help="Skip doing puppet/apt upgrades.")
|
||||
parser.add_argument("--skip-migrations", dest="skip_migrations", action='store_true',
|
||||
parser.add_argument("--skip-migrations", action='store_true',
|
||||
help="Skip doing migrations.")
|
||||
parser.add_argument("--from-git", dest="from_git", action='store_true',
|
||||
parser.add_argument("--from-git", action='store_true',
|
||||
help="Upgrading from git, so run update-prod-static.")
|
||||
parser.add_argument("--ignore-static-assets", dest="ignore_static_assets", action='store_true',
|
||||
parser.add_argument("--ignore-static-assets", action='store_true',
|
||||
help="Do not attempt to copy/manage static assets.")
|
||||
parser.add_argument("--skip-purge-old-deployments", dest="skip_purge_old_deployments",
|
||||
parser.add_argument("--skip-purge-old-deployments",
|
||||
action="store_true", help="Skip purging old deployments.")
|
||||
parser.add_argument("--audit-fts-indexes", dest="audit_fts_indexes",
|
||||
parser.add_argument("--audit-fts-indexes",
|
||||
action="store_true", help="Audit and fix full text search indexes.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -68,11 +68,11 @@ def parse_cache_script_args(description: str) -> argparse.Namespace:
|
|||
"installation in dev) and older than threshold days will be "
|
||||
"deleted. (defaults to 14)")
|
||||
parser.add_argument(
|
||||
"--dry-run", dest="dry_run", action="store_true",
|
||||
"--dry-run", action="store_true",
|
||||
help="If specified then script will only print the caches "
|
||||
"that it will delete/keep back. It will not delete any cache.")
|
||||
parser.add_argument(
|
||||
"--verbose", dest="verbose", action="store_true",
|
||||
"--verbose", action="store_true",
|
||||
help="If specified then script will print a detailed report "
|
||||
"of what is being will deleted/kept back.")
|
||||
parser.add_argument(
|
||||
|
|
|
@ -20,11 +20,11 @@ def parse_args() -> argparse.Namespace:
|
|||
nargs="?", metavar="<days>", help="Deployments older than "
|
||||
"threshold days will be deleted. (defaults to 14)")
|
||||
parser.add_argument(
|
||||
"--dry-run", dest="dry_run", action="store_true",
|
||||
"--dry-run", action="store_true",
|
||||
help="If specified then script will only print the deployments and "
|
||||
"caches that it will delete/keep back. It will not delete anything.")
|
||||
parser.add_argument(
|
||||
"--verbose", dest="verbose", action="store_true",
|
||||
"--verbose", action="store_true",
|
||||
help="If specified then script will print a detailed report "
|
||||
"of what is going on.")
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ logging.basicConfig(format="%(asctime)s restart-server: %(message)s",
|
|||
level=logging.INFO)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--fill-cache', action='store_true', dest='fill_cache', default=False,
|
||||
parser.add_argument('--fill-cache', action='store_true', default=False,
|
||||
help='Fill the memcached caches')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ if __name__ == '__main__':
|
|||
|
||||
parser = argparse.ArgumentParser()
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('--development', action='store_true', dest='development',
|
||||
group.add_argument('--development', action='store_true',
|
||||
help='For setting up the developer env for zulip')
|
||||
group.add_argument('--production', action='store_false', dest='development',
|
||||
help='For setting up the production env for zulip')
|
||||
|
|
|
@ -21,11 +21,11 @@ DJANGO_PO_REGEX = re.compile('msgid "(.*?)"')
|
|||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--show-ignored',
|
||||
action='store_true', dest='show_ignored', default=False,
|
||||
action='store_true', default=False,
|
||||
help='Show strings that passed the check because they '
|
||||
'contained ignored phrases.')
|
||||
parser.add_argument('--no-generate',
|
||||
action='store_true', dest='no_generate', default=False,
|
||||
action='store_true', default=False,
|
||||
help="Don't run makemessages command.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ def find_handlebars(translatable_strings: List[str]) -> List[str]:
|
|||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--no-generate',
|
||||
action='store_true', dest='no_generate', default=False,
|
||||
action='store_true', default=False,
|
||||
help="Don't run makemessages command.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ def get_next_page_url(link_header: str) -> Optional[str]:
|
|||
|
||||
def check_issue_labels() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--force', action="store_true", dest="force", default=False)
|
||||
parser.add_argument('--force', action="store_true", default=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.force:
|
||||
|
|
|
@ -30,7 +30,7 @@ import digitalocean
|
|||
parser = argparse.ArgumentParser(description='Create a Zulip devopment VM DigitalOcean droplet.')
|
||||
parser.add_argument("username", help="Github username for whom you want to create a Zulip dev droplet")
|
||||
parser.add_argument('--tags', nargs='+', default=[])
|
||||
parser.add_argument('-f', '--recreate', dest='recreate', action="store_true", default=False)
|
||||
parser.add_argument('-f', '--recreate', action="store_true", default=False)
|
||||
|
||||
def get_config() -> configparser.ConfigParser:
|
||||
config = configparser.ConfigParser()
|
||||
|
|
|
@ -434,7 +434,6 @@ if __name__ == "__main__":
|
|||
help="Provision needed to build release tarball.")
|
||||
|
||||
parser.add_argument('--skip-dev-db-build', action='store_true',
|
||||
dest='skip_dev_db_build',
|
||||
default=False,
|
||||
help="Don't run migrations on dev database.")
|
||||
|
||||
|
|
|
@ -337,7 +337,6 @@ if __name__ == "__main__":
|
|||
help="Provision for test suite with production settings.")
|
||||
|
||||
parser.add_argument('--skip-dev-db-build', action='store_true',
|
||||
dest='skip_dev_db_build',
|
||||
default=False,
|
||||
help="Don't run migrations on dev database.")
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from tools.lib.test_server import test_server_running
|
|||
|
||||
usage = """test-api [options]"""
|
||||
parser = argparse.ArgumentParser(usage)
|
||||
parser.add_argument('--force', dest='force',
|
||||
parser.add_argument('--force',
|
||||
action="store_true",
|
||||
default=False, help='Run tests despite possible provisioning problems.')
|
||||
options = parser.parse_args()
|
||||
|
|
|
@ -211,14 +211,14 @@ def main() -> None:
|
|||
|
||||
parser.add_argument('--nonfatal-errors', action="store_false", default=True,
|
||||
dest="fatal_errors", help="Continue past test failures to run all tests")
|
||||
parser.add_argument('--coverage', dest='coverage',
|
||||
parser.add_argument('--coverage',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Compute test coverage.')
|
||||
parser.add_argument('--verbose-coverage', dest='verbose_coverage',
|
||||
parser.add_argument('--verbose-coverage',
|
||||
action="store_true",
|
||||
default=False, help='Enable verbose print of coverage report.')
|
||||
parser.add_argument('--no-cov-cleanup', dest='no_cov_cleanup',
|
||||
parser.add_argument('--no-cov-cleanup',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Do not clean generated coverage files.")
|
||||
|
@ -229,39 +229,39 @@ def main() -> None:
|
|||
default=default_parallel,
|
||||
help='Specify the number of processes to run the '
|
||||
'tests in. Default is the number of logical CPUs')
|
||||
parser.add_argument('--profile', dest='profile',
|
||||
parser.add_argument('--profile',
|
||||
action="store_true",
|
||||
default=False, help='Profile test runtime.')
|
||||
parser.add_argument('--force', dest='force',
|
||||
parser.add_argument('--force',
|
||||
action="store_true",
|
||||
default=False, help='Run tests despite possible problems.')
|
||||
parser.add_argument('--no-shallow', dest='no_shallow',
|
||||
parser.add_argument('--no-shallow',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Don't allow shallow testing of templates (deprecated)")
|
||||
parser.add_argument('--verbose', dest='verbose',
|
||||
parser.add_argument('--verbose',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Show detailed output")
|
||||
parser.add_argument('--reverse', dest='reverse',
|
||||
parser.add_argument('--reverse',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Run tests in reverse order.")
|
||||
parser.add_argument('--rerun', dest="rerun",
|
||||
parser.add_argument('--rerun',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=("Run the tests which failed the last time "
|
||||
"test-backend was run. Implies --nonfatal-errors."))
|
||||
parser.add_argument('--include-webhooks', dest="include_webhooks",
|
||||
parser.add_argument('--include-webhooks',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=("Include webhook tests. By default, they are skipped for performance."))
|
||||
parser.add_argument('--generate-stripe-fixtures', dest="generate_stripe_fixtures",
|
||||
parser.add_argument('--generate-stripe-fixtures',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=("Generate Stripe test fixtures by making requests to Stripe test network"))
|
||||
parser.add_argument('args', nargs='*')
|
||||
parser.add_argument('--ban-console-output', dest='ban_console_output',
|
||||
parser.add_argument('--ban-console-output',
|
||||
action="store_true",
|
||||
default=False, help='Require stdout and stderr to be clean of unexpected output.')
|
||||
|
||||
|
|
|
@ -164,10 +164,10 @@ EXEMPT_FILES = {
|
|||
}
|
||||
|
||||
parser = argparse.ArgumentParser(USAGE)
|
||||
parser.add_argument('--coverage', dest='coverage',
|
||||
parser.add_argument('--coverage',
|
||||
action="store_true",
|
||||
default=False, help='Get coverage report')
|
||||
parser.add_argument('--force', dest='force',
|
||||
parser.add_argument('--force',
|
||||
action="store_true",
|
||||
default=False, help='Run tests despite possible problems.')
|
||||
parser.add_argument('args', nargs=argparse.REMAINDER)
|
||||
|
|
|
@ -27,10 +27,10 @@ usage = """test-js-with-puppeteer [options]
|
|||
test-js-with-puppeteer 01 03 # Run a few test files, 01-login.js and 03-narrow.js here"""
|
||||
parser = argparse.ArgumentParser(usage)
|
||||
|
||||
parser.add_argument('--interactive', dest='interactive',
|
||||
parser.add_argument('--interactive',
|
||||
action="store_true",
|
||||
default=False, help='Run tests interactively')
|
||||
parser.add_argument('--force', dest='force',
|
||||
parser.add_argument('--force',
|
||||
action="store_true",
|
||||
default=False, help='Run tests despite possible problems.')
|
||||
parser.add_argument('tests', nargs=argparse.REMAINDER,
|
||||
|
|
|
@ -11,7 +11,7 @@ sanity_check.check_venv(__file__)
|
|||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--coverage', dest='coverage',
|
||||
parser.add_argument('--coverage',
|
||||
action="store_true",
|
||||
default=False, help='compute test coverage')
|
||||
args = parser.parse_args()
|
||||
|
|
|
@ -112,25 +112,25 @@ def build_for_most_tests() -> None:
|
|||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--test',
|
||||
action='store_true', dest='test', default=False,
|
||||
action='store_true', default=False,
|
||||
help='generate a stub webpack-stats.json file (for backend testing)')
|
||||
parser.add_argument('--quiet',
|
||||
action='store_true', dest='quiet', default=False,
|
||||
action='store_true', default=False,
|
||||
help='Minimizes webpack output while running')
|
||||
parser.add_argument('--watch',
|
||||
action='store_true', dest='watch', default=False,
|
||||
action='store_true', default=False,
|
||||
help='watch for changes to source files (for development)')
|
||||
parser.add_argument('--host',
|
||||
action='store', dest='host',
|
||||
action='store',
|
||||
default='127.0.0.1', help='set the host for the webpack server to run on')
|
||||
parser.add_argument('--port',
|
||||
action='store', dest='port',
|
||||
action='store',
|
||||
default='9994', help='set the port for the webpack server to run on')
|
||||
parser.add_argument('--minify',
|
||||
action='store_true', dest='minify', default=False,
|
||||
action='store_true', default=False,
|
||||
help='Minify and optimize the assets (for development)')
|
||||
parser.add_argument('--disable-host-check',
|
||||
action='store_true', dest='disable_host_check', default=None,
|
||||
action='store_true', default=None,
|
||||
help='Disable host check for webpack-dev-server')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
|
@ -59,13 +59,11 @@ You can use the command list_realms to find ID of the realms in this server."""
|
|||
all_users_help: str="All users in realm.") -> None:
|
||||
parser.add_argument(
|
||||
'-u', '--users',
|
||||
dest='users',
|
||||
type=str,
|
||||
help=help)
|
||||
|
||||
parser.add_argument(
|
||||
'-a', '--all-users',
|
||||
dest='all_users',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=all_users_help)
|
||||
|
|
|
@ -16,15 +16,12 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument('--api-key',
|
||||
dest='api_key',
|
||||
type=str,
|
||||
help='MailChimp API key.')
|
||||
parser.add_argument('--list-id',
|
||||
dest='list_id',
|
||||
type=str,
|
||||
help='List ID of the MailChimp mailing list.')
|
||||
parser.add_argument('--optin-time',
|
||||
dest='optin_time',
|
||||
type=str,
|
||||
default=datetime.isoformat(timezone_now().replace(microsecond=0)),
|
||||
help='Opt-in time of the users.')
|
||||
|
|
|
@ -15,7 +15,6 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
parser.add_argument(
|
||||
'-s', '--streams',
|
||||
dest='streams',
|
||||
type=str,
|
||||
required=True,
|
||||
help='A comma-separated list of stream names.')
|
||||
|
|
|
@ -17,7 +17,6 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-t', '--trim',
|
||||
dest='trim',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Actually trim excess")
|
||||
|
|
|
@ -22,7 +22,6 @@ class Command(BaseCommand):
|
|||
help='Directory to write exported data to.')
|
||||
|
||||
parser.add_argument('--threads',
|
||||
dest='threads',
|
||||
action="store",
|
||||
default=settings.DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM,
|
||||
help='Threads to download avatars and attachments faster')
|
||||
|
|
|
@ -42,7 +42,7 @@ class Command(BaseCommand):
|
|||
action="store_true",
|
||||
help='Mask the content for privacy during QA.')
|
||||
|
||||
parser.add_argument('--slim-mode', dest='slim_mode',
|
||||
parser.add_argument('--slim-mode',
|
||||
action="store_true",
|
||||
help="Default to no public stream subscriptions if no token is available." +
|
||||
" See import docs for details.")
|
||||
|
|
|
@ -25,7 +25,6 @@ class Command(BaseCommand):
|
|||
help='Directory to write exported data to.')
|
||||
|
||||
parser.add_argument('--threads',
|
||||
dest='threads',
|
||||
action="store",
|
||||
default=settings.DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM,
|
||||
help='Threads to use in exporting UserMessage objects in parallel')
|
||||
|
|
|
@ -18,7 +18,6 @@ Create default stream groups which the users can choose during sign up.
|
|||
|
||||
parser.add_argument(
|
||||
'-n', '--name',
|
||||
dest='name',
|
||||
type=str,
|
||||
required=True,
|
||||
help='Name of the group you want to create.',
|
||||
|
@ -26,7 +25,6 @@ Create default stream groups which the users can choose during sign up.
|
|||
|
||||
parser.add_argument(
|
||||
'-d', '--description',
|
||||
dest='description',
|
||||
type=str,
|
||||
required=True,
|
||||
help='Description of the group.',
|
||||
|
@ -34,7 +32,6 @@ Create default stream groups which the users can choose during sign up.
|
|||
|
||||
parser.add_argument(
|
||||
'-s', '--streams',
|
||||
dest='streams',
|
||||
type=str,
|
||||
required=True,
|
||||
help='A comma-separated list of stream names.')
|
||||
|
|
|
@ -27,7 +27,6 @@ Omit both <email> and <full name> for interactive user creation.
|
|||
default=False,
|
||||
help='Acknowledgement that the user has already accepted the ToS.')
|
||||
parser.add_argument('--password',
|
||||
dest='password',
|
||||
type=str,
|
||||
default='',
|
||||
help='password of new user. For development only.'
|
||||
|
@ -36,7 +35,6 @@ Omit both <email> and <full name> for interactive user creation.
|
|||
'on the server via `ps -ef` or by any superuser with'
|
||||
'read access to the user\'s bash history.')
|
||||
parser.add_argument('--password-file',
|
||||
dest='password_file',
|
||||
type=str,
|
||||
default='',
|
||||
help='The file containing the password of the new user.')
|
||||
|
|
|
@ -12,7 +12,6 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('-f', '--for-real',
|
||||
dest='for_real',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Actually deactivate the user. Default is a dry run.")
|
||||
|
|
|
@ -20,7 +20,6 @@ class Command(BaseCommand):
|
|||
help="Limiting value of how old the file can be.")
|
||||
|
||||
parser.add_argument('-f', '--for-real',
|
||||
dest='for_real',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Actually remove the files from the storage.")
|
||||
|
|
|
@ -15,7 +15,6 @@ class Command(ZulipBaseCommand):
|
|||
default_cutoff = time.time() - 60 * 60 * 24 * 30 # 30 days.
|
||||
self.add_realm_args(parser, True)
|
||||
parser.add_argument('--since',
|
||||
dest='since',
|
||||
type=int,
|
||||
default=default_cutoff,
|
||||
help='The time in epoch since from which to start the dump.')
|
||||
|
|
|
@ -83,7 +83,6 @@ class Command(ZulipBaseCommand):
|
|||
default=None,
|
||||
help='Directory to write exported data to.')
|
||||
parser.add_argument('--threads',
|
||||
dest='threads',
|
||||
action="store",
|
||||
default=settings.DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM,
|
||||
help='Threads to use in exporting UserMessage objects in parallel')
|
||||
|
@ -94,7 +93,6 @@ class Command(ZulipBaseCommand):
|
|||
action="store_true",
|
||||
help='Deactivate the realm immediately before exporting')
|
||||
parser.add_argument('--consent-message-id',
|
||||
dest="consent_message_id",
|
||||
action="store",
|
||||
default=None,
|
||||
type=int,
|
||||
|
|
|
@ -15,17 +15,14 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--path',
|
||||
dest='path',
|
||||
action="store",
|
||||
default=None,
|
||||
help='Path to find messages.json archives')
|
||||
parser.add_argument('--thread',
|
||||
dest='thread',
|
||||
action="store",
|
||||
default=None,
|
||||
help='Thread ID')
|
||||
parser.add_argument('--consent-message-id',
|
||||
dest="consent_message_id",
|
||||
action="store",
|
||||
default=None,
|
||||
type=int,
|
||||
|
|
|
@ -8,7 +8,7 @@ from zerver.lib.cache_helpers import cache_fillers, fill_remote_cache
|
|||
|
||||
class Command(BaseCommand):
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--cache', dest="cache", default=None,
|
||||
parser.add_argument('--cache', default=None,
|
||||
help="Populate the memcached cache of messages.")
|
||||
|
||||
def handle(self, *args: Any, **options: Optional[str]) -> None:
|
||||
|
|
|
@ -21,7 +21,6 @@ class Command(ZulipBaseCommand):
|
|||
help='email address to spelunk')
|
||||
parser.add_argument('--all',
|
||||
action='store_true',
|
||||
dest='all',
|
||||
default=False,
|
||||
help='fix all users in specified realm')
|
||||
self.add_realm_args(parser)
|
||||
|
|
|
@ -14,7 +14,6 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--force',
|
||||
dest='force',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Override that the domain is restricted to external users.')
|
||||
|
|
|
@ -14,13 +14,11 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
parser.add_argument(
|
||||
'-s', '--streams',
|
||||
dest='streams',
|
||||
type=str,
|
||||
help='A comma-separated list of stream names.')
|
||||
|
||||
parser.add_argument(
|
||||
'--referred-by',
|
||||
dest='referred_by',
|
||||
type=str,
|
||||
help='Email of referrer',
|
||||
required=True,
|
||||
|
|
|
@ -16,7 +16,7 @@ class Command(BaseCommand):
|
|||
parser.add_argument('app_label', nargs='?',
|
||||
help='App label of an application to synchronize the state.')
|
||||
|
||||
parser.add_argument('--database', action='store', dest='database',
|
||||
parser.add_argument('--database', action='store',
|
||||
default=DEFAULT_DB_ALIAS, help='Nominates a database to synchronize. '
|
||||
'Defaults to the "default" database.')
|
||||
|
||||
|
|
|
@ -19,13 +19,11 @@ import a database dump from one or more JSON files."""
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('--destroy-rebuild-database',
|
||||
dest='destroy_rebuild_database',
|
||||
default=False,
|
||||
action="store_true",
|
||||
help='Destroys and rebuilds the databases prior to import.')
|
||||
|
||||
parser.add_argument('--import-into-nonempty',
|
||||
dest='import_into_nonempty',
|
||||
default=False,
|
||||
action="store_true",
|
||||
help='Import into an existing nonempty database.')
|
||||
|
@ -37,7 +35,6 @@ import a database dump from one or more JSON files."""
|
|||
metavar='<export path>',
|
||||
help="list of export directories to import")
|
||||
parser.add_argument('--processes',
|
||||
dest='processes',
|
||||
action="store",
|
||||
default=settings.DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM,
|
||||
help='Number of processes to use for uploading Avatars to S3 in parallel')
|
||||
|
|
|
@ -26,7 +26,6 @@ ONLY perform this on customer request from an authorized person.
|
|||
default=True,
|
||||
help='Remove an administrator\'s rights.')
|
||||
parser.add_argument('--permission',
|
||||
dest='permission',
|
||||
action="store",
|
||||
default='administer',
|
||||
choices=['administer', 'api_super_user'],
|
||||
|
|
|
@ -16,7 +16,6 @@ Usage examples:
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument("--all",
|
||||
dest="all",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Print all the configuration settings of the realms.")
|
||||
|
|
|
@ -19,7 +19,7 @@ class Command(BaseCommand):
|
|||
help="queue to process")
|
||||
parser.add_argument('--worker_num', metavar='<worker number>', type=int, nargs='?', default=0,
|
||||
help="worker label")
|
||||
parser.add_argument('--all', dest="all", action="store_true", default=False,
|
||||
parser.add_argument('--all', action="store_true", default=False,
|
||||
help="run all queues")
|
||||
parser.add_argument('--multi_threaded', nargs='+',
|
||||
metavar='<list of queue name>',
|
||||
|
|
|
@ -12,7 +12,7 @@ class Command(BaseCommand):
|
|||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument(dest="queue_name", type=str, nargs='?',
|
||||
help="queue to purge", default=None)
|
||||
parser.add_argument('--all', dest="all", action="store_true",
|
||||
parser.add_argument('--all', action="store_true",
|
||||
default=False, help="purge all queues")
|
||||
|
||||
help = "Discards all messages from the given queue"
|
||||
|
|
|
@ -11,18 +11,14 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('-e', '--email',
|
||||
dest='email',
|
||||
help="Email account of user.")
|
||||
parser.add_argument('-a', '--api-key',
|
||||
dest='api_key',
|
||||
help="API key of user.")
|
||||
parser.add_argument('-s', '--seconds',
|
||||
dest='seconds',
|
||||
default=60,
|
||||
type=int,
|
||||
help="Seconds to block for.")
|
||||
parser.add_argument('-d', '--domain',
|
||||
dest='domain',
|
||||
default='api_by_user',
|
||||
help="Rate-limiting domain. Defaults to 'api_by_user'.")
|
||||
parser.add_argument('-b', '--all-bots',
|
||||
|
|
|
@ -15,12 +15,10 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--op',
|
||||
dest='op',
|
||||
type=str,
|
||||
default="show",
|
||||
help='What operation to do (add, show, remove).')
|
||||
parser.add_argument('--allow-subdomains',
|
||||
dest='allow_subdomains',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Whether subdomains are allowed or not.')
|
||||
|
|
|
@ -24,7 +24,6 @@ Example: ./manage.py realm_filters --realm=zulip --op=show
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--op',
|
||||
dest='op',
|
||||
type=str,
|
||||
default="show",
|
||||
help='What operation to do (add, show, remove).')
|
||||
|
|
|
@ -20,12 +20,10 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--agree_to_terms_of_service',
|
||||
dest='agree_to_terms_of_service',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Agree to the Zulipchat Terms of Service: https://zulip.com/terms/.")
|
||||
parser.add_argument('--rotate-key',
|
||||
dest="rotate_key",
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Automatically rotate your server's zulip_org_key")
|
||||
|
|
|
@ -12,7 +12,6 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-s', '--stream',
|
||||
dest='stream',
|
||||
required=True,
|
||||
type=str,
|
||||
help='A stream name.')
|
||||
|
|
|
@ -29,11 +29,9 @@ To restore a specific ArchiveTransaction:
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-d', '--restore-deleted',
|
||||
dest='restore_deleted',
|
||||
action='store_true',
|
||||
help='Restore manually deleted messages.')
|
||||
parser.add_argument('-t', '--transaction-id',
|
||||
dest='transaction_id',
|
||||
type=int,
|
||||
help='Restore a specific ArchiveTransaction.')
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ class Command(ZulipBaseCommand):
|
|||
parser.add_argument('--entire-server', action="store_true", default=False,
|
||||
help="Send to every user on the server.")
|
||||
parser.add_argument('--markdown-template-path', '--path',
|
||||
dest='markdown_template_path',
|
||||
required=True,
|
||||
type=str,
|
||||
help='Path to a Markdown-format body for the email.')
|
||||
|
|
|
@ -37,14 +37,12 @@ Example:
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-f', '--fixture',
|
||||
dest='fixture',
|
||||
type=str,
|
||||
help='The path to the email message you\'d like to send '
|
||||
'to the email mirror.\n'
|
||||
'Accepted formats: json or raw email file. '
|
||||
'See zerver/tests/fixtures/email/ for examples')
|
||||
parser.add_argument('-s', '--stream',
|
||||
dest='stream',
|
||||
type=str,
|
||||
help='The name of the stream to which you\'d like to send '
|
||||
'the message. Default: Denmark')
|
||||
|
|
|
@ -32,19 +32,16 @@ approach shown above.
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-f', '--fixture',
|
||||
dest='fixture',
|
||||
type=str,
|
||||
help='The path to the fixture you\'d like to send '
|
||||
'into Zulip')
|
||||
|
||||
parser.add_argument('-u', '--url',
|
||||
dest='url',
|
||||
type=str,
|
||||
help='The url on your Zulip server that you want '
|
||||
'to post the fixture to')
|
||||
|
||||
parser.add_argument('-H', '--custom-headers',
|
||||
dest='custom-headers',
|
||||
type=str,
|
||||
help='The headers you want to provide along with '
|
||||
'your mock request to Zulip.')
|
||||
|
@ -71,7 +68,7 @@ approach shown above.
|
|||
if not self._does_fixture_path_exist(full_fixture_path):
|
||||
raise CommandError('Fixture {} does not exist'.format(options['fixture']))
|
||||
|
||||
headers = self.parse_headers(options['custom-headers'])
|
||||
headers = self.parse_headers(options['custom_headers'])
|
||||
json = self._get_fixture_as_json(full_fixture_path)
|
||||
realm = self.get_realm(options)
|
||||
if realm is None:
|
||||
|
|
|
@ -16,18 +16,15 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-l', '--for-real',
|
||||
dest='for_real',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="Actually change message flags. Default is a dry run.")
|
||||
|
||||
parser.add_argument('-f', '--flag',
|
||||
dest='flag',
|
||||
type=str,
|
||||
help="The flag to add of remove")
|
||||
|
||||
parser.add_argument('-o', '--op',
|
||||
dest='op',
|
||||
type=str,
|
||||
help="The operation to do: 'add' or 'remove'")
|
||||
|
||||
|
@ -37,7 +34,6 @@ class Command(ZulipBaseCommand):
|
|||
help="Mark all messages <= specific usermessage id")
|
||||
|
||||
parser.add_argument('-m', '--email',
|
||||
dest='email',
|
||||
type=str,
|
||||
help="Email to set messages for")
|
||||
self.add_realm_args(parser)
|
||||
|
|
|
@ -38,12 +38,10 @@ class Command(ZulipBaseCommand):
|
|||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
self.add_realm_args(parser)
|
||||
parser.add_argument('-d', '--deactivate',
|
||||
dest='deactivate',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Used to deactivate user/users.')
|
||||
parser.add_argument('-a', '--activate',
|
||||
dest='activate',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Used to activate user/users.')
|
||||
|
|
|
@ -53,7 +53,6 @@ def sync_ldap_user_data(user_profiles: List[UserProfile], deactivation_protectio
|
|||
class Command(ZulipBaseCommand):
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('-f', '--force',
|
||||
dest='force',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Disable the protection against deactivating all users.')
|
||||
|
|
|
@ -11,7 +11,6 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('--processes',
|
||||
dest='processes',
|
||||
action="store",
|
||||
default=settings.DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM,
|
||||
help='Processes to use for exporting uploads in parallel')
|
||||
|
|
|
@ -14,7 +14,6 @@ class Command(ZulipBaseCommand):
|
|||
self.add_realm_args(parser)
|
||||
parser.add_argument(
|
||||
'--lookback-hours',
|
||||
dest='lookback_hours',
|
||||
type=int,
|
||||
help="Period a bit larger than that of the cron job that runs "
|
||||
"this command so that the lookback periods are sure to overlap.",
|
||||
|
|
|
@ -160,37 +160,31 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument('-n', '--num-messages',
|
||||
dest='num_messages',
|
||||
type=int,
|
||||
default=500,
|
||||
help='The number of messages to create.')
|
||||
|
||||
parser.add_argument('-b', '--batch-size',
|
||||
dest='batch_size',
|
||||
type=int,
|
||||
default=1000,
|
||||
help='How many messages to process in a single batch')
|
||||
|
||||
parser.add_argument('--extra-users',
|
||||
dest='extra_users',
|
||||
type=int,
|
||||
default=0,
|
||||
help='The number of extra users to create')
|
||||
|
||||
parser.add_argument('--extra-bots',
|
||||
dest='extra_bots',
|
||||
type=int,
|
||||
default=0,
|
||||
help='The number of extra bots to create')
|
||||
|
||||
parser.add_argument('--extra-streams',
|
||||
dest='extra_streams',
|
||||
type=int,
|
||||
default=0,
|
||||
help='The number of extra streams to create')
|
||||
|
||||
parser.add_argument('--max-topics',
|
||||
dest='max_topics',
|
||||
type=int,
|
||||
default=None,
|
||||
help='The number of maximum topics to create')
|
||||
|
@ -208,25 +202,21 @@ class Command(BaseCommand):
|
|||
help='The number of personal pairs to create.')
|
||||
|
||||
parser.add_argument('--threads',
|
||||
dest='threads',
|
||||
type=int,
|
||||
default=1,
|
||||
help='The number of threads to use.')
|
||||
|
||||
parser.add_argument('--percent-huddles',
|
||||
dest='percent_huddles',
|
||||
type=float,
|
||||
default=15,
|
||||
help='The percent of messages to be huddles.')
|
||||
|
||||
parser.add_argument('--percent-personals',
|
||||
dest='percent_personals',
|
||||
type=float,
|
||||
default=15,
|
||||
help='The percent of messages to be personals.')
|
||||
|
||||
parser.add_argument('--stickyness',
|
||||
dest='stickyness',
|
||||
type=float,
|
||||
default=20,
|
||||
help='The percent of messages to repeat recent folks.')
|
||||
|
|
Loading…
Reference in New Issue