示例#1
0
 def _fold_no_color(self, a, b):
     try:
         A = a.no_color()
     except AttributeError:
         A = unicode(a)
     try:
         B = b.no_color()
     except AttributeError:
         B = unicode(b)
     return smart_str(A) + smart_str(B)
示例#2
0
 def _fold_no_color(self, a, b):
     try:
         A = a.no_color()
     except AttributeError:
         A = unicode(a)
     try:
         B = b.no_color()
     except AttributeError:
         B = unicode(b)
     return smart_str(A) + smart_str(B)
示例#3
0
 def __str__(self):
     return smart_str(self.__unicode__())
示例#4
0
 def __unicode__(self):
     suffix = ''
     if self.enabled:
         suffix = RESET_SEQ
     return smart_str(self.embed() + suffix)
示例#5
0
 def embed(self):
     prefix = ''
     if self.enabled:
         prefix = self.op
     return prefix + smart_str(reduce(self._add, self.s))
示例#6
0
 def test_smart_str(self):
     self.assertEqual(self.bytes_str, smart_str(self.decoded_bytes_str))
     self.assertIsInstance(smart_str(self.decoded_bytes_str), str)
     self.assertEqual(self.bytes_str, smart_str(self.bytes_str))
     self.assertIsInstance(smart_str(self.bytes_str), str)
示例#7
0
 def __str__(self):
     return smart_str(self.__unicode__())
示例#8
0
 def __unicode__(self):
     suffix = ''
     if self.enabled:
         suffix = RESET_SEQ
     return smart_str(self.embed() + suffix)
示例#9
0
 def embed(self):
     prefix = ''
     if self.enabled:
         prefix = self.op
     return prefix + smart_str(reduce(self._add, self.s))