Add '# vim: set fileencoding=utf8' to the second line of all source code,
[trinary.git] / Port.py
blob7926796e7d77900ba481cb4167a2e422b17c64a6
1 #!/usr/bin/python
2 # vim: set fileencoding=utf8
3 # Created:20080211
4 # By Jeff Connelly
6 IN = "in"
7 OUT = "out"
8 INOUT = "inout"
11 class Port(object):
12 def __init__(self, name, direction, type):
13 self.name = name
14 assert direction in [IN, OUT, INOUT], \
15 "Port direction %s is invalid" % (direction,)
17 self.direction = direction
18 self.type = type
20 def __str__(self):
21 return "<Port: %s, %s, %s>" % (self.name, self.direction, self.type)
23 if __name__ == "__main__":
24 a = Port("a", IN, None)
25 b = Port("b", IN, None)
26 c = Port("c", OUT, None)
28 print a
29 print b
30 print c