HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/serial/__pycache__/__init__.cpython-38.pyc
U

Y�sYd�@s�ddlZddlZddlTdZeZejdkr8ddlmZnhddlZej	dkrXddl
mZnHej	dkrxddlmZmZm
Z
n(ej	d	kr�ddlmZned
�ej	���dgZdd
�ZdS)�N)�*z3.4Zcli)�Serial�nt�posix)r�PosixPollSerial�VTIMESerial�javaz;Sorry: no implementation for your platform ('{}') availablezserial.urlhandlerc	Os�|�dd�}t}z|��}Wntk
r2Yn�Xd|kr�|�dd�d}d�|�}tD]\}zt�|�t�||�}	Wnt	k
r�YqZYqZXt
|	d�r�|	�|�\}}n|	j}q�qZtd�|���|d
|�|�}
||
_
|r�|
��|
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.
    Zdo_not_openFz://�rz.protocol_{}�serial_class_for_urlz$invalid URL, protocol {!r} not knownN)N)�popr�lower�AttributeError�split�format�protocol_handler_packages�	importlib�
import_module�ImportError�hasattrr
�
ValueErrorZport�open)Zurl�args�kwargsZdo_open�klassZ
url_lowercaseZprotocolZmodule_nameZpackage_nameZhandler_module�instance�r�1/usr/lib/python3/dist-packages/serial/__init__.py�serial_for_url)s2



r)�sysrZserial.serialutil�__version__ZVERSION�platformZserial.serialclir�os�nameZserial.serialwin32Zserial.serialposixrrZserial.serialjavarrrrrrrr�<module>
s"



�