pytty

changeset 29:10bc49064475

Added TTY.__repr__ and TTY.__str__
author Arc Riley <arcriley@gmail.com>
date Tue, 10 Jul 2012 03:47:01 -0400
parents 6b65d84b51b7
children 873320419f15
files src/__init__.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/src/__init__.py	Tue Jul 10 03:38:18 2012 -0400
     1.2 +++ b/src/__init__.py	Tue Jul 10 03:47:01 2012 -0400
     1.3 @@ -76,6 +76,12 @@
     1.4          # initialize self with BufferedRWPair
     1.5          super(TTY, self).__init__(reader, writer)
     1.6  
     1.7 +    def __repr__(self) :
     1.8 +        return '<pytty.TTY (%s)>' % str(self)
     1.9 +
    1.10 +    def __str__(self) :
    1.11 +        return '%i%s%i' % (self.bits, self.parity, self.stops)
    1.12 +
    1.13      @property
    1.14      def baud (self) :
    1.15          '''Baud rate