changeset 446:a5bf869a26de

cosmetic changes, make pep8 checker happy, add license (see below) License added, quoting MoinMoin:DavidLinke/Sinorca4Moin: "... I am OK with gpl v2 (since moin-code was partly reused this seems to be the right license). ... -- DavidLinke 2008-12-10 00:32:30" Note: moin uses "GPL v2 or later" license, so, assuming this was meant, I just used the same license declaration as everywhere in moin code.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Oct 2009 17:45:50 +0200
parents 6f25eded9177
children 0bc7b0127323
files data/plugin/theme/sinorca4moin.py
diffstat 1 files changed, 34 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/theme/sinorca4moin.py	Tue Oct 06 17:17:49 2009 +0200
+++ b/data/plugin/theme/sinorca4moin.py	Tue Oct 06 17:45:50 2009 +0200
@@ -1,33 +1,31 @@
 # -*- coding: iso-8859-1 -*-
-"""MoinMoin theme "sinorca4moin" by David Linke.
+"""
+MoinMoin - sinorca4moin theme
 
 See MoinMoin:DavidLinke/Sinorca4Moin for more infos.
 
-Version 0.5b   : changing css a bit (also made css2.1. compatible) and 
-                 updating the theme for MoinMoin Version 1.8 
-                 Attention: this is not an official release, more a
-                 personal update (Marcel Haefner)!
-Version 0.5    : Version adjusted for moin-1.6.x (2007-12-29)
-Version 0.4    : Extended version adjusted for moin-1.5.x (2006-08-13)
-Version 0.1-0.3: Initial version for moin-1.3.x (2005)
-
 Inspired by Haran's sinorca-design published at www.oswd.org.
 
-$Id: sinorca4moin.py 159 2007-12-29 21:43:07Z linke $
+@copyright: 2005-2009 MoinMoin:DavidLinke,
+            2008-2009 MoinMoin:MarcelHaefner
+@license: GNU GPL, see COPYING for details.
 """
 
 import os
+
 from MoinMoin.theme import ThemeBase
 from MoinMoin.Page import Page
 from MoinMoin.config.multiconfig import _url_re_list, _makeConfig, _getConfigName
 from MoinMoin import wikiutil, error
 
+
 class Theme(ThemeBase):
 
     name = "sinorca4moin"
 
     def farmWikiList(self):
-        """Generate list of links pointing to the wikis of the farm
+        """
+        Generate list of links pointing to the wikis of the farm
 
         Fore each Subwiki a link to Frontpage and RecentChanges (image) is
         created. If interwiki_preferred is specified in the farmconfig the
@@ -35,7 +33,7 @@
         in farmconfig.wiki will be created.
         """
         _ = self.request.getText
-        farmwikis =  [wiki_name for wiki_name, reg in _url_re_list()]
+        farmwikis = [wiki_name for wiki_name, reg in _url_re_list()]
         if self.request.cfg.interwiki_preferred:
             wikis = self.request.cfg.interwiki_preferred
             # remove everything that is not a wiki of the farm
@@ -43,7 +41,8 @@
         else:
             wikis = farmwikis
 
-        if len(wikis) < 2: return []  # creating links is useless for one wiki
+        if len(wikis) < 2:
+            return []  # creating links is useless for one wiki
 
         linkList = []
         for wiki_name in wikis:
@@ -55,27 +54,28 @@
                 interwiki_list = wikiutil.load_wikimap(self.request)
                 wiki_url = interwiki_list[cfg.interwikiname]
                 rc = _("RecentChanges", formatted=False)
-                linkList.append( ''.join([
+                linkList.append(''.join([
                     u' <a title="%s" href="%s"%s>%s</a>' %
                         (cfg.sitename, wiki_url, highlight, cfg.interwikiname),
                     u'<a title="%s" href="%s%s">' %
                         (rc, wiki_url, wikiutil.quoteWikinameURL(rc)),
                     u'<img src="%s/sinorca4moin/img/moin-diff.png" alt="%s"' %
                             (cfg.url_prefix_static, rc),
-                    u' height="11" width="15"></a>'
+                    u' height="11" width="15"></a>',
                     ]))
             except KeyError: # probably no interwikiname in config
                 msg = """
 Missing the wiki '%s' in the interwiki list.
 
 Please add the interwiki-name and the url of this wiki to 'intermap.txt'.
-"""%wiki_name
+""" % wiki_name
                 #raise error.ConfigurationError(msg)
                 pass
         return linkList
 
     def subheader(self):
-        """Make subheader
+        """
+        Make subheader
 
         Links to subwikis if it's a farm else uses page_header2.
         """
@@ -91,10 +91,10 @@
             ])
 
     def title(self, d):
-        """ Assemble the title (not as html list as in standard method!)
+        """
+        Assemble the title (not as html list as in standard method!)
 
-        Code copied from title-method in __init__.py
-        Only one line was changed.
+        Code copied from title-method in __init__.py - only one line was changed.
 
         @param d: parameter dictionary
         @rtype: string
@@ -138,7 +138,7 @@
     def iconbar(self, d):
         """
         Assemble the iconbar
-        
+
         @param d: parameter dictionary
         @rtype: string
         @return: iconbar html
@@ -189,14 +189,14 @@
 
         html = [
             u'<div class="sidepanel">',
-            u'<h1>%s</h1>' %  _("User"),
+            u'<h1>%s</h1>' % _("User"),
             self.username(d),
-            u'</div>'
+            u'</div>',
             ]
         return u'\n'.join(html)
 
     def linkedSitename(self):
-        """Create title from sitename and link to FrontPage"""
+        """ Create title from sitename and link to FrontPage """
         frontpage = wikiutil.getFrontPage(self.request).page_name
         html = wikiutil.link_tag(self.request,
                                  wikiutil.quoteWikinameURL(frontpage),
@@ -204,8 +204,7 @@
         return html
 
     def flexible_userhome(self, d):
-        """Determine content in superheader and sidebar based on page_header1
-        """
+        """ Determine content in superheader and sidebar based on page_header1 """
         if self.cfg.page_header1:
             superheader = self.cfg.page_header1
             userpanel = self.userpanel(d)
@@ -220,9 +219,10 @@
         return superheader, userpanel
 
     def shortenPagename(self, name):
-        """ Shorten page names (overrides default method)
+        """
+        Shorten page names (overrides default method)
 
-        changed compared to default: for hierarchical names a part of
+        Changes compared to default: for hierarchical names a part of
         the first level is always shown.
 
         @param name: page name, unicode
@@ -417,7 +417,8 @@
         return u'\n'.join(html)
 
     def splitNavilink_off(self, text, localize=1):
-        """ Split navibar links into pagename, link to page
+        """
+        Split navibar links into pagename, link to page
 
         This overrides the defaut method. In contrast to default quicklinks
         are cut down to a maximum length
@@ -450,7 +451,6 @@
             title = self.shortenPagename(title)
             link = page.link_to(request, title)
 
-
         from MoinMoin import config
         for scheme in self.linkSchemas:
             if pagename.startswith(scheme):
@@ -473,9 +473,7 @@
                 return (pagename,
                         self.request.formatter.interwikilink(True, interwiki, page) +
                         page +
-                        self.request.formatter.interwikilink(False, interwiki, page)
-                        )
-
+                        self.request.formatter.interwikilink(False, interwiki, page))
         except ValueError:
             pass
 
@@ -488,8 +486,10 @@
 
         return pagename, link
 
+
 def execute(request):
-    """ Generate and return a theme object
+    """
+    Generate and return a theme object
 
     @param request: the request object
     @rtype: MoinTheme