def listExport(self, force=None, path=None): _list = request.url_rule.rule.split('/')[2] bytIO = BytesIO() data = wl.exportWhitelist() if _list.lower == 'whitelist' else bl.exportBlacklist() bytIO.write(bytes(data, "utf-8")) bytIO.seek(0) return send_file(bytIO, as_attachment=True, attachment_filename=_list+".txt")
def listExport(self, force=None, path=None): _list = request.url_rule.rule.split('/')[2] bytIO = BytesIO() data = wl.exportWhitelist() if _list.lower == 'whitelist' else bl.exportBlacklist() bytIO.write(bytes(data, "utf-8")) bytIO.seek(0) return send_file(bytIO, as_attachment=True, attachment_filename=_list+".txt")
def listExport(): _list = request.url_rule.rule.split("/")[2] if _list.lower() == "whitelist": data = exportWhitelist() else: data = exportBlacklist() bytIO = BytesIO() bytIO.write(bytes(data, "utf-8")) bytIO.seek(0) return send_file(bytIO, as_attachment=True, attachment_filename=_list + ".txt")