Ticket #9436: 9436.3.diff

File 9436.3.diff, 3.9 KB (added by Marc Fargas, 15 years ago)

Good day to update patches ;)

  • docs/_ext/djangodocs.py

    diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py
    index bda7d3e..65a823e 100644
    a b import sphinx.builder  
    1010import sphinx.directives
    1111import sphinx.environment
    1212import sphinx.htmlwriter
     13import sphinx.roles
     14from docutils import nodes
    1315
    1416def setup(app):
    1517    app.add_crossref_type(
    def setup(app):  
    4446        indextemplate = "pair: %s; django-admin command-line option",
    4547        parse_node    = lambda env, sig, signode: sphinx.directives.parse_option_desc(signode, sig),
    4648    )
     49    app.add_config_value('django_next_version', '0.0', True)
     50    app.add_directive('versionadded', parse_version_directive, 1, (1, 1, 1))
     51    app.add_directive('versionchanged', parse_version_directive, 1, (1, 1, 1))
    4752    app.add_transform(SuppressBlockquotes)
    4853   
    4954    # Monkeypatch PickleHTMLBuilder so that it doesn't die in Sphinx 0.4.2
    5055    if sphinx.__version__ == '0.4.2':
    5156        monkeypatch_pickle_builder()
     57
     58def parse_version_directive(name, arguments, options, content, lineno,
     59                      content_offset, block_text, state, state_machine):
     60    env = state.document.settings.env
     61    is_nextversion = env.config.django_next_version == arguments[0]
     62    ret = []
     63    node = sphinx.addnodes.versionmodified()
     64    ret.append(node)
     65    if not is_nextversion:
     66        if len(arguments) == 1:
     67            linktext = 'Please, see the release notes <releases-%s>' % (arguments[0])
     68            xrefs = sphinx.roles.xfileref_role('ref', linktext, linktext, lineno, state)
     69            node.extend(xrefs[0])
     70        node['version'] = arguments[0]
     71    else:
     72        node['version'] = "Development version"
     73    node['type'] = name
     74    if len(arguments) == 2:
     75        inodes, messages = state.inline_text(arguments[1], lineno+1)
     76        node.extend(inodes)
     77        if content:
     78            state.nested_parse(content, content_offset, node)
     79        ret = ret + messages
     80    env.note_versionchange(node['type'], node['version'], node, lineno)
     81    return ret
     82
    5283               
    5384class SuppressBlockquotes(docutils.transforms.Transform):
    5485    """
  • docs/conf.py

    diff --git a/docs/conf.py b/docs/conf.py
    index 0d41b05..f7ff452 100644
    a b copyright = 'Django Software Foundation and contributors'  
    4444version = '1.0'
    4545# The full version, including alpha/beta/rc tags.
    4646release = version
     47# The next version to be released
     48django_next_version = '1.1'
    4749
    4850# There are two options for replacing |today|: either, you set today to some
    4951# non-false value, then it is used:
  • docs/topics/testing.txt

    diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
    index bd68f6b..3588519 100644
    a b arguments at time of construction:  
    570570
    571571    .. method:: Client.head(path, data={})
    572572
    573         .. versionadded:: development
     573        .. versionadded:: 1.1
    574574
    575575        Makes a HEAD request on the provided ``path`` and returns a ``Response``
    576576        object. Useful for testing RESTful interfaces. Acts just like
    arguments at time of construction:  
    578578
    579579    .. method:: Client.options(path, data={})
    580580
    581         .. versionadded:: development
     581        .. versionadded:: 1.1
    582582
    583583        Makes an OPTIONS request on the provided ``path`` and returns a
    584584        ``Response`` object. Useful for testing RESTful interfaces.
    585585
    586586    .. method:: Client.put(path, data={}, content_type=MULTIPART_CONTENT)
    587587
    588         .. versionadded:: development
     588        .. versionadded:: 1.1
    589589
    590590        Makes an PUT request on the provided ``path`` and returns a
    591591        ``Response`` object. Useful for testing RESTful interfaces. Acts just
    arguments at time of construction:  
    593593
    594594    .. method:: Client.delete(path)
    595595
    596         .. versionadded:: development
     596        .. versionadded:: 1.1
    597597
    598598        Makes an DELETE request on the provided ``path`` and returns a
    599599        ``Response`` object. Useful for testing RESTful interfaces.
Back to Top