hscommon.conflict¶
When you have to deal with names that have to be unique and can conflict together, you can use
this module that deals with conflicts by prepending unique numbers in [] brackets to the name.
-
hscommon.conflict.get_conflicted_name(other_names, name)¶ Returns name with a
[000]number in front of it.The number between brackets depends on how many conlicted filenames there already are in other_names.
-
hscommon.conflict.get_unconflicted_name(name)¶ Returns
namewithout[]brackets.Brackets which, of course, might have been added by func:get_conflicted_name.
-
hscommon.conflict.is_conflicted(name)¶ Returns whether
nameis prepended with a bracketed number.
-
hscommon.conflict.smart_copy(source_path, dest_path)¶ Copies
source_pathtodest_path, recursively and with conflict resolution.
-
hscommon.conflict.smart_move(source_path, dest_path)¶ Same as
smart_copy(), but it moves files instead.