[Python-modules-commits] [pydot] 02/13: drop patches

Sandro Tosi morph at moszumanska.debian.org
Sun Jan 10 02:07:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository pydot.

commit 3d52c862857af6aa62db994300f71002b15fc93b
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Jan 10 00:25:06 2016 +0000

    drop patches
---
 ...double-quoted-strings-with-escaped-quotes.patch |   26 -
 debian/patches/series                              |    3 -
 debian/patches/support-py3k.patch                  | 2316 --------------------
 debian/patches/support-pyparsing-v2.patch          |   28 -
 4 files changed, 2373 deletions(-)

diff --git a/debian/patches/handle-double-quoted-strings-with-escaped-quotes.patch b/debian/patches/handle-double-quoted-strings-with-escaped-quotes.patch
deleted file mode 100644
index 86204f9..0000000
--- a/debian/patches/handle-double-quoted-strings-with-escaped-quotes.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9082aad68503a6589f24cda3f9bfa9bd9834a476 Mon Sep 17 00:00:00 2001
-From: Christopher Durden <cdurden at gmail.com>
-Date: Thu, 8 Oct 2015 10:27:08 -0700
-Subject: Properly handle double quoted strings with escaped quotes
-
-Origin: upstream
-Bug: https://code.google.com/p/pydot/issues/detail?id=82
-Last-Update: 2014-03-21
-Patch-Name: handle-double-quoted-strings-with-escaped-quotes.patch
----
- dot_parser.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dot_parser.py b/dot_parser.py
-index 138d152..3a2062a 100644
---- a/dot_parser.py
-+++ b/dot_parser.py
-@@ -413,7 +413,7 @@ def graph_definition():
-         
-         identifier = Word(alphanums + "_." ).setName("identifier")
-         
--        double_quoted_string = QuotedString('"', multiline=True, unquoteResults=False) # dblQuotedString
-+        double_quoted_string = QuotedString('"', multiline=True, escChar='\\', unquoteResults=False) # dblQuotedString
- 
-         alphastring_ = OneOrMore(CharsNotIn(_noncomma + ' '))
- 
diff --git a/debian/patches/series b/debian/patches/series
index ae68d9e..e70e35f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1 @@
 01-setup-py-nodata.patch
-support-pyparsing-v2.patch
-support-py3k.patch
-handle-double-quoted-strings-with-escaped-quotes.patch
diff --git a/debian/patches/support-py3k.patch b/debian/patches/support-py3k.patch
deleted file mode 100644
index b0e5082..0000000
--- a/debian/patches/support-py3k.patch
+++ /dev/null
@@ -1,2316 +0,0 @@
-From cd9cf14fed9f1d6a2b14965f6df7bd3b0fae355c Mon Sep 17 00:00:00 2001
-From: David Villa Alises <david.villa at gmail.com>
-Date: Thu, 8 Oct 2015 10:27:07 -0700
-Subject: Support Python 3
-
-Origin: https://github.com/davidvilla/pydot/commit/68100b7004bb2fcb2dfde88202a34f69326ffa9e
-Bug: https://code.google.com/p/pydot/issues/detail?id=76
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739858
-Reviewed-by: Sandro Tosi <morph at debian.org>
-Last-Update: 2014-03-12
-Patch-Name: support-py3k.patch
----
- pydot.py | 947 +++++++++++++++++++++++++++++++--------------------------------
- setup.py |  37 ++-
- 2 files changed, 499 insertions(+), 485 deletions(-)
-
-diff --git a/pydot.py b/pydot.py
-index e9bd2a1..4c79076 100644
---- a/pydot.py
-+++ b/pydot.py
-@@ -1,4 +1,4 @@
--# -*- coding: Latin-1 -*-
-+# -*- coding: utf-8 -*-
- """Graphviz's dot language Python interface.
- 
- This module provides with a full interface to create handle modify
-@@ -19,7 +19,7 @@ Distributed under MIT license [http://opensource.org/licenses/mit-license.html].
- 
- __revision__ = "$LastChangedRevision: 28 $"
- __author__ = 'Ero Carrera'
--__version__ = '1.0.%d' % int( __revision__[21:-2] )
-+__version__ = '1.0.%d' % 29  # int( __revision__[21:-2] )
- __license__ = 'MIT'
- 
- import os
-@@ -31,7 +31,7 @@ try:
-     import dot_parser
- except Exception, e:
-     print "Couldn't import dot_parser, loading of dot files will not be possible."
--    
-+
- 
- 
- GRAPH_ATTRIBUTES = set( ['Damping', 'K', 'URL', 'aspect', 'bb', 'bgcolor',
-@@ -46,9 +46,9 @@ GRAPH_ATTRIBUTES = set( ['Damping', 'K', 'URL', 'aspect', 'bb', 'bgcolor',
-     'overlap_scaling', 'pack', 'packmode', 'pad', 'page', 'pagedir',
-     'quadtree', 'quantum', 'rankdir', 'ranksep', 'ratio', 'remincross',
-     'repulsiveforce', 'resolution', 'root', 'rotate', 'searchsize', 'sep',
--    'showboxes', 'size', 'smoothing', 'sortv', 'splines', 'start', 
-+    'showboxes', 'size', 'smoothing', 'sortv', 'splines', 'start',
-     'stylesheet', 'target', 'truecolor', 'viewport', 'voro_margin',
--    # for subgraphs 
-+    # for subgraphs
-     'rank' ] )
- 
- 
-@@ -81,7 +81,7 @@ CLUSTER_ATTRIBUTES = set( ['K', 'URL', 'bgcolor', 'color', 'colorscheme',
-     'fillcolor', 'fontcolor', 'fontname', 'fontsize', 'label', 'labeljust',
-     'labelloc', 'lheight', 'lp', 'lwidth', 'nojustify', 'pencolor',
-     'penwidth', 'peripheries', 'sortv', 'style', 'target', 'tooltip'] )
--            
-+
- 
- #
- # Extented version of ASPN's Python Cookbook Recipe:
-@@ -151,14 +151,14 @@ id_re_html = re.compile('^<.*>$', re.S|re.UNICODE)
- 
- def needs_quotes( s ):
-     """Checks whether a string is a dot language ID.
--    
-+
-     It will check whether the string is solely composed
-     by the characters allowed in an ID or not.
-     If the string is one of the reserved keywords it will
-     need quotes too but the user will need to add them
-     manually.
-     """
--    
-+
-     # If the name is a reserved keyword it will need quotes but pydot
-     # can't tell when it's being used as a keyword or when it's simply
-     # a name. Hence the user needs to supply the quotes when an element
-@@ -171,7 +171,7 @@ def needs_quotes( s ):
-     chars = [ord(c) for c in s if ord(c)>0x7f or ord(c)==0]
-     if chars and not id_re_dbl_quoted.match(s) and not id_re_html.match(s):
-         return True
--        
-+
-     for test_re in [id_re_alpha_nums, id_re_num, id_re_dbl_quoted, id_re_html, id_re_alpha_nums_with_ports]:
-         if test_re.match(s):
-             return False
-@@ -195,7 +195,7 @@ def quote_if_necessary(s):
- 
-     if not s:
-         return s
--        
-+
-     if needs_quotes(s):
-         replace = {'"'  : r'\"',
-                    "\n" : r'\n',
-@@ -204,62 +204,62 @@ def quote_if_necessary(s):
-             s = s.replace(a, b)
- 
-         return '"' + s + '"'
--     
--    return s   
-+
-+    return s
- 
- 
- 
- def graph_from_dot_data(data):
-     """Load graph as defined by data in DOT format.
--    
-+
-     The data is assumed to be in DOT format. It will
--    be parsed and a Dot class will be returned, 
-+    be parsed and a Dot class will be returned,
-     representing the graph.
-     """
--    
-+
-     return dot_parser.parse_dot_data(data)
- 
- 
- def graph_from_dot_file(path):
-     """Load graph as defined by a DOT file.
--    
-+
-     The file is assumed to be in DOT format. It will
--    be loaded, parsed and a Dot class will be returned, 
-+    be loaded, parsed and a Dot class will be returned,
-     representing the graph.
-     """
--    
--    fd = file(path, 'rb')
-+
-+    fd = open(path, 'rb')
-     data = fd.read()
-     fd.close()
--    
-+
-     return graph_from_dot_data(data)
- 
- 
- 
- def graph_from_edges(edge_list, node_prefix='', directed=False):
-     """Creates a basic graph out of an edge list.
--    
-+
-     The edge list has to be a list of tuples representing
-     the nodes connected by the edge.
-     The values can be anything: bool, int, float, str.
--    
-+
-     If the graph is undirected by default, it is only
-     calculated from one of the symmetric halves of the matrix.
-     """
--    
-+
-     if directed:
-         graph = Dot(graph_type='digraph')
--        
-+
-     else:
-         graph = Dot(graph_type='graph')
--        
-+
-     for edge in edge_list:
--        
-+
-         if isinstance(edge[0], str):
-             src = node_prefix + edge[0]
-         else:
-             src = node_prefix + str(edge[0])
--            
-+
-         if isinstance(edge[1], str):
-             dst = node_prefix + edge[1]
-         else:
-@@ -267,26 +267,26 @@ def graph_from_edges(edge_list, node_prefix='', directed=False):
- 
-         e = Edge( src, dst )
-         graph.add_edge(e)
--        
-+
-     return graph
- 
- 
- def graph_from_adjacency_matrix(matrix, node_prefix= u'', directed=False):
-     """Creates a basic graph out of an adjacency matrix.
--    
-+
-     The matrix has to be a list of rows of values
-     representing an adjacency matrix.
-     The values can be anything: bool, int, float, as long
-     as they can evaluate to True or False.
-     """
--    
-+
-     node_orig = 1
--    
-+
-     if directed:
-         graph = Dot(graph_type='digraph')
-     else:
-         graph = Dot(graph_type='graph')
--        
-+
-     for row in matrix:
-         if not directed:
-             skip = matrix.index(row)
-@@ -295,48 +295,48 @@ def graph_from_adjacency_matrix(matrix, node_prefix= u'', directed=False):
-             skip = 0
-             r = row
-         node_dest = skip+1
--        
-+
-         for e in r:
-             if e:
-                 graph.add_edge(
--                    Edge( node_prefix + node_orig, 
-+                    Edge( node_prefix + node_orig,
-                         node_prefix + node_dest) )
-             node_dest += 1
-         node_orig += 1
--        
-+
-     return graph
- 
- 
- 
- def graph_from_incidence_matrix(matrix, node_prefix='', directed=False):
-     """Creates a basic graph out of an incidence matrix.
--    
-+
-     The matrix has to be a list of rows of values
-     representing an incidence matrix.
-     The values can be anything: bool, int, float, as long
-     as they can evaluate to True or False.
-     """
--    
-+
-     node_orig = 1
--    
-+
-     if directed:
-         graph = Dot(graph_type='digraph')
-     else:
-         graph = Dot(graph_type='graph')
--        
-+
-     for row in matrix:
-         nodes = []
-         c = 1
--        
-+
-         for node in row:
-             if node:
-                 nodes.append(c*node)
-             c += 1
-             nodes.sort()
--            
-+
-         if len(nodes) == 2:
--            graph.add_edge(	
--                Edge( node_prefix + abs(nodes[0]),	
-+            graph.add_edge(
-+                Edge( node_prefix + abs(nodes[0]),
-                     node_prefix + nodes[1] ))
- 
-     if not directed:
-@@ -344,60 +344,60 @@ def graph_from_incidence_matrix(matrix, node_prefix='', directed=False):
- 
-     return graph
- 
--            
-+
- 
- 
- def __find_executables(path):
-     """Used by find_graphviz
--    
-+
-     path - single directory as a string
--    
-+
-     If any of the executables are found, it will return a dictionary
-     containing the program names as keys and their paths as values.
--    
-+
-     Otherwise returns None
-     """
--    
-+
-     success = False
-     progs = {'dot': '', 'twopi': '', 'neato': '', 'circo': '', 'fdp': '', 'sfdp': ''}
--    
-+
-     was_quoted = False
-     path = path.strip()
-     if path.startswith('"') and path.endswith('"'):
-         path = path[1:-1]
-         was_quoted =  True
--    
--    if os.path.isdir(path) : 
--    
-+
-+    if os.path.isdir(path) :
-+
-         for prg in progs.iterkeys():
--    
-+
-             if progs[prg]:
-                 continue
--               
-+
-             if os.path.exists( os.path.join(path, prg) ):
--                
-+
-                 if was_quoted:
-                     progs[prg] = '"' + os.path.join(path, prg) + '"'
-                 else:
-                     progs[prg] = os.path.join(path, prg)
--                    
-+
-                 success = True
--               
-+
-             elif os.path.exists( os.path.join(path, prg + '.exe') ):
- 
-                 if was_quoted:
-                     progs[prg] = '"' + os.path.join(path, prg + '.exe') + '"'
-                 else:
-                     progs[prg] = os.path.join(path, prg + '.exe')
--                    
-+
-                 success = True
--    
-+
-     if success:
--    
-+
-         return progs
--        
-+
-     else:
--    
-+
-         return None
- 
- 
-@@ -407,37 +407,37 @@ def __find_executables(path):
- #
- def find_graphviz():
-     """Locate Graphviz's executables in the system.
--    
-+
-     Tries three methods:
--    
-+
-     First: Windows Registry (Windows only)
-     This requires Mark Hammond's pywin32 is installed.
--    
-+
-     Secondly: Search the path
-     It will look for 'dot', 'twopi' and 'neato' in all the directories
-     specified in the PATH environment variable.
--    
-+
-     Thirdly: Default install location (Windows only)
-     It will look for 'dot', 'twopi' and 'neato' in the default install
-     location under the "Program Files" directory.
--    
-+
-     It will return a dictionary containing the program names as keys
-     and their paths as values.
--    
-+
-     If this fails, it returns None.
-     """
--    
-+
-     # Method 1 (Windows only)
-     #
-     if os.sys.platform == 'win32':
--        
-+
-         HKEY_LOCAL_MACHINE =    0x80000002
-         KEY_QUERY_VALUE =       0x0001
- 
-         RegOpenKeyEx = None
-         RegQueryValueEx = None
-         RegCloseKey = None
--        
-+
-         try:
-             import win32api, win32con
-             RegOpenKeyEx = win32api.RegOpenKeyEx
-@@ -451,31 +451,31 @@ def find_graphviz():
- 
-         try:
-             import ctypes
--            
-+
-             def RegOpenKeyEx(key, subkey, opt, sam):
-                 result = ctypes.c_uint(0)
-                 ctypes.windll.advapi32.RegOpenKeyExA(key, subkey, opt, sam, ctypes.byref(result))
-                 return result.value
--                
-+
-             def RegQueryValueEx( hkey, valuename ):
-                 data_type = ctypes.c_uint(0)
-                 data_len = ctypes.c_uint(1024)
-                 data = ctypes.create_string_buffer( 1024 )
--                
--                res = ctypes.windll.advapi32.RegQueryValueExA(hkey, valuename, 0, 
-+
-+                res = ctypes.windll.advapi32.RegQueryValueExA(hkey, valuename, 0,
-                     ctypes.byref(data_type), data, ctypes.byref(data_len))
--                    
-+
-                 return data.value
--            
-+
-             RegCloseKey = ctypes.windll.advapi32.RegCloseKey
--            
-+
-         except ImportError:
-             # Print a messaged suggesting they install these?
-             #
-             pass
- 
-         if RegOpenKeyEx is not None:
--            
-+
-             # Get the GraphViz install path from the registry
-             #
-             hkey = None
-@@ -484,20 +484,20 @@ def find_graphviz():
-                 "SOFTWARE\\AT&T Research Labs\\Graphviz",
-             ]
-             for potentialKey in potentialKeys:
--                
-+
-                 try:
-                     hkey = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-                         potentialKey, 0, KEY_QUERY_VALUE )
--                    
-+
-                     if hkey is not None:
-                         path = RegQueryValueEx( hkey, "InstallPath" )
-                         RegCloseKey( hkey )
--                        
-+
-                         # The regitry variable might exist, left by old installations
-                         # but with no value, in those cases we keep searching...
-                         if not path:
-                             continue
--                        
-+
-                         # Now append the "bin" subdirectory:
-                         #
-                         path = os.path.join(path, "bin")
-@@ -505,19 +505,19 @@ def find_graphviz():
-                         if progs is not None :
-                             #print "Used Windows registry"
-                             return progs
--                
-+
-                 except Exception, excp:
-                     #raise excp
-                     pass
-                 else:
-                     break
--                    
-+
- 
- 
-     # Method 2 (Linux, Windows etc)
-     #
-     if os.environ.has_key('PATH'):
--    
-+
-         for path in os.environ['PATH'].split(os.pathsep):
-             progs = __find_executables(path)
-             if progs is not None :
-@@ -527,27 +527,27 @@ def find_graphviz():
-     # Method 3 (Windows only)
-     #
-     if os.sys.platform == 'win32':
--    
-+
-         # Try and work out the equivalent of "C:\Program Files" on this
-         # machine (might be on drive D:, or in a different language)
-         #
--        
-+
-         if os.environ.has_key('PROGRAMFILES'):
--        
-+
-             # Note, we could also use the win32api to get this
-             # information, but win32api may not be installed.
--            
-+
-             path = os.path.join(os.environ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin')
--            
-+
-         else:
--        
-+
-             #Just in case, try the default...
-             path = r"C:\Program Files\att\Graphviz\bin"
--            
-+
-         progs = __find_executables(path)
--        
-+
-         if progs is not None :
--        
-+
-             #print "Used default install location"
-             return progs
- 
-@@ -557,7 +557,7 @@ def find_graphviz():
-         '/opt/local/bin',
-         '/opt/bin', '/sw/bin', '/usr/share',
-         '/Applications/Graphviz.app/Contents/MacOS/' ):
--        
-+
-         progs = __find_executables(path)
-         if progs is not None :
-             #print "Used path"
-@@ -566,48 +566,48 @@ def find_graphviz():
-     # Failed to find GraphViz
-     #
-     return None
--    
- 
--class Common:
-+
-+class Common(object):
-     """Common information to several classes.
--    
-+
-     Should not be directly used, several classes are derived from
-     this one.
-     """
--    
-+
- 
-     def __getstate__(self):
- 
-         dict = copy.copy(self.obj_dict)
--   
-+
-         return dict
- 
--    
-+
-     def __setstate__(self, state):
--    
-+
-         self.obj_dict = state
- 
- 
-     def __get_attribute__(self, attr):
-         """Look for default attributes for this node"""
--        
-+
-         attr_val = self.obj_dict['attributes'].get(attr, None)
--        
-+
-         if attr_val is None:
-             # get the defaults for nodes/edges
--            
-+
-             default_node_name = self.obj_dict['type']
--            
-+
-             # The defaults for graphs are set on a node named 'graph'
-             if default_node_name in ('subgraph', 'digraph', 'cluster'):
-                 default_node_name = 'graph'
--                
-+
-             g = self.get_parent_graph()
-             if g is not None:
-                 defaults = g.get_node( default_node_name )
-             else:
-                 return None
--            
-+
-             # Multiple defaults could be set by having repeated 'graph [...]'
-             # 'node [...]', 'edge [...]' statements. In such case, if the
-             # same attribute is set in different statements, only the first
-@@ -618,35 +618,35 @@ class Common:
-             #
-             if not isinstance(defaults, (list, tuple)):
-                 defaults = [defaults]
--                
-+
-             for default in defaults:
-                 attr_val = default.obj_dict['attributes'].get(attr, None)
-                 if attr_val:
-                     return attr_val
-         else:
-             return attr_val
--            
-+
-         return None
--    
-+
- 
-     def set_parent_graph(self, parent_graph):
--    
-+
-         self.obj_dict['parent_graph'] = parent_graph
--        
-+
- 
-     def get_parent_graph(self):
--    
-+
-         return self.obj_dict.get('parent_graph', None)
- 
- 
-     def set(self, name, value):
-         """Set an attribute value by name.
--        
-+
-         Given an attribute 'name' it will set its value to 'value'.
-         There's always the possibility of using the methods:
--        
-+
-             set_'name'(value)
--            
-+
-         which are defined for all the existing attributes.
-         """
- 
-@@ -655,43 +655,43 @@ class Common:
- 
-     def get(self, name):
-         """Get an attribute value by name.
--        
-+
-         Given an attribute 'name' it will get its value.
-         There's always the possibility of using the methods:
--        
-+
-             get_'name'()
--            
-+
-         which are defined for all the existing attributes.
-         """
- 
-         return self.obj_dict['attributes'].get(name, None)
--        
-+
- 
-     def get_attributes(self):
-         """"""
--        
-+
-         return self.obj_dict['attributes']
- 
--        
-+
-     def set_sequence(self, seq):
--    
-+
-         self.obj_dict['sequence'] = seq
- 
- 
-     def get_sequence(self):
--    
-+
-         return self.obj_dict['sequence']
--        
--        
-+
-+
-     def create_attribute_methods(self, obj_attributes):
--    
-+
-         #for attr in self.obj_dict['attributes']:
-         for attr in obj_attributes:
--        
-+
-             # Generate all the Setter methods.
-             #
-             self.__setattr__( 'set_'+attr, lambda x, a=attr : self.obj_dict['attributes'].__setitem__(a, x) )
--            
-+
-             # Generate all the Getter methods.
-             #
-             self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a))
-@@ -717,34 +717,34 @@ class InvocationException(Exception):
- 
- 
- 
--class Node(object, Common):
-+class Node(Common):
-     """A graph node.
--    
-+
-     This class represents a graph's node with all its attributes.
--    
-+
-     node(name, attribute=value, ...)
--    
-+
-     name: node's name
--    
-+
-     All the attributes defined in the Graphviz dot language should
-     be supported.
-     """
- 
-     def __init__(self, name = '', obj_dict = None, **attrs):
--    
-+
-         #
-         # Nodes will take attributes of all other types because the defaults
-         # for any GraphViz object are dealt with as if they were Node definitions
-         #
--        
-+
-         if obj_dict is not None:
--        
-+
-             self.obj_dict = obj_dict
--            
-+
-         else:
--        
-+
-             self.obj_dict = dict()
--            
-+
-             # Copy the attributes
-             #
-             self.obj_dict[ 'attributes' ] = dict( attrs )
-@@ -752,7 +752,7 @@ class Node(object, Common):
-             self.obj_dict[ 'parent_graph' ] = None
-             self.obj_dict[ 'parent_node_list' ] = None
-             self.obj_dict[ 'sequence' ] = None
--    
-+
-             # Remove the compass point
-             #
-             port = None
-@@ -763,49 +763,49 @@ class Node(object, Common):
- 
-             if isinstance(name, (long, int)):
-                 name = str(name)
--            
-+
-             self.obj_dict['name'] = quote_if_necessary( name )
-             self.obj_dict['port'] = port
--        
-+
-         self.create_attribute_methods(NODE_ATTRIBUTES)
--        
--    
--    
-+
-+
-+
-     def set_name(self, node_name):
-         """Set the node's name."""
--        
-+
-         self.obj_dict['name'] = node_name
--        
--        
-+
-+
-     def get_name(self):
-         """Get the node's name."""
--        
-+
-         return self.obj_dict['name']
- 
--    
-+
-     def get_port(self):
-         """Get the node's port."""
--        
-+
-         return self.obj_dict['port']
- 
- 
-     def add_style(self, style):
--    
-+
-         styles = self.obj_dict['attributes'].get('style', None)
-         if not styles and style:
-             styles = [ style ]
-         else:
-             styles = styles.split(',')
-             styles.append( style )
--        
-+
-         self.obj_dict['attributes']['style'] = ','.join( styles )
--        
-+
- 
-     def to_string(self):
-         """Returns a string representation of the node in dot language.
-         """
--        
--        
-+
-+
-         # RMF: special case defaults for node, edge and graph properties.
-         #
-         node = quote_if_necessary(self.obj_dict['name'])
-@@ -817,14 +817,14 @@ class Node(object, Common):
-                 node_attr.append( '%s=%s' % (attr, quote_if_necessary(value) ) )
-             else:
-                 node_attr.append( attr )
--                
--                
-+
-+
-         # No point in having nodes setting any defaults if the don't set
-         # any attributes...
-         #
-         if node in ('graph', 'node', 'edge') and len(node_attr) == 0:
-             return ''
--            
-+
-         node_attr = ', '.join(node_attr)
- 
-         if node_attr:
-@@ -834,47 +834,47 @@ class Node(object, Common):
- 
- 
- 
--class Edge(object,  Common ):
-+class Edge(Common):
-     """A graph edge.
--    
-+
-     This class represents a graph's edge with all its attributes.
--    
-+
-     edge(src, dst, attribute=value, ...)
--    
-+
-     src: source node's name
-     dst: destination node's name
--    
-+
-     All the attributes defined in the Graphviz dot language should
-     be supported.
--    
-+
-  	Attributes can be set through the dynamically generated methods:
--    
-+
-      set_[attribute name], i.e. set_label, set_fontname
--     
-+
-     or directly by using the instance's special dictionary:
--    
--     Edge.obj_dict['attributes'][attribute name], i.e. 
--     
-+
-+     Edge.obj_dict['attributes'][attribute name], i.e.
-+
-         edge_instance.obj_dict['attributes']['label']
-         edge_instance.obj_dict['attributes']['fontname']
--        
-+
-     """
--    
-+
- 
- 
-     def __init__(self, src='', dst='', obj_dict=None, **attrs):
--    
-+
-         if isinstance(src, (list, tuple)) and dst == '':
-             src, dst = src
--            
-+
-         if obj_dict is not None:
--        
-+
-             self.obj_dict = obj_dict
--            
-+
-         else:
--        
-+
-             self.obj_dict = dict()
--            
-+
-             # Copy the attributes
-             #
-             self.obj_dict[ 'attributes' ] = dict( attrs )
-@@ -885,83 +885,83 @@ class Edge(object,  Common ):
- 
-             if isinstance(src, Node):
-                 src = src.get_name()
--                
-+
-             if isinstance(dst, Node):
-                 dst = dst.get_name()
--    
-+
-             points = ( quote_if_necessary( src) , quote_if_necessary( dst) )
--            
-+
-             self.obj_dict['points'] = points
--            
-+
-         self.create_attribute_methods(EDGE_ATTRIBUTES)
- 
- 
-     def get_source(self):
-         """Get the edges source node name."""
--    
-+
-         return self.obj_dict['points'][0]
--        
--        
-+
-+
-     def get_destination(self):
-         """Get the edge's destination node name."""
--        
-+
-         return self.obj_dict['points'][1]
--            
--            
-+
-+
-     def __hash__(self):
... 1409 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pydot.git



More information about the Python-modules-commits mailing list