Add enchant without correct working

This commit is contained in:
Степаненко Ольга 2021-03-14 15:41:58 +03:00
parent c9ae302103
commit 79b7418b61
2 changed files with 17 additions and 14 deletions

View File

@ -14,6 +14,8 @@ import os
import sys
import importlib
import inspect
import enchant
sys.path.insert(0, os.path.abspath('../../'))
@ -35,10 +37,10 @@ ManagerDescriptor.__get__ = lambda self, *args, **kwargs: self.manager
from django.db.models.query import QuerySet
QuerySet.__repr__ = lambda self: self.__class__.__name__
try:
import enchant # NoQA
except ImportError:
enchant = None
# try:
# import enchant # NoQA
# except ImportError:
# enchant = None
django.setup()
@ -52,8 +54,6 @@ author = 'SHP S101, group 2'
release = 'v0.01'
# Django sphinx setup by https://gist.github.com/codingjoe/314bda5a07ff3b41f247
# -- General configuration ---------------------------------------------------
def process_django_models(app, what, name, obj, options, lines):
@ -91,7 +91,6 @@ def process_django_models(app, what, name, obj, options, lines):
lines.append(':type %s: %s.%s' % (field.attname, module, field_type.__name__))
if enchant is not None:
lines += spelling_white_list
print('ok')
return lines
@ -118,6 +117,9 @@ def skip_queryset(app, what, name, obj, skip, options):
return True
return skip
def process_signature(app, what, name, obj, options, signature, return_annotation):
return None
def setup(app):
# Register the docstring processor with sphinx
@ -125,12 +127,14 @@ def setup(app):
app.connect('autodoc-skip-member', skip_queryset)
if enchant is not None:
app.connect('autodoc-process-docstring', process_modules)
app.connect('autodoc-process-signature', process_signature)
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
extensions = {
'sphinx.ext.todo',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
@ -138,12 +142,11 @@ extensions = [
'sphinx_rtd_theme',
'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram',
'sphinx_autodoc_typehints'
'sphinx_autodoc_typehints',
'sphinxcontrib.spelling'
]
}
if enchant is not None:
extensions.append('sphinxcontrib.spelling')
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -188,7 +191,7 @@ intersphinx_mapping = {
autodoc_default_flags = ['members']
# spell checking
spelling_lang = 'en_US'
spelling_lang = 'ru_RU'
spelling_word_list_filename = 'spelling_wordlist.txt'
spelling_show_suggestions = True
spelling_ignore_pypi_package_names = True

View File

@ -27,7 +27,7 @@ from .models import UserProfile
class CustomRegistrationView(RegistrationView):
"""
Класс отображения и логики работы страницы регистрации пользователя
Классccc отображения и логики работы страницы регистрации пользователя
:param form_class: Форма, которую необходимо заполнить для регистрации
:type form_class: :class:`forms.CustomRegistrationForm`