Commit 8b32d7fc authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Complete re-factoring of python module and command line tool

The program was split in two parts:

    1. A python module, graph_tool.py, which encapsulates the graph
       manipulation under a Graph class. Now the following can be done:

              import graph_tool
              g1 = graph_tool.Graph()
              g2 = graph_tool.Graph()
              g1.load("foo.xml")
              g2.load("bar.xml")
              print g1.number_of_vertices(), g2.number_of_vertices()

    2. A standalone command line tool, graph-tool, which imports
       graph_tool.py, and exposes the Graph methods as command line
       options.

The whole command line engine was thus (once again) entirely
rewritten. It is now Crack-Free™, and simply mirrors the methods of the
Graph class as command line options, using, for this, the beauty of
function decorators. It classifies now, I believe, as Pythonic™.
parent f005e928
......@@ -4,13 +4,8 @@ AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = graph .
bin_SCRIPTS = graph-tool
EXTRA_DIST = $(bin_SCRIPTS)
graph_tool_PYTHON = graph_tool.py
graph_tooldir = $(pythondir)
# Also install graph-tool as a python module (graph_tool.py)
install-exec-hook:
ln -fs $(bindir)/graph-tool $(pythondir)/graph_tool.py
uninstall-hook:
rm -f $(pythondir)/graph_tool.py
bin_SCRIPTS = graph-tool
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment