From 47b81055fdf4421e30fcffa886bb7e068f093e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 18 May 2017 10:00:06 +0200 Subject: [PATCH] PEP8 formatting --- pillar/__init__.py | 6 +++--- pillar/cli.py | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pillar/__init__.py b/pillar/__init__.py index 37d17efe..e5c6b32c 100644 --- a/pillar/__init__.py +++ b/pillar/__init__.py @@ -261,7 +261,7 @@ class PillarServer(Eve): paths_list = [ jinja2.FileSystemLoader(path) for path in reversed(self.pillar_extensions_template_paths) - ] + ] # ...then load Pillar paths. pillar_dir = os.path.dirname(os.path.realpath(__file__)) @@ -380,7 +380,7 @@ class PillarServer(Eve): if doc_name: description = '%s "%s" was deleted.' % (node_type, doc_name) else: - description = 'This %s was deleted.' % (node_type, ) + description = 'This %s was deleted.' % (node_type,) else: if doc_name: description = '"%s" was deleted.' % doc_name @@ -561,7 +561,7 @@ class PillarServer(Eve): pprint(links) - def db(self, collection_name: str=None) \ + def db(self, collection_name: str = None) \ -> typing.Union[pymongo.collection.Collection, pymongo.database.Database]: """Returns the MongoDB database, or the collection (if given)""" diff --git a/pillar/cli.py b/pillar/cli.py index cec12493..40c8821f 100644 --- a/pillar/cli.py +++ b/pillar/cli.py @@ -3,8 +3,6 @@ Run commands with 'flask ' """ - - import copy import logging @@ -361,10 +359,10 @@ def create_local_user_account(email, password): @manager_maintenance.command @manager_maintenance.option('-c', '--chunk', dest='chunk_size', default=50, - help='Number of links to update, use 0 to update all.') + help='Number of links to update, use 0 to update all.') @manager_maintenance.option('-q', '--quiet', dest='quiet', action='store_true', default=False) @manager_maintenance.option('-w', '--window', dest='window', default=12, - help='Refresh links that expire in this many hours.') + help='Refresh links that expire in this many hours.') def refresh_backend_links(backend_name, chunk_size=50, quiet=False, window=12): """Refreshes all file links that are using a certain storage backend. @@ -463,11 +461,11 @@ def mass_copy_between_backends(src_backend='cdnsun', dest_backend='gcs'): @manager_operations.command @manager_operations.option('-p', '--project', dest='dest_proj_url', - help='Destination project URL') + help='Destination project URL') @manager_operations.option('-f', '--force', dest='force', action='store_true', default=False, - help='Move even when already at the given project.') + help='Move even when already at the given project.') @manager_operations.option('-s', '--skip-gcs', dest='skip_gcs', action='store_true', default=False, - help='Skip file handling on GCS, just update the database.') + help='Skip file handling on GCS, just update the database.') def move_group_node_project(node_uuid, dest_proj_url, force=False, skip_gcs=False): """Copies all files from one project to the other, then moves the nodes. @@ -521,9 +519,9 @@ def move_group_node_project(node_uuid, dest_proj_url, force=False, skip_gcs=Fals @manager_maintenance.command @manager_maintenance.option('-p', '--project', dest='proj_url', nargs='?', - help='Project URL') + help='Project URL') @manager_maintenance.option('-a', '--all', dest='all_projects', action='store_true', default=False, - help='Replace on all projects.') + help='Replace on all projects.') def replace_pillar_node_type_schemas(proj_url=None, all_projects=False): """Replaces the project's node type schemas with the standard Pillar ones. @@ -632,9 +630,9 @@ def remarkdown_comments(): @manager_maintenance.command @manager_maintenance.option('-p', '--project', dest='proj_url', nargs='?', - help='Project URL') + help='Project URL') @manager_maintenance.option('-a', '--all', dest='all_projects', action='store_true', default=False, - help='Replace on all projects.') + help='Replace on all projects.') def upgrade_attachment_schema(proj_url=None, all_projects=False): """Replaces the project's attachments with the new schema. @@ -789,6 +787,7 @@ def create_blog(proj_url): return 0 + manager.add_command("maintenance", manager_maintenance) manager.add_command("setup", manager_setup) manager.add_command("operations", manager_operations)