[Python-modules-commits] [python-pygraphviz] 03/14: Import python-pygraphviz_1.4~rc1.orig.tar.gz
Sandro Tosi
morph at moszumanska.debian.org
Sun Jan 8 20:06:45 UTC 2017
This is an automated email from the git hooks/post-receive script.
morph pushed a commit to branch master
in repository python-pygraphviz.
commit 4df25c6adda75c2c513e2ff8d8187be21e35bac6
Author: Sandro Tosi <morph at debian.org>
Date: Sun Jan 8 14:41:50 2017 -0500
Import python-pygraphviz_1.4~rc1.orig.tar.gz
---
PKG-INFO | 5 +-
doc/source/conf.py | 4 +-
pygraphviz.egg-info/PKG-INFO | 5 +-
pygraphviz.egg-info/SOURCES.txt | 1 +
pygraphviz/agraph.py | 33 ++---
pygraphviz/graphviz.i | 29 ++--
pygraphviz/graphviz.py | 269 +++++++++++++++++++++----------------
pygraphviz/graphviz_wrap.c | 159 +++++++++++++++++++---
pygraphviz/release.py | 5 +-
pygraphviz/tests/test_clear.py | 2 +-
pygraphviz/tests/test_graph.py | 21 ++-
pygraphviz/tests/test_readwrite.py | 27 ++--
pygraphviz/tests/test_setup.py | 51 +++++++
pygraphviz/version.py | 4 +-
setup.py | 10 +-
setup_commands.py | 8 +-
setup_extra.py | 74 +++++++---
tox.ini | 9 +-
18 files changed, 494 insertions(+), 222 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 92a7cd9..9929c55 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pygraphviz
-Version: 1.3.1
+Version: 1.4rc1
Summary: Python interface to Graphviz
Home-page: http://pygraphviz.github.io
Author: Aric Hagberg
@@ -23,6 +23,9 @@ Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
diff --git a/doc/source/conf.py b/doc/source/conf.py
index d0c843b..1cc968b 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -23,7 +23,7 @@ sys.path.append(os.path.abspath('../sphinxext'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath','sphinx.ext.doctest']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.imgmath','sphinx.ext.doctest']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
@@ -39,7 +39,7 @@ master_doc = 'index'
# General substitutions.
project = 'PyGraphviz'
-copyright = '2013, PyGraphviz Developers'
+copyright = '2016, PyGraphviz Developers'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
diff --git a/pygraphviz.egg-info/PKG-INFO b/pygraphviz.egg-info/PKG-INFO
index 92a7cd9..9929c55 100644
--- a/pygraphviz.egg-info/PKG-INFO
+++ b/pygraphviz.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pygraphviz
-Version: 1.3.1
+Version: 1.4rc1
Summary: Python interface to Graphviz
Home-page: http://pygraphviz.github.io
Author: Aric Hagberg
@@ -23,6 +23,9 @@ Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
diff --git a/pygraphviz.egg-info/SOURCES.txt b/pygraphviz.egg-info/SOURCES.txt
index 91765a1..122df10 100644
--- a/pygraphviz.egg-info/SOURCES.txt
+++ b/pygraphviz.egg-info/SOURCES.txt
@@ -65,6 +65,7 @@ pygraphviz/tests/test_html.py
pygraphviz/tests/test_layout.py
pygraphviz/tests/test_node_attributes.py
pygraphviz/tests/test_readwrite.py
+pygraphviz/tests/test_setup.py
pygraphviz/tests/test_string.py
pygraphviz/tests/test_subgraph.py
pygraphviz/tests/test_unicode.py
\ No newline at end of file
diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py
index ef80569..654e78a 100644
--- a/pygraphviz/agraph.py
+++ b/pygraphviz/agraph.py
@@ -17,11 +17,7 @@ import subprocess
import sys
import threading
import warnings
-try:
- from UserDict import DictMixin
-except ImportError:
- # Python 3
- from collections import MutableMapping as DictMixin
+from collections import MutableMapping
from . import graphviz as gv
@@ -132,7 +128,7 @@ class AGraph(object):
self.has_layout = False # avoid creating members outside of init
# backward compability
- filename = attr.get('file', filename)
+ filename = attr.pop('file', filename)
# guess input type if specified as first (nonkeyword) argument
if thing is not None:
# can't specify first argument and also file,data,string,handle
@@ -888,7 +884,7 @@ class AGraph(object):
"""
if with_labels:
- return dict(self.in_degree_iter(nbunch, with_labels))
+ return dict(self.in_degree_iter(nbunch))
else:
dlist = list(d for n, d in self.in_degree_iter(nbunch))
if nbunch in self:
@@ -941,11 +937,6 @@ class AGraph(object):
"""Return the number of edges in the graph."""
return gv.agnedges(self.handle)
- def size(self):
- """Return the number of edges in the graph."""
- return self.number_of_edges()
-
-
def clear(self):
"""Remove all nodes, edges, and attributes from the graph."""
self.remove_edges_from(self.edges())
@@ -956,6 +947,9 @@ class AGraph(object):
directed = self.directed
gv.agclose(self.handle)
self.handle = gv.agraphnew(name, strict, directed)
+ self.graph_attr.handle = self.handle
+ self.node_attr.handle = self.handle
+ self.edge_attr.handle = self.handle
def close(self):
# may be useful to clean up graphviz data
@@ -1201,7 +1195,7 @@ class AGraph(object):
self.handle = gv.agread(fh, None)
except ValueError:
raise DotError
-
+
except IOError:
print("IO error reading file")
@@ -1221,7 +1215,9 @@ class AGraph(object):
gv.agwrite(self.handle, fh)
except IOError:
print("IO error writing file")
-
+ finally:
+ if hasattr(fh, 'close') and not hasattr(path, 'write'):
+ fh.close()
def string_nop(self):
"""Return a string (unicode) representation of graph in dot format."""
@@ -1332,11 +1328,10 @@ class AGraph(object):
t.join()
if not data:
- raise IOError(b"".join(errors))
+ raise IOError(b"".join(errors).decode(self.encoding))
if len(errors) > 0:
- warnings.warn(b"".join(errors), RuntimeWarning)
-
+ warnings.warn(b"".join(errors).decode(self.encoding), RuntimeWarning)
return b"".join(data)
def layout(self, prog='neato', args=''):
@@ -1663,7 +1658,7 @@ class Edge(tuple):
key = property(get_name)
-class Attribute(DictMixin):
+class Attribute(MutableMapping):
"""Default attributes for graphs.
Assigned on initialization of AGraph class.
@@ -1729,7 +1724,7 @@ class Attribute(DictMixin):
return False
def __len__(self):
- return len(self.__iter__())
+ return len(list(self.__iter__()))
def has_key(self, name):
return self.__contains__(name)
diff --git a/pygraphviz/graphviz.i b/pygraphviz/graphviz.i
index 0d9b43b..68265ce 100644
--- a/pygraphviz/graphviz.i
+++ b/pygraphviz/graphviz.i
@@ -1,9 +1,9 @@
-# Copyright (C) 2004-2006 by
-# Aric Hagberg <hagberg at lanl.gov>
-# Dan Schult <dschult at colgate.edu>
-# Manos Renieris, http://www.cs.brown.edu/~er/
-# Distributed with BSD license.
-# All rights reserved, see LICENSE for details.
+// Copyright (C) 2004-2006 by
+// Aric Hagberg <hagberg at lanl.gov>
+// Dan Schult <dschult at colgate.edu>
+// Manos Renieris, http://www.cs.brown.edu/~er/
+// Distributed with BSD license.
+// All rights reserved, see LICENSE for details.
%module graphviz
@@ -18,15 +18,28 @@ extern PyTypeObject PyIOBase_Type;
%}
%typemap(in) FILE* (int fd, PyObject *mode_obj, PyObject *mode_byte_obj, char *mode) {
-%#if PY_VERSION_HEX >= 0x03000000
+%#if PY_VERSION_HEX >= 0x03000000 || defined(PYPY_VERSION)
+%#if !defined(PYPY_VERSION)
if (!PyObject_IsInstance($input, (PyObject *)&PyIOBase_Type)) {
PyErr_SetString(PyExc_TypeError, "not a file handle");
return NULL;
}
// work around to get hold of FILE*
fd = PyObject_AsFileDescriptor($input);
+%#else
+ fd = PyObject_AsFileDescriptor($input);
+ if (fd < 0) {
+ PyErr_SetString(PyExc_TypeError, "not a file handle");
+ return NULL;
+ }
+%#endif
mode_obj = PyObject_GetAttrString($input, "mode");
- mode_byte_obj = PyUnicode_AsUTF8String(mode_obj);
+%#if !defined(PYPY_VERSION)
+ mode_byte_obj = PyUnicode_AsUTF8String(mode_obj);
+%#else
+ mode_byte_obj = mode_obj;
+ Py_INCREF(mode_byte_obj);
+%#endif
mode = PyBytes_AsString(mode_byte_obj);
$1 = fdopen(fd, mode);
Py_XDECREF(mode_obj);
diff --git a/pygraphviz/graphviz.py b/pygraphviz/graphviz.py
index f6e4812..eb83702 100644
--- a/pygraphviz/graphviz.py
+++ b/pygraphviz/graphviz.py
@@ -1,5 +1,5 @@
# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 3.0.2
+# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
@@ -9,7 +9,7 @@
from sys import version_info
-if version_info >= (2,6,0):
+if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
@@ -33,46 +33,68 @@ del version_info
try:
_swig_property = property
except NameError:
- pass # Python < 2.2 doesn't have 'property'.
-def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
- if (name == "thisown"): return self.this.own(value)
+ pass # Python < 2.2 doesn't have 'property'.
+
+
+def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
+ if (name == "thisown"):
+ return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
- method = class_type.__swig_setmethods__.get(name,None)
- if method: return method(self,value)
+ method = class_type.__swig_setmethods__.get(name, None)
+ if method:
+ return method(self, value)
if (not static):
- self.__dict__[name] = value
+ if _newclass:
+ object.__setattr__(self, name, value)
+ else:
+ self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
-def _swig_setattr(self,class_type,name,value):
- return _swig_setattr_nondynamic(self,class_type,name,value,0)
-def _swig_getattr(self,class_type,name):
- if (name == "thisown"): return self.this.own()
- method = class_type.__swig_getmethods__.get(name,None)
- if method: return method(self)
- raise AttributeError(name)
+def _swig_setattr(self, class_type, name, value):
+ return _swig_setattr_nondynamic(self, class_type, name, value, 0)
+
+
+def _swig_getattr_nondynamic(self, class_type, name, static=1):
+ if (name == "thisown"):
+ return self.this.own()
+ method = class_type.__swig_getmethods__.get(name, None)
+ if method:
+ return method(self)
+ if (not static):
+ return object.__getattr__(self, name)
+ else:
+ raise AttributeError(name)
+
+def _swig_getattr(self, class_type, name):
+ return _swig_getattr_nondynamic(self, class_type, name, 0)
+
def _swig_repr(self):
- try: strthis = "proxy of " + self.this.__repr__()
- except: strthis = ""
+ try:
+ strthis = "proxy of " + self.this.__repr__()
+ except:
+ strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
- class _object : pass
+ class _object:
+ pass
_newclass = 0
-def agopen(*args):
- return _graphviz.agopen(*args)
+def agopen(name, kind, disc):
+ return _graphviz.agopen(name, kind, disc)
agopen = _graphviz.agopen
+
def agraphnew(name,strict=False,directed=False):
if strict:
if directed:
@@ -86,201 +108,202 @@ def agraphnew(name,strict=False,directed=False):
return _graphviz.agopen(name,cvar.Agundirected,None)
-def agclose(*args):
- return _graphviz.agclose(*args)
+def agclose(g):
+ return _graphviz.agclose(g)
agclose = _graphviz.agclose
-def agread(*args):
- return _graphviz.agread(*args)
+def agread(file, arg2):
+ return _graphviz.agread(file, arg2)
agread = _graphviz.agread
-def agwrite(*args):
- return _graphviz.agwrite(*args)
+def agwrite(g, file):
+ return _graphviz.agwrite(g, file)
agwrite = _graphviz.agwrite
-def agisundirected(*args):
- return _graphviz.agisundirected(*args)
+def agisundirected(g):
+ return _graphviz.agisundirected(g)
agisundirected = _graphviz.agisundirected
-def agisdirected(*args):
- return _graphviz.agisdirected(*args)
+def agisdirected(g):
+ return _graphviz.agisdirected(g)
agisdirected = _graphviz.agisdirected
-def agisstrict(*args):
- return _graphviz.agisstrict(*args)
+def agisstrict(g):
+ return _graphviz.agisstrict(g)
agisstrict = _graphviz.agisstrict
-def agnode(*args):
- return _graphviz.agnode(*args)
+def agnode(g, name, createflag):
+ return _graphviz.agnode(g, name, createflag)
agnode = _graphviz.agnode
-def agidnode(*args):
- return _graphviz.agidnode(*args)
+def agidnode(g, id, createflag):
+ return _graphviz.agidnode(g, id, createflag)
agidnode = _graphviz.agidnode
-def agsubnode(*args):
- return _graphviz.agsubnode(*args)
+def agsubnode(g, n, createflag):
+ return _graphviz.agsubnode(g, n, createflag)
agsubnode = _graphviz.agsubnode
-def agfstnode(*args):
- return _graphviz.agfstnode(*args)
+def agfstnode(g):
+ return _graphviz.agfstnode(g)
agfstnode = _graphviz.agfstnode
-def agnxtnode(*args):
- return _graphviz.agnxtnode(*args)
+def agnxtnode(g, n):
+ return _graphviz.agnxtnode(g, n)
agnxtnode = _graphviz.agnxtnode
-def aglstnode(*args):
- return _graphviz.aglstnode(*args)
+def aglstnode(g):
+ return _graphviz.aglstnode(g)
aglstnode = _graphviz.aglstnode
-def agprvnode(*args):
- return _graphviz.agprvnode(*args)
+def agprvnode(g, n):
+ return _graphviz.agprvnode(g, n)
agprvnode = _graphviz.agprvnode
-def agedge(*args):
- return _graphviz.agedge(*args)
+def agedge(g, t, h, name, createflag):
+ return _graphviz.agedge(g, t, h, name, createflag)
agedge = _graphviz.agedge
-def agidedge(*args):
- return _graphviz.agidedge(*args)
+def agidedge(g, t, h, id, createflag):
+ return _graphviz.agidedge(g, t, h, id, createflag)
agidedge = _graphviz.agidedge
-def agsubedge(*args):
- return _graphviz.agsubedge(*args)
+def agsubedge(g, e, createflag):
+ return _graphviz.agsubedge(g, e, createflag)
agsubedge = _graphviz.agsubedge
-def agfstin(*args):
- return _graphviz.agfstin(*args)
+def agfstin(g, n):
+ return _graphviz.agfstin(g, n)
agfstin = _graphviz.agfstin
-def agnxtin(*args):
- return _graphviz.agnxtin(*args)
+def agnxtin(g, e):
+ return _graphviz.agnxtin(g, e)
agnxtin = _graphviz.agnxtin
-def agfstout(*args):
- return _graphviz.agfstout(*args)
+def agfstout(g, n):
+ return _graphviz.agfstout(g, n)
agfstout = _graphviz.agfstout
-def agnxtout(*args):
- return _graphviz.agnxtout(*args)
+def agnxtout(g, e):
+ return _graphviz.agnxtout(g, e)
agnxtout = _graphviz.agnxtout
-def agfstedge(*args):
- return _graphviz.agfstedge(*args)
+def agfstedge(g, n):
+ return _graphviz.agfstedge(g, n)
agfstedge = _graphviz.agfstedge
-def agnxtedge(*args):
- return _graphviz.agnxtedge(*args)
+def agnxtedge(g, e, n):
+ return _graphviz.agnxtedge(g, e, n)
agnxtedge = _graphviz.agnxtedge
-def aghead(*args):
- return _graphviz.aghead(*args)
+def aghead(e):
+ return _graphviz.aghead(e)
aghead = _graphviz.aghead
-def agtail(*args):
- return _graphviz.agtail(*args)
+def agtail(e):
+ return _graphviz.agtail(e)
agtail = _graphviz.agtail
-def agattr(*args):
- return _graphviz.agattr(*args)
+def agattr(g, kind, name, value):
+ return _graphviz.agattr(g, kind, name, value)
agattr = _graphviz.agattr
-def agattrsym(*args):
- return _graphviz.agattrsym(*args)
+def agattrsym(obj, name):
+ return _graphviz.agattrsym(obj, name)
agattrsym = _graphviz.agattrsym
-def agnxtattr(*args):
- return _graphviz.agnxtattr(*args)
+def agnxtattr(g, kind, attr):
+ return _graphviz.agnxtattr(g, kind, attr)
agnxtattr = _graphviz.agnxtattr
-def agget(*args):
- return _graphviz.agget(*args)
+def agget(obj, name):
+ return _graphviz.agget(obj, name)
agget = _graphviz.agget
-def agxget(*args):
- return _graphviz.agxget(*args)
+def agxget(obj, sym):
+ return _graphviz.agxget(obj, sym)
agxget = _graphviz.agxget
-def agset(*args):
- return _graphviz.agset(*args)
+def agset(obj, name, value):
+ return _graphviz.agset(obj, name, value)
agset = _graphviz.agset
-def agxset(*args):
- return _graphviz.agxset(*args)
+def agxset(obj, sym, value):
+ return _graphviz.agxset(obj, sym, value)
agxset = _graphviz.agxset
-def agsafeset(*args):
- return _graphviz.agsafeset(*args)
+def agsafeset(obj, name, value, arg4):
+ return _graphviz.agsafeset(obj, name, value, arg4)
agsafeset = _graphviz.agsafeset
-def agattrname(*args):
- return _graphviz.agattrname(*args)
+def agattrname(atsym):
+ return _graphviz.agattrname(atsym)
agattrname = _graphviz.agattrname
-def agattrdefval(*args):
- return _graphviz.agattrdefval(*args)
+def agattrdefval(atsym):
+ return _graphviz.agattrdefval(atsym)
agattrdefval = _graphviz.agattrdefval
-def agsafeset_label(*args):
- return _graphviz.agsafeset_label(*args)
+def agsafeset_label(g, obj, name, val, arg5):
+ return _graphviz.agsafeset_label(g, obj, name, val, arg5)
agsafeset_label = _graphviz.agsafeset_label
-def agattr_label(*args):
- return _graphviz.agattr_label(*args)
+def agattr_label(g, kind, name, val):
+ return _graphviz.agattr_label(g, kind, name, val)
agattr_label = _graphviz.agattr_label
-def agsubg(*args):
- return _graphviz.agsubg(*args)
+def agsubg(g, name, createflag):
+ return _graphviz.agsubg(g, name, createflag)
agsubg = _graphviz.agsubg
-def agfstsubg(*args):
- return _graphviz.agfstsubg(*args)
+def agfstsubg(g):
+ return _graphviz.agfstsubg(g)
agfstsubg = _graphviz.agfstsubg
-def agnxtsubg(*args):
- return _graphviz.agnxtsubg(*args)
+def agnxtsubg(subg):
+ return _graphviz.agnxtsubg(subg)
agnxtsubg = _graphviz.agnxtsubg
-def agparent(*args):
- return _graphviz.agparent(*args)
+def agparent(g):
+ return _graphviz.agparent(g)
agparent = _graphviz.agparent
-def agroot(*args):
- return _graphviz.agroot(*args)
+def agroot(g):
+ return _graphviz.agroot(g)
agroot = _graphviz.agroot
-def agdelsubg(*args):
- return _graphviz.agdelsubg(*args)
+def agdelsubg(g, sub):
+ return _graphviz.agdelsubg(g, sub)
agdelsubg = _graphviz.agdelsubg
-def agnnodes(*args):
- return _graphviz.agnnodes(*args)
+def agnnodes(g):
+ return _graphviz.agnnodes(g)
agnnodes = _graphviz.agnnodes
-def agnedges(*args):
- return _graphviz.agnedges(*args)
+def agnedges(g):
+ return _graphviz.agnedges(g)
agnedges = _graphviz.agnedges
-def agdegree(*args):
- return _graphviz.agdegree(*args)
+def agdegree(g, n, arg3, out):
+ return _graphviz.agdegree(g, n, arg3, out)
agdegree = _graphviz.agdegree
-def agraphof(*args):
- return _graphviz.agraphof(*args)
+def agraphof(arg1):
+ return _graphviz.agraphof(arg1)
agraphof = _graphviz.agraphof
-def agnameof(*args):
- return _graphviz.agnameof(*args)
+def agnameof(arg1):
+ return _graphviz.agnameof(arg1)
agnameof = _graphviz.agnameof
-def agdelnode(*args):
- return _graphviz.agdelnode(*args)
+def agdelnode(g, arg_n):
+ return _graphviz.agdelnode(g, arg_n)
agdelnode = _graphviz.agdelnode
-def agdeledge(*args):
- return _graphviz.agdeledge(*args)
+def agdeledge(g, arg_e):
+ return _graphviz.agdeledge(g, arg_e)
agdeledge = _graphviz.agdeledge
+
def agnameof(handle):
name=_graphviz.agnameof(handle)
if name is None:
@@ -290,10 +313,20 @@ def agnameof(handle):
else:
return name
+
+_graphviz.AGRAPH_swigconstant(_graphviz)
AGRAPH = _graphviz.AGRAPH
+
+_graphviz.AGNODE_swigconstant(_graphviz)
AGNODE = _graphviz.AGNODE
+
+_graphviz.AGOUTEDGE_swigconstant(_graphviz)
AGOUTEDGE = _graphviz.AGOUTEDGE
+
+_graphviz.AGINEDGE_swigconstant(_graphviz)
AGINEDGE = _graphviz.AGINEDGE
+
+_graphviz.AGEDGE_swigconstant(_graphviz)
AGEDGE = _graphviz.AGEDGE
# This file is compatible with both classic and new-style classes.
diff --git a/pygraphviz/graphviz_wrap.c b/pygraphviz/graphviz_wrap.c
index ee37f9c..3b0b75d 100644
--- a/pygraphviz/graphviz_wrap.c
+++ b/pygraphviz/graphviz_wrap.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.7
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
@@ -119,6 +119,19 @@
# define _SCL_SECURE_NO_DEPRECATE
#endif
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used. So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
@@ -1508,6 +1521,23 @@ typedef struct {
#endif
} SwigPyObject;
+
+#ifdef SWIGPYTHON_BUILTIN
+
+SWIGRUNTIME PyObject *
+SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
+{
+ SwigPyObject *sobj = (SwigPyObject *)v;
+
+ if (!sobj->dict)
+ sobj->dict = PyDict_New();
+
+ Py_INCREF(sobj->dict);
+ return sobj->dict;
+}
+
+#endif
+
SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject *v)
{
@@ -1778,7 +1808,7 @@ swigobject_methods[] = {
static PyMethodDef
swigobject_methods[] = {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
- {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
+ {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
@@ -2547,18 +2577,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f
newobj = (SwigPyObject *) newobj->next;
newobj->next = next_self;
newobj = (SwigPyObject *)next_self;
+#ifdef SWIGPYTHON_BUILTIN
+ newobj->dict = 0;
+#endif
}
} else {
newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+#ifdef SWIGPYTHON_BUILTIN
+ newobj->dict = 0;
+#endif
}
if (newobj) {
newobj->ptr = ptr;
newobj->ty = type;
newobj->own = own;
newobj->next = 0;
-#ifdef SWIGPYTHON_BUILTIN
- newobj->dict = 0;
-#endif
return (PyObject*) newobj;
}
return SWIG_Py_Void();
@@ -2943,7 +2976,7 @@ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
#endif
#define SWIG_name "_graphviz"
-#define SWIGVERSION 0x030002
+#define SWIGVERSION 0x030007
#define SWIG_VERSION SWIGVERSION
@@ -3414,15 +3447,28 @@ SWIGINTERN PyObject *_wrap_agread(PyObject *SWIGUNUSEDPARM(self), PyObject *args
if (!PyArg_ParseTuple(args,(char *)"OO:agread",&obj0,&obj1)) SWIG_fail;
{
-#if PY_VERSION_HEX >= 0x03000000
+#if PY_VERSION_HEX >= 0x03000000 || defined(PYPY_VERSION)
+#if !defined(PYPY_VERSION)
if (!PyObject_IsInstance(obj0, (PyObject *)&PyIOBase_Type)) {
PyErr_SetString(PyExc_TypeError, "not a file handle");
return NULL;
}
// work around to get hold of FILE*
fd1 = PyObject_AsFileDescriptor(obj0);
+#else
+ fd1 = PyObject_AsFileDescriptor(obj0);
+ if (fd1 < 0) {
+ PyErr_SetString(PyExc_TypeError, "not a file handle");
+ return NULL;
+ }
+#endif
mode_obj1 = PyObject_GetAttrString(obj0, "mode");
+#if !defined(PYPY_VERSION)
mode_byte_obj1 = PyUnicode_AsUTF8String(mode_obj1);
+#else
+ mode_byte_obj1 = mode_obj1;
+ Py_INCREF(mode_byte_obj1);
+#endif
mode1 = PyBytes_AsString(mode_byte_obj1);
arg1 = fdopen(fd1, mode1);
Py_XDECREF(mode_obj1);
@@ -3475,15 +3521,28 @@ SWIGINTERN PyObject *_wrap_agwrite(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
}
arg1 = (Agraph_t *)(argp1);
{
-#if PY_VERSION_HEX >= 0x03000000
+#if PY_VERSION_HEX >= 0x03000000 || defined(PYPY_VERSION)
+#if !defined(PYPY_VERSION)
if (!PyObject_IsInstance(obj1, (PyObject *)&PyIOBase_Type)) {
PyErr_SetString(PyExc_TypeError, "not a file handle");
return NULL;
}
// work around to get hold of FILE*
fd2 = PyObject_AsFileDescriptor(obj1);
+#else
+ fd2 = PyObject_AsFileDescriptor(obj1);
+ if (fd2 < 0) {
+ PyErr_SetString(PyExc_TypeError, "not a file handle");
+ return NULL;
+ }
+#endif
mode_obj2 = PyObject_GetAttrString(obj1, "mode");
+#if !defined(PYPY_VERSION)
mode_byte_obj2 = PyUnicode_AsUTF8String(mode_obj2);
+#else
+ mode_byte_obj2 = mode_obj2;
+ Py_INCREF(mode_byte_obj2);
+#endif
mode2 = PyBytes_AsString(mode_byte_obj2);
arg2 = fdopen(fd2, mode2);
Py_XDECREF(mode_obj2);
@@ -5151,6 +5210,61 @@ SWIGINTERN PyObject *Swig_var_Agstrictundirected_get(void) {
}
+SWIGINTERN PyObject *AGRAPH_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *module;
+ PyObject *d;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL;
+ d = PyModule_GetDict(module);
+ if (!d) return NULL;
+ SWIG_Python_SetConstant(d, "AGRAPH",SWIG_From_int((int)(0)));
+ return SWIG_Py_Void();
+}
+
+
+SWIGINTERN PyObject *AGNODE_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *module;
+ PyObject *d;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL;
+ d = PyModule_GetDict(module);
+ if (!d) return NULL;
+ SWIG_Python_SetConstant(d, "AGNODE",SWIG_From_int((int)(1)));
+ return SWIG_Py_Void();
+}
+
+
+SWIGINTERN PyObject *AGOUTEDGE_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *module;
+ PyObject *d;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL;
+ d = PyModule_GetDict(module);
+ if (!d) return NULL;
+ SWIG_Python_SetConstant(d, "AGOUTEDGE",SWIG_From_int((int)(2)));
+ return SWIG_Py_Void();
+}
+
+
+SWIGINTERN PyObject *AGINEDGE_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *module;
+ PyObject *d;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL;
+ d = PyModule_GetDict(module);
+ if (!d) return NULL;
+ SWIG_Python_SetConstant(d, "AGINEDGE",SWIG_From_int((int)(3)));
+ return SWIG_Py_Void();
+}
+
+
+SWIGINTERN PyObject *AGEDGE_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *module;
+ PyObject *d;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL;
+ d = PyModule_GetDict(module);
+ if (!d) return NULL;
+ SWIG_Python_SetConstant(d, "AGEDGE",SWIG_From_int((int)(2)));
+ return SWIG_Py_Void();
+}
+
+
static PyMethodDef SwigMethods[] = {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
{ (char *)"agopen", _wrap_agopen, METH_VARARGS, NULL},
@@ -5203,6 +5317,11 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"agnameof", _wrap_agnameof, METH_VARARGS, NULL},
{ (char *)"agdelnode", _wrap_agdelnode, METH_VARARGS, NULL},
{ (char *)"agdeledge", _wrap_agdeledge, METH_VARARGS, NULL},
+ { (char *)"AGRAPH_swigconstant", AGRAPH_swigconstant, METH_VARARGS, NULL},
+ { (char *)"AGNODE_swigconstant", AGNODE_swigconstant, METH_VARARGS, NULL},
+ { (char *)"AGOUTEDGE_swigconstant", AGOUTEDGE_swigconstant, METH_VARARGS, NULL},
+ { (char *)"AGINEDGE_swigconstant", AGINEDGE_swigconstant, METH_VARARGS, NULL},
+ { (char *)"AGEDGE_swigconstant", AGEDGE_swigconstant, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
@@ -5315,7 +5434,7 @@ SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
size_t i;
swig_module_info *module_head, *iter;
- int found, init;
+ int init;
/* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) {
@@ -5334,22 +5453,18 @@ SWIG_InitializeModule(void *clientdata) {
/* This is the first module loaded for this interpreter */
/* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module);
- module_head = &swig_module;
} else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
- found=0;
iter=module_head;
do {
if (iter==&swig_module) {
- found=1;
- break;
+ /* Our module is already in the list, so there's nothing more to do. */
+ return;
}
iter=iter->next;
} while (iter!= module_head);
- /* if the is found in the list, then all is done and we may leave */
- if (found) return;
- /* otherwise we must add out module into the list */
+ /* otherwise we must add our module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
}
@@ -5760,7 +5875,9 @@ extern "C" {
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
const char *c = methods[i].ml_doc;
- if (c && (c = strstr(c, "swig_ptr: "))) {
+ if (!c) continue;
+ c = strstr(c, "swig_ptr: ");
+ if (c) {
int j;
swig_const_info *ci = 0;
const char *name = c + 10;
@@ -5862,6 +5979,7 @@ SWIG_init(void) {
PyObject *public_interface, *public_symbol;
PyObject *this_descr;
PyObject *thisown_descr;
+ PyObject *self = 0;
int i;
(void)builtin_pytype;
@@ -5869,6 +5987,7 @@ SWIG_init(void) {
(void)builtin_basetype;
(void)tuple;
(void)static_getset;
+ (void)self;
/* metatype is used to implement static member variables. */
metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
@@ -5888,6 +6007,7 @@ SWIG_init(void) {
#else
m = Py_InitModule((char *) SWIG_name, SwigMethods);
#endif
+
md = d = PyModule_GetDict(m);
(void)md;
@@ -5936,11 +6056,6 @@ SWIG_init(void) {
SWIG_addvarlink(SWIG_globals(),(char*)"Agstrictdirected",Swig_var_Agstrictdirected_get, Swig_var_Agstrictdirected_set);
SWIG_addvarlink(SWIG_globals(),(char*)"Agundirected",Swig_var_Agundirected_get, Swig_var_Agundirected_set);
... 434 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pygraphviz.git
More information about the Python-modules-commits
mailing list