From 4bdf440b15bb4ab913b3c91c089a2cac4acf5beb Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Sat, 14 Mar 2009 10:07:11 +0100 Subject: [PATCH] [wiki-lenny] on retire ce qui est dans le paquet debian custom darcs-hash:20090314090711-bd074-5773471654807d83978f6ab5fea6cf009078dbea.gz --- wiki-lenny/local/formatter/__init__.py | 5 + wiki-lenny/local/parser/Box.py | 94 ----- wiki-lenny/local/parser/Portail.py | 85 ---- wiki-lenny/local/parser/__init__.py | 5 + wiki-lenny/local/theme/crans-www.py | 540 ------------------------- wiki-lenny/local/theme/crans.py | 189 --------- 6 files changed, 10 insertions(+), 908 deletions(-) create mode 100644 wiki-lenny/local/formatter/__init__.py delete mode 100644 wiki-lenny/local/parser/Box.py delete mode 100644 wiki-lenny/local/parser/Portail.py create mode 100644 wiki-lenny/local/parser/__init__.py delete mode 100644 wiki-lenny/local/theme/crans-www.py delete mode 100644 wiki-lenny/local/theme/crans.py diff --git a/wiki-lenny/local/formatter/__init__.py b/wiki-lenny/local/formatter/__init__.py new file mode 100644 index 00000000..e4ed3b60 --- /dev/null +++ b/wiki-lenny/local/formatter/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: iso-8859-1 -*- + +from MoinMoin.util import pysupport + +modules = pysupport.getPackageModules(__file__) diff --git a/wiki-lenny/local/parser/Box.py b/wiki-lenny/local/parser/Box.py deleted file mode 100644 index 0941d3d2..00000000 --- a/wiki-lenny/local/parser/Box.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: iso-8859-1 -*- -""" - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... - . . .... ............. .. ... - .. .. ... ........ ... ... - ................................ - - MoinMoin - Box parser - - PURPOSE: - une boite jolie - - CALLING SEQUENCE: - {{{ - #!Box titre - blablabla - - tables, images.... - }}} - - Copyright 2008 Antoine Durand-Gasselin - -""" - -import os,string,re,StringIO -from MoinMoin import config, wikiutil -from MoinMoin.parser.text_moin_wiki import Parser as WikiParser - -Dependencies = [] -color_list = ['orange', 'black', 'red', 'green', 'blue', 'gray'] - -##################################################################### -# Parser : classe principale, c'est elle qui fait tout -####### -class Parser: - parsername = "Box" - Dependencies=Dependencies - - def __init__(self, raw, request, **kw): - self.form = request.form - self.request = request - self.raw = raw - self.settings = self.parseArgs(kw["format_args"]) - - def getRandomColor(self): - nb_of_colors = color_list.__len__() - from random import randint - colorNum = randint(0, nb_of_colors - 1) - return color_list[colorNum] - - def parseArgs(self, argsString): - argList = argsString.split(u',') - settings = {} - for anArg in argList: - anArg = anArg.strip(u' ') - if anArg.find(u'color=')!=-1: - theColor = anArg.split(u'=')[1].lower() - if theColor == 'random': - theColor = self.getRandomColor() - settings['color'] = theColor - else: - settings['title'] = anArg - return settings - - def format(self, formatter): - - # on utilise la classe qui va fabriquer le code html - try: title = self.settings['title'] - except: title = '' - try: color = self.settings['color'] - except: color=None - - content_buf = StringIO.StringIO() - self.request.redirect(content_buf) - WikiParser(self.raw, self.request).format(formatter) - content = content_buf.getvalue() - self.request.redirect() - - del content_buf - - # On le fout dans une boîte - self.request.write(formatter.crans_box(title, content, color)) - diff --git a/wiki-lenny/local/parser/Portail.py b/wiki-lenny/local/parser/Portail.py deleted file mode 100644 index 86e33c03..00000000 --- a/wiki-lenny/local/parser/Portail.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -""" - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... - . . .... ............. .. ... - .. .. ... ........ ... ... - ................................ - -MoinMoin - Portail parser - - PURPOSE: - Pour afficher un portail a la wikipedia. - - CALLING SEQUENCE: - {{{ - #!Portail - image1.png @@ title1 @@ description 1 - image2.png @@ title2 @@ description 2 - image3.png @@ title3 @@ description 3 - }}} - - Copyright 2008 Antoine Durand-Gasselin - -""" -import os,string,re,StringIO -from MoinMoin.action import AttachFile -from MoinMoin.parser.text_moin_wiki import Parser as WikiParser - -##################################################################### -# Parser : classe principale, c'est elle qui fait tout -####### -class Parser: - def __init__(self, raw, request, **kw): - self.request = request - self.form = request.form - self.raw = raw - - def format(self, formatter): - # on divise le textes en lignes (1 ligne = une entree dans le portail) - quotes = self.raw.split('\n') - - # on récupere le chemin des fichiers attaches pour les images - current_pagename=formatter.page.page_name - attachment_path = AttachFile.getAttachDir(self.request, current_pagename, create=1) - # on traite les ligne une à une - entries = [] - for line in quotes: - line=line.strip() - items=line.split('@@',2) - if len(items)<3: - # Voir ce qu'on fait - ## self.request.write('') - pass - else: - # On récupère le nom de l'image - pic = items[0].strip() - - # On va formatter le titre et la légende - tit_buf = StringIO.StringIO() - bod_buf = StringIO.StringIO() - - self.request.redirect(tit_buf) - WikiParser(items[1], self.request).format(formatter) - title = tit_buf.getvalue() - self.request.redirect() - - self.request.redirect(bod_buf) - WikiParser(items[2], self.request).format(formatter) - body = bod_buf.getvalue() - self.request.redirect() - - # Qu'on rajoute à la liste des entrées - entries += [ (( pic, title, body )) ] - - self.request.write(formatter.crans_portal(entries)) diff --git a/wiki-lenny/local/parser/__init__.py b/wiki-lenny/local/parser/__init__.py new file mode 100644 index 00000000..e4ed3b60 --- /dev/null +++ b/wiki-lenny/local/parser/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: iso-8859-1 -*- + +from MoinMoin.util import pysupport + +modules = pysupport.getPackageModules(__file__) diff --git a/wiki-lenny/local/theme/crans-www.py b/wiki-lenny/local/theme/crans-www.py deleted file mode 100644 index 914ded83..00000000 --- a/wiki-lenny/local/theme/crans-www.py +++ /dev/null @@ -1,540 +0,0 @@ -# -*- coding: iso-8859-1 -*- -""" - MoinMoin monobook theme. Uses the css sheet from - http://wikipedia.org, adapting the moin output to fit it. - - Adapted by Jim Clark - @license: GNU GPL, see COPYING for details. -""" - -from MoinMoin.theme import ThemeBase -from MoinMoin import wikiutil, i18n -from MoinMoin.Page import Page -from crans import ThemeCrans - -class Theme(ThemeBase): - icons = ThemeCrans.icons - - - name = "crans-www" - - # Liste des feuilles de style - stylesheets = ( - # media basename - ('all', 'common'), - ('screen', 'layout'), - ('screen', 'screen'), - ('print', 'print'), -# ('projection', 'projection'), - ) - - - # liste des liens du menu - menu_links = [ - # tire #lien - - (u"Accueil", u"http://www.crans.org/"), - (u"Webmail", u"https://webmail.crans.org/"), - (u"Accès SSH", u"http://www.crans.org/VieCrans/OpenSsh"), - (u"Accès Intranet",u"https://intranet.crans.org/"), - (u"Pages persos", u"http://www.crans.org/PagesPerso"), - ] - - # Chemin des badges - badgesPath = u'/wiki/common/badges/' - - - # liste des badges - support_badges = [ - # page, # image # alt text - (u'http://www.mozilla-europe.org/fr/products/firefox/', u'badges_80x15_firefox.png', u'Get firefox'), - (u'http://www.debian.org/', u'badges_80x15_debian.png', u'Debian powered'), - (u'http://www.apache.org/', u'badges_80x15_apache.png', u'Apache powered'), - (u'http://www.python.org/', u'badges_80x15_python.png', u'Python powered'), - (u'http://www.federez.org/', u'badges_80x15_federez.png', u'Membre du réseau federeez'), - (u'http://moinmoin.wikiwikiweb.de/', u'badges_80x15_moinmoin.png', u'Moinmoin powered'), - (u'http://jigsaw.w3.org/css-validator/check?uri=referer&profile=css3&warning=no', u'valid_css_80x15.png', u'Valid css3'), -# (u'http://validator.w3.org/check?uri=referer', u'valid_html401_80x15.png', u'Valid html 4.01'), - ] - -# Public functions ##################################################### - - def header(self, d, **kw): - """ Assemble wiki header - Here we don't add any menu bars, search bars, etc - instead wait - until the footer. This keeps the HTML cleaner and more accessible, - making sure the main content arrives first. - """ - parent = d['page'].getParentPage() - title = [ - '
', - self.title(d), - parent and wikiutil.link_tag(self.request, - parent.page_name, - u'Haut') or u'', - '
' - ] - html = [ - u'
', - self.logo(), - u'
', - self.startPage(), - ] - - - - - if d['page'].page_name != 'VieCrans' : - html += title - html += [self.msg(d)] - return u'\n'.join(html) - - def footer(self, d, **keywords): - """ Assemble wiki footer - """ - html = [ - # End of page - u'
', - self.endPage(), - u'
', - u'
', - self.menu(d), - u'
', - self.username(d), - self.badges(d), - u'', # Campagne "Save A Developer. Upgrade Your Browser." - ] - return u'\n'.join(html) - - def menu(self, d): - """ assemble all the navigation aids for the page - """ - liens = [] - for titre, lien in self.menu_links: - liens.append(u'
  • %s
  • ' % (lien, titre)) - html = [ - u'', - ] - return u''.join(html) - - - def badges(self,d ): - badges_html = [] - for page, image, alt_text in self.support_badges: - badges_html.append(u'
  • %(alt)s
  • ' % {'href':page, 'path':self.badgesPath, 'image':image, 'alt':alt_text}) - html = [ - u'
      ', - u'\n'.join(badges_html), - u'
    \n\n', - ] - - - return u''.join(html) - - - def searchform(self, d): - """ assemble HTML code for the search form - Tweaks from the bass class to wrap in a 'portlet' class, move the - description to a header tag, add an access key of 'f' and - add SearchButton class for the buttons - """ - _ = self.request.getText - form = self.request.form - updates = { - 'search_label' : _('Search:'), - 'search_value': wikiutil.escape(form.get('value', [''])[0], 1), - 'search_full_label' : _('Text', formatted=False), - 'search_title_label' : _('Titles', formatted=False), - } - d.update(updates) - - - html = u''' -
    -
    -
    - - -
    - - -
    -
    - ''' % d - return html - - - - - def columnone(self, d): - """ assemble all the navigation aids for the page - """ - page = d['page'] - html = [ - u'
    ', - self.editbar(d), - self.username(d), - u'', - self.navibar(d), - self.searchform(d), - self.actionmenu(d), - u'
    ', - u'', - u'
    ' - ] - return u'\n'.join(html) - - def headscript(self, d): - """ Override to not output search/action menu javascript. - (perhaps not a good idea) - """ - return '' - - def extendedAttrs(self, title, accesskey): - """ Helper function for assembling titled access key links - """ - return 'title="%(title)s [alt-%(accesskey)s]" accesskey=%(accesskey)s' % \ - {'accesskey' : accesskey, - 'title' : title} - - def editbar(self, d): - """ Display a list of actions for the page. This list will be turned - into a set of tabbed views on the page by the css. - """ - page = d['page'] - - if not self.shouldShowEditbar(page): - return '' - - # Use cached editbar if possible. - cacheKey = 'editbar' - cached = self._cache.get(cacheKey) - if cached: - return cached - - request = self.request - _ = self.request.getText - link = wikiutil.link_tag - quotedname = wikiutil.quoteWikinameURL(page.page_name) - # action, title, description, accesskey - tabs = [('show', 'Article', 'View the page content', 'c'), - ('edit', 'Edit', 'Edit this page', 'e'), - ('diff', 'Show Changes', 'Last page modification', 'd'), - ('info', 'Get Info', 'Page history and information', 'h'), - ('subscribe', 'Subscribe', 'Subscribe to updates to this page', 'w')] - - items = [] - current = self.request.form.get('action', ['show'])[0] - for action, title, description, accesskey in tabs: - if action == current: - cls = 'selected' - else: - cls = 'none' - - if action == 'edit': - if page.isWritable() and request.user.may.write(page.page_name): - pass - else: - action = 'raw' - title = 'View Source' - description = 'This page is protected. You can view its source' - - if action == 'subscribe': - user = self.request.user - if not self.cfg.mail_smarthost or not user.valid: - break - # Email enabled and user valid, get current page status - if user.isSubscribedTo([page.page_name]): - title = 'Unsubscribe' - description = 'Unsubscribe from updates to this page' - - - if action == 'show': - url = quotedname - else: - url = quotedname + '?action=' + action - - - attrs = self.extendedAttrs(_(description), accesskey) - link = wikiutil.link_tag(self.request, url, _(title), attrs=attrs) - items.append(u'
  • %s
  • ' % (cls, link)) - - html = [ - u'
    ', - u'
      ', - ''.join(items), - u'
    ', - u'
    ' - ] - html = ''.join(html) - # cache for next call - self._cache[cacheKey] = html - - return html - - - def actionmenu(self, d): - """ different implementation of the actionmenu (aka toolbox) - - """ - - page = d['page'] - - # Use cached actionmenu if possible. - cacheKey = 'actionmenu' - cached = self._cache.get(cacheKey) - if cached: - return cached - - request = self.request - _ = request.getText - quotedname = wikiutil.quoteWikinameURL(page.page_name) - - - menu = [ - 'raw', - 'print', - 'refresh', - 'AttachFile', - 'SpellCheck', - 'LikePages', - 'LocalSiteMap', - 'RenamePage', - 'DeletePage', - ] - - titles = { - 'raw': _('Show Raw Text', formatted=False), - 'print': _('Show Print View', formatted=False), - 'refresh': _('Delete Cache', formatted=False), - 'AttachFile': _('Attach File', formatted=False), - 'SpellCheck': _('Check Spelling', formatted=False), # rename action! - 'RenamePage': _('Rename Page', formatted=False), - 'DeletePage': _('Delete Page', formatted=False), - 'LikePages': _('Show Like Pages', formatted=False), - 'LocalSiteMap': _('Show Local Site Map', formatted=False), - } - - links = [] - - - # Format standard actions - available = request.getAvailableActions(page) - for action in menu: - # Enable delete cache only if page can use caching - if action == 'refresh': - if not page.canUseCache(): - break - # Actions which are not available for this wiki, user or page - if action[0].isupper() and not action in available: - break; - - link = wikiutil.link_tag(self.request, \ - quotedname + '?action=' + action, titles[action]) - links.append(link) - - # Add custom actions not in the standard menu - more = [item for item in available if not item in titles] - more.sort() - if more: - # Add more actions (all enabled) - for action in more: - data = {'action': action, 'disabled': ''} - title = Page(request, action).split_title(request, force=1) - # Use translated version if available - title = _(title, formatted=False) - link = wikiutil.link_tag(self.request, \ - quotedname + '?action=' + action, title) - links.append(link) - - html = [ - u'
    ', - u'
    Toolbox
    ', - u'
    ', - u'
      ', - u'
    • %s
    ' % '\n
  • '.join(links), - u'', - u'
  • ', - u'
    ', - ] - html = ''.join(html) - # cache for next call - self._cache[cacheKey] = html - return html - - - def username(self, d): - """ Assemble the username / userprefs link - Copied from the base class, modified to include hotkeys and link titles - """ - from MoinMoin.Page import Page - request = self.request - _ = request.getText - - - userlinks = [] - # Add username/homepage link for registered users. We don't care - # if it exists, the user can create it. - if request.user.valid: - homepage = Page(request, request.user.name) - title = homepage.split_title(request) - attrs = self.extendedAttrs(_('User Page'), '.') - homelink = homepage.link_to(request, text=title, attrs=attrs) - userlinks.append(homelink) - - - # Set pref page to localized Preferences page - attrs = self.extendedAttrs(_('My Preferences'), 'u') - - prefpage = wikiutil.getLocalizedPage(request, 'UserPreferences') - title = prefpage.split_title(request) - userlinks.append(prefpage.link_to(request, text=title, attrs=attrs)) - - # Add a logout link (not sure this is really necessary - attrs = self.extendedAttrs(_('log out'), 'o') - page = d['page'] - url = wikiutil.quoteWikinameURL(page.page_name) + \ - '?action=userform&logout=1' - link = wikiutil.link_tag(self.request, url, 'log out', attrs=attrs) - userlinks.append(link) - - else: - # Add prefpage links with title: Login -# prefpage = wikiutil.getSysPage(request, 'UserPreferences') -# attrs = self.extendedAttrs('Logging in is not required, but brings benefits', 'o') -# userlinks.append(prefpage.link_to(request, text=_("Login"), attrs=attrs)) - url = u'http://wiki.crans.org/%s' % d['page'].page_name - link = u'%s' % ( url, 'Version Wiki') - userlinks.append(link) - - - html = [ - u'
    ', - u'
      ', - u'
    • %s
    • ' % '\n
    • '.join(userlinks), - u'
    ', - u'
    ' - ] - return ''.join(html) - - - def shouldShowEditbar(self, page): - """ Override to include the editbar on edit/preview pages. - (at the risk that the user may accidentally cancel an edit) - """ - return False - - - def navibar(self, d): - """ Alterations from the base class to include access keys and - descriptions for FrontPage/RecentChanges - """ - request = self.request - found = {} # pages we found. prevent duplicates - links = [] # navibar items - current = d['page_name'] - - # Process config navi_bar - if request.cfg.navi_bar: - for text in request.cfg.navi_bar: - pagename, link = self.splitNavilink(text) - if pagename == d['page_front_page']: - attrs = self.extendedAttrs('Visit the main page', 'z') - elif pagename == 'RecentChanges': - attrs = self.extendedAttrs('List of recent changes in this wiki', 'r') - else: - attrs = '' - - a = wikiutil.link_tag(request, pagename, attrs=attrs) - links.append(a) - - found[pagename] = 1 - - # Add user links to wiki links, eliminating duplicates. - userlinks = request.user.getQuickLinks() - for text in userlinks: - # Split text without localization, user know what she wants - pagename, link = self.splitNavilink(text, localize=0) - if not pagename in found: - a = wikiutil.link_tag(request, pagename, attrs=attrs) - links.append(a) - - found[pagename] = 1 - - html = [ - u'', - ] - return ''.join(html) - - def pageinfo(self, page): - """ Simple override from base class. - Remove

    so footer isn't too big - """ - _ = self.request.getText - - - if self.shouldShowPageinfo(page): - info = page.lastEditInfo() - if info: - if info['editor']: - info = _("last edited %(time)s by %(editor)s") % info - else: - info = _("last modified %(time)s") % info - return info - return '' - - def rtl_stylesheet(self, d): - """ monobook uses a separate css page for rtl alterations. - Add the rtl stylesheet if the user needs it - """ - link = ('') - html = [] - if i18n.getDirection(self.request.lang) == 'rtl': - prefix = self.cfg.url_prefix - href = '%s/%s/css/%s.css' % (prefix, self.name, 'rtl') - html.append(link % (self.stylesheetsCharset, 'all', href)) - return '\n'.join(html) - - def html_head(self, d): - """ Tweak the sending of the head, to include right-to-left - - alterations if necessary - """ - html = [ - u".:: CRANS : Cachan / Réseau @ Normale Sup' ::.", - self.headscript(d), # Should move to separate .js file - self.html_stylesheets(d), - self.rtl_stylesheet(d), - self.rsslink(d), - ] - return '\n'.join(html) - - -def execute(request): - """ - Generate and return a theme object - - - @param request: the request object - @rtype: MoinTheme - @return: Theme object - """ - return Theme(request) diff --git a/wiki-lenny/local/theme/crans.py b/wiki-lenny/local/theme/crans.py deleted file mode 100644 index 5bfb595c..00000000 --- a/wiki-lenny/local/theme/crans.py +++ /dev/null @@ -1,189 +0,0 @@ -# -*- coding: iso-8859-1 -*- -""" - MoinMoin monobook theme. Uses the css sheet from - http://wikipedia.org, adapting the moin output to fit it. - - Adapted by Jim Clark - Adapted for CR@NS by Nicolas Salles - @license: GNU GPL, see COPYING for details. -""" -import datetime -from MoinMoin.theme import ThemeBase -from MoinMoin import wikiutil, i18n -from MoinMoin.Page import Page - -class ThemeCrans(ThemeBase): - - name = "crans" - - # Standard set of style sheets - stylesheets = ( - # media basename - ('all', 'common'), - ('screen', 'crans'), - ('print', 'print'), - ('projection', 'projection'), - ) - - # Standard set of scripts - scripts = ( - 'crans', - ) - - -# Public functions ##################################################### - - def header(self, d, **kw): - """ Assemble wiki header - Here we don't add any menu bars, search bars, etc - instead wait - until the footer. This keeps the HTML cleaner and more accessible, - making sure the main content arrives first. - """ - if datetime.date.today().month == 10: - extra_style = " class=\"halloween\"" - elif (datetime.date.today().month == 12) and (datetime.date.today().day <= 24): - extra_style = " class=\"noel\"" - else: - extra_style = "" - parent = d['page'].getParentPage() - html = [ - u'

    ' % extra_style, - u'
    ', - u'
    ', - '

    ', - self.title(d), - u'

    ', - u'
    ', - self.msg(d), - self.startPage(), - ] - return u'\n'.join(html) - - editorheader = header - def footer(self, d, **keywords): - """ Assemble wiki footer - """ - html = [ - # End of page - self.pageinfo(d['page']), - self.endPage(), - u'
    ', # fin du div main-content - self.rightcolumn(d), - u'
    ', # fin du div globalWrapper - u'', # Campagne "Save A Developer. Upgrade Your Browser." - ] - return u'\n'.join(html) - - def rightcolumn(self, d): - """ assemble all the navigation aids for the page - """ - _ = self.request.getText - page = d['page'] - html = [ - u'
    ', - u"
    Personnel
    ", - self.username(d), - u"
    Navigation
    ", - self.navibar(d), - # hack : c1 and V1 or v2 c'est comme le code C : c1? v1 : V2 - # (si c1 est vrai alors prends la valeur V1 sinon prend la valeur c2 - self.shouldShowEditbar(d['page']) and u"
    %s
    " % _("Page") or u" ", - self.editbar(d), - u"
    %s
    " % _('Search'), - self.searchform(d), - #self.actionmenu(d), - #self.pageinfo(page), - self.credits(d), - ] - return u'\n'.join(html) - - def html_head(self, d): - """ add opensearch description to html head - """ - # common prefix for static content - prefix = self.cfg.url_prefix - open_search_desc = '\n\n' % {'page':d['page'].request.script_name, 'sitename':d['sitename']} - if (d['page'].isWritable() and - self.request.user.may.write(d['page'].page_name)): - edit_link = "/" + wikiutil.quoteWikinameURL(d['page'].page_name) + '?action=edit&editor=text' - wiki_rel = '\n' % edit_link - else: - wiki_rel = "" - - classic_head = ThemeBase.html_head(self, d) - - return classic_head + open_search_desc + wiki_rel - - def headscript(self, d): - html = [] - # Check mode - if d.get('print_mode'): - link = "" - else: - # Create stylesheets links - link = '' - prefix = self.cfg.url_prefix - csshref = '%s/%s/js' % (prefix, self.name) - html = [] - for basename in self.scripts: - href = '%s/%s.js' % (csshref, basename) - html.append(link % href ) - - if not self.request.query_string: - html.append(''' - -''') - - return ThemeBase.headscript(self, d) + u"\n".join(html) - - - - -class Theme(ThemeCrans): - - name = "crans" - - # Standard set of style sheets - stylesheets = ( - # media basename - ('all', 'common'), - ('screen', 'layout'), - ('screen', 'crans'), - ('print', 'print'), - ('projection', 'projection'), - ) - - -def execute(request): - """ - Generate and return a theme object - - @param request: the request object - @rtype: MoinTheme - @return: Theme object - """ - return Theme(request)