本文整理匯總了Python中fmt_template.Formatter.begin_folder方法的典型用法代碼示例。如果您正苦於以下問題:Python Formatter.begin_folder方法的具體用法?Python Formatter.begin_folder怎麽用?Python Formatter.begin_folder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fmt_template.Formatter
的用法示例。
在下文中一共展示了Formatter.begin_folder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: begin_folder
# 需要導入模塊: from fmt_template import Formatter [as 別名]
# 或者: from fmt_template.Formatter import begin_folder [as 別名]
def begin_folder (self, folder):
if self.last_line_was_text:
print >> self.out
print >>self.out, ('#' * (self.header_depth+1)),
Formatter.begin_folder(self, folder)
print >>self.out
self.depth = 0
self.header_depth+=1
self.last_line_was_text = False
示例2: begin_folder
# 需要導入模塊: from fmt_template import Formatter [as 別名]
# 或者: from fmt_template.Formatter import begin_folder [as 別名]
def begin_folder (self, folder):
is_output = 'FolderStart' in self.template.nodes
if self.last_line_was_text and is_output:
print >> self.out
self.last_line_was_text = False
Formatter.begin_folder(self, folder)
if is_output:
print >>self.out
self.depth = 0
self.header_depth+=1