Skip to content

Commit

Permalink
Fix pep8 errors after automatic replacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Oct 27, 2013
1 parent 7de995f commit d852093
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
28 changes: 14 additions & 14 deletions emoticons/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
from django.conf import settings

emoticons_default_list = ((':)', 'smile.gif'),
(':D', 'mrgreen.gif'),
(':(', 'sad.gif'),
(':|', 'neutral.gif'),
(';)', 'wink.gif'),
(':p', 'razz.gif'),
(':P', 'razz.gif'),
(':o', 'surprised.gif'),
(':O', 'surprised.gif'),
(':s', 'confused.gif'),
(':S', 'confused.gif'),
(':$', 'confused.gif'),
('o_O', 'eek.gif'),
)
(':D', 'mrgreen.gif'),
(':(', 'sad.gif'),
(':|', 'neutral.gif'),
(';)', 'wink.gif'),
(':p', 'razz.gif'),
(':P', 'razz.gif'),
(':o', 'surprised.gif'),
(':O', 'surprised.gif'),
(':s', 'confused.gif'),
(':S', 'confused.gif'),
(':$', 'confused.gif'),
('o_O', 'eek.gif'),
)

EMOTICONS_URL = getattr(settings, 'EMOTICONS_URL',
join(settings.MEDIA_URL, 'emoticons/'))
join(settings.MEDIA_URL, 'emoticons/'))
EMOTICONS_LIST = getattr(settings, 'EMOTICONS_LIST', emoticons_default_list)
EMOTICONS_CLASS = getattr(settings, 'EMOTICONS_CLASS', 'emoticon')
5 changes: 3 additions & 2 deletions emoticons/templatetags/smiley_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

register = template.Library()

RE_EMOTICONS_LIST = [(re.compile(re.escape(emoticon[0])), emoticon[0], emoticon[1])
for emoticon in EMOTICONS_LIST]
RE_EMOTICONS_LIST = [(re.compile(re.escape(emoticon[0])),
emoticon[0], emoticon[1])
for emoticon in EMOTICONS_LIST]


def replace_emoticons(content, autoescape=None):
Expand Down
9 changes: 6 additions & 3 deletions emoticons/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def test_filter(self):
{{ content|emoticons }}
""")
html = t.render(Context({'content': 'Coding is fun :).'}))
self.assertEquals(html.strip(), 'Coding is fun <img class=\"emoticon\" '
self.assertEquals(html.strip(),
'Coding is fun <img class=\"emoticon\" '
'src=\"emoticons/smile.gif\" alt=\":)\" />.')

def test_tag(self):
Expand All @@ -23,7 +24,8 @@ def test_tag(self):
{% endemoticons %}
""")
html = t.render(Context())
self.assertEquals(html.strip(), 'Coding is fun <img class=\"emoticon\" '
self.assertEquals(html.strip(),
'Coding is fun <img class=\"emoticon\" '
'src=\"emoticons/smile.gif\" alt=\":)\" />.')

def test_tag_var(self):
Expand All @@ -34,7 +36,8 @@ def test_tag_var(self):
{% endemoticons %}
""")
html = t.render(Context({'content': 'Coding is fun :).'}))
self.assertEquals(html.strip(), 'Coding is fun <img class=\"emoticon\" '
self.assertEquals(html.strip(),
'Coding is fun <img class=\"emoticon\" '
'src=\"emoticons/smile.gif\" alt=\":)\" />.')

def test_multiple(self):
Expand Down

0 comments on commit d852093

Please sign in to comment.