1 '''
2 A package for a basic command interpreter for the graph.
3 (and graph db...)
4 '''
5
6 import sys
7 import cmd
8
9 import visgraph.dbcore as vg_dbcore
10 import visgraph.pathcore as vg_pcore
11 import visgraph.graphcore as vg_gcore
12
14
16 cmd.Cmd.__init__(self)
17 if graph == None:
18 graph = vg_gcore.Graph()
19 self.graph = graph
20
22 '''
23 Add a node with the given key=value properties on the CLI.
24 (the property nid is special and MUST be an integer)
25 '''
26 nid = self.graph.addNode()
27 print 'Node %d added!' % nid
28
30 '''
31 Exit the visgraph cli....
32 '''
33 raise SystemExit()
34
35
36
40
41 if __name__ == '__main__':
42 sys.exit(main())
43