Little code cleanup.

This commit is contained in:
Martin Mahner 2013-03-19 14:08:56 +01:00
parent 9593853696
commit 04fefe15a6
5 changed files with 4 additions and 9 deletions

View file

@ -33,6 +33,7 @@ LEXER_WORDWRAP = ('text', 'rst')
class NakedHtmlFormatter(HtmlFormatter):
def wrap(self, source, outfile):
return self._wrap_code(source)
def _wrap_code(self, source):
for i, t in source:
yield i, t

View file

@ -1,7 +1,7 @@
import datetime
import sys
from optparse import make_option
from django.core.management.base import CommandError, LabelCommand
from django.core.management.base import LabelCommand
from dpaste.models import Snippet
class Command(LabelCommand):

View file

@ -1,13 +1,10 @@
import datetime
import difflib
import random
import mptt
import re
from django.db import models
from django.core.urlresolvers import reverse
from django.db.models import permalink
from django.utils.translation import ugettext_lazy as _
from dpaste.highlight import LEXER_DEFAULT, pygmentize
from dpaste.highlight import LEXER_DEFAULT
t = 'abcdefghijkmnopqrstuvwwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ1234567890'
def generate_secret_id(length=5):

View file

@ -1 +0,0 @@
__version__ = '0.1'

View file

@ -1,12 +1,10 @@
from django.template import Library
from django.utils.safestring import mark_safe
from dpaste.highlight import pygmentize
register = Library()
@register.filter
def in_list(value,arg):
def in_list(value, arg):
return value in arg
@register.filter