Esempio n. 1
0
 def save_namespace(self, filename):
     """Save namespace into filename"""
     ns = self._get_current_namespace()
     settings = self.namespace_view_settings
     data = get_remote_data(ns, settings, mode='picklable',
                            more_excluded_names=EXCLUDED_NAMES).copy()
     return iofunctions.save(data, filename)
Esempio n. 2
0
    def get_var_properties(self):
        """
        Get some properties of the variables in the current
        namespace
        """
        if not IS_EXT_INTERPRETER:
            from spyder.widgets.variableexplorer.utils import get_remote_data
        else:
            from widgets.variableexplorer.utils import get_remote_data

        settings = self.namespace_view_settings
        if settings:
            ns = self._get_current_namespace()
            data = get_remote_data(ns, settings, mode='editable',
                                   more_excluded_names=EXCLUDED_NAMES)

            properties = {}
            for name, value in list(data.items()):
                properties[name] = {
                    'is_list':  isinstance(value, (tuple, list)),
                    'is_dict':  isinstance(value, dict),
                    'is_set': isinstance(value, set),
                    'len': self._get_len(value),
                    'is_array': self._is_array(value),
                    'is_image': self._is_image(value),
                    'is_data_frame': self._is_data_frame(value),
                    'is_series': self._is_series(value),
                    'array_shape': self._get_array_shape(value),
                    'array_ndim': self._get_array_ndim(value)
                }

            return repr(properties)
        else:
            return repr(None)
Esempio n. 3
0
    def get_var_properties(self):
        """
        Get some properties of the variables in the current
        namespace
        """
        settings = self.namespace_view_settings
        if settings:
            ns = self._get_current_namespace()
            data = get_remote_data(ns, settings, mode='editable',
                                   more_excluded_names=EXCLUDED_NAMES)

            properties = {}
            for name, value in list(data.items()):
                properties[name] = {
                    'is_list':  isinstance(value, (tuple, list)),
                    'is_dict':  isinstance(value, dict),
                    'is_set': isinstance(value, set),
                    'len': self._get_len(value),
                    'is_array': self._is_array(value),
                    'is_image': self._is_image(value),
                    'is_data_frame': self._is_data_frame(value),
                    'is_series': self._is_series(value),
                    'array_shape': self._get_array_shape(value),
                    'array_ndim': self._get_array_ndim(value)
                }

            return repr(properties)
        else:
            return repr(None)
Esempio n. 4
0
 def save_namespace(self, filename):
     """Save namespace into filename"""
     ns = self._get_current_namespace()
     settings = self.namespace_view_settings
     data = get_remote_data(ns, settings, mode='picklable',
                            more_excluded_names=EXCLUDED_NAMES).copy()
     return iofunctions.save(data, filename)
Esempio n. 5
0
    def get_var_properties(self):
        """
        Get some properties of the variables in the current
        namespace
        """
        settings = self.namespace_view_settings
        if settings:
            ns = self._get_current_namespace()
            data = get_remote_data(ns, settings, mode='editable',
                                   more_excluded_names=['In', 'Out'])

            properties = {}
            for name, value in list(data.items()):
                properties[name] = {
                    'is_list':  isinstance(value, (tuple, list)),
                    'is_dict':  isinstance(value, dict),
                    'len': self._get_len(value),
                    'is_array': self._is_array(value),
                    'is_image': self._is_image(value),
                    'is_data_frame': self._is_data_frame(value),
                    'is_series': self._is_series(value),
                    'array_shape': self._get_array_shape(value),
                    'array_ndim': self._get_array_ndim(value)
                }

            return properties
        else:
            return {}
Esempio n. 6
0
 def saveglobals(self):
     """Save globals() into filename"""
     ns = self.get_current_namespace()
     from spyder.utils.iofuncs import iofunctions
     settings = read_packet(self.i_request)
     filename = read_packet(self.i_request)
     data = get_remote_data(ns, settings, mode='picklable').copy()
     return iofunctions.save(data, filename)
Esempio n. 7
0
    def save_namespace(self, filename):
        """Save namespace into filename"""
        if not IS_EXT_INTERPRETER:
            from spyder.utils.iofuncs import iofunctions
            from spyder.widgets.variableexplorer.utils import get_remote_data
        else:
            from utils.iofuncs import iofunctions
            from widgets.variableexplorer.utils import get_remote_data

        ns = self._get_current_namespace()
        settings = self.namespace_view_settings
        data = get_remote_data(ns, settings, mode='picklable',
                               more_excluded_names=EXCLUDED_NAMES).copy()
        return iofunctions.save(data, filename)
Esempio n. 8
0
    def save_namespace(self, filename):
        """Save namespace into filename"""
        if not IS_EXT_INTERPRETER:
            from spyder.utils.iofuncs import iofunctions
            from spyder.widgets.variableexplorer.utils import get_remote_data
        else:
            from utils.iofuncs import iofunctions
            from widgets.variableexplorer.utils import get_remote_data

        ns = self._get_current_namespace()
        settings = self.namespace_view_settings
        data = get_remote_data(ns, settings, mode='picklable',
                               more_excluded_names=EXCLUDED_NAMES).copy()
        return iofunctions.save(data, filename)