7def write_file(overwrite,overwrite_is_default,full_qualified_filename):
9 overwrite is of type Overwrite and is what the user passes in
10 overwrite_is_default is a boolean
12 if overwrite==Overwrite.Always:
14 elif overwrite==Overwrite.Never
and os.path.exists(full_qualified_filename):
16 elif overwrite==Overwrite.Never
and not os.path.exists(full_qualified_filename):
18 elif overwrite==Overwrite.Default:
19 if not overwrite_is_default
and os.path.exists(full_qualified_filename):
24 print(
"Error: undefined overwrite strategy")
write_file(overwrite, overwrite_is_default, full_qualified_filename)
overwrite is of type Overwrite and is what the user passes in overwrite_is_default is a boolean