1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

auto format change

This commit is contained in:
Hanyu Liu
2020-07-18 19:04:46 -04:00
parent 36ebda0452
commit 055a1f6829
2 changed files with 14 additions and 6 deletions

View File

@@ -433,9 +433,13 @@ def parse_logger_from_args(args):
outfile_name = "{}.txt".format(args.txt_filename)
else:
if args.recipe:
outfile_name = "TXT_AttackResult_{}_{}_{}-{}-{}-{}-{}.txt".format(args.model, args.recipe, year, month, day, hour, minute)
outfile_name = "TXT_AttackResult_{}_{}_{}-{}-{}-{}-{}.txt".format(
args.model, args.recipe, year, month, day, hour, minute
)
else:
outfile_name = "TXT_AttackResult_{}_{}-{}-{}-{}-{}.txt".format(args.model, year, month, day, hour, minute)
outfile_name = "TXT_AttackResult_{}_{}-{}-{}-{}-{}.txt".format(
args.model, year, month, day, hour, minute
)
attack_log_manager.add_output_file(os.path.join(args.out_dir, outfile_name))
# CSV
@@ -445,9 +449,13 @@ def parse_logger_from_args(args):
outfile_name = "{}.csv".format(args.csv_filename)
else:
if args.recipe:
outfile_name = "CSV_AttackResult_{}_{}_{}-{}-{}-{}-{}.csv".format(args.model, args.recipe, year, month, day, hour, minute)
outfile_name = "CSV_AttackResult_{}_{}_{}-{}-{}-{}-{}.csv".format(
args.model, args.recipe, year, month, day, hour, minute
)
else:
outfile_name = "CSV_AttackResult_{}_{}-{}-{}-{}-{}.csv".format(args.model, year, month, day, hour, minute)
outfile_name = "CSV_AttackResult_{}_{}-{}-{}-{}-{}.csv".format(
args.model, year, month, day, hour, minute
)
color_method = None if args.enable_csv == "plain" else "file"
csv_path = os.path.join(args.out_dir, outfile_name)
attack_log_manager.add_output_csv(csv_path, color_method)