Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
82b9ccc0
Commit
82b9ccc0
authored
May 21, 2012
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve import warnings in graphviz_draw()
parent
7ea3821e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/graph_tool/draw/graphviz_draw.py
src/graph_tool/draw/graphviz_draw.py
+9
-4
No files found.
src/graph_tool/draw/graphviz_draw.py
View file @
82b9ccc0
...
...
@@ -36,8 +36,9 @@ try:
import
matplotlib.cm
import
matplotlib.colors
except
ImportError
:
warnings
.
warn
(
"error importing matplotlib module... "
+
\
"graphviz_draw() will not work."
,
ImportWarning
)
msg
=
"Error importing matplotlib module... graphviz_draw() will not work."
warnings
.
filterwarnings
(
"always"
,
msg
,
ImportWarning
)
warnings
.
warn
(
msg
,
ImportWarning
)
try
:
libname
=
ctypes
.
util
.
find_library
(
"c"
)
...
...
@@ -45,6 +46,9 @@ try:
if
hasattr
(
libc
,
"open_memstream"
):
libc
.
open_memstream
.
restype
=
ctypes
.
POINTER
(
ctypes
.
c_char
)
except
OSError
:
msg
=
"Error importing C standard library... graphviz_draw() will not work."
warnings
.
filterwarnings
(
"always"
,
msg
,
ImportWarning
)
warnings
.
warn
(
msg
,
ImportWarning
)
pass
...
...
@@ -65,8 +69,9 @@ try:
# it, we will hit a memory leak in graphviz)
gvc
=
libgv
.
gvContext
()
except
OSError
:
warnings
.
warn
(
"error importing graphviz C library (libgvc)... "
+
\
"graphviz_draw() will not work."
,
ImportWarning
)
msg
=
"Error importing graphviz C library (libgvc)... graphviz_draw() will not work."
warnings
.
filterwarnings
(
"always"
,
msg
,
ImportWarning
)
warnings
.
warn
(
msg
,
ImportWarning
)
def
htmlize
(
val
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment