00001 __copyright__ = """
00002 Copyright 2008 Sean Ross-Ross
00003 """
00004 __license__ = """
00005 This file is part of SLIMpy .
00006
00007 SLIMpy is free software: you can redistribute it and/or modify
00008 it under the terms of the GNU Lesser General Public License as published by
00009 the Free Software Foundation, either version 3 of the License, or
00010 (at your option) any later version.
00011
00012 SLIMpy is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 GNU Lesser General Public License for more details.
00016
00017 You should have received a copy of the GNU Lesser General Public License
00018 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00019 """
00020
00021 """
00022 Prints graph to SLIMpy log
00023 """
00024 from slimpy_base.Core.Graph.Graph.GraphPrinter import GraphPrinter as GraphPrinter_Base
00025 from slimpy_base.Environment.InstanceManager import InstanceManager
00026
00027
00028
00029
00030
00031
00032 class GraphPrinter( GraphPrinter_Base ):
00033 """
00034 Prints graph to SLIMpy log
00035 """
00036
00037 env = InstanceManager()
00038
00039
00040
00041 @classmethod
00042 def nodeToString( cls, node ):
00043 """
00044 function to work with data in the hashtable
00045 """
00046 table = cls.env['table']
00047 if isinstance( node, tuple ):
00048
00049 nodes = [ table[n] for n in node ]
00050 else:
00051 nodes = table[node]
00052
00053 return str( nodes )
00054
00055 @classmethod
00056 def _print( cls, *things ):
00057 """
00058 print classmethod
00059 """
00060
00061
00062
00063 return things
00064
00065
00066
00067
00068