Flamenco: sort path replacement vars by replacement, not by variable name

The longer paths need to be replaced first. Not the longer variable name.
This commit is contained in:
Sybren A. Stüvel 2019-04-18 11:07:36 +02:00
parent b0f7719add
commit 97ad8bf5ba

View File

@ -19,7 +19,7 @@ class Manager(List, Find):
items = self.path_replacement.to_dict().items() items = self.path_replacement.to_dict().items()
def by_length(item): def by_length(item):
return -len(item[0]), item[0] return -len(item[1]), item[1]
this_platform = platform.system().lower() this_platform = platform.system().lower()
return [(varname, platform_replacements[this_platform]) return [(varname, platform_replacements[this_platform])