def dump(self, bucket=None, collection=None):
cmd = 'kinto-wizard {} --server={} --auth={}'
dump_cmd = cmd.format("dump --full", self.server, self.auth)
if bucket:
dump_cmd += ' --bucket={}'.format(bucket)
if collection:
dump_cmd += ' --collection={}'.format(collection)
sys.argv = dump_cmd.split(" ")
output = io.StringIO()
with redirect_stdout(output):
main()
output.flush()
# Check that identical to original file.
return output.getvalue()
评论列表
文章目录