Example #1
0
        def _nix_bad_emoticons(text):
            """Remove troublesome emoticons so, e.g., '(128)' renders properly.

            By default (at least in 'text' mode), '8)' is replaced by
            a sunglasses-head emoticon.  There is no way to send
            sunglasses-head using alertlib.  This is a feature.
            """
            return text.replace(u'8)', u'8\u200b)')   # zero-width space
Example #2
0
 def translate_line_breaks(text):
     """Convert any EOL style to Linux EOL."""
     text = text.replace("\r\n", "\n")
     return text.replace("\r", "\n")
Example #3
0
File: mailer.py Project: kpj/WAM
	def append(self, text):
		text = text.replace('\n', '')
		self.story.append(text)
		text = text.encode('utf-8')
		print >> self.fd, text
		self.fd.flush()