Date: Mon, 19 Oct 2015 20:18:12 +0000 (UTC) From: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r399727 - in head/graphics/py-pydot: . files Message-ID: <201510192018.t9JKICKR025732@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sunpoet Date: Mon Oct 19 20:18:12 2015 New Revision: 399727 URL: https://svnweb.freebsd.org/changeset/ports/399727 Log: - Add LICENSE_FILE - Allow concurrent installation (USE_PYTHON=concurrent) - Fix build with Python 3.x Added: head/graphics/py-pydot/files/patch-dot_parser.py (contents, props changed) head/graphics/py-pydot/files/patch-pydot.py (contents, props changed) Modified: head/graphics/py-pydot/Makefile head/graphics/py-pydot/files/patch-setup.py Modified: head/graphics/py-pydot/Makefile ============================================================================== --- head/graphics/py-pydot/Makefile Mon Oct 19 20:18:07 2015 (r399726) +++ head/graphics/py-pydot/Makefile Mon Oct 19 20:18:12 2015 (r399727) @@ -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 Added: head/graphics/py-pydot/files/patch-dot_parser.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/py-pydot/files/patch-dot_parser.py Mon Oct 19 20:18:12 2015 (r399727) @@ -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 Added: head/graphics/py-pydot/files/patch-pydot.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/py-pydot/files/patch-pydot.py Mon Oct 19 20:18:12 2015 (r399727) @@ -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... + # Modified: head/graphics/py-pydot/files/patch-setup.py ============================================================================== --- head/graphics/py-pydot/files/patch-setup.py Mon Oct 19 20:18:07 2015 (r399726) +++ head/graphics/py-pydot/files/patch-setup.py Mon Oct 19 20:18:12 2015 (r399727) @@ -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')),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510192018.t9JKICKR025732>