예제 #1
0
    def get_debug_info():
        """Return a list of lines with backend info.
        """
        from pyvisa import __version__
        d = OrderedDict()
        d['Version'] = '%s (bundled with PyVISA)' % __version__

        paths = NIVisaLibrary.get_library_paths()

        for ndx, visalib in enumerate(paths, 1):
            nfo = OrderedDict()
            nfo['found by'] = visalib.found_by
            nfo['bitness'] = visalib.bitness
            try:
                lib = NIVisaLibrary(visalib)
                sess, _ = lib.open_default_resource_manager()
                nfo['Vendor'] = str(lib.get_attribute(sess, constants.VI_ATTR_RSRC_MANF_NAME)[0])
                nfo['Impl. Version'] = str(lib.get_attribute(sess, constants.VI_ATTR_RSRC_IMPL_VERSION)[0])
                nfo['Spec. Version'] = str(lib.get_attribute(sess, constants.VI_ATTR_RSRC_SPEC_VERSION)[0])
                lib.close(sess)
            except Exception as e:
                e = str(e)
                if 'No matching architecture' in e:
                    nfo['Could not get more info'] = 'Interpreter and library have different bitness.'
                else:
                    nfo['Could not get more info'] = str(e).split('\n')

            d['#%d: %s' % (ndx, visalib)] = nfo

        if not paths:
            d['Binary library'] = 'Not found'

        return d
예제 #2
0
    def get_debug_info():
        """Return a list of lines with backend info.
        """
        from . import __version__
        from .parser import SPEC_VERSION
        d = OrderedDict()
        d['Version'] = '%s' % __version__
        d['Spec version'] = SPEC_VERSION

        return d
예제 #3
0
    def get_debug_info():
        """Return a list of lines with backend info.
        """
        from . import __version__
        d = OrderedDict()
        d['Version'] = '%s' % __version__

        for key, val in PyVisaLibrary.get_session_classes().items():
            key_name = '%s %s' % (key[0].name.upper(), key[1])
            try:
                d[key_name] = getattr(val, 'session_issue').split('\n')
            except AttributeError:
                d[key_name] = 'Available ' + val.get_low_level_info()

        return d