~netlandish/django-wiki

bef56330617e61931e7d69d9366283be10249338 — Benjamin Bach 6 years ago ee9a3cd
Lint properly, reorganizing some imports and removing unused ones
M docs/development/testing.rst => docs/development/testing.rst +0 -1
@@ 62,4 62,3 @@ fixtures for tests e.g. a root article.
  Javascript, and can be tested using the fast WebTest method, rather than
  relying on the slow and fragile Selenium method. Selenium tests are not run by
  default.


M docs/development/testproject.rst => docs/development/testproject.rst +0 -1
@@ 8,4 8,3 @@ an sqlite database. Login for django admin is ``admin:admin``. This
project should always be maintained, but please do not commit changes to
the SQLite database as we only care about its contents in case data
models are changed.


M docs/index.rst => docs/index.rst +0 -1
@@ 26,4 26,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


M docs/settings.rst => docs/settings.rst +0 -1
@@ 33,4 33,3 @@ Plugin macros

.. automodule:: wiki.plugins.macros.settings
   :members:


M src/wiki/__init__.py => src/wiki/__init__.py +0 -1
@@ 17,7 17,6 @@

from wiki.core.version import get_version


default_app_config = 'wiki.apps.WikiConfig'

VERSION = (0, 4, 0, 'alpha', 5)

M src/wiki/conf/settings.py => src/wiki/conf/settings.py +0 -1
@@ 1,5 1,4 @@
import bleach
from django.apps import apps
from django.conf import settings as django_settings
from django.contrib.messages import constants as messages
from django.core.files.storage import default_storage

M src/wiki/plugins/images/apps.py => src/wiki/plugins/images/apps.py +1 -1
@@ 1,6 1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
from django.core.checks import register
from django.utils.translation import gettext_lazy as _

from . import checks


M src/wiki/plugins/images/models.py => src/wiki/plugins/images/models.py +2 -2
@@ 107,9 107,9 @@ class ImageRevision(RevisionPluginRevision):
def on_image_revision_delete(instance, *args, **kwargs):
    if not instance.image:
        return
    # Remove image file    
    # Remove image file
    instance.image.delete(save=False)
    

    try:
        path = instance.image.path.split("/")[:-1]
    except NotImplemented:

M src/wiki/plugins/macros/mdx/toc.py => src/wiki/plugins/macros/mdx/toc.py +1 -2
@@ 1,7 1,6 @@
import re

from markdown.extensions.toc import TocTreeprocessor, TocExtension, slugify
from markdown.util import etree
from markdown.extensions.toc import TocExtension, TocTreeprocessor, slugify
from wiki.plugins.macros import settings

HEADER_ID_PREFIX = "wiki-toc-"

M src/wiki/plugins/redlinks/mdx/redlinks.py => src/wiki/plugins/redlinks/mdx/redlinks.py +4 -3
@@ 1,6 1,7 @@
from urllib.parse import urlparse, urljoin
from markdown.treeprocessors import Treeprocessor
from urllib.parse import urljoin, urlparse

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor
from wiki.models import URLPath




@@ 22,7 23,7 @@ def urljoin_internal(base, url):
    res1 = urljoin(canary1 + base, url)
    res2 = urljoin(canary2 + base, url)
    if res1.startswith(canary1) and res2.startswith(canary2):
        return res1[len(canary1) :]
        return res1[len(canary1):]


class LinkTreeprocessor(Treeprocessor):

M src/wiki/sites.py => src/wiki/sites.py +1 -1
@@ 1,8 1,8 @@
from django.apps import apps
from django.utils.functional import LazyObject
from django.utils.module_loading import import_string
from wiki.conf import settings
from wiki.compat import include, url
from wiki.conf import settings
from wiki.core.plugins import registry



M src/wiki/static/wiki/bootstrap/LICENSE => src/wiki/static/wiki/bootstrap/LICENSE +1 -1
@@ 173,4 173,4 @@
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS
\ No newline at end of file
   END OF TERMS AND CONDITIONS

M src/wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.svg => src/wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.svg +1 -1
@@ 285,4 285,4 @@
<glyph unicode="&#x1f511;" d="M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z" />
<glyph unicode="&#x1f6aa;" d="M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z" />
</font>
</defs></svg> 
\ No newline at end of file
</defs></svg>

M src/wiki/static/wiki/font-awesome/font/fontawesome-webfont.svg => src/wiki/static/wiki/font-awesome/font/fontawesome-webfont.svg +1 -1
@@ 517,4 517,4 @@
<glyph unicode="&#xf20e;" horiz-adv-x="1792" />
<glyph unicode="&#xf500;" horiz-adv-x="1792" />
</font>
</defs></svg> 
\ No newline at end of file
</defs></svg>

M src/wiki/urls.py => src/wiki/urls.py +1 -2
@@ 1,11 1,10 @@
from django.utils.module_loading import import_string
from wiki import sites
from wiki.compat import include, url
from wiki.conf import settings
from wiki.core.plugins import registry
from wiki import sites
from wiki.views import accounts, article, deleted_list


urlpatterns = [
    url(r'^', sites.site.urls),
]

M tests/core/test_checks.py => tests/core/test_checks.py +1 -1
@@ 3,7 3,7 @@ import copy
from django.conf import settings
from django.core.checks import Error, registry
from django.test import TestCase
from wiki.checks import OBSOLETE_INSTALLED_APPS, REQUIRED_CONTEXT_PROCESSORS, REQUIRED_INSTALLED_APPS, Tags
from wiki.checks import REQUIRED_CONTEXT_PROCESSORS, REQUIRED_INSTALLED_APPS, Tags


def _remove(settings, arg):

M tests/core/test_markdown.py => tests/core/test_markdown.py +2 -1
@@ 1,6 1,7 @@
from unittest.mock import patch

import markdown
from django.test import TestCase
from unittest.mock import patch
from wiki.core.markdown import ArticleMarkdown
from wiki.core.markdown.mdx.codehilite import WikiCodeHiliteExtension
from wiki.core.markdown.mdx.responsivetable import ResponsiveTableExtension

M tests/plugins/attachments/test_models.py => tests/plugins/attachments/test_models.py +1 -1
@@ 1,5 1,5 @@
from tests.base import RequireRootArticleMixin, TestBase
from wiki.plugins.attachments.models import AttachmentRevision, Attachment
from wiki.plugins.attachments.models import Attachment, AttachmentRevision


class AttachmentRevisionTests(RequireRootArticleMixin, TestBase):

M tests/plugins/images/test_forms.py => tests/plugins/images/test_forms.py +0 -1
@@ 1,6 1,5 @@
from django.test import TestCase
from django.utils.translation import gettext

from wiki.plugins.images.forms import PurgeForm



M tests/plugins/images/test_views.py => tests/plugins/images/test_views.py +1 -4
@@ 9,10 9,7 @@ from wiki.models import URLPath
from wiki.plugins.images import models
from wiki.plugins.images.wiki_plugin import ImagePlugin

from ...base import (
    ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin,
    wiki_override_settings,
)
from ...base import ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin, wiki_override_settings


class ImageTests(RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase):

M tests/plugins/links/test_urlize.py => tests/plugins/links/test_urlize.py +2 -4
@@ 1,11 1,9 @@
import html
import markdown
from unittest import mock

import markdown
import pytest

from wiki.plugins.links.mdx.urlize import makeExtension, UrlizeExtension

from wiki.plugins.links.mdx.urlize import UrlizeExtension, makeExtension

# Template accepts two strings - href value and link text value.
EXPECTED_LINK_TEMPLATE = (

M tests/testdata/urls.py => tests/testdata/urls.py +0 -1
@@ 3,7 3,6 @@ from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from wiki.compat import include, url


urlpatterns = [
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', admin.site.urls),