def __init__(self, device):
        super(SysFS, self).__init__(device)
        self.name = os.path.basename(device)
        self.usb_device_path = None
        if os.path.exists('/sys/class/tty/%s/device' % (self.name,)):
            self.device_path = os.path.realpath('/sys/class/tty/%s/device' % (self.name,))
            self.subsystem = os.path.basename(os.path.realpath(os.path.join(self.device_path, 'subsystem')))
        else:
            self.device_path = None
            self.subsystem = None
        # check device type
        if self.subsystem == 'usb-serial':
            self.usb_device_path = os.path.dirname(os.path.dirname(self.device_path))
        elif self.subsystem == 'usb':
            self.usb_device_path = os.path.dirname(self.device_path)
        else:
            self.usb_device_path = None
        # fill-in info for USB devices
        if self.usb_device_path is not None:
            self.vid = int(self.read_line(self.usb_device_path, 'idVendor'), 16)
            self.pid = int(self.read_line(self.usb_device_path, 'idProduct'), 16)
            self.serial_number = self.read_line(self.usb_device_path, 'serial')
            self.location = os.path.basename(self.usb_device_path)
            self.manufacturer = self.read_line(self.usb_device_path, 'manufacturer')
            self.product = self.read_line(self.usb_device_path, 'product')
            self.interface = self.read_line(self.device_path, 'interface')

        if self.subsystem in ('usb', 'usb-serial'):
            self.apply_usb_info()
        #~ elif self.subsystem in ('pnp', 'amba'):  # PCI based devices, raspi
        elif self.subsystem == 'pnp':  # PCI based devices
            self.description = self.name
            self.hwid = self.read_line(self.device_path, 'id')
        elif self.subsystem == 'amba':  # raspi
            self.description = self.name
            self.hwid = os.path.basename(self.device_path)
dataset/ETHPy150Open pyserial/pyserial/serial/tools/list_ports_linux.py/SysFS.__init__/original