Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
# Set form values
self._pathlist.options = get_subpaths(path)
self._pathlist.value = path
self._filename.value = filename
# file/folder real names
dircontent_real_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=False
)
# file/folder display names
dircontent_display_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=self._use_dir_icons
)
# Dict to map real names to display names
self._map_name_to_disp = {
real_name: disp_name
for real_name, disp_name in zip(
dircontent_real_names,
dircontent_display_names
)
}
# Dict to map display names to real names
self._map_disp_to_name = dict(
self._dircontent.unobserve(
self._on_dircontent_select,
names='value'
)
self._filename.unobserve(
self._on_filename_change,
names='value'
)
# Set form values
self._pathlist.options = get_subpaths(path)
self._pathlist.value = path
self._filename.value = filename
# file/folder real names
dircontent_real_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=False
)
# file/folder display names
dircontent_display_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=self._use_dir_icons
)
# Dict to map real names to display names
self._map_name_to_disp = {
real_name: disp_name
for real_name, disp_name in zip(
# box from automatically triggering a new event.
self._pathlist.unobserve(
self._on_pathlist_select,
names='value'
)
self._dircontent.unobserve(
self._on_dircontent_select,
names='value'
)
self._filename.unobserve(
self._on_filename_change,
names='value'
)
# Set form values
self._pathlist.options = get_subpaths(path)
self._pathlist.value = path
self._filename.value = filename
# file/folder real names
dircontent_real_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=False
)
# file/folder display names
dircontent_display_names = get_dir_contents(
path,
hidden=self._show_hidden,
prepend_icons=self._use_dir_icons
)