Minimal fixes and cleanup.
This commit is contained in:
parent
03ab07a650
commit
950e41e22e
@ -12,7 +12,7 @@ from werkzeug import redirect, Response
|
||||
from werkzeug.exceptions import NotFound
|
||||
from lodgeit import local
|
||||
from lodgeit.lib import antispam
|
||||
from lodgeit.i18n import list_languages, _
|
||||
from lodgeit.i18n import list_languages as i18n_list_languages, _
|
||||
from lodgeit.utils import render_to_response
|
||||
from lodgeit.models import Paste
|
||||
from lodgeit.database import db
|
||||
@ -176,9 +176,9 @@ class PasteController(object):
|
||||
return resp
|
||||
|
||||
def set_language(self, lang='en'):
|
||||
"""Minimal view that set's a different language. Redirects
|
||||
"""Minimal view that sets a different language. Redirects
|
||||
back to the page the user is coming from."""
|
||||
for key, value in list_languages():
|
||||
for key, value in i18n_list_languages():
|
||||
if key == lang:
|
||||
local.request.set_language(lang)
|
||||
break
|
||||
|
@ -139,7 +139,6 @@ class TextLayer(Layer):
|
||||
color = random_color(saturation=0.1, lumination=0.1)
|
||||
self.text_color = color
|
||||
self.transparency = random.randint(20, 60)
|
||||
f = get_random_resource('fonts')
|
||||
self.font = ImageFont.truetype(get_random_resource('fonts'),
|
||||
random.randrange(min_size, max_size))
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
:license: BSD
|
||||
"""
|
||||
import re
|
||||
from werkzeug import escape
|
||||
|
||||
|
||||
_gcc_message_re = re.compile(r'''(?ux)
|
||||
|
@ -203,7 +203,6 @@ class DiffRenderer(object):
|
||||
continue
|
||||
for chunk in file['chunks']:
|
||||
lineiter = iter(chunk)
|
||||
first = True
|
||||
try:
|
||||
while True:
|
||||
line = lineiter.next()
|
||||
|
@ -103,7 +103,7 @@ def preview_highlight(code, language, num=5):
|
||||
parsed_code.index('<pre>', start) + num:
|
||||
parsed_code.index('</pre>', start + 7)
|
||||
].strip('\n').splitlines()
|
||||
except (IndexError, ValueError), e:
|
||||
except (IndexError, ValueError):
|
||||
code = code.strip('\n').splitlines()
|
||||
lines = code[:num]
|
||||
if len(code) > num:
|
||||
|
@ -59,7 +59,6 @@ def generate_pagination(page, per_page, total, link_builder=None,
|
||||
abs(page - num) < math.ceil(threshold / 2.0):
|
||||
if result and result[-1] != ellipsis:
|
||||
result.append(commata)
|
||||
was_space = False
|
||||
link = link_builder(num)
|
||||
template = num == page and active or normal
|
||||
result.append(template % {
|
||||
|
Loading…
Reference in New Issue
Block a user