| author | Pawel Solyga <Pawel.Solyga@gmail.com> |
| Sun, 30 Nov 2008 16:32:23 +0000 | |
| changeset 624 | 811f50717bea |
| parent 594 | 06c2228e39cb |
| permissions | -rw-r--r-- |
|
594
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright (c) 2007-2008 Pedro Matiello <pmatiello@gmail.com> |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# License: MIT (see COPYING file) |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
import sys |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
sys.path.append('..')
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
import graph |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
gr = graph.graph() |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
inputfile = file('graph.xml','r')
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
string = inputfile.read() |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
inputfile.close() |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
|
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
gr.read(string) |
|
06c2228e39cb
Added the python-graph module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
17 |
print gr.write() |