def get_diff_list(left, right, ignore=['.DS_Store', 'pymakr.conf']):
left_paths = get_all_paths(left, ignore=ignore)
right_paths = get_all_paths(right, ignore=ignore)
new_files = right_paths.difference(left_paths)
to_delete = left_paths.difference(right_paths)
common = left_paths.intersection(right_paths)
to_update = []
for f in common:
if not filecmp.cmp(os.path.join(left, f),
os.path.join(right, f),
shallow=False):
to_update.append(f)
return (to_delete, new_files, (to_update))
# Searches the current working directory for a file starting with "firmware_"
# followed by a version number higher than `current_ver` as per LooseVersion.
# Returns None if such a file does not exist.
# Parameters
# path - the path to the directory to be searched
# current_ver - the result must be higher than this version
#
评论列表
文章目录