~ubuntu-branches/ubuntu/edgy/trac/edgy

« back to all changes in this revision

Viewing changes to trac/wikimacros/rst.py

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-07-24 12:21:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050724122152-3xf8v1oqf2jcqk5n
Tags: 0.8.4-1ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#
28
28
# Inserts `reference` nodes for TracLinks into the document tree.
29
29
 
 
30
from __future__ import nested_scopes
 
31
from distutils.version import StrictVersion
30
32
import re
31
33
 
32
34
docutils_required = '0.3.3'
39
41
except ImportError:
40
42
    raise EnvironmentError, 'Docutils >= %s not found' % docutils_required
41
43
 
42
 
if __version__ < docutils_required:
 
44
if StrictVersion(__version__) < StrictVersion(docutils_required):
43
45
    raise EnvironmentError, 'Docutils version >= %s required, %s found' % (docutils_required, __version__)
44
46
 
45
47
from trac.Href import Href
83
85
        m = pattern.match(text)
84
86
        if m:
85
87
            g = filter(None, m.groups())
86
 
            missing = False
 
88
            missing = 0
87
89
            if pattern == WIKI_LINK:
88
90
                if not (env._wiki_pages.has_key(g[0])):
89
 
                        missing = True
 
91
                        missing = 1
90
92
                        text = text + "?"
91
93
            uri = function(env.href, g)
92
94
            reference = nodes.reference(rawtext, text)
122
124
    text = arguments[int(len(arguments) == 2)]
123
125
    reference = trac_get_reference(env, block_text, text)
124
126
    if reference:
125
 
        return reference
 
127
        p = nodes.paragraph()
 
128
        p += reference
 
129
        return p
126
130
    # didn't find a match (invalid TracLink),
127
131
    # report a warning
128
132
    warning = state_machine.reporter.warning(