1. Ronny Pfannschmidt
  2. lodgeit

Commits

Georg Brandl  committed b42c849

Minimal fixes and cleanup.

  • Participants
  • Parent commits 43d73e5
  • Branches lodgeit

Comments (0)

Files changed (7)

File lodgeit/controllers/pastes.py

View file
 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:
                 local.request.set_language(lang)
                 break

File lodgeit/lib/captcha.py

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

File lodgeit/lib/compilerparser.py

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

File lodgeit/lib/diff.py

View file
                 continue
             for chunk in file['chunks']:
                 lineiter = iter(chunk)
-                first = True
                 try:
                     while True:
                         line = lineiter.next()

File lodgeit/lib/highlighting.py

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

File lodgeit/lib/pagination.py

View file
            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 % {

File manage.py

View file
 #!/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