Cleanup compatibility shims

This commit is contained in:
Iacopo Spalletti 2018-01-09 01:08:57 +01:00
parent bdfbfc438a
commit 497ec74f2e
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6
4 changed files with 9 additions and 12 deletions

View file

@ -24,12 +24,6 @@ from .forms import CategoryAdminForm, PostAdminForm
from .models import BlogCategory, Post
from .settings import get_setting
try:
from admin_enhancer.admin import EnhancedModelAdminMixin
except ImportError:
class EnhancedModelAdminMixin(object):
pass
class SiteListFilter(admin.SimpleListFilter):
title = _('site')
@ -55,7 +49,7 @@ class SiteListFilter(admin.SimpleListFilter):
raise admin.options.IncorrectLookupParameters(e)
class BlogCategoryAdmin(EnhancedModelAdminMixin, ModelAppHookConfig, TranslatableAdmin):
class BlogCategoryAdmin(ModelAppHookConfig, TranslatableAdmin):
form = CategoryAdminForm
list_display = [
'name', 'parent', 'app_config', 'all_languages_column',

View file

@ -24,10 +24,10 @@ try:
import HTMLParser
h = HTMLParser.HTMLParser()
except ImportError:
from html.parser import HTMLParser
unescape = h.unescape
h = HTMLParser()
except ImportError:
from html import unescape
class LatestEntriesFeed(Feed):
@ -123,13 +123,13 @@ class FBInstantFeed(Rss201rev2Feed):
handler.startElement('description', {})
handler._write('<![CDATA[{0}]]>'.format(
h.unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
)
handler.endElement('description')
handler.startElement('content:encoded', {})
handler._write('<![CDATA[')
handler._write('<!doctype html>')
handler._write(h.unescape(force_text(item['content'])))
handler._write(unescape(force_text(item['content'])))
handler._write(']]>')
handler.endElement('content:encoded')

View file

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from aldryn_search.helpers import get_plugin_index_data
from aldryn_search.utils import get_index_base, strip_tags
from django.utils.encoding import force_text

View file

@ -60,6 +60,7 @@ setup(
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',