How to use the ipyfilechooser.utils.get_dir_contents function in ipyfilechooser

To help you get started, we’ve selected a few ipyfilechooser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crahan / ipyfilechooser / ipyfilechooser / filechooser.py View on Github external
)

        # 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(
github crahan / ipyfilechooser / ipyfilechooser / filechooser.py View on Github external
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(

ipyfilechooser

Python file chooser widget for use in Jupyter/IPython in conjunction with ipywidgets

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages