usbinfo/darwin.py
def _ioreg(nodename):
        """Run ioreg command on specific node name"""
        cmd = ['ioreg', '-a', '-l', '-r', '-n', nodename]
        output = subprocess.check_output(cmd)
        # ST-Link devices (and possibly others?) erroneously store binary data
        # in the <string> serial number, which causes plistlib to blow up.
        # This will convert that to hex and preserve contents otherwise.
        output = _sanitize_xml(output)
        plist_data = []
        if output:
            try:
                plist_data = plistlib.readPlistFromString(output)
            except AttributeError as e:
                plist_data = plistlib.loads(output)
        return plist_data
Run ioreg command on specific node name
Run ioreg command on specific node name
Run ioreg command on specific node name
def _ioreg(nodename):
        cmd = ['ioreg', '-a', '-l', '-r', '-n', nodename]
        output = subprocess.check_output(cmd)
        output = _sanitize_xml(output)
        plist_data = []
        if output:
            try:
                plist_data = plistlib.readPlistFromString(output)
            except AttributeError as e:
                plist_data = plistlib.loads(output)
        return plist_data
def _ioreg ( nodename ) : cmd = [ 'ioreg' , '-a' , '-l' , '-r' , '-n' , nodename ] output = subprocess . check_output ( cmd ) output = _sanitize_xml ( output ) plist_data = [ ] if output : try : plist_data = plistlib . readPlistFromString ( output ) except AttributeError as e : plist_data = plistlib . loads ( output ) return plist_data
Run ioreg command on specific node name
Run ioreg command on specific node name
"""Run ioreg command on specific node name""" # ST-Link devices (and possibly others?) erroneously store binary data # in the <string> serial number, which causes plistlib to blow up. # This will convert that to hex and preserve contents otherwise.
nodename