This commit is contained in:
chestm007 2019-02-05 16:49:38 +11:00 committed by GitHub
parent feb2a68172
commit 68dbf4434b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View File

@ -115,18 +115,18 @@ class SettingsBase(metaclass=SettingsBaseMeta):
user_backend = settings_source.get('keyring_backend')
found_settings = dict()
for setting_name in self.__PROTECTED_SETTINGS:
# Nothing to do if the setting is already defined.
if settings_source.get(setting_name):
continue
# Nothing to do if the setting is already defined.
if settings_source.get(setting_name):
continue
setting = None
identifier = "%s.%s" % (self.__name__, setting_name)
if hasattr(self, 'required') and setting_name in getattr(self, 'required'):
setting = self.get_setting_from_keyring(identifier, user_backend)
elif hasattr(self, setting_name):
setting = self.get_setting_from_keyring(identifier, user_backend)
if setting:
found_settings.update({setting_name: setting})
setting = None
identifier = "%s.%s" % (self.__name__, setting_name)
if hasattr(self, 'required') and setting_name in getattr(self, 'required'):
setting = self.get_setting_from_keyring(identifier, user_backend)
elif hasattr(self, setting_name):
setting = self.get_setting_from_keyring(identifier, user_backend)
if setting:
found_settings.update({setting_name: setting})
return found_settings
def get_setting_from_keyring(self, setting_identifier, keyring_backend=None):

View File

@ -564,9 +564,9 @@ def make_glyph(number, glyphs="▁▂▃▄▅▆▇█", lower_bound=0, upper_b
if lower_bound >= upper_bound:
raise Exception("Invalid upper/lower bounds")
elif number <= lower_bound:
return glyphs[0]
return glyphs[0]
elif number >= upper_bound:
return glyphs[-1]
return glyphs[-1]
if enable_boundary_glyphs:
# Trim first and last items from glyphs as boundary conditions already

View File

@ -49,9 +49,9 @@ class Timewarrior(IntervalModule):
self.loadTrack()
if 'end' in self.track and self.enable_continue:
subprocess.check_output(['timew', 'continue'])
subprocess.check_output(['timew', 'continue'])
elif self.enable_stop:
subprocess.check_output(['timew', 'stop'])
subprocess.check_output(['timew', 'stop'])
def run(self):
self.loadTrack()