Skip to content

Commit

Permalink
Added the ability to track the closure of the file manager without se…
Browse files Browse the repository at this point in the history
…lecting content (kivy#667)

* Added the ability to track the closure of the file manager without selecting content
* extracting that duplicate logic to a helper method
  • Loading branch information
Neizvestnyj authored Apr 6, 2022
1 parent 8dc622e commit b2896c0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plyer/platforms/linux/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ def _run_command(self, cmd):
if ret is not None:
if ret == self.successretcode:
out = self._process.communicate()[0].strip().decode('utf8')
self.selection = self._split_output(out)
self._handle_selection(self.selection)
return self.selection
return self._set_and_return_selection(self._split_output(out))
else:
return None
return self._set_and_return_selection(None)
time.sleep(0.1)

def _set_and_return_selection(self, value):
self.selection = value
self._handle_selection(value)
return value

def _split_output(self, out):
'''This methods receives the output of the back-end and turns
it into a list of paths.
Expand Down

0 comments on commit b2896c0

Please sign in to comment.