Make the treefactory as simple as possible.
Fix spacing and create the name based on the filename only. We are excluding fullpath. That can be obtained with get_path.
Graph class that extends pgv.Agraph from pygraphviz. I added get_root and
get_number_of_children.
Pygraphviz can be obtained from
http://pygraphviz.github.io/documentation/latest/reference/agraph.html
There is similar library which is networkx
http://networkx.github.io/
Very similar they provide most of the stuff I need from a graphing system.
Please note I also implemented my own graph class. Howerver, it is very limited in comparsion with both libraries above.
graphutils is module that includes the class GraphJson to create a json file
or json object. It takes as input a normal graph from Graph class and it created a dictionary representing json output. The json output can be written to a file by passing a filename to the create_json_file function. Please note that the create_dict function depends on the following function from a Graph object:
get_graph() - to get the actual graph

Once the actual graph has been obtained the following functions are needed:

successors(node)-get the list of successors/children for a specific node
get_root() - get the actual root of the graph.

Note:
Future implementations should take care of multiple roots. A forest or network of trees.
RamResidentGraph should be as simple as possible. Deleted a whole bunch of non-necessary functions like write_graphviz. These should be done somewhere else. Keep classes short and simple.
added logging ability and also fix tab spacing.
Remove write_graphiv and is edge. We don't need them here. Please use graphutils for anything from writting a graphviz file or other types of files for the graph in question.
controller still a mess but ok for now.
added a few items from output directory to be ignored.