예제 #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))