# HG changeset patch # User Paul Boddie # Date 1334704851 -7200 # Node ID 914e514a8adfcb8500a6d45bcb9b31a99ccc55ab # Parent 8336b85bc4f546375c3677d4cd8bb36837f11c92 Moved section argument processing functions to MoinSupport. Updated release notes and the version number. diff -r 8336b85bc4f5 -r 914e514a8adf ImprovedTableParser.py --- a/ImprovedTableParser.py Mon Apr 02 20:08:41 2012 +0200 +++ b/ImprovedTableParser.py Wed Apr 18 01:20:51 2012 +0200 @@ -8,11 +8,12 @@ """ from MoinMoin import wikiutil -from shlex import shlex from StringIO import StringIO from MoinSupport import * import re +__version__ = "0.2" + # Regular expressions. syntax = { @@ -268,65 +269,6 @@ table_attrs[name] = value del attrs[name] -def parseAttributes(s, escape=True): - - """ - Parse the table attributes string 's', returning a mapping of names to - values. If 'escape' is set to a true value, the attributes will be suitable - for use with the formatter API. If 'escape' is set to a false value, the - attributes will have any quoting removed. - """ - - attrs = {} - f = StringIO(s) - name = None - need_value = False - - for token in shlex(f): - - # Capture the name if needed. - - if name is None: - name = escape and wikiutil.escape(token) or strip_token(token) - - # Detect either an equals sign or another name. - - elif not need_value: - if token == "=": - need_value = True - else: - attrs[name.lower()] = escape and "true" or True - name = wikiutil.escape(token) - - # Otherwise, capture a value. - - else: - # Quoting of attributes done similarly to wikiutil.parseAttributes. - - if token: - if escape: - if token[0] in ("'", '"'): - token = wikiutil.escape(token) - else: - token = '"%s"' % wikiutil.escape(token, 1) - else: - token = strip_token(token) - - attrs[name.lower()] = token - name = None - need_value = False - - return attrs - -def strip_token(token): - - "Return the given 'token' stripped of quoting." - - if token[0] in ("'", '"') and token[-1] == token[0]: - return token[1:-1] - else: - return token - # Formatting of embedded content. # NOTE: Borrowed from EventAggregator. diff -r 8336b85bc4f5 -r 914e514a8adf PKG-INFO --- a/PKG-INFO Mon Apr 02 20:08:41 2012 +0200 +++ b/PKG-INFO Wed Apr 18 01:20:51 2012 +0200 @@ -1,12 +1,12 @@ Metadata-Version: 1.1 Name: ImprovedTableParser -Version: 0.1 +Version: 0.2 Author: Paul Boddie Author-email: paul at boddie org uk Maintainer: Paul Boddie Maintainer-email: paul at boddie org uk Home-page: http://moinmo.in/ParserMarket/ImprovedTableParser -Download-url: http://moinmo.in/ParserMarket/ImprovedTableParser?action=AttachFile&do=view&target=ImprovedTableParser-0.1.tar.bz2 +Download-url: http://moinmo.in/ParserMarket/ImprovedTableParser?action=AttachFile&do=view&target=ImprovedTableParser-0.2.tar.bz2 Summary: Support an alternative table syntax for MoinMoin, together with improved presentation functionality License: GPL (version 2 or later) Description: The ImprovedTableParser extension for MoinMoin provides an alternative way of diff -r 8336b85bc4f5 -r 914e514a8adf README.txt --- a/README.txt Mon Apr 02 20:08:41 2012 +0200 +++ b/README.txt Wed Apr 18 01:20:51 2012 +0200 @@ -103,9 +103,16 @@ Packages Release Information -------- ------------------- -MoinSupport Tested with 0.1 +MoinSupport Tested with 0.2 Source: http://hgweb.boddie.org.uk/MoinSupport +New in ImprovedTableParser 0.2 (Changes since ImprovedTableParser 0.1) +---------------------------------------------------------------------- + + * Moved the section argument processing functions into the MoinSupport + distribution. + * Added the missing __version__ attribute to the common library module. + Release Procedures ------------------ diff -r 8336b85bc4f5 -r 914e514a8adf setup.py --- a/setup.py Mon Apr 02 20:08:41 2012 +0200 +++ b/setup.py Wed Apr 18 01:20:51 2012 +0200 @@ -8,6 +8,6 @@ author = "Paul Boddie", author_email = "paul@boddie.org.uk", url = "http://moinmo.in/ParserMarket/ImprovedTableParser", - version = "0.1", + version = "0.2", py_modules = ["ImprovedTableParser"] )