;ò
î¸ýCc           @   s…   d  Z  d d d !Z d k l Z d k l Z d k l Z y d k l	 Z	 Wn n Xd e f d	 „  ƒ  YZ
 d
 e f d „  ƒ  YZ d S(   s@   
   Copyright (C) 2003 PimenTech SARL (http://www.pimentech.net)

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.	
s   $Revision: 1.32 $i   iþÿÿÿ(   s   Object(   s   Map(   s   Set(   s   HTMLFiles   Vertexc           B   s…   t  Z d  Z d Z d Z y e d e ƒ  ƒ Z Wn n Xd d „ Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   s   the vertex classs   Vertexi    s   dtml/vertexIndexs    c         C   s&   t  i |  t | ƒ | ƒ | |  _ d  S(   N(   s   Maps   __init__s   selfs   strs   objects   title(   s   selfs   objects   title(    (    s   graph.pys   __init__+   s    c         C   s±   |  i d |  i |  i ƒ  | | f ƒ |  i | ƒ o |  | } |  i d | ƒ nL t t	 | ƒ ƒ } |  i d |  i |  i ƒ  | | f ƒ t
 i |  | | ƒ | i | ƒ d  S(   Ns(   %s (Vertex)%s.__setitem__(%s, Vertex %s)s   set = self[%s]s%   %s (Vertex)%s.__setitem__(%s, Set %s)(   s   selfs   messages	   meta_types   getIds   labels   vertexs   has_keys   sets   Sets   strs   Maps   __setitem__s   insert(   s   selfs   labels   vertexs   set(    (    s   graph.pys   __setitem__/   s    &
&c         C   s!   t  i |  | ƒ p
 t d ƒ Sd  S(   Ns    (   s   Maps   __getitem__s   selfs   labels   Set(   s   selfs   label(    (    s   graph.pys   __getitem__:   s    c         C   sö   d |  i |  i ƒ  |  i f } d | } d | |  i f } d | } xƒ |  i ƒ  D]u \ } } d | } d | | f } d | } x- | i	 ƒ  D] } d | t i | ƒ f } q’ Wd | } d	 | } qT Wd
 | } d	 | } d | |  i f Sd  S(   Ns   <%s id='%s' title='%s'>
s	   %s<pair>
s   %s<value>%s</value>
s
   %s<edges>
s   %s<label>%s</label>
s   %s<vertices>
s   %s%s
s   %s</vertices>
s
   %s</pair>
s   %s</edges>
s   %s</%s>(   s   selfs	   meta_types   getIds   titles   xmlstrs   objects   itemss   labels   verticess   valuess   vertexs   Objects   __repr__(   s   selfs   vertexs   verticess   labels   xmlstr(    (    s   graph.pys   __repr__=   s"    

 

 


c         C   s;   d } x* |  i ƒ  D] } | t | i ƒ  ƒ } q W| Sd S(   s   return the degre of a vertexi    N(   s   degres   selfs   valuess   verticess   len(   s   selfs   degres   vertices(    (    s   graph.pys   degreN   s      c         C   s*   |  i d |  i |  i ƒ  | | f ƒ d S(   s#   avoid infinite recursion when addeds$   %s (Vertex)%s.manage_afterAdd(%s,%s)N(   s   selfs   messages	   meta_types   getIds   items	   container(   s   selfs   items	   container(    (    s   graph.pys   manage_afterAddU   s     &c         C   s*   |  i d |  i |  i ƒ  | | f ƒ d S(   s%   avoid infinite recursion when deleteds(   %s (Vertex)%s.manage_beforeDelete(%s,%s)N(   s   selfs   messages	   meta_types   getIds   items	   container(   s   selfs   items	   container(    (    s   graph.pys   manage_beforeDeleteZ   s     &c         C   s$   |  i d |  i |  i ƒ  f ƒ d S(   s#   avoid infinite recursion when addess-   %s (Vertex)%s.manage_fixupOwnershipAfterAdd()N(   s   selfs   messages	   meta_types   getId(   s   self(    (    s   graph.pys   manage_fixupOwnershipAfterAdd_   s      (   s   __name__s
   __module__s   __doc__s	   meta_types   tags   HTMLFiles   globalss
   index_htmls   __init__s   __setitem__s   __getitem__s   __repr__s   degres   manage_afterAdds   manage_beforeDeletes   manage_fixupOwnershipAfterAdd(    (    (    s   graph.pys   Vertex    s    						s   Graphc           B   sG   t  Z d  Z d Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s'   the graph class, here a set of verticess   Graphi   c         C   s   t  i |  t | ƒ ƒ Sd S(   s   return a vertexN(   s   Sets   inserts   selfs   Vertexs   object(   s   selfs   object(    (    s   graph.pys   insertk   s     c         C   sn   |  i d |  i |  i ƒ  | | | f ƒ |  i | ƒ } |  i | ƒ } | | | <|  i
 o | | | <n d  S(   Ns"   %s (Graph)%s.insert_edge(%s,%s,%s)(   s   selfs   messages	   meta_types   getIds   object1s   labels   object2s   inserts   vertex1s   vertex2s   directed(   s   selfs   object1s   labels   object2s   vertex1s   vertex2(    (    s   graph.pys   insert_edgeo   s    )
c         C   s$   x |  i ƒ  D] } d | _ q Wd  S(   Ni    (   s   selfs   valuess   vs   tag(   s   selfs   v(    (    s   graph.pys
   clear_tagsw   s     c   	      C   sÎ   |  | } |  | } | o | o¤ d | _ x˜ | i ƒ  D]† \ } } xw | i	 ƒ  D]i } | i o qQ n | | j o | | | f g SqQ |  i | | ƒ } | o | | | f g | SqQ qQ Wq8 Wn g  Sd  S(   Ni   (   s   selfs   object1s   v1s   object2s   v2s   tags   itemss   labels   verticess   valuess   vs   _get_dfs_paths   subpath(	   s   selfs   object1s   object2s   v1s   verticess   subpaths   labels   v2s   v(    (    s   graph.pys   _get_dfs_path{   s     

	  
$c         C   s   |  i ƒ  |  i | | ƒ Sd  S(   N(   s   selfs
   clear_tagss   _get_dfs_paths   object1s   object2(   s   selfs   object1s   object2(    (    s   graph.pys   get_dfs_pathŒ   s    
(
   s   __name__s
   __module__s   __doc__s	   meta_types   directeds   inserts   insert_edges
   clear_tagss   _get_dfs_paths   get_dfs_path(    (    (    s   graph.pys   Graphe   s    				N(   s   __doc__s   __version__s"   Products.PimenTechLibCommon.objects   Objects   Products.PimenTechLibCommon.maps   Maps   Products.PimenTechLibCommon.sets   Sets   Globalss   HTMLFiles   Vertexs   Graph(   s   Maps   Sets   HTMLFiles   Objects   Vertexs   Graphs   __version__(    (    s   graph.pys   ?   s   E
