Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
3
u1‘Wô, ã @ sì d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl Z ddl
Z
ddlmZ ddlm
Z
d d
„ Ze
jejƒG dd„ deƒƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )zš
pyudev.discover
===============
Tools to discover a device given limited information.
.. moduleauthor:: mulhern
é )Úabsolute_import)Údivision)Úprint_function)Úunicode_literalsN)ÚDevices)ÚDeviceNotFoundErrorc s t jˆ ƒ‡ fdd„ƒ}|S )z\
Allow Device discovery methods to return None instead of raising an
exception.
c s$ y
ˆ | |ŽS t k
r dS X dS )z‘
Returns result of calling ``func`` on ``args``, ``kwargs``.
Returns None if ``func`` raises :exc:`DeviceNotFoundError`.
N)r )ÚargsÚkwargs)Úfunc© ú/usr/lib/python3.6/discover.pyÚthe_func1 s
z wrap_exception..the_func)Ú functoolsÚwraps)r
r
r )r
r Úwrap_exception+ s r c @ sL e Zd ZdZeejdd„ ƒƒZeejdd„ ƒƒZedd„ ƒZ edd „ ƒZ
d
S )Ú
HypothesiszM
Represents a hypothesis about the meaning of the device identifier.
c C s
t ƒ ‚dS )aì
Match the given string according to the hypothesis.
The purpose of this method is to obtain a value corresponding to
``value`` if that is possible. It may use a regular expression, but
in general it should just return ``value`` and let the lookup method
sort out the rest.
:param str value: the string to inspect
:returns: the matched thing or None if unmatched
:rtype: the type of lookup's key parameter or NoneType
N)ÚNotImplementedError)ÚclsÚvaluer r r ÚmatchD s zHypothesis.matchc C s
t ƒ ‚dS )aN
Lookup the given string according to the hypothesis.
:param Context context: the pyudev context
:param key: a key with which to lookup the device
:type key: the type of match's return value if not None
:returns: a list of Devices obtained
:rtype: frozenset of :class:`Device`
N)r )r ÚcontextÚkeyr r r ÚlookupU s zHypothesis.lookupc C s dS )zé
A potentially expensive method that may allow an :class:`Hypothesis`
to find devices more rapidly or to find a device that it would
otherwise miss.
:param Context context: the pyudev context
Nr )r r r r r Úsetupc s zHypothesis.setupc C s$ | j |ƒ}|dk r| j||ƒS tƒ S )a
Get any devices that may correspond to the given string.
:param Context context: the pyudev context
:param str value: the value to look for
:returns: a list of devices obtained
:rtype: set of :class:`Device`
N)r r Ú frozenset)r r r r r r r Úget_devicesn s
zHypothesis.get_devicesN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚclassmethodÚabcÚabstractmethodr r r r r r r r r > s
r c @ sL e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZedd „ ƒZed
d„ ƒZ dS )
ÚDeviceNumberHypothesisz—
Represents the hypothesis that the device is a device number.
The device may be separated into major/minor number or a composite number.
c C s8 t jdƒ}|j|ƒ}|o6tjt|jdƒƒt|jdƒƒƒS )zÌ
Match the number under the assumption that it is a major,minor pair.
:param str value: value to match
:returns: the device number or None
:rtype: int or NoneType
z#^(?P\d+)(\D+)(?P\d+)$ÚmajorÚminor)ÚreÚcompiler ÚosÚmakedevÚintÚgroup)r r Zmajor_minor_rer r r r Ú_match_major_minorƒ s
z)DeviceNumberHypothesis._match_major_minorc C s&