Print itself, only display attributes defined in
        :attr:`ExtendedBase._settings_major_attrs`
439805
def glance(self):  # pragma: no cover
        
        if self._settings_major_attrs is None:
            msg = ("Please specify attributes you want to include "
                   "in `class._settings_major_attrs`!")
            raise NotImplementedError(msg)

        kwargs = [
            (attr, getattr(self, attr))
            for attr in self._settings_major_attrs
        ]

        text = "{classname}({kwargs})".format(
            classname=self.__class__.__name__,
            kwargs=", ".join([
                "%s=%r" % (attr, value)
                for attr, value in kwargs
            ])
        )

        print(text)
1160648
def _AssAttr(self, t):
        
        self._dispatch(t.expr)
        self._write('.'+t.attrname)
1260076
def build_attr(self, attrs):
        
        """
        attrs = sorted(attrs.iteritems(), key=lambda x: x[0])
        return ' '.join(map(lambda x: '%s="%s"' % x, attrs))
278693
def do_attr(self, args):
        

        if not self.current:
            print('There are no resources in use. Use the command "open".')
            return

        args = args.strip()

        if not args:
            self.print_attribute_list()
            return

        args = args.split(' ')

        if len(args) > 2:
            print('Invalid syntax, use `attr <name>` to get; or `attr <name> <value>` to set')
        elif len(args) == 1:
            # Get
            attr_name = args[0]
            if attr_name.startswith('VI_'):
                try:
                    print(self.current.get_visa_attribute(getattr(constants, attr_name)))
                except Exception as e:
                    print(e)
            else:
                try:
                    print(getattr(self.current, attr_name))
                except Exception as e:
                    print(e)
        else:
            attr_name, attr_state = args[0], args[1]
            if attr_name.startswith('VI_'):
                try:
                    attributeId = getattr(constants, attr_name)
                    attr = attributes.AttributesByID[attributeId]
                    datatype = attr.visa_type
                    retcode = None
                    if datatype == 'ViBoolean':
                        if attr_state == 'True':
                            attr_state = True
                        elif attr_state == 'False':
                            attr_state = False
                        else:
                            retcode = constants.StatusCode.error_nonsupported_attribute_state
                    elif datatype in ['ViUInt8', 'ViUInt16', 'ViUInt32', 'ViInt8', 'ViInt16', 'ViInt32']:
                        try:
                            attr_state = int(attr_state)
                        except ValueError:
                            retcode = constants.StatusCode.error_nonsupported_attribute_state
                    if not retcode:
                        retcode = self.current.set_visa_attribute(attributeId, attr_state)
                    if retcode:
                        print('Error {}'.format(str(retcode)))
                    else:
                        print('Done')
                except Exception as e:
                    print(e)
            else:
                print('Setting Resource Attributes by python name is not yet supported.')
                return
                try:
                    print(getattr(self.current, attr_name))
                    print('Done')
                except Exception as e:
                    print(e)
332452
def cprint(text, color=None, on_color=None, attrs=None, **kwargs):
    
    try:
        print((colored(text, color, on_color, attrs)), **kwargs)
    except TypeError:
        # flush is not supported by py2.7
        kwargs.pop("flush", None)
        print((colored(text, color, on_color, attrs)), **kwargs)
1076483
def _attributeStrs(self):
        
        return ";".join([self._attributeStr(name)
                         for name in self.attributes.iterkeys()])
883317
def htmlprint(*values, plain=None, **options):
    
    print(*[htmlrender(x, plain=plain) for x in values], **options)
667664
def get_attr_text(self):
        """"""
        return ' '.join([
            '{}="{}"'.format(key, value)
            for key, value in self.attr.items()
        ])
959264
def get_attr(self):
        
        self.values = getattr(self.attrs, self.kind_attr, None)
        self.dtype = getattr(self.attrs, self.dtype_attr, None)
        self.meta = getattr(self.attrs, self.meta_attr, None)
        self.set_kind()
1097075
def display_dp_matrix_attr(dp_matrix, attr_name):
    

    print()
    print("---------- {:s} ----------".format(attr_name))
    for dp_list in dp_matrix:
        print([getattr(dp, attr_name) for dp in dp_list])
612351
def show_attrs(key, calc_id=-1):
    
    ds = util.read(calc_id)
    try:
        attrs = h5py.File.__getitem__(ds.hdf5, key).attrs
    except KeyError:
        print('%r is not in %s' % (key, ds))
    else:
        if len(attrs) == 0:
            print('%s has no attributes' % key)
        for name, value in attrs.items():
            print(name, value)
    finally:
        ds.close()
989227
def printed_out(self, name):
        
        opt = self.variables().optional_namestring()
        req = self.variables().required_namestring()
        out = ''
        out += '|   |\n'
        out += '|   |---{}({}{})\n'.format(name, req, opt)
        if self.description:
            out += '|   |       {}\n'.format(self.description)
        return out
1238573
def _printClassDomain(self, hrlinetop=True, print_inferred=False):
        
        if not self.currentEntity:  # ==> ontology level
            return
        x = self.currentEntity['object']
        if self.currentEntity['type'] == 'class':
            if hrlinetop:
                self._print("----------------")
            self._print("DOMAIN OF:", "IMPORTANT")
            self._print("[%d] Explicitly declared" % len(x.domain_of), "IMPORTANT")
            for i in x.domain_of:
                if i.ranges:
                    ranges = ",".join([y.qname if hasattr(y, "qname") else str(y)
                                       for y in i.ranges])
                else:
                    ranges = "owl:Thing"
                    # print( Style.RESET_ALL + " => " + Fore.MAGENTA +
                print(Fore.GREEN + x.qname + Style.RESET_ALL + " => " + Fore.MAGENTA +
                      i.qname + Style.RESET_ALL + " => " + Style.DIM + ranges +
                      Style.RESET_ALL)

            # inferred stuff
            if print_inferred:
                for _dict in x.domain_of_inferred:
                    _class = list(_dict.items())[0][0]
                    _propslist = list(_dict.items())[0][1]
                    if _class.id != x.id and len(_propslist):  # print only inferred properties
                        self._print("[%d] Inherited from [%s]" % (len(_propslist), _class.qname),
                                    "IMPORTANT")
                        for i in _propslist:
                            if i.ranges:
                                ranges = ",".join([y.qname if hasattr(y, "qname")
                                                   else str(y) for y in i.ranges])
                            else:
                                ranges = "owl:Thing"
                                # print(Style.RESET_ALL + " => " + Fore.MAGENTA +
                            print(Fore.GREEN + x.qname + Style.RESET_ALL + " => " + Fore.MAGENTA +
                                  i.qname + Style.RESET_ALL + " => " + Style.DIM +
                                  ranges + Style.RESET_ALL)

            self._print("----------------")
        return
831886
private void encodeAttributes(List attributes, PrintStream out,
                                  Indenter indenter) {
        Iterator it = attributes.iterator();
        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());
            attr.encode(out, indenter);
        }
    }
1290164
def display_col_dp(dp_list, attr_name):
    

    print()
    print("---------- {:s} ----------".format(attr_name))
    print([getattr(dp, attr_name) for dp in dp_list])
70407
def _generate_dom_attrs(attrs, allow_no_value=True):
    
    for attr in iterate_items(attrs):
        if isinstance(attr, basestring):
            attr = (attr, True)
        key, value = attr
        if value is None:
            continue
        if value is True and not allow_no_value:
            value = key  # E.g. <option checked="true" />
        if value is True:
            yield True  # E.g. <option checked />
        else:
            yield '%s="%s"' % (key, value.replace('"', '\\"'))
368095
def set_attr(self):
        
        setattr(self.attrs, self.kind_attr, self.values)
        setattr(self.attrs, self.meta_attr, self.meta)
        if self.dtype is not None:
            setattr(self.attrs, self.dtype_attr, self.dtype)