pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/cad/py-PyRTL py-PyRTL: Support graphics/py-graphviz-0....
details: https://anonhg.NetBSD.org/pkgsrc/rev/69371b51aa40
branches: trunk
changeset: 379593:69371b51aa40
user: ryoon <ryoon%pkgsrc.org@localhost>
date: Thu May 19 15:59:04 2022 +0000
description:
py-PyRTL: Support graphics/py-graphviz-0.19 or later too
diffstat:
cad/py-PyRTL/Makefile | 4 +-
cad/py-PyRTL/distinfo | 3 +-
cad/py-PyRTL/patches/patch-pyrtl_visualization.py | 25 +++++++++++++++++++++++
3 files changed, 29 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r 2abd3e2d5fc4 -r 69371b51aa40 cad/py-PyRTL/Makefile
--- a/cad/py-PyRTL/Makefile Thu May 19 15:57:23 2022 +0000
+++ b/cad/py-PyRTL/Makefile Thu May 19 15:59:04 2022 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2022/01/04 20:52:35 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2022/05/19 15:59:04 ryoon Exp $
DISTNAME= pyrtl-${PKGVERSION_NOREV}
PKGNAME= ${PYPKGPREFIX}-PyRTL-0.10.1
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= cad python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/pyrtl/}
diff -r 2abd3e2d5fc4 -r 69371b51aa40 cad/py-PyRTL/distinfo
--- a/cad/py-PyRTL/distinfo Thu May 19 15:57:23 2022 +0000
+++ b/cad/py-PyRTL/distinfo Thu May 19 15:59:04 2022 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.5 2021/11/21 15:10:08 ryoon Exp $
+$NetBSD: distinfo,v 1.6 2022/05/19 15:59:04 ryoon Exp $
BLAKE2s (pyrtl-0.10.1.tar.gz) = 9cfd2f3c21ddb36d47607efe9d371201cb2405eab9ad0c83c14c6187337caf1c
SHA512 (pyrtl-0.10.1.tar.gz) = 84a9c8da6e793d7740a38753ff8ae96b16e734e6024ce2df8b15df6e469ccedbd2a4f9019882d985c8842c73a4d7d4d2637d8ca071cfd9429ed27f3f07471b7f
Size (pyrtl-0.10.1.tar.gz) = 199543 bytes
+SHA1 (patch-pyrtl_visualization.py) = 2b7bdb0171fa13e8c9d0317b782c6d0a5fc80b66
diff -r 2abd3e2d5fc4 -r 69371b51aa40 cad/py-PyRTL/patches/patch-pyrtl_visualization.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cad/py-PyRTL/patches/patch-pyrtl_visualization.py Thu May 19 15:59:04 2022 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-pyrtl_visualization.py,v 1.1 2022/05/19 15:59:04 ryoon Exp $
+
+* Support SVG output with py-graphviz 0.19 or later too.
+
+--- pyrtl/visualization.py.orig 2021-09-02 19:11:31.000000000 +0000
++++ pyrtl/visualization.py
+@@ -453,8 +453,16 @@ def block_to_svg(block=None, split_state
+ """
+ try:
+ from graphviz import Source
+- return Source(block_to_graphviz_string(block, split_state=split_state,
+- maintain_arg_order=maintain_arg_order))._repr_svg_()
++ src = Source(block_to_graphviz_string(block, split_state=split_state,
++ maintain_arg_order=maintain_arg_order))
++ try:
++ svg = src._repr_image_svg_xml()
++ except AttributeError:
++ # py-graphviz 0.18.3 or earlier
++ return src._repr_svg_()
++ else:
++ # py-graphviz 0.19 or later
++ return svg
+ except ImportError:
+ raise PyrtlError('need graphviz installed (try "pip install graphviz")')
+
Home |
Main Index |
Thread Index |
Old Index