def puts(self, ts, *args):
if ts == "":
return
ts = puts(ts, *args)
ends_with_line_feed = (ts[-1] == '\n')
max_replace = string.count(ts, '\n') - 1 if ends_with_line_feed else -1
ts = string.replace(ts, '\n', '\n' + tab_character * self.indention, max_replace)
if self.line_feed == 0:
self.template += tab_character * self.indention
self.template += ts
if ends_with_line_feed:
self.line_feed = 0
else:
self.line_feed += 1
评论列表
文章目录