def write(self, data, debug_info=None):
        """
        Write data to YHSM device.
        """
        self.num_write_bytes += len(data)
        if self.debug:
            if not debug_info:
                debug_info = str(len(data))
            sys.stderr.write("%s: WRITE %s:\n%s\n" %(
                    self.__class__.__name__,
                    debug_info,
                    pyhsm.util.hexdump(data)
                    ))
        return self.ser.write(data)
def write ( self , data , debug_info = None ) : self . num_write_bytes += len ( data ) if self . debug : if not debug_info : debug_info = str ( len ( data ) ) sys . stderr . write ( "%s: WRITE %s:\n%s\n" % ( self . __class__ . __name__ , debug_info , pyhsm . util . hexdump ( data ) ) ) return self . ser . write ( data )
Write data to YHSM device.