🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-07 22:55:58 | PHP 8.2.32
📂
/ (Root)
/
usr
/
lib
/
python3.6
/
site-packages
/
serial
/
tools
/
__pycache__
📍 /usr/lib/python3.6/site-packages/serial/tools/__pycache__
🔄 Refresh
✏️
Editing: list_ports_common.cpython-36.opt-1.pyc
Read Only
3 M�]W� � @ s8 d dl Z dd� ZG dd� de�Zedkr4eed�� dS )� Nc C sN g }xDt jd| �D ]4}|ryt|�}W n tk r: Y nX |j|� qW |S )zc Convert string into a list of texts and numbers in order to support a natural sorting. z(\d+))�re�split�int� ValueError�append)�text�result�group� r �'/usr/lib/python3.6/list_ports_common.py�numsplit s r c @ sR e Zd ZdZddd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� ZdS )�ListPortInfoz+Info collection base class for serial portsNc C sF || _ d | _d| _d| _d | _d | _d | _d | _d | _d | _ d | _ d S )Nzn/a)�device�name�description�hwid�vid�pid� serial_number�locationZmanufacturer�product� interface)�selfr r r r �__init__ s zListPortInfo.__init__c C s4 | j dk rdj| j| j �S | jdk r*| jS | jS dS )z8return a short string to name the port based on USB infoNz{} - {})r �formatr r )r r r r �usb_description. s zListPortInfo.usb_descriptionc C s@ dj | j| j| jdk r"dj | j�nd| jdk r:dj | j�nd�S )z9return a string with USB related information about devicezUSB VID:PID={:04X}:{:04X}{}{}Nz SER={}� z LOCATION={})r r r r r )r r r r �usb_info7 s zListPortInfo.usb_infoc C s | j � | _| j� | _dS )z)update description and hwid from USB dataN)r r r r )r r r r �apply_usb_info? s zListPortInfo.apply_usb_infoc C s | j |j kS )N)r )r �otherr r r �__eq__D s zListPortInfo.__eq__c C s t | j�t |j�k S )N)r r )r r r r r �__lt__G s zListPortInfo.__lt__c C s dj | j| j�S )Nz{} - {})r r r )r r r r �__str__J s zListPortInfo.__str__c C s<