Fix system resume event in inquirer prompt

This commit is contained in:
Cédric Leporcq 2021-12-05 14:11:28 +01:00
parent da4a388697
commit d55fc63a41
2 changed files with 11 additions and 2 deletions

View File

@ -427,7 +427,11 @@ class Paths:
default=self.paths_list,
),
]
return inquirer.prompt(questions, theme=self.theme)['selection']
prompt = inquirer.prompt(questions, theme=self.theme)
if prompt:
return prompt['selection']
sys.exit()
def get_paths_list(self, path):
self.paths_list = list(self.get_files(path))

View File

@ -301,9 +301,11 @@ class Media(ReadExif):
default=default,
),
]
# import ipdb; ipdb.set_trace()
answers = inquirer.prompt(choices_list, theme=self.theme)
if not answers:
sys.exit()
if not answers['date_list']:
prompt = [
inquirer.Text('date_custom', message="date"),
@ -414,6 +416,9 @@ class Media(ReadExif):
]
answers = inquirer.prompt(choices_list, theme=self.theme)
if not answers:
sys.exit()
if not answers['album']:
answers = inquirer.prompt(prompt, theme=self.theme)
return answers['custom']