Attachment 'SortText-1.3.5-1.py'

Download

   1 #-*- coding: utf-8 -*-
   2 """ 
   3 SortText to sort one level of input
   4 ===================================
   5 
   6 This parser is used to sort text lines
   7     
   8 
   9 Install
  10 -------
  11 
  12 remove the version number 
  13 Put it in your wiki/data/plugin/parser/
  14 
  15 
  16 Example
  17 -------
  18 
  19 {{{
  20 #!SortText
  21  * B
  22  * A
  23  * D
  24  * C
  25 }}}
  26  
  27 
  28 Result::
  29 
  30  * A
  31  * B
  32  * C
  33  * D
  34     
  35 Compatibility
  36 --------------
  37 Tested with release 1.3.5, should work with any 1.3 release.
  38 
  39 
  40 Legal
  41 -----
  42 @copyright © 2005 ReimarBauer <R.Bauer@fz-juelich.de>
  43 
  44 This program is free software; you can redistribute it and/or modify
  45 it under the terms of the GNU General Public License as published by
  46 the Free Software Foundation; either version 2 of the License, or
  47 (at your option) any later version.
  48 
  49 This program is distributed in the hope that it will be useful,
  50 but WITHOUT ANY WARRANTY; without even the implied warranty of
  51 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  52 GNU General Public License for more details.
  53 
  54 You should have received a copy of the GNU General Public License
  55 along with this program; if not, write to the Free Software
  56 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  57 """
  58 
  59 
  60 
  61 Dependencies = []
  62 import string
  63 from MoinMoin.parser import wiki
  64 class Parser:
  65         
  66    def __init__(self, raw, request, **kw):
  67         self.raw = raw
  68         self.request = request
  69         self.form = request.form
  70         self._ = request.getText
  71         
  72         
  73    def format(self, formatter):
  74        
  75         Dict = {}
  76         raw = self.raw.split('\n')
  77         raw.sort()
  78         
  79         wikiizer = wiki.Parser(string.join(raw,"\n"),self.request) 
  80         wikiizer.format(formatter)
  81         
  82         

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] (2006-02-16 14:59:57, 14.6 KB) [[attachment:Calendar-20060216.py]]
  • [get | view] (2007-05-28 09:42:03, 2.7 KB) [[attachment:ExcelPastedTable.py]]
  • [get | view] (2005-04-12 19:22:18, 6.0 KB) [[attachment:Gantt-1.3.3-2.py]]
  • [get | view] (2007-03-24 02:05:26, 3.9 KB) [[attachment:Literate_parser-0.7_Moin-1.3.tgz]]
  • [get | view] (2007-03-24 02:08:08, 4.8 KB) [[attachment:Literate_parser-0.7_Moin-1.3.zip]]
  • [get | view] (2005-03-11 13:50:49, 12.3 KB) [[attachment:MySQL.py]]
  • [get | view] (2005-09-11 08:09:44, 1.6 KB) [[attachment:SortText-1.3.5-1.py]]
  • [get | view] (2005-11-21 08:40:10, 2.8 KB) [[attachment:Sorter-1.3.py]]
  • [get | view] (2005-06-02 13:02:06, 1.2 KB) [[attachment:colorer.py]]
  • [get | view] (2006-01-04 16:10:31, 0.6 KB) [[attachment:gettext.py]]
  • [get | view] (2004-10-19 13:05:05, 0.7 KB) [[attachment:html-parser-1.2.py]]
  • [get | view] (2005-02-17 10:46:56, 0.6 KB) [[attachment:html.py]]
  • [get | view] (2005-12-06 21:09:48, 1.3 KB) [[attachment:matlab.py]]
  • [get | view] (2005-01-20 07:42:34, 0.4 KB) [[attachment:nocamelcase.py]]
  • [get | view] (2005-11-28 16:55:23, 2.3 KB) [[attachment:php-1.3.4-1]]
  • [get | view] (2005-12-18 22:36:37, 15.0 KB) [[attachment:sctable-1.3.5-4.py]]
  • [get | view] (2004-12-31 04:41:23, 1.6 KB) [[attachment:textil.py]]
 All files | Selected Files: delete move to page copy to page

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