| Server IP : 62.171.151.215 / Your IP : 216.73.217.53 Web Server : nginx/1.18.0 System : Linux vmi3128365 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64 User : alex ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/serial/__pycache__/ |
Upload File : |
o
/�_� � @ s� d dl mZ d dlZd dlZd dlT dZeZejdkr"d dlm Z n4d dl
Z
e
jdkr2d dlm Z n$e
jdkrBd d l
m Z mZmZ ne
jd
krNd dlm Z ned�e
j���dgZd
d� ZdS )� )�absolute_importN)�*z3.5�cli)�Serial�nt�posix)r �PosixPollSerial�VTIMESerial�javaz;Sorry: no implementation for your platform ('{}') availablezserial.urlhandlerc O s� |� dd� }t}z| �� }W n ty Y nFw d|v r^|�dd�d }d�|�}tD ]*}z
t�|� t�||�} W n t yD Y q,w t
| d�rR| �| �\} }n| j} ntd�|���|d g|�R i |��}
| |
_
|rr|
�� |
S )
a� Get an instance of the Serial class, depending on port/url. The port is not
opened when the keyword parameter 'do_not_open' is true, by default it
is. All other parameters are directly passed to the __init__ method when
the port is instantiated.
The list of package names that is searched for protocol handlers is kept in
``protocol_handler_packages``.
e.g. we want to support a URL ``foobar://``. A module
``my_handlers.protocol_foobar`` is provided by the user. Then
``protocol_handler_packages.append("my_handlers")`` would extend the search
path so that ``serial_for_url("foobar://"))`` would work.
�do_not_openFz://� r z.protocol_{}�serial_class_for_urlz$invalid URL, protocol {!r} not knownN)�popr �lower�AttributeError�split�format�protocol_handler_packages� importlib�
import_module�ImportError�hasattrr
�
ValueError�port�open)�url�args�kwargs�do_open�klass�
url_lowercase�protocol�module_name�package_name�handler_module�instance� r&