本文整理汇总了Python中reindent.makebackup方法的典型用法代码示例。如果您正苦于以下问题:Python reindent.makebackup方法的具体用法?Python reindent.makebackup怎么用?Python reindent.makebackup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reindent
的用法示例。
在下文中一共展示了reindent.makebackup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: normalize_whitespace
# 需要导入模块: import reindent [as 别名]
# 或者: from reindent import makebackup [as 别名]
def normalize_whitespace(file_paths):
"""Make sure that the whitespace for .py files have been normalized."""
reindent.makebackup = False # No need to create backups.
fixed = []
for path in (x for x in file_paths if x.endswith('.py')):
if reindent.check(os.path.join(SRCDIR, path)):
fixed.append(path)
return fixed
示例2: normalize_whitespace
# 需要导入模块: import reindent [as 别名]
# 或者: from reindent import makebackup [as 别名]
def normalize_whitespace(file_paths):
"""Make sure that the whitespace for .py files have been normalized."""
reindent.makebackup = False # No need to create backups.
fixed = [path for path in file_paths if path.endswith('.py') and
reindent.check(os.path.join(SRCDIR, path))]
return fixed