示例#1
0
 def __init__(self, f):
     CCodeWriter.__init__(self, self)
     self.buffer = StringIO()
     self.real_f = f
     self.annotations = []
     self.last_pos = None
     self.code = {}
示例#2
0
 def __init__(self, f):
     CCodeWriter.__init__(self, self)
     self.buffer = StringIO()
     self.real_f = f
     self.annotations = []
     self.last_pos = None
     self.code = {}
示例#3
0
文件: Annotate.py 项目: anandu/pylibs
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         code = self.code.get(self.last_pos[1], "")
         self.code[self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
示例#4
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         code = self.code.get(self.last_pos[1], "")
         self.code[
             self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
示例#5
0
文件: Annotate.py 项目: bzzzz/cython
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         pos_code = self.code.setdefault(self.last_pos[0].filename,{})
         code = pos_code.get(self.last_pos[1], "")
         pos_code[self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
示例#6
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         pos_code = self.code.setdefault(self.last_pos[0].filename, {})
         code = pos_code.get(self.last_pos[1], "")
         pos_code[
             self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
示例#7
0
 def __init__(self, create_from=None, buffer=None, copy_formatting=True):
     CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
     if create_from is None:
         self.annotation_buffer = StringIO()
         self.annotations = []
         self.last_pos = None
         self.code = {}
     else:
         # When creating an insertion point, keep references to the same database
         self.annotation_buffer = create_from.annotation_buffer
         self.annotations = create_from.annotations
         self.code = create_from.code
         self.last_pos = create_from.last_pos
示例#8
0
文件: Annotate.py 项目: bzzzz/cython
 def __init__(self, create_from=None, buffer=None, copy_formatting=True):
     CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
     if create_from is None:
         self.annotation_buffer = StringIO()
         self.annotations = []
         self.last_pos = None
         self.code = {}
     else:
         # When creating an insertion point, keep references to the same database
         self.annotation_buffer = create_from.annotation_buffer
         self.annotations = create_from.annotations
         self.code = create_from.code
         self.last_pos = create_from.last_pos
示例#9
0
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)
示例#10
0
文件: Annotate.py 项目: bzzzz/cython
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)