Georg Brandl committed b42c849

Minimal fixes and cleanup.

Comments (0)

Files changed (7)


 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
         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:


             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))


     :license: BSD
 import re
-from werkzeug import escape
 _gcc_message_re = re.compile(r'''(?ux)


             for chunk in file['chunks']:
                 lineiter = iter(chunk)
-                first = True
                     while True:
                         line =


             parsed_code.index('<pre>', start) + num:
             parsed_code.index('</pre>', start + 7)
-    except (IndexError, ValueError), e:
+    except (IndexError, ValueError):
         code = code.strip('\n').splitlines()
     lines = code[:num]
     if len(code) > num:


            abs(page - num) < math.ceil(threshold / 2.0):
             if result and result[-1] != ellipsis:
-            was_space = False
             link = link_builder(num)
             template = num == page and active or normal
             result.append(template % {
 #!/usr/bin/env python
-import os
-from werkzeug import script, run_simple, create_environ, run_wsgi_app
+from werkzeug import script, create_environ, run_wsgi_app
 from lodgeit import local
 from lodgeit.application import make_app
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.