diff MoinMoin/themes/__init__.py @ 1975:384555088cab

lots of pep8 fixes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 11 Feb 2013 04:49:04 +0100
parents 87272c032485
children 791bdedb0c20
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/themes/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -41,7 +41,8 @@
     try:
         return get_theme(theme_name)
     except KeyError:
-        logging.warning("Theme {0!r} was not found; using default of {1!r} instead.".format(theme_name, app.cfg.theme_default))
+        logging.warning("Theme {0!r} was not found; using default of {1!r} instead.".format(
+            theme_name, app.cfg.theme_default))
         theme_name = app.cfg.theme_default
         return get_theme(theme_name)
 
@@ -50,6 +51,7 @@
 def render_template(template, **context):
     return render_theme_template(get_current_theme(), template, **context)
 
+
 def themed_error(e):
     item_name = request.view_args.get('item_name', u'')
     if e.code == 403:
@@ -72,11 +74,11 @@
         self.cfg = cfg
         self.user = flaskg.user
         self.storage = flaskg.storage
-        self.ui_lang = 'en' # XXX
-        self.ui_dir = 'ltr' # XXX
-        self.content_lang = flaskg.content_lang # XXX
-        self.content_dir = 'ltr' # XXX
-        self.meta_items = [] # list of (name, content) for html head <meta>
+        self.ui_lang = 'en'  # XXX
+        self.ui_dir = 'ltr'  # XXX
+        self.content_lang = flaskg.content_lang  # XXX
+        self.content_dir = 'ltr'  # XXX
+        self.meta_items = []  # list of (name, content) for html head <meta>
 
     def location_breadcrumbs(self, item_name):
         """
@@ -235,12 +237,12 @@
                                 item_url, item_name = line.split(' ', 1)
                                 sisteritems[item_name.decode('utf-8')] = item_url
                             except:
-                                pass # ignore invalid lines
+                                pass  # ignore invalid lines
                         f.close()
                         app.cache.set(cid, sisteritems)
                         logging.info("Site: {0!r} Status: Updated. Pages: {1}".format(sistername, len(sisteritems)))
                     except IOError as err:
-                        (title, code, msg, headers) = err.args # code e.g. 304
+                        (title, code, msg, headers) = err.args  # code e.g. 304
                         logging.warning("Site: {0!r} Status: Not updated.".format(sistername))
                         logging.exception("exception was:")
                 if current in sisteritems:
@@ -327,6 +329,7 @@
         result['email'] = email
     return result
 
+
 def shorten_item_name(name, length=25):
     """
     Shorten item names
@@ -349,6 +352,7 @@
             name = u'{0}...{1}'.format(name[:half + left], name[-half:])
     return name
 
+
 def shorten_id(name, length=7):
     """
     Shorten IDs to specified length
@@ -374,6 +378,7 @@
     'application/x-svgdraw': 'drawing',
 }
 
+
 def contenttype_to_class(contenttype):
     """
     Convert a contenttype string to a css class.