def reformat(self, sourcefile, destfile, configfile):
# type: (str, str, str) -> None
formatstyle = style_make()
with open(configfile) as fp:
for line in fp.readlines():
line = line.rstrip()
if line.startswith('--'):
line = line[2:]
pos = line.find('=')
if pos > 0:
optionname, value = line[:pos], line[pos + 1:]
else:
optionname, value = line, OPTION_PRESENT
set_option(formatstyle, optionname, value)
sourcedata = readbinary(sourcefile)
data = self.formatcode(formatstyle, sourcedata, filename=sourcefile)
if data is None:
data = b''
writebinary(destfile, data)
# ----------------------------------------------------------------------
评论列表
文章目录