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
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
64018e6f
Commit
64018e6f
authored
Jan 18, 2009
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand user dir (~) in file IO
e.g., g.save("~/foo.xml")
parent
8ae75c9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/graph_tool/core.py
src/graph_tool/core.py
+2
-0
No files found.
src/graph_tool/core.py
View file @
64018e6f
...
...
@@ -549,6 +549,7 @@ class Graph(object):
"""Load graph from 'filename' (which can also be a file-like
object). The format is guessed from the file name, or can be specified
by 'format', which can be either 'xml' or 'dot'."""
filename
=
os
.
path
.
expanduser
(
filename
)
if
format
==
'auto'
and
isinstance
(
filename
,
str
):
if
filename
.
endswith
(
".xml"
)
or
filename
.
endswith
(
".xml.gz"
)
or
\
filename
.
endswith
(
".xml.bz2"
):
...
...
@@ -577,6 +578,7 @@ class Graph(object):
def
save
(
self
,
filename
,
format
=
"auto"
):
"""Save graph to file. The format is guessed from the 'file' name, or
can be specified by 'format', which can be either 'xml' or 'dot'."""
filename
=
os
.
path
.
expanduser
(
filename
)
if
format
==
'auto'
and
isinstance
(
filename
,
str
):
if
filename
.
endswith
(
".xml"
)
or
filename
.
endswith
(
".xml.gz"
)
or
\
filename
.
endswith
(
".xml.bz2"
):
...
...
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