Example #1
0
 def slot_code(self, scope):
     if scope.doc is not None:
         if scope.doc.is_unicode:
             doc = scope.doc.utf8encode()
         else:
             doc = scope.doc.byteencode()
         return '__Pyx_DOCSTR("%s")' % StringEncoding.escape_byte_string(doc)
     else:
         return "0"
Example #2
0
 def slot_code(self, scope):
     if scope.doc is not None:
         if scope.doc.is_unicode:
             doc = scope.doc.utf8encode()
         else:
             doc = scope.doc.byteencode()
         return '"%s"' % StringEncoding.escape_byte_string(doc)
     else:
         return "0"
Example #3
0
File: Code.py Project: dagss/cython
 def __init__(self, cname, text, byte_string):
     self.cname = cname
     self.text = text
     self.escaped_value = StringEncoding.escape_byte_string(byte_string)
     self.py_strings = None
Example #4
0
 def __init__(self, cname, text, byte_string):
     self.cname = cname
     self.text = text
     self.escaped_value = StringEncoding.escape_byte_string(byte_string)
     self.py_strings = None
Example #5
0
 def literal_code(self, value):
     assert isinstance(value, str)
     return '"%s"' % StringEncoding.escape_byte_string(value)
Example #6
0
 def literal_code(self, value):
     assert isinstance(value, str)
     return '"%s"' % StringEncoding.escape_byte_string(value)