From 9c9a4c6d2b4a939e89963fca2c6e26cd0a3cb18f Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Tue, 4 Jun 2019 22:25:16 +0200 Subject: [PATCH] fix bug with remove and ALL in profiles --- dotdrop/cfg_yaml.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dotdrop/cfg_yaml.py b/dotdrop/cfg_yaml.py index b98b48c..8b84972 100644 --- a/dotdrop/cfg_yaml.py +++ b/dotdrop/cfg_yaml.py @@ -642,16 +642,19 @@ class CfgYaml: self.log.err('key not in dotfiles: {}'.format(df_key)) return False if pro_key not in self.profiles.keys(): - self.log.err('key not in profiles: {}'.format(pro_key)) + self.log.err('key not in profile: {}'.format(pro_key)) return False - profiles = self.yaml_dict[self.key_profiles][pro_key] + # get the profile dictionary + profile = self.yaml_dict[self.key_profiles][pro_key] + if df_key not in profile[self.key_profiles_dotfiles]: + return True if self.debug: - dfs = profiles[self.key_profiles_dotfiles] + dfs = profile[self.key_profiles_dotfiles] self.log.dbg('{} profile dotfiles: {}'.format(pro_key, dfs)) self.log.dbg('remove {} from profile {}'.format(df_key, pro_key)) - profiles[self.key_profiles_dotfiles].remove(df_key) + profile[self.key_profiles_dotfiles].remove(df_key) if self.debug: - dfs = profiles[self.key_profiles_dotfiles] + dfs = profile[self.key_profiles_dotfiles] self.log.dbg('{} profile dotfiles: {}'.format(pro_key, dfs)) self.dirty = True return True