| Server IP : 192.250.235.158 / Your IP : 216.73.216.143 Web Server : LiteSpeed System : Linux s4099.sgp1.stableserver.net 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64 User : vmxfzbqj ( 1905) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.9/site-packages/usb/__pycache__/ |
Upload File : |
a
j��Yp� � @ s< d Z dZg d�ZddlmZ ddlZddlZddlmZ ddl m
Z
ddlmZ
ddlZddlZddlZddlZe�d�ZdZdd� Zd&dd�Zd'd
d�ZG dd� de�Zdd� ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de�Z"G dd� de�Z#G dd � d e
j$�Z%d(d"d#�Z&d)d$d%�Z'dS )*av usb.core - Core USB features.
This module exports:
Device - a class representing a USB device.
Configuration - a class representing a configuration descriptor.
Interface - a class representing an interface descriptor.
Endpoint - a class representing an endpoint descriptor.
find() - a function to find USB devices.
show_devices() - a function to show the devices present.
zWander Lairson Costa)�Device�
Configuration� Interface�Endpoint�find�show_devices� Nzusb.corei� c C s |D ]}t ||t| |�� qd S �N)�setattr�getattr)�input�output�fields�f� r �,/usr/lib/python3.9/site-packages/usb/core.py� _set_attr= s r � �Error Accessing Stringc C sL |dkr|}n:z(|du r&t �| |�}nt �| ||�}W n |}Y n0 |S )z= try to get a string, but return a string no matter what
r N)�util�
get_string)�dev�indexZlangidZdefault_str_i0Zdefault_access_error�stringr r r �_try_get_stringA s
r c C s( z| | }W n t y" |}Y n0 |S )zS try to get a string from the lookup table, return "" instead of key
error
)�KeyError)�table�value�defaultr r r r �_try_lookupQ s
r c @ s e Zd ZdZdd� ZdS )�_DescriptorInfozc this class is used so that when a descriptor is shown on the
terminal it is propely formatted c C s | S r r ��selfr r r �__repr__^ s z_DescriptorInfo.__repr__N)�__name__�
__module__�__qualname__�__doc__r"