[Pli-devel] pli-devel/pli/tags tag.py,1.15,1.16 tree.py,1.14,1.15
Status: Pre-Alpha
Brought to you by:
alex_nanou
|
From: Alex A. N. <ale...@us...> - 2008-03-08 15:57:09
|
Update of /cvsroot/pli/pli-devel/pli/tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31469/pli/tags Modified Files: tag.py tree.py Log Message: Index: tag.py =================================================================== RCS file: /cvsroot/pli/pli-devel/pli/tags/tag.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tag.py 7 Mar 2008 11:34:38 -0000 1.15 --- tag.py 8 Mar 2008 15:57:11 -0000 1.16 *************** *** 2,6 **** __version__ = '''0.0.01''' ! __sub_version__ = '''20080307143129''' __copyright__ = '''(c) Alex A. Naanou 2007''' --- 2,6 ---- __version__ = '''0.0.01''' ! __sub_version__ = '''20080307153553''' __copyright__ = '''(c) Alex A. Naanou 2007''' *************** *** 249,252 **** --- 249,261 ---- res = self.select(self.__chain_tag__, *tags) return res + def chainrelated(self, *tags): + ''' + return all the tags that are related via chains. + ''' + chains = self.chains(*tags) + res = set() + for chain in chains: + res.update(self.chain2tags(chain)) + return res.difference(tags) *************** *** 488,491 **** --- 497,501 ---- print ts.relatedtags('aaa') print ts.chains('aaa') + print ts.chainrelated('aaa') ## print ts.relatedtags('aaa:bbb') Index: tree.py =================================================================== RCS file: /cvsroot/pli/pli-devel/pli/tags/tree.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tree.py 7 Mar 2008 02:06:04 -0000 1.14 --- tree.py 8 Mar 2008 15:57:11 -0000 1.15 *************** *** 2,6 **** __version__ = '''0.0.01''' ! __sub_version__ = '''20080307044349''' __copyright__ = '''(c) Alex A. Naanou 2003''' --- 2,6 ---- __version__ = '''0.0.01''' ! __sub_version__ = '''20080307153817''' __copyright__ = '''(c) Alex A. Naanou 2003''' *************** *** 169,172 **** --- 169,173 ---- if o != generic.TAG_TAG][0] return super(TagTreePathProxy, self).__getattr__(name) + ## __getitem__ = __getattr__ # public interface... *************** *** 178,181 **** --- 179,187 ---- ''' return self._root.relatedtags(*self._path + tags) + @public + def chains(self, *tags): + ''' + ''' + return self._root.chains(*self._path + tags) ##!!! OID !!!## # XXX add efficient counting... |