Package fuzzy :: Package doc :: Package structure :: Package dot :: Module dot
[hide private]
[frames] | no frames]

Source Code for Module fuzzy.doc.structure.dot.dot

 1  # -*- coding: utf-8 -*- 
 2  # 
 3  # Copyright (C) 2009  Rene Liebscher 
 4  # 
 5  # This program is free software; you can redistribute it and/or modify it under 
 6  # the terms of the GNU Lesser General Public License as published by the Free  
 7  # Software Foundation; either version 3 of the License, or (at your option) any 
 8  # later version. 
 9  # 
10  # This program is distributed in the hope that it will be useful, but WITHOUT  
11  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
12  # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 
13  # details. 
14  #  
15  # You should have received a copy of the GNU Lesser General Public License 
16  # along with this program; if not, see <http://www.gnu.org/licenses/>.  
17  # 
18   
19  """Generates description of structure in dot format""" 
20   
21  __revision__ = "$Id: dot.py,v 1.7 2010-01-21 20:54:44 rliebscher Exp $" 
22   
23  # stores handler of different object types 
24  _registered_handler = {} 
25   
26 -def register_handler(class_, handler):
27 _registered_handler[class_] = handler
28 29 37
38 -def printVariablesDot(system,out):
39 """Print all variables""" 40 for name,variable in system.variables.items(): 41 print_dot(variable,out,system,name)
42
43 -def printRulesDot(system,out):
44 """Print all rules""" 45 for name,rule in system.rules.items(): 46 print_dot(rule,out,system,name)
47
48 -def printDot(system,out):
49 """Print whole system into one graph""" 50 print_header(out) 51 #printVariablesDot(system,out) 52 printRulesDot(system,out) 53 print_footer(out)
54 58 62 63 # import handlers for object types 64 import fuzzy.doc.structure.dot.handlers #@UnusedImport 65