Attachment 'languages_packs_content-2-of-2.patch'

Download

   1 Author: Frank Lin Piatroot <fpiat@klabs.be>
   2 Date:   Sat Feb 20 18:57:34 2010 +0100
   3 
   4     Print the lists of package and pages side-by-side
   5 
   6 diff --git a/language_setup.py b/language_setup.py
   7 index 2ab9452..a6a8b22 100644
   8 --- a/language_setup.py
   9 +++ b/language_setup.py
  10 @@ -18,6 +18,7 @@ i18n.strings = strings
  11  from MoinMoin.action import AttachFile
  12  from MoinMoin.util.dataset import TupleDataset, Column
  13  from MoinMoin.widget.browser import DataBrowserWidget
  14 +from MoinMoin.widget import html
  15  from MoinMoin import wikiutil
  16  
  17  def execute(pagename, request):
  18 @@ -43,6 +44,7 @@ def execute(pagename, request):
  19      target = request.values.get('target') or ''
  20      mode = request.values.get('mode') or 'show'
  21      msg = ''
  22 +    pkg_content = ''
  23      # if target is given it tries to install the package.
  24      if target:
  25          dummy_pagename, dummy_target, targetpath = AttachFile._access_file(language_setup_page, request)
  26 @@ -54,7 +56,7 @@ def execute(pagename, request):
  27                  else:
  28                      msg = _("Installation of '%(filename)s' failed.") % {'filename': target}
  29              else:
  30 -                    msg = "<pre><b>%s</b>\n%s</pre>" % (_("Package script:"), wikiutil.escape(package.getScript()))
  31 +                    pkg_content = "<b>%s</b>(%s)<br><pre>%s</pre>" % (_("Package script:"), target, wikiutil.escape(package.getScript()))
  32  
  33          else:
  34              msg = _('The file %s is not a MoinMoin package file.') % target
  35 @@ -96,12 +98,22 @@ def execute(pagename, request):
  36  
  37      lang_selector = u''.join([fmt.paragraph(1), _("Choose:"), ' ', ' '.join(lang_links), fmt.paragraph(0)])
  38  
  39 +    tbl = html.TABLE(border="0")
  40 +    tr = html.TR()
  41 +    tbl.append(tr)
  42 +    td = html.TD(valign="top")
  43 +    tr.append(td)
  44 +    td.append(page_table)
  45 +    td = html.TD(valign="top")
  46 +    tr.append(td)
  47 +    td.append(pkg_content)
  48 +
  49      title = _("Install language packs for '%s'") % (lang)
  50      request.theme.add_msg(msg, "info")
  51      request.theme.send_title(title, page=request.page, pagename=pagename)
  52      request.write(request.formatter.startContent("content"))
  53      request.write(lang_selector)
  54 -    request.write(page_table)
  55 +    request.write(unicode(tbl))
  56      request.write(request.formatter.endContent())
  57      request.theme.send_footer(pagename)
  58      request.theme.send_closing_html()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-02-20 18:30:58, 69.2 KB) [[attachment:ListPages.png]]
  • [get | view] (2010-02-20 20:22:39, 3.2 KB) [[attachment:languages_packs_content-1-of-2.patch]]
  • [get | view] (2010-02-20 20:22:35, 2.3 KB) [[attachment:languages_packs_content-2-of-2.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.