diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2015-10-19 20:18:12 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2015-10-19 20:18:12 +0000 |
commit | 3ccb9d291ae9fe95ff491190d18f6a75a3dd9010 (patch) | |
tree | 672eb0c87ded2d322df25efb7c10a1fd5a140243 /graphics/py-pydot | |
parent | 744f955765db451b32f1d04806180f348842871f (diff) | |
download | ports-3ccb9d291ae9fe95ff491190d18f6a75a3dd9010.tar.gz ports-3ccb9d291ae9fe95ff491190d18f6a75a3dd9010.zip |
- Add LICENSE_FILE
- Allow concurrent installation (USE_PYTHON=concurrent)
- Fix build with Python 3.x
Notes
Notes:
svn path=/head/; revision=399727
Diffstat (limited to 'graphics/py-pydot')
-rw-r--r-- | graphics/py-pydot/Makefile | 3 | ||||
-rw-r--r-- | graphics/py-pydot/files/patch-dot_parser.py | 68 | ||||
-rw-r--r-- | graphics/py-pydot/files/patch-pydot.py | 118 | ||||
-rw-r--r-- | graphics/py-pydot/files/patch-setup.py | 9 |
4 files changed, 197 insertions, 1 deletions
diff --git a/graphics/py-pydot/Makefile b/graphics/py-pydot/Makefile index ac364f39f9bf..da784389119b 100644 --- a/graphics/py-pydot/Makefile +++ b/graphics/py-pydot/Makefile @@ -10,13 +10,14 @@ MAINTAINER= sunpoet@FreeBSD.org COMMENT= Python interface to the Graphviz Dot language LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}parsing>=0:${PORTSDIR}/devel/py-parsing RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}parsing>=0:${PORTSDIR}/devel/py-parsing \ dot:${PORTSDIR}/graphics/graphviz NO_ARCH= yes -USE_PYTHON= autoplist distutils +USE_PYTHON= autoplist concurrent distutils USES= python GH_ACCOUNT= erocarrera diff --git a/graphics/py-pydot/files/patch-dot_parser.py b/graphics/py-pydot/files/patch-dot_parser.py new file mode 100644 index 000000000000..c56d7a875200 --- /dev/null +++ b/graphics/py-pydot/files/patch-dot_parser.py @@ -0,0 +1,68 @@ +--- dot_parser.py.orig 2012-01-03 00:15:07 UTC ++++ dot_parser.py +@@ -25,7 +25,7 @@ from pyparsing import __version__ as pyp + from pyparsing import ( nestedExpr, Literal, CaselessLiteral, Word, Upcase, OneOrMore, ZeroOrMore, + Forward, NotAny, delimitedList, oneOf, Group, Optional, Combine, alphas, nums, + restOfLine, cStyleComment, nums, alphanums, printables, empty, quotedString, +- ParseException, ParseResults, CharsNotIn, _noncomma, dblQuotedString, QuotedString, ParserElement ) ++ ParseException, ParseResults, CharsNotIn, dblQuotedString, QuotedString, ParserElement ) + + + class P_AttrList: +@@ -111,7 +111,7 @@ def push_top_graph_stmt(str, loc, toks): + add_elements(g, element) + + else: +- raise ValueError, "Unknown element statement: %r " % element ++ raise ValueError("Unknown element statement: %r " % element) + + + for g in top_graphs: +@@ -218,14 +218,14 @@ def add_elements(g, toks, defaults_graph + defaults_edge.update(element.attrs) + + else: +- raise ValueError, "Unknown DefaultStatement: %s " % element.default_type ++ raise ValueError("Unknown DefaultStatement: %s " % element.default_type) + + elif isinstance(element, P_AttrList): + + g.obj_dict['attributes'].update(element.attrs) + + else: +- raise ValueError, "Unknown element statement: %r" % element ++ raise ValueError("Unknown element statement: %r" % element) + + + def push_graph_stmt(str, loc, toks): +@@ -267,7 +267,7 @@ def push_default_stmt(str, loc, toks): + if default_type in ['graph', 'node', 'edge']: + return DefaultStatement(default_type, attrs) + else: +- raise ValueError, "Unknown default statement: %r " % toks ++ raise ValueError("Unknown default statement: %r " % toks) + + + def push_attr_list(str, loc, toks): +@@ -414,6 +414,7 @@ def graph_definition(): + + double_quoted_string = QuotedString('"', multiline=True, unquoteResults=False) # dblQuotedString + ++ _noncomma = "".join( [ c for c in printables if c != "," ] ) + alphastring_ = OneOrMore(CharsNotIn(_noncomma + ' ')) + + def parse_html(s, loc, toks): +@@ -523,9 +524,9 @@ def parse_dot_data(data): + else: + return [g for g in tokens] + +- except ParseException, err: ++ except ParseException as err: + +- print err.line +- print " "*(err.column-1) + "^" +- print err ++ print(err.line) ++ print(" "*(err.column-1) + "^") ++ print(err) + return None diff --git a/graphics/py-pydot/files/patch-pydot.py b/graphics/py-pydot/files/patch-pydot.py new file mode 100644 index 000000000000..4d96d536af22 --- /dev/null +++ b/graphics/py-pydot/files/patch-pydot.py @@ -0,0 +1,118 @@ +--- pydot.py.orig 2012-01-03 00:15:07 UTC ++++ pydot.py +@@ -19,7 +19,7 @@ Distributed under MIT license [http://op + + __revision__ = "$LastChangedRevision$" + __author__ = 'Ero Carrera' +-__version__ = '1.0.%d' % int( __revision__[21:-2] ) ++__version__ = '1.0.28' + __license__ = 'MIT' + + import os +@@ -29,8 +29,8 @@ import tempfile + import copy + try: + import dot_parser +-except Exception, e: +- print "Couldn't import dot_parser, loading of dot files will not be possible." ++except Exception as e: ++ print("Couldn't import dot_parser, loading of dot files will not be possible.") + + + +@@ -92,7 +92,7 @@ CLUSTER_ATTRIBUTES = set( ['K', 'URL', ' + # + class frozendict(dict): + def _blocked_attribute(obj): +- raise AttributeError, "A frozendict cannot be modified." ++ raise AttributeError("A frozendict cannot be modified.") + _blocked_attribute = property(_blocked_attribute) + + __delitem__ = __setitem__ = clear = _blocked_attribute +@@ -190,7 +190,7 @@ def quote_if_necessary(s): + return 'True' + return 'False' + +- if not isinstance( s, basestring ): ++ if not isinstance( s, str ): + return s + + if not s: +@@ -506,7 +506,7 @@ def find_graphviz(): + #print "Used Windows registry" + return progs + +- except Exception, excp: ++ except Exception as excp: + #raise excp + pass + else: +@@ -717,7 +717,7 @@ class InvocationException(Exception): + + + +-class Node(object, Common): ++class Node(Common): + """A graph node. + + This class represents a graph's node with all its attributes. +@@ -756,12 +756,12 @@ class Node(object, Common): + # Remove the compass point + # + port = None +- if isinstance(name, basestring) and not name.startswith('"'): ++ if isinstance(name, str) and not name.startswith('"'): + idx = name.find(':') + if idx > 0 and idx+1 < len(name): + name, port = name[:idx], name[idx:] + +- if isinstance(name, (long, int)): ++ if isinstance(name, int): + name = str(name) + + self.obj_dict['name'] = quote_if_necessary( name ) +@@ -834,7 +834,7 @@ 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. +@@ -925,7 +925,7 @@ class Edge(object, Common ): + """ + + if not isinstance(edge, Edge): +- raise Error, "Can't compare and edge to a non-edge object." ++ raise Error("Can't compare and edge to a non-edge object.") + + if self.get_parent_graph().get_top_graph_type() == 'graph': + +@@ -1025,7 +1025,7 @@ class Edge(object, Common ): + + + +-class Graph(object, Common): ++class Graph(Common): + """Class representing a graph in Graphviz's dot language. + + This class implements the methods to work on a representation +@@ -1075,7 +1075,7 @@ class Graph(object, Common): + self.obj_dict['attributes'] = dict(attrs) + + if graph_type not in ['graph', 'digraph']: +- raise Error, 'Invalid type "%s". Accepted graph types are: graph, digraph, subgraph' % graph_type ++ raise Error('Invalid type "%s". Accepted graph types are: graph, digraph, subgraph' % graph_type) + + + self.obj_dict['name'] = quote_if_necessary(graph_name) +@@ -2022,7 +2022,7 @@ class Dot(Graph): + 'Program terminated with status: %d. stderr follows: %s' % ( + status, stderr_output) ) + elif stderr_output: +- print stderr_output ++ print(stderr_output) + + # For each of the image files... + # diff --git a/graphics/py-pydot/files/patch-setup.py b/graphics/py-pydot/files/patch-setup.py index 34907ad4e031..e4c9a8b15d76 100644 --- a/graphics/py-pydot/files/patch-setup.py +++ b/graphics/py-pydot/files/patch-setup.py @@ -1,5 +1,14 @@ --- setup.py.orig 2012-01-03 00:15:07 UTC +++ setup.py +@@ -2,7 +2,7 @@ + + try: + from distutils.core import setup +-except ImportError, excp: ++except ImportError as excp: + from setuptools import setup + + import pydot @@ -31,5 +31,5 @@ setup( name = 'pydot', 'Topic :: Software Development :: Libraries :: Python Modules'], long_description = "\n".join(pydot.__doc__.split('\n')), |