示例#1
0
文件: core.py 项目: scott91e1/pypad
 def add(self, buf, **kw):
     """Add a buffer to the editor."""
     self._buffers.append(buf)
     p, f = os.path.split(buf.path)
     kw['text'] = TAB.format(path=p, file=f)
     if 'image' in kw:
         kw.pop('image')
     super().add(buf, **kw)
示例#2
0
文件: core.py 项目: Nazek42/pypad
 def add(self, buf, **kw):
     """Add a buffer to the editor."""
     self._buffers.append(buf)
     p, f = os.path.split(buf.path)
     kw["text"] = TAB.format(path=p, file=f)
     if "image" in kw:
         kw.pop("image")
     super().add(buf, **kw)
示例#3
0
文件: core.py 项目: scott91e1/pypad
 def update_tabs(self):
     """Change the tabs' text to reflect their buffers."""
     for i in range(self.index('end')):
         buf = self.buffer(i)
         p, f = os.path.split(buf.path)
         self.tab(i, text=TAB.format(path=p, file=f))
示例#4
0
文件: core.py 项目: Nazek42/pypad
 def update_tabs(self):
     """Change the tabs' text to reflect their buffers."""
     for i in range(self.index("end")):
         buf = self.buffer(i)
         p, f = os.path.split(buf.path)
         self.tab(i, text=TAB.format(path=p, file=f))