Example #1
0
    def _repr__base(self, rich_output=False):
        """
        Representation of the object

        :param rich_output: if True, generates HTML, otherwise text
        :return: the representation
        """

        # Make a dictionary which will then be transformed in a list

        repr_dict = collections.OrderedDict()

        key = '%s (extended source)' % self.name

        repr_dict[key] = collections.OrderedDict()
        repr_dict[key]['shape'] = self._spatial_shape.to_dict(minimal=True)
        repr_dict[key]['spectrum'] = collections.OrderedDict()

        for component_name, component in self.components.iteritems():
            repr_dict[key]['spectrum'][component_name] = component.to_dict(minimal=True)

        return dict_to_list(repr_dict, rich_output)
Example #2
0
    def _repr__base(self, rich_output=False):
        """
        Representation of the object

        :param rich_output: if True, generates HTML, otherwise text
        :return: the representation
        """

        # Make a dictionary which will then be transformed in a list

        repr_dict = collections.OrderedDict()

        key = '%s (extended source)' % self.name

        repr_dict[key] = collections.OrderedDict()
        repr_dict[key]['shape'] = self._spatial_shape.to_dict(minimal=True)
        repr_dict[key]['spectrum'] = collections.OrderedDict()

        for component_name, component in self.components.iteritems():
            repr_dict[key]['spectrum'][component_name] = component.to_dict(minimal=True)

        return dict_to_list(repr_dict, rich_output)
Example #3
0
    def _repr__base(self, rich_output):

        return dict_to_list(self._units, html=rich_output)
Example #4
0
    def _repr__base(self, rich_output):

        return dict_to_list(self._units, html=rich_output)