From b4f01103dcb7c5087d75e01d43f1d9eae0cb6bea Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sun, 24 Nov 2013 23:37:01 +0100 Subject: [PATCH] Moar cleanup. --- dpaste/templatetags/dpaste_tags.py | 10 ++-------- dpaste/tests/test_snippet.py | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dpaste/templatetags/dpaste_tags.py b/dpaste/templatetags/dpaste_tags.py index 8ec2b3f..487311b 100644 --- a/dpaste/templatetags/dpaste_tags.py +++ b/dpaste/templatetags/dpaste_tags.py @@ -8,12 +8,6 @@ def in_list(value, arg): return value in arg @register.filter -def highlight(snippet, maxlines=None): +def highlight(snippet): h = pygmentize(snippet.content, snippet.lexer) - if not h: - s = snippet.content.splitlines() - s = h.splitlines() - - if maxlines: - return s[:maxlines] - return s \ No newline at end of file + return h.splitlines() diff --git a/dpaste/tests/test_snippet.py b/dpaste/tests/test_snippet.py index 65de29f..28e0605 100644 --- a/dpaste/tests/test_snippet.py +++ b/dpaste/tests/test_snippet.py @@ -60,4 +60,4 @@ class SnippetTestCase(TestCase): response = self.client.post(response.request['PATH_INFO'], data, follow=True) self.assertContains(response, data['content']) self.assertEqual(response.status_code, 200) - self.assertEqual(Snippet.objects.count(), 2) \ No newline at end of file + self.assertEqual(Snippet.objects.count(), 2)