/[pdpsoft]/trunk/nl.nikhef.pdp.dot2term/dvtree.py
ViewVC logotype

Contents of /trunk/nl.nikhef.pdp.dot2term/dvtree.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1455 - (show annotations) (download) (as text)
Thu Feb 4 09:56:48 2010 UTC (12 years, 6 months ago) by templon
File MIME type: application/x-python
File size: 1165 byte(s)
First checkin of dot2term, a program to convert 'dot' files to 'udg' files.


1 # J. Templon NIKHEF, written May 2001 while at University of Georgia.
2
3 from treedefs import *
4 import sys
5
6 class dvCounter:
7 def __init__(self,prefix):
8 self.value = 0
9 self.prefix = prefix
10 def next(self):
11 self.value = self.value + 1
12 return self.prefix + repr(self.value)
13
14 nodec = dvCounter('N')
15 refc = dvCounter('R')
16
17 def dvref(tnode, fmt):
18 indent = len(Lparent)*' '
19 fmt.of.write(indent + 'r("' + tnode.name + '")\n')
20
21 def dvnode(tnode, fmt):
22 indent = len(Lparent)*' '
23 fmt.of.write(indent)
24 fmt.of.write('l("' + tnode.name + '",n("hmmm",[a("OBJECT","' + tnode.name)
25 if tnode.shape :
26 fmt.of.write('"),\n')
27 fmt.of.write(indent+indent)
28 fmt.of.write('a("_GO","' + tnode.shape)
29 fmt.of.write('")],[')
30
31 def dvb4child(tnode,fmt):
32 indent = len(Lparent)*' '
33 fmt.of.write('\n' + indent + 'l("' + refc.next() + '",e("fred",[],')
34
35 def dvafterchild(fmt):
36 indent = len(Lparent)*' '
37 fmt.of.write('))')
38
39 def dvb4next(fmt):
40 indent = len(Lparent)*' '
41 fmt.of.write(',\n')
42
43 def dvafterchildren(fmt):
44 indent = len(Lparent)*' '
45 fmt.of.write(']))\n')
46

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28