Esempio n. 1
0
    def write(self, s):
        from _pydevd_bundle.pydevd_comm import ID_TO_MEANING
        meaning = ID_TO_MEANING.get(re.search(r'\d+', s).group(), '')
        if meaning:
            meaning += ': '

        self.log.append('write: %s%s' % (
            meaning,
            s,
        ))

        if SHOW_WRITES_AND_READS:
            print('Test Writer Thread Written %s%s' % (
                meaning,
                s,
            ))
        msg = s + '\n'

        if not hasattr(self, 'sock'):
            print('%s.sock not available when sending: %s' % (self, msg))
            return

        if IS_PY3K:
            msg = msg.encode('utf-8')

        self.sock.send(msg)
Esempio n. 2
0
    def write(self, s):
        from _pydevd_bundle.pydevd_comm import ID_TO_MEANING
        meaning = ID_TO_MEANING.get(re.search(r'\d+', s).group(), '')
        if meaning:
            meaning += ': '

        self.log.append('write: %s%s' % (meaning, s,))

        if SHOW_WRITES_AND_READS:
            print('Test Writer Thread Written %s%s' % (meaning, s,))
        msg = s + '\n'

        if not hasattr(self, 'sock'):
            print('%s.sock not available when sending: %s' % (self, msg))
            return

        if IS_PY3K:
            msg = msg.encode('utf-8')

        self.sock.send(msg)