ó ÿgdSc@spdZddlmZddlmZddlmZmZmZdZ d„Z d„Z d„Z d „Z d S( sø sphinx.versioning ~~~~~~~~~~~~~~~~~ Implements the low-level algorithms Sphinx uses for the versioning of doctrees. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿ(tuuid4(t itemgetter(tproductt zip_longesttalliAccs2x+|j|ƒD]}tƒj|_|VqWdS(sAdd a unique id to every node in the `doctree` which matches the condition and yield the nodes. :param doctree: A :class:`docutils.nodes.document` instance. :param condition: A callable which returns either ``True`` or ``False`` for a given node. N(ttraverseRthextuid(tdoctreet conditiontnode((s;/usr/local/lib/python2.7/site-packages/sphinx/versioning.pytadd_uidss c csK|j|ƒ}|j|ƒ}g}g}i}tƒ}xÂt||ƒD]±\} } | dkrt|j| ƒqIn| dkr“|j| ƒqInt| j| jƒ} | dkrÐ| j| _|j| ƒqI| || | f<|j| ƒ|j| ƒqIWxŽt ||ƒD]}\} } | |ks| | f|kr>qnt| j| jƒ} | dkr{| j| _|j| ƒq| || | f s  @