Update filechooser.py

Modification of function _generate_file_entries (lines 821-831) so as to correct a malfunctioning with ..\ in Windows platforms (it was impossible to go back after having accessed a directory)
This commit is contained in:
jfrancoc 2018-11-15 10:21:15 +01:00 committed by GitHub
parent bcd8887106
commit 9e01c953bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -818,7 +818,15 @@ class FileChooserController(RelativeLayout):
# generate an entries to go back to previous
if not is_root and not have_parent:
back = '..' + sep
pardir = self._create_entry_widget(dict(
if platform == 'win':
new_path = path[:path.rfind(sep)]
if sep not in new_path:
new_path+= sep
pardir = self._create_entry_widget(dict(
name=back, size='', path=new_path, controller=ref(self),
isdir=True, parent=None, sep=sep, get_nice_size=lambda: ''))
else:
pardir = self._create_entry_widget(dict(
name=back, size='', path=back, controller=ref(self),
isdir=True, parent=None, sep=sep, get_nice_size=lambda: ''))
yield 0, 1, pardir