Exemplo n.º 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"
Exemplo n.º 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"
Exemplo n.º 3
0
Arquivo: Code.py Projeto: 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
Exemplo n.º 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
Exemplo n.º 5
0
 def literal_code(self, value):
     assert isinstance(value, str)
     return '"%s"' % StringEncoding.escape_byte_string(value)
Exemplo n.º 6
0
 def literal_code(self, value):
     assert isinstance(value, str)
     return '"%s"' % StringEncoding.escape_byte_string(value)