Docstring/PEP 257 fixes for the core app (#2830)

tox-dependencies
Alex Chan 2017-05-10 22:44:06 +01:00 committed by Anthony
parent ed5364a45a
commit 2f17a2e255
4 changed files with 9 additions and 6 deletions

View File

@ -14,13 +14,14 @@ for slug, name in PROGRAMMING_LANGUAGES:
class Command(BaseCommand):
"""
Import a project's programming language from GitHub.
This builds a basic management command that will set
a projects language to the most used one in GitHub.
Requies a ``GITHUB_AUTH_TOKEN`` to be set in the environment,
Requires a ``GITHUB_AUTH_TOKEN`` to be set in the environment,
which should contain a proper GitHub Oauth Token for rate limiting.
"""

View File

@ -15,7 +15,7 @@ register = template.Library()
@register.filter
def gravatar(email, size=48):
"""
hacked from djangosnippets.org, but basically given an email address
Hacked from djangosnippets.org, but basically given an email address
render an img tag with the hashed up bits needed for leetness
omgwtfstillreading

View File

@ -158,11 +158,12 @@ slugify = allow_lazy(slugify, six.text_type, SafeText)
def safe_makedirs(directory_name):
"""
Safely create a directory.
Makedirs has an issue where it has a race condition around
checking for a directory and then creating it.
This catches the exception in the case where the dir already exists.
"""
try:
os.makedirs(directory_name)
except OSError as e:

View File

@ -136,8 +136,9 @@ def _build_url(url, projects, branches):
@csrf_exempt
def github_build(request):
"""GitHub webhook consumer
def github_build(request): # noqa: D205
"""
GitHub webhook consumer
.. warning:: **DEPRECATED**
Use :py:cls:`readthedocs.restapi.views.intergrations.GitHubWebhookView`
@ -190,7 +191,7 @@ def github_build(request):
@csrf_exempt
def gitlab_build(request):
def gitlab_build(request): # noqa: D205
"""GitLab webhook consumer
.. warning:: **DEPRECATED**