symmetric_difference for set, saves the trouble of doing two difference calls
This commit is contained in:
parent
3ee87bbb12
commit
d304e67089
@ -235,8 +235,8 @@ class Userconfig:
|
|||||||
# get temp_file and dest_file, remove comments and whitespaces
|
# get temp_file and dest_file, remove comments and whitespaces
|
||||||
temp_lines = self.sanitize_input(open(temp_file), comment_string)
|
temp_lines = self.sanitize_input(open(temp_file), comment_string)
|
||||||
dest_lines = self.sanitize_input(open(dest_file), comment_string)
|
dest_lines = self.sanitize_input(open(dest_file), comment_string)
|
||||||
# differences of temp_file and dest_file in both directions, if > 0: files differ
|
# differences of temp_file and dest_file in both directions, if != 0: files differ
|
||||||
return len(temp_lines.difference(dest_lines)) + len(dest_lines.difference(temp_lines)) != 0
|
return len(temp_lines.symmetric_difference(dest_lines)) != 0
|
||||||
|
|
||||||
def user_config_generated(self, filename):
|
def user_config_generated(self, filename):
|
||||||
"""returns True if filename has been generated by userconfig, False else"""
|
"""returns True if filename has been generated by userconfig, False else"""
|
||||||
|
Loading…
Reference in New Issue
Block a user