def run(self, line):
def _formatOutput(res):
if isinstance(res, str):
return res
else:
try:
return "\n".join(_formatOutput(r) for r in res)
except TypeError:
return str(res)
ishellCompleter = readline.get_completer()
readline.set_completer_delims(' \t\n;')
readline.parse_and_bind("tab: complete")
readline.set_completer(completer.complete)
filePath = raw_input("Please specify a path to the output file: ").strip()
readline.set_completer(ishellCompleter)
if os.path.isfile(filePath):
confirm = raw_input("File already exists and will be overwritten, confirm? [y/N] ")
if confirm is "" or confirm[0] not in ("y", "Y"):
print "Canceled."
return
with open(filePath, "w+") as handle:
handle.write(_formatOutput(feathermodules.results))
评论列表
文章目录