(self, text='', join=', ')
Send everything here to print, so that tweaks can be made if needed.
Send everything here to print, so that tweaks can be made if needed.
Send everything here to print so that tweaks can be made if needed .
def send(self, text='', join=', '):
        """Send everything here to print, so that tweaks can be made if needed."""
        try:
            #Join text
            if isinstance(text, (tuple, list)):
                text = unicode(join).join(str(i).decode('utf-8','ignore').encode("utf-8") for i in text)
            else:
                text = text.replace('\\n', '\n')

            #Split by line
            for line in text.split('\n'):
                try:
                    print(line)
                except (UnicodeEncodeError, UnicodeDecodeError):
                    line = line.encode('utf-8').strip()
                    print(line)
                if self.queue is not None:
                    self.queue.put(line)
                    
        except AttributeError:
            print(text)
            if self.queue is not None:
                try:
                    self.queue.put(text)
                except AssertionError:
                    pass
def send ( self , text = '' , join = ', ' ) : try : #Join text if isinstance ( text , ( tuple , list ) ) : text = unicode ( join ) . join ( str ( i ) . decode ( 'utf-8' , 'ignore' ) . encode ( "utf-8" ) for i in text ) else : text = text . replace ( '\\n' , '\n' ) #Split by line for line in text . split ( '\n' ) : try : print ( line ) except ( UnicodeEncodeError , UnicodeDecodeError ) : line = line . encode ( 'utf-8' ) . strip ( ) print ( line ) if self . queue is not None : self . queue . put ( line ) except AttributeError : print ( text ) if self . queue is not None : try : self . queue . put ( text ) except AssertionError : pass