Skip to content

Commit

Permalink
Fix tripple quotes to match PEP
Browse files Browse the repository at this point in the history
Tripple-doubleqoutes (`"""`) are used almost everewhere in this project.
And they are PEP compliant. However there are few places where
tripple-singlequotes (`'''`) are still used.

This patch replaces quotes with correct ones (`"""` -> `'''`).

Signed-off-by: Ivan Remizov <[email protected]>
  • Loading branch information
akaRem committed Jul 14, 2018
1 parent edadad7 commit 40bfd96
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions galaxy/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@


class ModelAccessPermission(permissions.BasePermission):
'''
"""
Default permissions class to check user access based on the model and
request method, optionally verifying the request data.
'''
"""

def check_options_permissions(self, request, view, obj=None):
return self.check_get_permissions(request, view, obj)
Expand Down Expand Up @@ -95,10 +95,10 @@ def check_delete_permissions(self, request, view, obj=None):
return check_user_access(request.user, view.model, 'delete', obj)

def check_permissions(self, request, view, obj=None):
'''
"""
Perform basic permissions checking before delegating to the appropriate
method based on the request method.
'''
"""

# Check that obj (if given) is active, otherwise raise a 404.
active = getattr(obj, 'active', getattr(obj, 'is_active', True))
Expand Down
8 changes: 4 additions & 4 deletions galaxy/api/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@


class BrowsableAPIRenderer(renderers.BrowsableAPIRenderer):
'''
"""
Customizations to the default browsable API renderer.
'''
"""

def get_rendered_html_form(self, view, method, request):
'''
"""
Never show auto-generated form (only raw form).
'''
"""
obj = getattr(view, 'object', None)
if not self.show_form_for_method(view, method, request, obj):
return
Expand Down
4 changes: 2 additions & 2 deletions galaxy/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def camelcase_to_underscore(s):


class RequireDebugTrueOrTest(logging.Filter):
'''
"""
Logging filter to output when in DEBUG mode or running tests.
'''
"""

def filter(self, record):
from django.conf import settings
Expand Down
4 changes: 2 additions & 2 deletions galaxy/api/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ def list(self, request, *args, **kwargs):
if releases:
queryset = queryset.filter(release__in=releases)
if autocomplete:
where_clause = '''
where_clause = """
to_tsvector(
name || ' ' || release || ' ' || coalesce(alias, ''))
@@ to_tsquery(quote_literal(%s) || ':*')
'''
"""
queryset = queryset.extra(where=[where_clause],
params=[autocomplete])
return self.make_response(queryset)
Expand Down
4 changes: 2 additions & 2 deletions galaxy/api/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,9 @@ def get(self, request, *args, **kwargs):


class TokenView(base_views.APIView):
'''
"""
Allows ansible-galaxy CLI to retrieve an auth token
'''
"""
def post(self, request, *args, **kwargs):

gh_user = None
Expand Down
4 changes: 2 additions & 2 deletions galaxy/main/celerytasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ def refresh_user_stars(user, token):

@celery.task(name="galaxy.main.celerytasks.tasks.refresh_role_counts")
def refresh_role_counts(start, end, token, tracker):
'''
"""
Update each role with latest counts from GitHub
'''
"""
tracker.state = 'RUNNING'
tracker.save()

Expand Down

0 comments on commit 40bfd96

Please sign in to comment.