diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-07-24 19:25:13 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-07-24 19:25:13 -0300 |
commit | 07ed8c9950405d55deac35ec5845d161026fd45f (patch) | |
tree | c382146ed77a39503b69a0449de251d08d3a2d8a | |
parent | a1eacb023782f2e4d9528833526f2090195c5a46 (diff) | |
download | finder-07ed8c9950405d55deac35ec5845d161026fd45f.tar.gz finder-07ed8c9950405d55deac35ec5845d161026fd45f.tar.bz2 |
Fix: exit status
-rw-r--r-- | packages/finder/main.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/packages/finder/main.py b/packages/finder/main.py index 30f7f10..130a2e2 100644 --- a/packages/finder/main.py +++ b/packages/finder/main.py @@ -75,14 +75,14 @@ class FinderMain(): def _(event): "Pressing Ctrl-C or Ctrl-Q will exit the user interface." - event.app.exit() + self.finish() @self.keybindings.add("c-d") def _(event): "Pressing Ctrl-D with empty input will exit the user interface" if self.input_field.text is None or self.input_field.text == '': - event.app.exit() + self.finish() @self.keybindings.add("tab") def _(event): @@ -95,7 +95,8 @@ class FinderMain(): @self.keybindings.add("q", filter = has_focus(self.list_buffer)) def _(event): "Pressing 'q' on the selection buffer will exit the user interface" - event.app.exit() + + self.finish() def theme(self): self.style = Style.from_dict({ @@ -216,15 +217,13 @@ class FinderMain(): # Load initial buffer content loader = tg.create_task(self.load()) + return True + def format(self, items): return '\n'.join( sorted( [ item.removeprefix(self.path).removeprefix(os.sep) for item in items ] )) - def finish(self): - # If we have to exit the application depending on the input buffer - # contents - #self.app.exit(result='sometext') - #self.app.exit() - self.app.exit() + def finish(self, result = True): + self.app.exit(result=result) |