Logo Search packages:      
Sourcecode: g15daemon version File versions

def g15daemon::g15screen::__validate_buffer (   self,
  buf,
  use_exceptions 
) [private]

Validate given buffer

Definition at line 93 of file g15daemon.py.

00093                                                    :
        """Validate given buffer"""
        if len(buf) != MAX_BUFFER_LENGTH:
            if use_exceptions:
                raise Exception("Buffer has wrong size(%d)" % len(buf))
            return False
        for i in range(0,MAX_BUFFER_LENGTH):
            if not self.__validate_pixel(buf[i]):
                if use_exceptions:
                    raise Exception("Buffer contains at position %d an invalid char" % i)
                return False
        self.screen=str(buf)
        return True

    def __validate_pixel(self,pixel):


Generated by  Doxygen 1.6.0   Back to index