From f58318def80491ee840b5efca1852883b10f9400 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Thu, 19 May 2022 21:50:06 +0200 Subject: [PATCH] remove unused "private" libusb. Since we depend on python3-usb now there is no need to ship our own copy of libusb. Get rid of it. --- silhouette/pyusb-1.0.2/usb/__init__.py | 97 -- silhouette/pyusb-1.0.2/usb/__init__.pyc | Bin 2274 -> 0 bytes silhouette/pyusb-1.0.2/usb/_debug.py | 77 - silhouette/pyusb-1.0.2/usb/_debug.pyc | Bin 2337 -> 0 bytes silhouette/pyusb-1.0.2/usb/_interop.py | 98 -- silhouette/pyusb-1.0.2/usb/_interop.pyc | Bin 1738 -> 0 bytes silhouette/pyusb-1.0.2/usb/_lookup.py | 94 -- silhouette/pyusb-1.0.2/usb/_lookup.pyc | Bin 1748 -> 0 bytes silhouette/pyusb-1.0.2/usb/_objfinalizer.py | 155 -- silhouette/pyusb-1.0.2/usb/_objfinalizer.pyc | Bin 3840 -> 0 bytes .../pyusb-1.0.2/usb/backend/__init__.py | 378 ----- .../pyusb-1.0.2/usb/backend/__init__.pyc | Bin 17687 -> 0 bytes silhouette/pyusb-1.0.2/usb/backend/libusb0.py | 678 --------- .../pyusb-1.0.2/usb/backend/libusb0.pyc | Bin 18254 -> 0 bytes silhouette/pyusb-1.0.2/usb/backend/libusb1.py | 952 ------------ .../pyusb-1.0.2/usb/backend/libusb1.pyc | Bin 28287 -> 0 bytes silhouette/pyusb-1.0.2/usb/backend/openusb.py | 749 ---------- .../pyusb-1.0.2/usb/backend/openusb.pyc | Bin 21494 -> 0 bytes silhouette/pyusb-1.0.2/usb/control.py | 253 ---- silhouette/pyusb-1.0.2/usb/control.pyc | Bin 6707 -> 0 bytes silhouette/pyusb-1.0.2/usb/core.py | 1289 ----------------- silhouette/pyusb-1.0.2/usb/core.pyc | Bin 43477 -> 0 bytes silhouette/pyusb-1.0.2/usb/legacy.py | 355 ----- silhouette/pyusb-1.0.2/usb/legacy.pyc | Bin 14435 -> 0 bytes silhouette/pyusb-1.0.2/usb/libloader.py | 190 --- silhouette/pyusb-1.0.2/usb/libloader.pyc | Bin 5552 -> 0 bytes silhouette/pyusb-1.0.2/usb/util.py | 330 ----- silhouette/pyusb-1.0.2/usb/util.pyc | Bin 11587 -> 0 bytes 28 files changed, 5695 deletions(-) delete mode 100644 silhouette/pyusb-1.0.2/usb/__init__.py delete mode 100644 silhouette/pyusb-1.0.2/usb/__init__.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/_debug.py delete mode 100644 silhouette/pyusb-1.0.2/usb/_debug.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/_interop.py delete mode 100644 silhouette/pyusb-1.0.2/usb/_interop.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/_lookup.py delete mode 100644 silhouette/pyusb-1.0.2/usb/_lookup.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/_objfinalizer.py delete mode 100644 silhouette/pyusb-1.0.2/usb/_objfinalizer.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/__init__.py delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/__init__.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/libusb0.py delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/libusb0.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/libusb1.py delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/libusb1.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/openusb.py delete mode 100644 silhouette/pyusb-1.0.2/usb/backend/openusb.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/control.py delete mode 100644 silhouette/pyusb-1.0.2/usb/control.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/core.py delete mode 100644 silhouette/pyusb-1.0.2/usb/core.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/legacy.py delete mode 100644 silhouette/pyusb-1.0.2/usb/legacy.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/libloader.py delete mode 100644 silhouette/pyusb-1.0.2/usb/libloader.pyc delete mode 100644 silhouette/pyusb-1.0.2/usb/util.py delete mode 100644 silhouette/pyusb-1.0.2/usb/util.pyc diff --git a/silhouette/pyusb-1.0.2/usb/__init__.py b/silhouette/pyusb-1.0.2/usb/__init__.py deleted file mode 100644 index d83be87b..00000000 --- a/silhouette/pyusb-1.0.2/usb/__init__.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -r"""PyUSB - Easy USB access in Python - -This package exports the following modules and subpackages: - - core - the main USB implementation - legacy - the compatibility layer with 0.x version - backend - the support for backend implementations. - control - USB standard control requests. - libloader - helper module for backend library loading. - -Since version 1.0, main PyUSB implementation lives in the 'usb.core' -module. New applications are encouraged to use it. -""" - -import logging -import os - -__author__ = 'Wander Lairson Costa' - -# Use Semantic Versioning, http://semver.org/ -version_info = (1, 0, 2) -__version__ = '%d.%d.%d' % version_info - -__all__ = ['legacy', 'control', 'core', 'backend', 'util', 'libloader'] - -def _setup_log(): - from usb import _debug - logger = logging.getLogger('usb') - debug_level = os.getenv('PYUSB_DEBUG') - - if debug_level is not None: - _debug.enable_tracing(True) - filename = os.getenv('PYUSB_LOG_FILENAME') - - LEVELS = {'debug': logging.DEBUG, - 'info': logging.INFO, - 'warning': logging.WARNING, - 'error': logging.ERROR, - 'critical': logging.CRITICAL} - - level = LEVELS.get(debug_level, logging.CRITICAL + 10) - logger.setLevel(level = level) - - try: - handler = logging.FileHandler(filename) - except: - handler = logging.StreamHandler() - - fmt = logging.Formatter('%(asctime)s %(levelname)s:%(name)s:%(message)s') - handler.setFormatter(fmt) - logger.addHandler(handler) - else: - class NullHandler(logging.Handler): - def emit(self, record): - pass - - # We set the log level to avoid delegation to the - # parent log handler (if there is one). - # Thanks to Chris Clark to pointing this out. - logger.setLevel(logging.CRITICAL + 10) - - logger.addHandler(NullHandler()) - - -_setup_log() - -# We import all 'legacy' module symbols to provide compatibility -# with applications that use 0.x versions. -from usb.legacy import * diff --git a/silhouette/pyusb-1.0.2/usb/__init__.pyc b/silhouette/pyusb-1.0.2/usb/__init__.pyc deleted file mode 100644 index a734742880bc900e5fe3d0a445f4389f413ad105..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2274 zcma)7&2ke*5bj;slD$~iU_#)Ks=2rjsUS!W9H=A}aAe{tA&6uk=(4ri9m``zyUNV0 zjjH4mc?#YuPm%{nzMfs-kPDH$tDc^o{`varQRA<6^x?z$IHmg2#P?5l>?vLu(HQT5 zvXFE@V+fTT(m157LE{ExJ2YOStVME-ZjRR}+n{WdvWT)PlxYQwac&9OC6TDgVL$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debug.py deleted file mode 100644 index 4a6ea09a..00000000 --- a/silhouette/pyusb-1.0.2/usb/_debug.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -__author__ = 'Wander Lairson Costa' - -__all__ = ['methodtrace', 'functiontrace'] - -import logging -import usb._interop as _interop - -_enable_tracing = False - -def enable_tracing(enable): - global _enable_tracing - _enable_tracing = enable - -def _trace_function_call(logger, fname, *args, **named_args): - logger.debug( - # TODO: check if 'f' is a method or a free function - fname + '(' + \ - ', '.join((str(val) for val in args)) + \ - ', '.join((name + '=' + str(val) for name, val in named_args.items())) + ')' - ) - -# decorator for methods calls tracing -def methodtrace(logger): - def decorator_logging(f): - if not _enable_tracing: - return f - def do_trace(*args, **named_args): - # this if is just a optimization to avoid unecessary string formatting - if logging.DEBUG >= logger.getEffectiveLevel(): - fn = type(args[0]).__name__ + '.' + f.__name__ - _trace_function_call(logger, fn, *args[1:], **named_args) - return f(*args, **named_args) - _interop._update_wrapper(do_trace, f) - return do_trace - return decorator_logging - -# decorator for methods calls tracing -def functiontrace(logger): - def decorator_logging(f): - if not _enable_tracing: - return f - def do_trace(*args, **named_args): - # this if is just a optimization to avoid unecessary string formatting - if logging.DEBUG >= logger.getEffectiveLevel(): - _trace_function_call(logger, f.__name__, *args, **named_args) - return f(*args, **named_args) - _interop._update_wrapper(do_trace, f) - return do_trace - return decorator_logging diff --git a/silhouette/pyusb-1.0.2/usb/_debug.pyc b/silhouette/pyusb-1.0.2/usb/_debug.pyc deleted file mode 100644 index 3de7b16fccf3fd20a523e7fbdb223854b194782b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2337 zcmc&#ZEqVz5S~4soj6TNTPRj|Y4QnO5nRHH#0N@+nznptjdT?t1<>i@TN{VVow-{F zBBh^#Xg=`+`ZxIj@I14&Yov-q2nowOo}JyDnSJJ&b?c9-YtNsz_Xjfj1o-_Nqxlvh z7ukn2k_R#hWFJaP@=yxs!CY_2VJQ2d*tTRH$=mWPPOV7ZQDs%~6;-;Dud1>}4^N^l zgS-auO;+Z%-hPyg>!vEV_o~Ka?g|!;toxzLU7ZcAyNda6S`OT}D%CRn6QBOTz&;;) z(3>@gQ;|%Qe-d%6uhMNmO>LPS6gH)caXIn}9V~cz1Wi;lZ$gWACMVP8;QbHc-T1>D zXgg_c52mAda^hZD9GW|O2bPBLNig6~h|$LQ5~FzxfwT@G0iux}5Is~lf!1jt_s@*r zJ2!_!>J-QZawabp+tR}(lMC=;)_uqOMH=?3heZjYhWCl_4|H%~?Ha92rSVo^pEm0);~QEbe>nf zexL9F4HDcmx6B*H2U1pR65y1rtBHT3rjtB#HvPHICKKyBGGQktZ$W6!`ZRcZUAXYE z;*D}UsOrpBbvnc8V;J?h1dU8+Zgj30y_sHDBP1-Uw`nY1{-Rh3_Q*%v=oz|k<^N_V zQC=|gQ%qjM(3lJb2hWw0Gs?Y;g2bU8(Oq(r;&qB11^JU~LU{ZZB=S?O-=)c;m3|0c z4arT?Y%WnIc^kIm7Q~Y8f6EQ6@g96FQ=$FeP=R3Gqw5(J)*}9`>w}o4*%bfob((7H zVpb4VRBit|M^!#8>|H|I VT!ZKY>%qF&2s%MG>~^~we*qr}gk=B# diff --git a/silhouette/pyusb-1.0.2/usb/_interop.py b/silhouette/pyusb-1.0.2/usb/_interop.py deleted file mode 100644 index cf7d80c9..00000000 --- a/silhouette/pyusb-1.0.2/usb/_interop.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -# All the hacks necessary to assure compatibility across all -# supported versions come here. -# Please, note that there is one version check for each -# hack we need to do, this makes maintenance easier... ^^ - -import sys -import array - -__all__ = ['_reduce', '_set', '_next', '_update_wrapper'] - -# we support Python >= 2.4 -assert sys.hexversion >= 0x020400f0 - -# On Python 3, reduce became a functools module function -try: - import functools - _reduce = functools.reduce -except (ImportError, AttributeError): - _reduce = reduce - -# all, introduced in Python 2.5 -try: - _all = all -except NameError: - _all = lambda iter_ : _reduce( lambda x, y: x and y, iter_, True ) - -# we only have the builtin set type since 2.5 version -try: - _set = set -except NameError: - import sets - _set = sets.Set - -# On Python >= 2.6, we have the builtin next() function -# On Python 2.5 and before, we have to call the iterator method next() -def _next(iter): - try: - return next(iter) - except NameError: - return iter.next() - -# functools appeared in 2.5 -try: - import functools - _update_wrapper = functools.update_wrapper -except (ImportError, AttributeError): - def _update_wrapper(wrapper, wrapped): - wrapper.__name__ = wrapped.__name__ - wrapper.__module__ = wrapped.__module__ - wrapper.__doc__ = wrapped.__doc__ - wrapper.__dict__ = wrapped.__dict__ - -# this is used (as of May 2015) twice in core, once in backend/openusb, and in -# some unit test code. It would probably be clearer if written in terms of some -# definite 3.2+ API (bytearrays?) with a fallback provided for 2.4+. -def as_array(data=None): - if data is None: - return array.array('B') - - if isinstance(data, array.array): - return data - - try: - return array.array('B', data) - except TypeError: - # When you pass a unicode string or a character sequence, - # you get a TypeError if the first parameter does not match - a = array.array('B') - a.fromstring(data) # deprecated since 3.2 - return a diff --git a/silhouette/pyusb-1.0.2/usb/_interop.pyc b/silhouette/pyusb-1.0.2/usb/_interop.pyc deleted file mode 100644 index 12f53a437ad1d69a4f20784bb4c3e0e2ccf0b4f4..0000000000000000000000000000000000000000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mI`#kn diff --git a/silhouette/pyusb-1.0.2/usb/_lookup.py b/silhouette/pyusb-1.0.2/usb/_lookup.py deleted file mode 100644 index eec882e5..00000000 --- a/silhouette/pyusb-1.0.2/usb/_lookup.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (C) 2009-2014 Walker Inman -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -r"""usb._lookups - Lookup tables for USB -""" - -descriptors = { - 0x1 : "Device", - 0x2 : "Configuration", - 0x3 : "String", - 0x4 : "Interface", - 0x5 : "Endpoint", - 0x6 : "Device qualifier", - 0x7 : "Other speed configuration", - 0x8 : "Interface power", - 0x9 : "OTG", - 0xA : "Debug", - 0xB : "Interface association", - 0xC : "Security", - 0xD : "Key", - 0xE : "Encryption type", - 0xF : "Binary device object store (BOS)", - 0x10 : "Device capability", - 0x11 : "Wireless endpoint companion", - 0x30 : "SuperSpeed endpoint companion", - } - -device_classes = { - 0x0 : "Specified at interface", - 0x2 : "Communications Device", - 0x9 : "Hub", - 0xF : "Personal Healthcare Device", - 0xDC : "Diagnostic Device", - 0xE0 : "Wireless Controller", - 0xEF : "Miscellaneous", - 0xFF : "Vendor-specific", - } - -interface_classes = { - 0x0 : "Reserved", - 0x1 : "Audio", - 0x2 : "CDC Communication", - 0x3 : "Human Interface Device", - 0x5 : "Physical", - 0x6 : "Image", - 0x7 : "Printer", - 0x8 : "Mass Storage", - 0x9 : "Hub", - 0xA : "CDC Data", - 0xB : "Smart Card", - 0xD : "Content Security", - 0xE : "Video", - 0xF : "Personal Healthcare", - 0xDC : "Diagnostic Device", - 0xE0 : "Wireless Controller", - 0xEF : "Miscellaneous", - 0xFE : "Application Specific", - 0xFF : "Vendor Specific", - } - -ep_attributes = { - 0x0 : "Control", - 0x1 : "Isochronous", - 0x2 : "Bulk", - 0x3 : "Interrupt", - } - -MAX_POWER_UNITS_USB2p0 = 2 # mA -MAX_POWER_UNITS_USB_SUPERSPEED = 8 # mA diff --git a/silhouette/pyusb-1.0.2/usb/_lookup.pyc b/silhouette/pyusb-1.0.2/usb/_lookup.pyc deleted file mode 100644 index 044cca00932199b94d39e0f8715670badaa6651e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1748 zcmah}+j1L45N%nu>?m>KTp?G6OF#iEI|j@xB(WtCyTGx^8z+=rwnp1ydB|#KnVAix z58x;AZ9MP?Jn#;5?<^7l7g*&!(oEmZ>E5mXw%mOAa$%4_^;ai+NdNAq8UO+e0Q3dG z8sHpkVjXavU;(f}un4$Ba0;+Va2oIo!7|`kf^&c?1m^)S5L^VjL~t4K3c+iDuM=Da zyhd;x@CLz6z*_`w01ARP0pB8c8}J?29MnKB0p13Dm(Jb`J+wmRJ0a|Szz^u|L%>yn zHsBh;I^bQ3o&!zwH$wDBfyl=p$tQuxW?=AXVDMRB@OfZR)%hYY_%blK7h3-+w0{3T zdUyc%kXqRat<*u!18#>_I-!+rXr))SGN9{u7?8j#FlYdN4N>b6kK;C(!VTMTYRvN@ zcVbn1TYeK>4pZgCk+I@1+HU#=d3MzcohVHs1iwtCW3nSXDy;O{WO|N|*)8%`XCuus z_ovA0W?tDNNs;q>v_z(tVQzHh^#c8HD`Y}$@k1d~eWaDuoXK4!v+s|U6)sl_Me<6; zMRqwyW?Dhy=0}R<5}xbtKY66N1i-nQfg(I}uoFCCu=9m3ZO2u}ZYI_oF+S8+PZ( zRFo5$%b`xW6bs?5lX<4CBKe(Al~BZdoXd=L=1_N&OjP8`Mx`z%xUI9>6?V&2!jhtp zUXbS1Ea)ca&@tn2k?Ex5??mXTB)n4$-8FLSE9*=qQ?a9D>W>piT!LHRq2(wu&g-N) z)jxCYi)5xeXjQy5X-dQSh0e?M+0!mjX(}^i3a5YN7}n+~kui3a2F`6K`VaQ!i5w`W z>wPby3YI z(ZAEh-&B}hlpR(gdfw4pTG?Z3GLp{oW3^qR&u34YEpq?3#jMJ}I7XAiaT$opC06Ie z&3Rs0EEhFSQlhM!=k1y<$@G-hUgfd$^k@$YPkyZN-qv?5#>z1v=IZ>-U`wd$qR&L`#g?~M%>sk+bU dT}GxcSFbJp@26S+r`NwvPR=s(Yt|dJKLOKbqc8vf diff --git a/silhouette/pyusb-1.0.2/usb/_objfinalizer.py b/silhouette/pyusb-1.0.2/usb/_objfinalizer.py deleted file mode 100644 index de88769f..00000000 --- a/silhouette/pyusb-1.0.2/usb/_objfinalizer.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2014 André Erdmann -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -import sys - -__all__ = ['AutoFinalizedObject'] - - -class _AutoFinalizedObjectBase(object): - """ - Base class for objects that get automatically - finalized on delete or at exit. - """ - - def _finalize_object(self): - """Actually finalizes the object (frees allocated resources etc.). - - Returns: None - - Derived classes should implement this. - """ - pass - - def __new__(cls, *args, **kwargs): - """Creates a new object instance and adds the private finalizer - attributes to it. - - Returns: new object instance - - Arguments: - * *args, **kwargs -- ignored - """ - instance = super(_AutoFinalizedObjectBase, cls).__new__(cls) - instance._finalize_called = False - return instance - - def _do_finalize_object(self): - """Helper method that finalizes the object if not already done. - - Returns: None - """ - if not self._finalize_called: # race-free? - self._finalize_called = True - self._finalize_object() - - def finalize(self): - """Finalizes the object if not already done. - - Returns: None - """ - # this is the "public" finalize method - raise NotImplementedError( - "finalize() must be implemented by AutoFinalizedObject." - ) - - def __del__(self): - self.finalize() - - -if sys.hexversion >= 0x3040000: - # python >= 3.4: use weakref.finalize - import weakref - - def _do_finalize_object_ref(obj_ref): - """Helper function for weakref.finalize() that dereferences a weakref - to an object and calls its _do_finalize_object() method if the object - is still alive. Does nothing otherwise. - - Returns: None (implicit) - - Arguments: - * obj_ref -- weakref to an object - """ - obj = obj_ref() - if obj is not None: - # else object disappeared - obj._do_finalize_object() - - - class AutoFinalizedObject(_AutoFinalizedObjectBase): - - def __new__(cls, *args, **kwargs): - """Creates a new object instance and adds the private finalizer - attributes to it. - - Returns: new object instance - - Arguments: - * *args, **kwargs -- passed to the parent instance creator - (which ignores them) - """ - # Note: Do not pass a (hard) reference to instance to the - # finalizer as func/args/kwargs, it'd keep the object - # alive until the program terminates. - # A weak reference is fine. - # - # Note 2: When using weakrefs and not calling finalize() in - # __del__, the object may already have disappeared - # when weakref.finalize() kicks in. - # Make sure that _finalizer() gets called, - # i.e. keep __del__() from the base class. - # - # Note 3: the _finalize_called attribute is (probably) useless - # for this class - instance = super(AutoFinalizedObject, cls).__new__( - cls, *args, **kwargs - ) - - instance._finalizer = weakref.finalize( - instance, _do_finalize_object_ref, weakref.ref(instance) - ) - - return instance - - def finalize(self): - """Finalizes the object if not already done.""" - self._finalizer() - - -else: - # python < 3.4: keep the old behavior (rely on __del__), - # but don't call _finalize_object() more than once - - class AutoFinalizedObject(_AutoFinalizedObjectBase): - - def finalize(self): - """Finalizes the object if not already done.""" - self._do_finalize_object() diff --git a/silhouette/pyusb-1.0.2/usb/_objfinalizer.pyc b/silhouette/pyusb-1.0.2/usb/_objfinalizer.pyc deleted file mode 100644 index b88b9ac60485f2974c6f0d502bfb8eee376d8541..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3840 zcmcInU2oh(6dl{yO*gcpfYcUv=un_?qIL^Z;-MhaG$o=hTgl;tfMhxLY}Sd_UU_Dl z2Bj}epUWenKZZZW4}f#VADgBNqzzb^yVv8HJ9qA!d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pyusb-1.0.2/usb/backend/__init__.py deleted file mode 100644 index 3a4d4d77..00000000 --- a/silhouette/pyusb-1.0.2/usb/backend/__init__.py +++ /dev/null @@ -1,378 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -r"""usb.backend - Backend interface. - -This module exports: - -IBackend - backend interface. - -Backends are Python objects which implement the IBackend interface. -The easiest way to do so is inherinting from IBackend. - -PyUSB already provides backends for libusb versions 0.1 and 1.0, -and OpenUSB library. Backends modules included with PyUSB are required to -export the get_backend() function, which returns an instance of a backend -object. You can provide your own customized backend if you -want to. Below you find a skeleton of a backend implementation module: - -import usb.backend - -class MyBackend(usb.backend.IBackend): - pass - -def get_backend(): - return MyBackend() - -You can use your customized backend by passing it as the backend parameter of the -usb.core.find() function. For example: - -import custom_backend -import usb.core - -myidVendor = 0xfffe -myidProduct = 0x0001 - -mybackend = custom_backend.get_backend() - -dev = usb.core.find(backend = mybackend, idProduct=myidProduct, - idVendor=myidVendor) - -For custom backends, you are not required to supply the get_backend() function, -since the application code will instantiate the backend. - -If you do not provide a backend to the find() function, it will use one of the -defaults backend according to its internal rules. For details, consult the -find() function documentation. -""" - -import usb._objfinalizer as _objfinalizer - -__author__ = 'Wander Lairson Costa' - -__all__ = ['IBackend', 'libusb01', 'libusb10', 'openusb'] - -def _not_implemented(func): - raise NotImplementedError(func.__name__) - -class IBackend(_objfinalizer.AutoFinalizedObject): - r"""Backend interface. - - IBackend is the basic interface for backend implementations. By default, - the methods of the interface raise a NotImplementedError exception. A - backend implementation should replace the methods to provide the funcionality - necessary. - - As Python is a dynamic typed language, you are not obligated to inherit from - IBackend: everything that behaves like an IBackend is an IBackend. But you - are strongly recommended to do so, inheriting from IBackend provides consistent - default behavior. - """ - - def enumerate_devices(self): - r"""This function is required to return an iterable object which - yields an implementation defined device identification for each - USB device found in the system. - - The device identification object is used as argument to other methods - of the interface. - """ - _not_implemented(self.enumerate_devices) - - def get_device_descriptor(self, dev): - r"""Return the device descriptor of the given device. - - The object returned is required to have all the Device Descriptor - fields accessible as member variables. They must be convertible (but - not required to be equal) to the int type. - - dev is an object yielded by the iterator returned by the enumerate_devices() - method. - """ - _not_implemented(self.get_device_descriptor) - - def get_configuration_descriptor(self, dev, config): - r"""Return a configuration descriptor of the given device. - - The object returned is required to have all the Configuration Descriptor - fields acessible as member variables. They must be convertible (but - not required to be equal) to the int type. - - The dev parameter is the device identification object. - config is the logical index of the configuration (not the bConfigurationValue - field). By "logical index" we mean the relative order of the configurations - returned by the peripheral as a result of GET_DESCRIPTOR request. - """ - _not_implemented(self.get_configuration_descriptor) - - def get_interface_descriptor(self, dev, intf, alt, config): - r"""Return an interface descriptor of the given device. - - The object returned is required to have all the Interface Descriptor - fields accessible as member variables. They must be convertible (but - not required to be equal) to the int type. - - The dev parameter is the device identification object. - The intf parameter is the interface logical index (not the bInterfaceNumber field) - and alt is the alternate setting logical index (not the bAlternateSetting value). - Not every interface has more than one alternate setting. In this case, the alt - parameter should be zero. config is the configuration logical index (not the - bConfigurationValue field). - """ - _not_implemented(self.get_interface_descriptor) - - def get_endpoint_descriptor(self, dev, ep, intf, alt, config): - r"""Return an endpoint descriptor of the given device. - - The object returned is required to have all the Endpoint Descriptor - fields acessible as member variables. They must be convertible (but - not required to be equal) to the int type. - - The ep parameter is the endpoint logical index (not the bEndpointAddress - field) of the endpoint descriptor desired. dev, intf, alt and config are the same - values already described in the get_interface_descriptor() method. - """ - _not_implemented(self.get_endpoint_descriptor) - - def open_device(self, dev): - r"""Open the device for data exchange. - - This method opens the device identified by the dev parameter for communication. - This method must be called before calling any communication related method, such - as transfer methods. - - It returns a handle identifying the communication instance. This handle must be - passed to the communication methods. - """ - _not_implemented(self.open_device) - - def close_device(self, dev_handle): - r"""Close the device handle. - - This method closes the device communication channel and releases any - system resources related to it. - """ - _not_implemented(self.close_device) - - def set_configuration(self, dev_handle, config_value): - r"""Set the active device configuration. - - This method should be called to set the active configuration - of the device. The dev_handle parameter is the value returned - by the open_device() method and the config_value parameter is the - bConfigurationValue field of the related configuration descriptor. - """ - _not_implemented(self.set_configuration) - - def get_configuration(self, dev_handle): - r"""Get the current active device configuration. - - This method returns the bConfigurationValue of the currently - active configuration. Depending on the backend and the OS, - either a cached value may be returned or a control request may - be issued. The dev_handle parameter is the value returned by - the open_device method. - """ - _not_implemented(self.get_configuration) - - def set_interface_altsetting(self, dev_handle, intf, altsetting): - r"""Set the interface alternate setting. - - This method should only be called when the interface has more than - one alternate setting. The dev_handle is the value returned by the - open_device() method. intf and altsetting are respectivelly the - bInterfaceNumber and bAlternateSetting fields of the related interface. - """ - _not_implemented(self.set_interface_altsetting) - - def claim_interface(self, dev_handle, intf): - r"""Claim the given interface. - - Interface claiming is not related to USB spec itself, but it is - generally an necessary call of the USB libraries. It requests exclusive - access to the interface on the system. This method must be called - before using one of the transfer methods. - - dev_handle is the value returned by the open_device() method and - intf is the bInterfaceNumber field of the desired interface. - """ - _not_implemented(self.claim_interface) - - def release_interface(self, dev_handle, intf): - r"""Release the claimed interface. - - dev_handle and intf are the same parameters of the claim_interface - method. - """ - _not_implemented(self.release_interface) - - def bulk_write(self, dev_handle, ep, intf, data, timeout): - r"""Perform a bulk write. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be sent to. intf is the bInterfaceNumber field - of the interface containing the endpoint. The data parameter - is the data to be sent. It must be an instance of the array.array - class. The timeout parameter specifies a time limit to the operation - in miliseconds. - - The method returns the number of bytes written. - """ - _not_implemented(self.bulk_write) - - def bulk_read(self, dev_handle, ep, intf, buff, timeout): - r"""Perform a bulk read. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be received from. intf is the bInterfaceNumber field - of the interface containing the endpoint. The buff parameter - is the buffer to receive the data read, the length of the buffer - tells how many bytes should be read. The timeout parameter - specifies a time limit to the operation in miliseconds. - - The method returns the number of bytes actually read. - """ - _not_implemented(self.bulk_read) - - def intr_write(self, dev_handle, ep, intf, data, timeout): - r"""Perform an interrupt write. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be sent to. intf is the bInterfaceNumber field - of the interface containing the endpoint. The data parameter - is the data to be sent. It must be an instance of the array.array - class. The timeout parameter specifies a time limit to the operation - in miliseconds. - - The method returns the number of bytes written. - """ - _not_implemented(self.intr_write) - - def intr_read(self, dev_handle, ep, intf, size, timeout): - r"""Perform an interrut read. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be received from. intf is the bInterfaceNumber field - of the interface containing the endpoint. The buff parameter - is the buffer to receive the data read, the length of the buffer - tells how many bytes should be read. The timeout parameter - specifies a time limit to the operation in miliseconds. - - The method returns the number of bytes actually read. - """ - _not_implemented(self.intr_read) - - def iso_write(self, dev_handle, ep, intf, data, timeout): - r"""Perform an isochronous write. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be sent to. intf is the bInterfaceNumber field - of the interface containing the endpoint. The data parameter - is the data to be sent. It must be an instance of the array.array - class. The timeout parameter specifies a time limit to the operation - in miliseconds. - - The method returns the number of bytes written. - """ - _not_implemented(self.iso_write) - - def iso_read(self, dev_handle, ep, intf, size, timeout): - r"""Perform an isochronous read. - - dev_handle is the value returned by the open_device() method. - The ep parameter is the bEndpointAddress field whose endpoint - the data will be received from. intf is the bInterfaceNumber field - of the interface containing the endpoint. The buff parameter - is buffer to receive the data read, the length of the buffer tells - how many bytes should be read. The timeout parameter specifies - a time limit to the operation in miliseconds. - - The method returns the number of bytes actually read. - """ - _not_implemented(self.iso_read) - - def ctrl_transfer(self, - dev_handle, - bmRequestType, - bRequest, - wValue, - wIndex, - data, - timeout): - r"""Perform a control transfer on the endpoint 0. - - The direction of the transfer is inferred from the bmRequestType - field of the setup packet. - - dev_handle is the value returned by the open_device() method. - bmRequestType, bRequest, wValue and wIndex are the same fields - of the setup packet. data is an array object, for OUT requests - it contains the bytes to transmit in the data stage and for - IN requests it is the buffer to hold the data read. The number - of bytes requested to transmit or receive is equal to the length - of the array times the data.itemsize field. The timeout parameter - specifies a time limit to the operation in miliseconds. - - Return the number of bytes written (for OUT transfers) or the data - read (for IN transfers), as an array.array object. - """ - _not_implemented(self.ctrl_transfer) - - def clear_halt(self, dev_handle, ep): - r"""Clear the halt/stall condition for the endpoint.""" - _not_implemented(self.clear_halt) - - def reset_device(self, dev_handle): - r"""Reset the device.""" - _not_implemented(self.reset_device) - - def is_kernel_driver_active(self, dev_handle, intf): - r"""Determine if a kernel driver is active on an interface. - - If a kernel driver is active, you cannot claim the interface, - and the backend will be unable to perform I/O. - """ - _not_implemented(self.is_kernel_driver_active) - - def detach_kernel_driver(self, dev_handle, intf): - r"""Detach a kernel driver from an interface. - - If successful, you will then be able to claim the interface - and perform I/O. - """ - _not_implemented(self.detach_kernel_driver) - - def attach_kernel_driver(self, dev_handle, intf): - r"""Re-attach an interface's kernel driver, which was previously - detached using detach_kernel_driver().""" - _not_implemented(self.attach_kernel_driver) diff --git a/silhouette/pyusb-1.0.2/usb/backend/__init__.pyc b/silhouette/pyusb-1.0.2/usb/backend/__init__.pyc deleted file mode 100644 index a8b9343faf243c8752478eabea9b5891757837ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17687 zcmeHPOOM>xb*5UHp6=3X-VaagT+GCFH_)nX8OUakF|3!JhGR)!%M(~gP+*a_x+t;8 z3dvGW8D1D3d+&`Az{~uAEVB%<%Oaa>@&~fW!rQE}N&J21US3{SSGUxfsnG;b3#?|d z$aC*K=R5C9o&WF4z2E=-m4|U)e=gwn4{%fm_(+1_AwJIq$y$(|3m&Zn57&a^eDLsm zkX#6oSAt|cNL~#NF9Z+q=SJ{r+>eVF0=*VIS`S8eaFZ854}zaPe3euVwt6J~$tyuH ztA_ny6hGE^qOPf%_AJe7U5=ty_j|nuCdJ`SyvzTdi%|-*HrVk|B(H* zQcA0@c(KwCADxFL-J<)ls>akXioJZsVuIs2ubycgQXs+r)C55UA zh54lUSeLjr%@5V6EGCWsCVYSX(}SBT%1Rw2b2TlCCuyRqW}1~66{X73Ay%%Q=(0+S zyi$Ap>nZ{ZuJ`wLdOW!|)j7%F#xg4B{f0FSD>#KXn>-VJ4S3d+M^k)$<*{;-# z*GSD@KZ*2ulX;qa3dO;*pQydhMx&9IYxhfNOI*vvy}iBbytA3pCst4m)qaN=t)38!JtcZAdAw*S-2QtmVp279?=v%&^2)sBFJDw`Lz4`fx%rqc{6 z2$k$ixCL?#LI7xaM}&LR*q|pa5)BQ>GK=dvjcRk3T@@5|UvNt0=CBR29rmgCB)cFq zumE;}lnIa`7lome0kLS7!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pEg!DD$Zfc(5MtBW668p%ERZ#rbAE9Qno bDSu(a|NXzjJSt9heeLSn`q~?7o9F)sJ{=0s diff --git a/silhouette/pyusb-1.0.2/usb/backend/libusb0.py b/silhouette/pyusb-1.0.2/usb/backend/libusb0.py deleted file mode 100644 index 07524284..00000000 --- a/silhouette/pyusb-1.0.2/usb/backend/libusb0.py +++ /dev/null @@ -1,678 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -from ctypes import * -import os -import usb.backend -import usb.util -import sys -from usb.core import USBError -from usb._debug import methodtrace -import usb._interop as _interop -import logging -import usb.libloader - -__author__ = 'Wander Lairson Costa' - -__all__ = ['get_backend'] - -_logger = logging.getLogger('usb.backend.libusb0') - -# usb.h - -if sys.platform.find('bsd') != -1 or sys.platform.find('mac') != -1 or \ - sys.platform.find('darwin') != -1 or sys.platform.find('sunos5') != -1: - _PATH_MAX = 1024 -elif sys.platform == 'win32' or sys.platform == 'cygwin': - _PATH_MAX = 511 -else: - _PATH_MAX = os.pathconf('.', 'PC_PATH_MAX') - -# libusb-win32 makes all structures packed, while -# default libusb only does for some structures -# _PackPolicy defines the structure packing according -# to the platform. -class _PackPolicy(object): - pass - -if sys.platform == 'win32' or sys.platform == 'cygwin': - _PackPolicy._pack_ = 1 - -# Data structures - -class _usb_descriptor_header(Structure): - _pack_ = 1 - _fields_ = [('blength', c_uint8), - ('bDescriptorType', c_uint8)] - -class _usb_string_descriptor(Structure): - _pack_ = 1 - _fields_ = [('bLength', c_uint8), - ('bDescriptorType', c_uint8), - ('wData', c_uint16)] - -class _usb_endpoint_descriptor(Structure, _PackPolicy): - _fields_ = [('bLength', c_uint8), - ('bDescriptorType', c_uint8), - ('bEndpointAddress', c_uint8), - ('bmAttributes', c_uint8), - ('wMaxPacketSize', c_uint16), - ('bInterval', c_uint8), - ('bRefresh', c_uint8), - ('bSynchAddress', c_uint8), - ('extra', POINTER(c_uint8)), - ('extralen', c_int)] - -class _usb_interface_descriptor(Structure, _PackPolicy): - _fields_ = [('bLength', c_uint8), - ('bDescriptorType', c_uint8), - ('bInterfaceNumber', c_uint8), - ('bAlternateSetting', c_uint8), - ('bNumEndpoints', c_uint8), - ('bInterfaceClass', c_uint8), - ('bInterfaceSubClass', c_uint8), - ('bInterfaceProtocol', c_uint8), - ('iInterface', c_uint8), - ('endpoint', POINTER(_usb_endpoint_descriptor)), - ('extra', POINTER(c_uint8)), - ('extralen', c_int)] - -class _usb_interface(Structure, _PackPolicy): - _fields_ = [('altsetting', POINTER(_usb_interface_descriptor)), - ('num_altsetting', c_int)] - -class _usb_config_descriptor(Structure, _PackPolicy): - _fields_ = [('bLength', c_uint8), - ('bDescriptorType', c_uint8), - ('wTotalLength', c_uint16), - ('bNumInterfaces', c_uint8), - ('bConfigurationValue', c_uint8), - ('iConfiguration', c_uint8), - ('bmAttributes', c_uint8), - ('bMaxPower', c_uint8), - ('interface', POINTER(_usb_interface)), - ('extra', POINTER(c_uint8)), - ('extralen', c_int)] - -class _usb_device_descriptor(Structure, _PackPolicy): - _pack_ = 1 - _fields_ = [('bLength', c_uint8), - ('bDescriptorType', c_uint8), - ('bcdUSB', c_uint16), - ('bDeviceClass', c_uint8), - ('bDeviceSubClass', c_uint8), - ('bDeviceProtocol', c_uint8), - ('bMaxPacketSize0', c_uint8), - ('idVendor', c_uint16), - ('idProduct', c_uint16), - ('bcdDevice', c_uint16), - ('iManufacturer', c_uint8), - ('iProduct', c_uint8), - ('iSerialNumber', c_uint8), - ('bNumConfigurations', c_uint8)] - -class _usb_device(Structure, _PackPolicy): - pass - -class _usb_bus(Structure, _PackPolicy): - pass - -_usb_device._fields_ = [('next', POINTER(_usb_device)), - ('prev', POINTER(_usb_device)), - ('filename', c_int8 * (_PATH_MAX + 1)), - ('bus', POINTER(_usb_bus)), - ('descriptor', _usb_device_descriptor), - ('config', POINTER(_usb_config_descriptor)), - ('dev', c_void_p), - ('devnum', c_uint8), - ('num_children', c_ubyte), - ('children', POINTER(POINTER(_usb_device)))] - -_usb_bus._fields_ = [('next', POINTER(_usb_bus)), - ('prev', POINTER(_usb_bus)), - ('dirname', c_char * (_PATH_MAX + 1)), - ('devices', POINTER(_usb_device)), - ('location', c_uint32), - ('root_dev', POINTER(_usb_device))] - -_usb_dev_handle = c_void_p - -class _DeviceDescriptor: - def __init__(self, dev): - desc = dev.descriptor - self.bLength = desc.bLength - self.bDescriptorType = desc.bDescriptorType - self.bcdUSB = desc.bcdUSB - self.bDeviceClass = desc.bDeviceClass - self.bDeviceSubClass = desc.bDeviceSubClass - self.bDeviceProtocol = desc.bDeviceProtocol - self.bMaxPacketSize0 = desc.bMaxPacketSize0 - self.idVendor = desc.idVendor - self.idProduct = desc.idProduct - self.bcdDevice = desc.bcdDevice - self.iManufacturer = desc.iManufacturer - self.iProduct = desc.iProduct - self.iSerialNumber = desc.iSerialNumber - self.bNumConfigurations = desc.bNumConfigurations - self.address = dev.devnum - self.bus = dev.bus[0].location - - self.port_number = None - self.port_numbers = None - self.speed = None - -_lib = None - -def _load_library(find_library=None): - return usb.libloader.load_locate_library( - ('usb-0.1', 'usb', 'libusb0'), - 'cygusb0.dll', 'Libusb 0', - find_library=find_library - ) - -def _setup_prototypes(lib): - # usb_dev_handle *usb_open(struct usb_device *dev); - lib.usb_open.argtypes = [POINTER(_usb_device)] - lib.usb_open.restype = _usb_dev_handle - - # int usb_close(usb_dev_handle *dev); - lib.usb_close.argtypes = [_usb_dev_handle] - - # int usb_get_string(usb_dev_handle *dev, - # int index, - # int langid, - # char *buf, - # size_t buflen); - lib.usb_get_string.argtypes = [ - _usb_dev_handle, - c_int, - c_int, - c_char_p, - c_size_t - ] - - # int usb_get_string_simple(usb_dev_handle *dev, - # int index, - # char *buf, - # size_t buflen); - lib.usb_get_string_simple.argtypes = [ - _usb_dev_handle, - c_int, - c_char_p, - c_size_t - ] - - # int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, - # int ep, - # unsigned char type, - # unsigned char index, - # void *buf, - # int size); - lib.usb_get_descriptor_by_endpoint.argtypes = [ - _usb_dev_handle, - c_int, - c_ubyte, - c_ubyte, - c_void_p, - c_int - ] - - # int usb_get_descriptor(usb_dev_handle *udev, - # unsigned char type, - # unsigned char index, - # void *buf, - # int size); - lib.usb_get_descriptor.argtypes = [ - _usb_dev_handle, - c_ubyte, - c_ubyte, - c_void_p, - c_int - ] - - # int usb_bulk_write(usb_dev_handle *dev, - # int ep, - # const char *bytes, - # int size, - # int timeout); - lib.usb_bulk_write.argtypes = [ - _usb_dev_handle, - c_int, - c_char_p, - c_int, - c_int - ] - - # int usb_bulk_read(usb_dev_handle *dev, - # int ep, - # char *bytes, - # int size, - # int timeout); - lib.usb_bulk_read.argtypes = [ - _usb_dev_handle, - c_int, - c_char_p, - c_int, - c_int - ] - - # int usb_interrupt_write(usb_dev_handle *dev, - # int ep, - # const char *bytes, - # int size, - # int timeout); - lib.usb_interrupt_write.argtypes = [ - _usb_dev_handle, - c_int, - c_char_p, - c_int, - c_int - ] - - # int usb_interrupt_read(usb_dev_handle *dev, - # int ep, - # char *bytes, - # int size, - # int timeout); - lib.usb_interrupt_read.argtypes = [ - _usb_dev_handle, - c_int, - c_char_p, - c_int, - c_int - ] - - # int usb_control_msg(usb_dev_handle *dev, - # int requesttype, - # int request, - # int value, - # int index, - # char *bytes, - # int size, - # int timeout); - lib.usb_control_msg.argtypes = [ - _usb_dev_handle, - c_int, - c_int, - c_int, - c_int, - c_char_p, - c_int, - c_int - ] - - # int usb_set_configuration(usb_dev_handle *dev, int configuration); - lib.usb_set_configuration.argtypes = [_usb_dev_handle, c_int] - - # int usb_claim_interface(usb_dev_handle *dev, int interface); - lib.usb_claim_interface.argtypes = [_usb_dev_handle, c_int] - - # int usb_release_interface(usb_dev_handle *dev, int interface); - lib.usb_release_interface.argtypes = [_usb_dev_handle, c_int] - - # int usb_set_altinterface(usb_dev_handle *dev, int alternate); - lib.usb_set_altinterface.argtypes = [_usb_dev_handle, c_int] - - # int usb_resetep(usb_dev_handle *dev, unsigned int ep); - lib.usb_resetep.argtypes = [_usb_dev_handle, c_int] - - # int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); - lib.usb_clear_halt.argtypes = [_usb_dev_handle, c_int] - - # int usb_reset(usb_dev_handle *dev); - lib.usb_reset.argtypes = [_usb_dev_handle] - - # char *usb_strerror(void); - lib.usb_strerror.argtypes = [] - lib.usb_strerror.restype = c_char_p - - # void usb_set_debug(int level); - lib.usb_set_debug.argtypes = [c_int] - - # struct usb_device *usb_device(usb_dev_handle *dev); - lib.usb_device.argtypes = [_usb_dev_handle] - lib.usb_device.restype = POINTER(_usb_device) - - # struct usb_bus *usb_get_busses(void); - lib.usb_get_busses.restype = POINTER(_usb_bus) - - # linux only - - # int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); - if hasattr(lib, 'usb_detach_kernel_driver_np'): - lib.usb_detach_kernel_driver_np.argtypes = [_usb_dev_handle, c_int] - - # libusb-win32 only - - # int usb_isochronous_setup_async(usb_dev_handle *dev, - # void **context, - # unsigned char ep, - # int pktsize) - if hasattr(lib, 'usb_isochronous_setup_async'): - lib.usb_isochronous_setup_async.argtypes = \ - [_usb_dev_handle, POINTER(c_void_p), c_uint8, c_int] - - # int usb_bulk_setup_async(usb_dev_handle *dev, - # void **context, - # unsigned char ep) - if hasattr(lib, 'usb_bulk_setup_async'): - lib.usb_bulk_setup_async.argtypes = \ - [_usb_dev_handle, POINTER(c_void_p), c_uint8] - - # int usb_interrupt_setup_async(usb_dev_handle *dev, - # void **context, - # unsigned char ep) - if hasattr(lib, 'usb_interrupt_setup_async'): - lib.usb_interrupt_setup_async.argtypes = \ - [_usb_dev_handle, POINTER(c_void_p), c_uint8] - - # int usb_submit_async(void *context, char *bytes, int size) - if hasattr(lib, 'usb_submit_async'): - lib.usb_submit_async.argtypes = [c_void_p, c_char_p, c_int] - - # int usb_reap_async(void *context, int timeout) - if hasattr(lib, 'usb_reap_async'): - lib.usb_reap_async.argtypes = [c_void_p, c_int] - - # int usb_reap_async_nocancel(void *context, int timeout) - if hasattr(lib, 'usb_reap_async_nocancel'): - lib.usb_reap_async_nocancel.argtypes = [c_void_p, c_int] - - # int usb_cancel_async(void *context) - if hasattr(lib, 'usb_cancel_async'): - lib.usb_cancel_async.argtypes = [c_void_p] - - # int usb_free_async(void **context) - if hasattr(lib, 'usb_free_async'): - lib.usb_free_async.argtypes = [POINTER(c_void_p)] - -def _check(ret): - if ret is None: - errmsg = _lib.usb_strerror() - else: - if hasattr(ret, 'value'): - ret = ret.value - - if ret < 0: - errmsg = _lib.usb_strerror() - # No error means that we need to get the error - # message from the return code - # Thanks to Nicholas Wheeler to point out the problem... - # Also see issue #2860940 - if errmsg.lower() == 'no error': - errmsg = os.strerror(-ret) - else: - return ret - raise USBError(errmsg, ret) - -def _has_iso_transfer(): - return hasattr(_lib, 'usb_isochronous_setup_async') - -# implementation of libusb 0.1.x backend -class _LibUSB(usb.backend.IBackend): - @methodtrace(_logger) - def enumerate_devices(self): - _check(_lib.usb_find_busses()) - _check(_lib.usb_find_devices()) - bus = _lib.usb_get_busses() - while bool(bus): - dev = bus[0].devices - while bool(dev): - yield dev[0] - dev = dev[0].next - bus = bus[0].next - - @methodtrace(_logger) - def get_device_descriptor(self, dev): - return _DeviceDescriptor(dev) - - @methodtrace(_logger) - def get_configuration_descriptor(self, dev, config): - if config >= dev.descriptor.bNumConfigurations: - raise IndexError('Invalid configuration index ' + str(config)) - config_desc = dev.config[config] - config_desc.extra_descriptors = config_desc.extra[:config_desc.extralen] - return config_desc - - @methodtrace(_logger) - def get_interface_descriptor(self, dev, intf, alt, config): - cfgdesc = self.get_configuration_descriptor(dev, config) - if intf >= cfgdesc.bNumInterfaces: - raise IndexError('Invalid interface index ' + str(intf)) - interface = cfgdesc.interface[intf] - if alt >= interface.num_altsetting: - raise IndexError('Invalid alternate setting index ' + str(alt)) - intf_desc = interface.altsetting[alt] - intf_desc.extra_descriptors = intf_desc.extra[:intf_desc.extralen] - return intf_desc - - @methodtrace(_logger) - def get_endpoint_descriptor(self, dev, ep, intf, alt, config): - interface = self.get_interface_descriptor(dev, intf, alt, config) - if ep >= interface.bNumEndpoints: - raise IndexError('Invalid endpoint index ' + str(ep)) - ep_desc = interface.endpoint[ep] - ep_desc.extra_descriptors = ep_desc.extra[:ep_desc.extralen] - return ep_desc - - @methodtrace(_logger) - def open_device(self, dev): - return _check(_lib.usb_open(dev)) - - @methodtrace(_logger) - def close_device(self, dev_handle): - _check(_lib.usb_close(dev_handle)) - - @methodtrace(_logger) - def set_configuration(self, dev_handle, config_value): - _check(_lib.usb_set_configuration(dev_handle, config_value)) - - @methodtrace(_logger) - def get_configuration(self, dev_handle): - bmRequestType = usb.util.build_request_type( - usb.util.CTRL_IN, - usb.util.CTRL_TYPE_STANDARD, - usb.util.CTRL_RECIPIENT_DEVICE - ) - buff = usb.util.create_buffer(1) - ret = self.ctrl_transfer( - dev_handle, - bmRequestType, - 0x08, - 0, - 0, - buff, - 100) - - assert ret == 1 - return buff[0] - - @methodtrace(_logger) - def set_interface_altsetting(self, dev_handle, intf, altsetting): - _check(_lib.usb_set_altinterface(dev_handle, altsetting)) - - @methodtrace(_logger) - def claim_interface(self, dev_handle, intf): - _check(_lib.usb_claim_interface(dev_handle, intf)) - - @methodtrace(_logger) - def release_interface(self, dev_handle, intf): - _check(_lib.usb_release_interface(dev_handle, intf)) - - @methodtrace(_logger) - def bulk_write(self, dev_handle, ep, intf, data, timeout): - return self.__write(_lib.usb_bulk_write, - dev_handle, - ep, - intf, - data, timeout) - - @methodtrace(_logger) - def bulk_read(self, dev_handle, ep, intf, buff, timeout): - return self.__read(_lib.usb_bulk_read, - dev_handle, - ep, - intf, - buff, - timeout) - - @methodtrace(_logger) - def intr_write(self, dev_handle, ep, intf, data, timeout): - return self.__write(_lib.usb_interrupt_write, - dev_handle, - ep, - intf, - data, - timeout) - - @methodtrace(_logger) - def intr_read(self, dev_handle, ep, intf, buff, timeout): - return self.__read(_lib.usb_interrupt_read, - dev_handle, - ep, - intf, - buff, - timeout) - - @methodtrace(_logger) - def iso_write(self, dev_handle, ep, intf, data, timeout): - if not _has_iso_transfer(): - return usb.backend.IBackend.iso_write(self, dev_handle, ep, intf, data, timeout) - return self.__iso_transfer(dev_handle, ep, intf, data, timeout) - - @methodtrace(_logger) - def iso_read(self, dev_handle, ep, intf, buff, timeout): - if not _has_iso_transfer(): - return usb.backend.IBackend.iso_read(self, dev_handle, ep, intf, buff, timeout) - return self.__iso_transfer(dev_handle, ep, intf, buff, timeout) - - @methodtrace(_logger) - def ctrl_transfer(self, - dev_handle, - bmRequestType, - bRequest, - wValue, - wIndex, - data, - timeout): - address, length = data.buffer_info() - length *= data.itemsize - return _check(_lib.usb_control_msg( - dev_handle, - bmRequestType, - bRequest, - wValue, - wIndex, - cast(address, c_char_p), - length, - timeout - )) - - @methodtrace(_logger) - def clear_halt(self, dev_handle, ep): - _check(_lib.usb_clear_halt(dev_handle, ep)) - - @methodtrace(_logger) - def reset_device(self, dev_handle): - _check(_lib.usb_reset(dev_handle)) - - @methodtrace(_logger) - def detach_kernel_driver(self, dev_handle, intf): - _check(_lib.usb_detach_kernel_driver_np(dev_handle, intf)) - - def __write(self, fn, dev_handle, ep, intf, data, timeout): - address, length = data.buffer_info() - length *= data.itemsize - return int(_check(fn( - dev_handle, - ep, - cast(address, c_char_p), - length, - timeout - ))) - - def __read(self, fn, dev_handle, ep, intf, buff, timeout): - address, length = buff.buffer_info() - length *= buff.itemsize - ret = int(_check(fn( - dev_handle, - ep, - cast(address, c_char_p), - length, - timeout - ))) - return ret - - def __iso_transfer(self, dev_handle, ep, intf, data, timeout): - context = c_void_p() - buff, length = data.buffer_info() - length *= data.itemsize - - _check(_lib.usb_isochronous_setup_async( - dev_handle, - byref(context), - ep, - 0)) - - transmitted = 0 - - try: - while transmitted < length: - _check(_lib.usb_submit_async( - context, - cast(buff + transmitted, c_char_p), - length - transmitted)) - - ret = _check(_lib.usb_reap_async(context, timeout)) - if not ret: - return transmitted - - transmitted += ret - except: - if not transmitted: - raise - finally: - _check(_lib.usb_free_async(byref(context))) - - return transmitted - -def get_backend(find_library=None): - global _lib - try: - if _lib is None: - _lib = _load_library(find_library) - _setup_prototypes(_lib) - _lib.usb_init() - return _LibUSB() - except usb.libloader.LibraryException: - # exception already logged (if any) - _logger.error('Error loading libusb 0.1 backend', exc_info=False) - return None - except Exception: - _logger.error('Error loading libusb 0.1 backend', exc_info=True) - return None diff --git a/silhouette/pyusb-1.0.2/usb/backend/libusb0.pyc b/silhouette/pyusb-1.0.2/usb/backend/libusb0.pyc deleted file mode 100644 index fecdb7b854331a2b98f4789238943eff05671c05..0000000000000000000000000000000000000000 GIT bin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z`hJG=;ueUqI;ty5%SN=6hI(QxZx{8no!y^?_P^k@y9vmlXzBV_Lc7RkJW7XrJzi9k z?T$D*LQ{x>% zzsutHSo}VVKVb34EdGSWpR)Kf7GGoWS1kUT#n)Ld%9MCYe7*gTy!|H@|I9)bQ?kT( z7q=aoCD3hN9NNExSA3a?E0V5gO$<*ICI(QJ@XgP7@;v|yKSg{dHLf&N8g}uhoK5b- zx2WUK0ocLrl{qhSiXH%K2ncOe%d^1T%0>_fRka!-nt)c$H(pi+NIH}ZTT>SXRk%UL zfR5oHEmRYEP6*m{pdimH1>|?x=B+(#c+ya}d6f;tkuFCS3{CQg6&?rXeie?zVDq|y z1Jaf3lEuHmpPsHarzvK7p?8i@jm29iBy!}oHxHEy4Q1_Pe};9m{W#yjL(_{_TpSTY z`qKV3Ye*yWI-JlZfj=Zt~ZG$lI%JC2OXZLNsTzvLGv36 z9 0: - dev_desc.port_numbers = tuple(buff[:written]) - else: - dev_desc.port_numbers = None - except AttributeError: - dev_desc.port_numbers = None - - return dev_desc - - @methodtrace(_logger) - def get_configuration_descriptor(self, dev, config): - cfg = POINTER(_libusb_config_descriptor)() - _check(self.lib.libusb_get_config_descriptor( - dev.devid, - config, byref(cfg))) - config_desc = _ConfigDescriptor(cfg) - config_desc.extra_descriptors = ( - config_desc.extra[:config_desc.extra_length]) - return config_desc - - @methodtrace(_logger) - def get_interface_descriptor(self, dev, intf, alt, config): - cfg = self.get_configuration_descriptor(dev, config) - if intf >= cfg.bNumInterfaces: - raise IndexError('Invalid interface index ' + str(intf)) - i = cfg.interface[intf] - if alt >= i.num_altsetting: - raise IndexError('Invalid alternate setting index ' + str(alt)) - intf_desc = i.altsetting[alt] - intf_desc.extra_descriptors = intf_desc.extra[:intf_desc.extra_length] - return _WrapDescriptor(intf_desc, cfg) - - @methodtrace(_logger) - def get_endpoint_descriptor(self, dev, ep, intf, alt, config): - i = self.get_interface_descriptor(dev, intf, alt, config) - if ep > i.bNumEndpoints: - raise IndexError('Invalid endpoint index ' + str(ep)) - ep_desc = i.endpoint[ep] - ep_desc.extra_descriptors = ep_desc.extra[:ep_desc.extra_length] - return _WrapDescriptor(ep_desc, i) - - @methodtrace(_logger) - def open_device(self, dev): - return _DeviceHandle(dev) - - @methodtrace(_logger) - def close_device(self, dev_handle): - self.lib.libusb_close(dev_handle.handle) - - @methodtrace(_logger) - def set_configuration(self, dev_handle, config_value): - _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value)) - - @methodtrace(_logger) - def get_configuration(self, dev_handle): - config = c_int() - _check(self.lib.libusb_get_configuration(dev_handle.handle, byref(config))) - return config.value - - @methodtrace(_logger) - def set_interface_altsetting(self, dev_handle, intf, altsetting): - _check(self.lib.libusb_set_interface_alt_setting( - dev_handle.handle, - intf, - altsetting)) - - @methodtrace(_logger) - def claim_interface(self, dev_handle, intf): - _check(self.lib.libusb_claim_interface(dev_handle.handle, intf)) - - @methodtrace(_logger) - def release_interface(self, dev_handle, intf): - _check(self.lib.libusb_release_interface(dev_handle.handle, intf)) - - @methodtrace(_logger) - def bulk_write(self, dev_handle, ep, intf, data, timeout): - return self.__write(self.lib.libusb_bulk_transfer, - dev_handle, - ep, - intf, - data, - timeout) - - @methodtrace(_logger) - def bulk_read(self, dev_handle, ep, intf, buff, timeout): - return self.__read(self.lib.libusb_bulk_transfer, - dev_handle, - ep, - intf, - buff, - timeout) - - @methodtrace(_logger) - def intr_write(self, dev_handle, ep, intf, data, timeout): - return self.__write(self.lib.libusb_interrupt_transfer, - dev_handle, - ep, - intf, - data, - timeout) - - @methodtrace(_logger) - def intr_read(self, dev_handle, ep, intf, buff, timeout): - return self.__read(self.lib.libusb_interrupt_transfer, - dev_handle, - ep, - intf, - buff, - timeout) - - @methodtrace(_logger) - def iso_write(self, dev_handle, ep, intf, data, timeout): - handler = _IsoTransferHandler(dev_handle, ep, data, timeout) - return handler.submit(self.ctx) - - @methodtrace(_logger) - def iso_read(self, dev_handle, ep, intf, buff, timeout): - handler = _IsoTransferHandler(dev_handle, ep, buff, timeout) - return handler.submit(self.ctx) - - @methodtrace(_logger) - def ctrl_transfer(self, - dev_handle, - bmRequestType, - bRequest, - wValue, - wIndex, - data, - timeout): - addr, length = data.buffer_info() - length *= data.itemsize - - ret = _check(self.lib.libusb_control_transfer( - dev_handle.handle, - bmRequestType, - bRequest, - wValue, - wIndex, - cast(addr, POINTER(c_ubyte)), - length, - timeout)) - - return ret - - @methodtrace(_logger) - def clear_halt(self, dev_handle, ep): - _check(self.lib.libusb_clear_halt(dev_handle.handle, ep)) - - @methodtrace(_logger) - def reset_device(self, dev_handle): - _check(self.lib.libusb_reset_device(dev_handle.handle)) - - @methodtrace(_logger) - def is_kernel_driver_active(self, dev_handle, intf): - return bool(_check(self.lib.libusb_kernel_driver_active(dev_handle.handle, - intf))) - - @methodtrace(_logger) - def detach_kernel_driver(self, dev_handle, intf): - _check(self.lib.libusb_detach_kernel_driver(dev_handle.handle, intf)) - - @methodtrace(_logger) - def attach_kernel_driver(self, dev_handle, intf): - _check(self.lib.libusb_attach_kernel_driver(dev_handle.handle, intf)) - - def __write(self, fn, dev_handle, ep, intf, data, timeout): - address, length = data.buffer_info() - length *= data.itemsize - transferred = c_int() - retval = fn(dev_handle.handle, - ep, - cast(address, POINTER(c_ubyte)), - length, - byref(transferred), - timeout) - # do not assume LIBUSB_ERROR_TIMEOUT means no I/O. - if not (transferred.value and retval == LIBUSB_ERROR_TIMEOUT): - _check(retval) - - return transferred.value - - def __read(self, fn, dev_handle, ep, intf, buff, timeout): - address, length = buff.buffer_info() - length *= buff.itemsize - transferred = c_int() - retval = fn(dev_handle.handle, - ep, - cast(address, POINTER(c_ubyte)), - length, - byref(transferred), - timeout) - # do not assume LIBUSB_ERROR_TIMEOUT means no I/O. - if not (transferred.value and retval == LIBUSB_ERROR_TIMEOUT): - _check(retval) - return transferred.value - -def get_backend(find_library=None): - global _lib - try: - if _lib is None: - _lib = _load_library(find_library=find_library) - _setup_prototypes(_lib) - return _LibUSB(_lib) - except usb.libloader.LibraryException: - # exception already logged (if any) - _logger.error('Error loading libusb 1.0 backend', exc_info=False) - return None - except Exception: - _logger.error('Error loading libusb 1.0 backend', exc_info=True) - return None diff --git a/silhouette/pyusb-1.0.2/usb/backend/libusb1.pyc b/silhouette/pyusb-1.0.2/usb/backend/libusb1.pyc deleted file mode 100644 index c75d7b431c2e282ae8c2838f1fe9070246ad0e22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28287 zcmd^IdvqLEdB6M6N-Im2EnBi=JMqSO$%!pL0#58ah%C!Qi7c6sY$pq0SnZ6YkypFQ z&TMRjn3UKg^qjOkg+5bgd-^^=TS_@Cr3KQKM>#;D?KyqXH-Gf-2ZeLmQV0#{@Auug zGozOYCtmYMZO`31-+j#e?)SXky)(}IXJ`BK&$krID*V%f-}`a-FSaP<;9p8rl$v5L zttu&1ObZnGj4EbKKC6mZ$!AohMJ?o1F{e^tn^ra7riyK*YF^E^t75yk-JpsaOuj=E zJ0zb~l}@#=Q582vy>!WwTU2qAa&pRPRStU0D+e8+J(_hYXQOhul!FSJmD8=9Ey~%d zoF3)$DrcK=`jpeJob771M-?|KH>>7RXNS53oKSP8nn4EjuTw=dxn32~YL_aa;Z9XV zTcwIy>k}D(+IwEvi^h&aJ9=gK`E`akp~z zsN#*vxlI*sQqJwFc(d{_)V<2>Q-_^>%I(L`pmMk4XTNfH;OBsHcjD)ua<9YBA?03= zpF5Ph3qP+>ZUH~9RqhS=Ijr2>__+cC4F%H4~f2bH@IKMyH)5I$~}OeapfMw zcvv};209f%?^Mod13eQ#?^4cL1ARDx9#PIC23m}uN0swN1AS8j1-sp&iuWq#QB(Hj zs0@q*uDMSn6Eh=7xc8G~i^r5>EB9VC11VB*FB*3{_9k%`k&0qy0of{8OD)`_u+ zv#UEgHF|0!=v!HTbbJauo<21-a(p!=81c!GldC6Sd}0a{cIwoG#b&p!>~mu3fe|Yl z)s!_fK6zrqvWF*5o*Elr{lu7~Qo$hJ8{1=n=BJsP?!DOR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0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -r"""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. -""" - -__author__ = 'Wander Lairson Costa' - -__all__ = [ 'Device', 'Configuration', 'Interface', 'Endpoint', 'find', - 'show_devices' ] - -import usb.util as util -import copy -import operator -import usb._interop as _interop -import usb._objfinalizer as _objfinalizer -import usb._lookup as _lu -import logging -import array -import threading -import functools - -_logger = logging.getLogger('usb.core') - -_DEFAULT_TIMEOUT = 1000 - -def _set_attr(input, output, fields): - for f in fields: - setattr(output, f, getattr(input, f)) - -def _try_get_string(dev, index, langid = None, default_str_i0 = "", - default_access_error = "Error Accessing String"): - """ try to get a string, but return a string no matter what - """ - if index == 0 : - string = default_str_i0 - else: - try: - if langid is None: - string = util.get_string(dev, index) - else: - string = util.get_string(dev, index, langid) - except : - string = default_access_error - return string - -def _try_lookup(table, value, default = ""): - """ try to get a string from the lookup table, return "" instead of key - error - """ - try: - string = table[ value ] - except KeyError: - string = default - return string - -class _DescriptorInfo(str): - """ this class is used so that when a descriptor is shown on the - terminal it is propely formatted """ - def __repr__(self): - return self - -def synchronized(f): - @functools.wraps(f) - def wrapper(self, *args, **kwargs): - try: - self.lock.acquire() - return f(self, *args, **kwargs) - finally: - self.lock.release() - return wrapper - -class _ResourceManager(object): - def __init__(self, dev, backend): - self.backend = backend - self._active_cfg_index = None - self.dev = dev - self.handle = None - self._claimed_intf = _interop._set() - self._ep_info = {} - self.lock = threading.RLock() - - @synchronized - def managed_open(self): - if self.handle is None: - self.handle = self.backend.open_device(self.dev) - return self.handle - - @synchronized - def managed_close(self): - if self.handle is not None: - self.backend.close_device(self.handle) - self.handle = None - - @synchronized - def managed_set_configuration(self, device, config): - if config is None: - cfg = device[0] - elif isinstance(config, Configuration): - cfg = config - elif config == 0: # unconfigured state - class MockConfiguration(object): - def __init__(self): - self.index = None - self.bConfigurationValue = 0 - cfg = MockConfiguration() - else: - cfg = util.find_descriptor(device, bConfigurationValue=config) - - if cfg is None: - raise ValueError("Invalid configuration " + str(config)) - - self.managed_open() - self.backend.set_configuration(self.handle, cfg.bConfigurationValue) - - # cache the index instead of the object to avoid cyclic references - # of the device and Configuration (Device tracks the _ResourceManager, - # which tracks the Configuration, which tracks the Device) - self._active_cfg_index = cfg.index - - self._ep_info.clear() - - @synchronized - def managed_claim_interface(self, device, intf): - self.managed_open() - - if isinstance(intf, Interface): - i = intf.bInterfaceNumber - else: - i = intf - - if i not in self._claimed_intf: - self.backend.claim_interface(self.handle, i) - self._claimed_intf.add(i) - - @synchronized - def managed_release_interface(self, device, intf): - if intf is None: - cfg = self.get_active_configuration(device) - i = cfg[(0,0)].bInterfaceNumber - elif isinstance(intf, Interface): - i = intf.bInterfaceNumber - else: - i = intf - - if i in self._claimed_intf: - try: - self.backend.release_interface(self.handle, i) - finally: - self._claimed_intf.remove(i) - - @synchronized - def managed_set_interface(self, device, intf, alt): - if isinstance(intf, Interface): - i = intf - else: - cfg = self.get_active_configuration(device) - if intf is None: - intf = cfg[(0,0)].bInterfaceNumber - if alt is not None: - i = util.find_descriptor(cfg, bInterfaceNumber=intf, bAlternateSetting=alt) - else: - i = util.find_descriptor(cfg, bInterfaceNumber=intf) - - self.managed_claim_interface(device, i) - - if alt is None: - alt = i.bAlternateSetting - - self.backend.set_interface_altsetting(self.handle, i.bInterfaceNumber, alt) - - @synchronized - def setup_request(self, device, endpoint): - # we need the endpoint address, but the "endpoint" parameter - # can be either the a Endpoint object or the endpoint address itself - if isinstance(endpoint, Endpoint): - endpoint_address = endpoint.bEndpointAddress - else: - endpoint_address = endpoint - - intf, ep = self.get_interface_and_endpoint(device, endpoint_address) - self.managed_claim_interface(device, intf) - return (intf, ep) - - # Find the interface and endpoint objects which endpoint address belongs to - @synchronized - def get_interface_and_endpoint(self, device, endpoint_address): - try: - return self._ep_info[endpoint_address] - except KeyError: - for intf in self.get_active_configuration(device): - ep = util.find_descriptor(intf, bEndpointAddress=endpoint_address) - if ep is not None: - self._ep_info[endpoint_address] = (intf, ep) - return intf, ep - - raise ValueError('Invalid endpoint address ' + hex(endpoint_address)) - - @synchronized - def get_active_configuration(self, device): - if self._active_cfg_index is None: - self.managed_open() - cfg = util.find_descriptor( - device, - bConfigurationValue=self.backend.get_configuration(self.handle) - ) - if cfg is None: - raise USBError('Configuration not set') - self._active_cfg_index = cfg.index - return cfg - return device[self._active_cfg_index] - - @synchronized - def release_all_interfaces(self, device): - claimed = copy.copy(self._claimed_intf) - for i in claimed: - try: - self.managed_release_interface(device, i) - except USBError: - # Ignore errors when releasing the interfaces - # When the device is disconnected, the call may fail - pass - - @synchronized - def dispose(self, device, close_handle = True): - self.release_all_interfaces(device) - if close_handle: - self.managed_close() - self._ep_info.clear() - self._active_cfg_index = None - - -class USBError(IOError): - r"""Exception class for USB errors. - - Backends must raise this exception when USB related errors occur. The - backend specific error code is available through the 'backend_error_code' - member variable. - """ - - def __init__(self, strerror, error_code = None, errno = None): - r"""Initialize the object. - - This initializes the USBError object. The strerror and errno are passed - to the parent object. The error_code parameter is attributed to the - backend_error_code member variable. - """ - - IOError.__init__(self, errno, strerror) - self.backend_error_code = error_code - -class NoBackendError(ValueError): - r"Exception class when a valid backend is not found." - pass - -class Endpoint(object): - r"""Represent an endpoint object. - - This class contains all fields of the Endpoint Descriptor according to the - USB Specification. You can access them as class properties. For example, to - access the field bEndpointAddress of the endpoint descriptor, you can do so: - - >>> import usb.core - >>> dev = usb.core.find() - >>> for cfg in dev: - >>> for i in cfg: - >>> for e in i: - >>> print e.bEndpointAddress - """ - - def __init__(self, device, endpoint, interface = 0, - alternate_setting = 0, configuration = 0): - r"""Initialize the Endpoint object. - - The device parameter is the device object returned by the find() - function. endpoint is the endpoint logical index (not the endpoint - address). The configuration parameter is the logical index of the - configuration (not the bConfigurationValue field). The interface - parameter is the interface logical index (not the bInterfaceNumber - field) and alternate_setting is the alternate setting logical index - (not the bAlternateSetting value). An interface may have only one - alternate setting. In this case, the alternate_setting parameter - should be zero. By "logical index" we mean the relative order of the - configurations returned by the peripheral as a result of GET_DESCRIPTOR - request. - """ - self.device = device - self.index = endpoint - - backend = device._ctx.backend - - desc = backend.get_endpoint_descriptor( - device._ctx.dev, - endpoint, - interface, - alternate_setting, - configuration - ) - - _set_attr( - desc, - self, - ( - 'bLength', - 'bDescriptorType', - 'bEndpointAddress', - 'bmAttributes', - 'wMaxPacketSize', - 'bInterval', - 'bRefresh', - 'bSynchAddress', - 'extra_descriptors' - ) - ) - - def __repr__(self): - return "<" + self._str() + ">" - - def __str__(self): - headstr = " " + self._str() + " " - - if util.endpoint_direction(self.bEndpointAddress) == util.ENDPOINT_IN: - direction = "IN" - else: - direction = "OUT" - - return "%s%s\n" % (headstr, "=" * (60 - len(headstr))) + \ - " %-17s:%#7x (7 bytes)\n" % ( - "bLength", self.bLength) + \ - " %-17s:%#7x %s\n" % ( - "bDescriptorType", self.bDescriptorType, - _try_lookup(_lu.descriptors, self.bDescriptorType)) + \ - " %-17s:%#7x %s\n" % ( - "bEndpointAddress", self.bEndpointAddress, direction) + \ - " %-17s:%#7x %s\n" % ( - "bmAttributes", self.bmAttributes, - _lu.ep_attributes[(self.bmAttributes & 0x3)]) + \ - " %-17s:%#7x (%d bytes)\n" % ( - "wMaxPacketSize", self.wMaxPacketSize, self.wMaxPacketSize) + \ - " %-17s:%#7x" % ("bInterval", self.bInterval) - - def write(self, data, timeout = None): - r"""Write data to the endpoint. - - The parameter data contains the data to be sent to the endpoint and - timeout is the time limit of the operation. The transfer type and - endpoint address are automatically inferred. - - The method returns the number of bytes written. - - For details, see the Device.write() method. - """ - return self.device.write(self, data, timeout) - - def read(self, size_or_buffer, timeout = None): - r"""Read data from the endpoint. - - The parameter size_or_buffer is either the number of bytes to - read or an array object where the data will be put in and timeout is the - time limit of the operation. The transfer type and endpoint address - are automatically inferred. - - The method returns either an array object or the number of bytes - actually read. - - For details, see the Device.read() method. - """ - return self.device.read(self, size_or_buffer, timeout) - - def clear_halt(self): - r"""Clear the halt/status condition of the endpoint.""" - self.device.clear_halt(self.bEndpointAddress) - - def _str(self): - if util.endpoint_direction(self.bEndpointAddress) == util.ENDPOINT_IN: - direction = "IN" - else: - direction = "OUT" - - return ( - "ENDPOINT 0x%X: %s %s" % (self.bEndpointAddress, - _lu.ep_attributes[(self.bmAttributes & 0x3)], - direction)) - -class Interface(object): - r"""Represent an interface object. - - This class contains all fields of the Interface Descriptor - according to the USB Specification. You may access them as class - properties. For example, to access the field bInterfaceNumber - of the interface descriptor, you can do so: - - >>> import usb.core - >>> dev = usb.core.find() - >>> for cfg in dev: - >>> for i in cfg: - >>> print i.bInterfaceNumber - """ - - def __init__(self, device, interface = 0, - alternate_setting = 0, configuration = 0): - r"""Initialize the interface object. - - The device parameter is the device object returned by the find() - function. The configuration parameter is the logical index of the - configuration (not the bConfigurationValue field). The interface - parameter is the interface logical index (not the bInterfaceNumber - field) and alternate_setting is the alternate setting logical index - (not the bAlternateSetting value). An interface may have only one - alternate setting. In this case, the alternate_setting parameter - should be zero. By "logical index" we mean the relative order of - the configurations returned by the peripheral as a result of - GET_DESCRIPTOR request. - """ - self.device = device - self.alternate_index = alternate_setting - self.index = interface - self.configuration = configuration - - backend = device._ctx.backend - - desc = backend.get_interface_descriptor( - self.device._ctx.dev, - interface, - alternate_setting, - configuration - ) - - _set_attr( - desc, - self, - ( - 'bLength', - 'bDescriptorType', - 'bInterfaceNumber', - 'bAlternateSetting', - 'bNumEndpoints', - 'bInterfaceClass', - 'bInterfaceSubClass', - 'bInterfaceProtocol', - 'iInterface', - 'extra_descriptors' - ) - ) - - def __repr__(self): - return "<" + self._str() + ">" - - def __str__(self): - """Show all information for the interface.""" - - string = self._get_full_descriptor_str() - for endpoint in self: - string += "\n" + str(endpoint) - return string - - def endpoints(self): - r"""Return a tuple of the interface endpoints.""" - return tuple(self) - - def set_altsetting(self): - r"""Set the interface alternate setting.""" - self.device.set_interface_altsetting( - self.bInterfaceNumber, - self.bAlternateSetting) - - def __iter__(self): - r"""Iterate over all endpoints of the interface.""" - for i in range(self.bNumEndpoints): - yield Endpoint( - self.device, - i, - self.index, - self.alternate_index, - self.configuration) - - def __getitem__(self, index): - r"""Return the Endpoint object in the given position.""" - return Endpoint( - self.device, - index, - self.index, - self.alternate_index, - self.configuration) - - def _str(self): - if self.bAlternateSetting: - alt_setting = ", %d" % self.bAlternateSetting - else: - alt_setting = "" - - return "INTERFACE %d%s: %s" % (self.bInterfaceNumber, alt_setting, - _try_lookup(_lu.interface_classes, self.bInterfaceClass, - default = "Unknown Class")) - - def _get_full_descriptor_str(self): - headstr = " " + self._str() + " " - return "%s%s\n" % (headstr, "=" * (60 - len(headstr))) + \ - " %-19s:%#7x (9 bytes)\n" % ( - "bLength", self.bLength) + \ - " %-19s:%#7x %s\n" % ( - "bDescriptorType", self.bDescriptorType, - _try_lookup(_lu.descriptors, self.bDescriptorType)) + \ - " %-19s:%#7x\n" % ( - "bInterfaceNumber", self.bInterfaceNumber) + \ - " %-19s:%#7x\n" % ( - "bAlternateSetting", self.bAlternateSetting) + \ - " %-19s:%#7x\n" % ( - "bNumEndpoints", self.bNumEndpoints) + \ - " %-19s:%#7x %s\n" % ( - "bInterfaceClass", self.bInterfaceClass, - _try_lookup(_lu.interface_classes, self.bInterfaceClass)) + \ - " %-19s:%#7x\n" % ( - "bInterfaceSubClass", self.bInterfaceSubClass) + \ - " %-19s:%#7x\n" % ( - "bInterfaceProtocol", self.bInterfaceProtocol) + \ - " %-19s:%#7x %s" % ( - "iInterface", self.iInterface, - _try_get_string(self.device, self.iInterface)) - - -class Configuration(object): - r"""Represent a configuration object. - - This class contains all fields of the Configuration Descriptor according to - the USB Specification. You may access them as class properties. For - example, to access the field bConfigurationValue of the configuration - descriptor, you can do so: - - >>> import usb.core - >>> dev = usb.core.find() - >>> for cfg in dev: - >>> print cfg.bConfigurationValue - """ - - def __init__(self, device, configuration = 0): - r"""Initialize the configuration object. - - The device parameter is the device object returned by the find() - function. The configuration parameter is the logical index of the - configuration (not the bConfigurationValue field). By "logical index" - we mean the relative order of the configurations returned by the - peripheral as a result of GET_DESCRIPTOR request. - """ - self.device = device - self.index = configuration - - backend = device._ctx.backend - - desc = backend.get_configuration_descriptor( - self.device._ctx.dev, - configuration - ) - - _set_attr( - desc, - self, - ( - 'bLength', - 'bDescriptorType', - 'wTotalLength', - 'bNumInterfaces', - 'bConfigurationValue', - 'iConfiguration', - 'bmAttributes', - 'bMaxPower', - 'extra_descriptors' - ) - ) - - def __repr__(self): - return "<" + self._str() + ">" - - def __str__(self): - string = self._get_full_descriptor_str() - for interface in self: - string += "\n%s" % str(interface) - return string - - def interfaces(self): - r"""Return a tuple of the configuration interfaces.""" - return tuple(self) - - def set(self): - r"""Set this configuration as the active one.""" - self.device.set_configuration(self.bConfigurationValue) - - def __iter__(self): - r"""Iterate over all interfaces of the configuration.""" - for i in range(self.bNumInterfaces): - alt = 0 - try: - while True: - yield Interface(self.device, i, alt, self.index) - alt += 1 - except (USBError, IndexError): - pass - - def __getitem__(self, index): - r"""Return the Interface object in the given position. - - index is a tuple of two values with interface index and - alternate setting index, respectivally. Example: - - >>> interface = config[(0, 0)] - """ - return Interface(self.device, index[0], index[1], self.index) - - - def _str(self): - return "CONFIGURATION %d: %d mA" % ( - self.bConfigurationValue, - _lu.MAX_POWER_UNITS_USB2p0 * self.bMaxPower) - - def _get_full_descriptor_str(self): - headstr = " " + self._str() + " " - if self.bmAttributes & (1<<6): - powered = "Self" - else: - powered = "Bus" - - if self.bmAttributes & (1<<5): - remote_wakeup = ", Remote Wakeup" - else: - remote_wakeup = "" - - return "%s%s\n" % (headstr, "=" * (60 - len(headstr))) + \ - " %-21s:%#7x (9 bytes)\n" % ( - "bLength", self.bLength) + \ - " %-21s:%#7x %s\n" % ( - "bDescriptorType", self.bDescriptorType, - _try_lookup(_lu.descriptors, self.bDescriptorType)) + \ - " %-21s:%#7x (%d bytes)\n" % ( - "wTotalLength", self.wTotalLength, self.wTotalLength) + \ - " %-21s:%#7x\n" % ( - "bNumInterfaces", self.bNumInterfaces) + \ - " %-21s:%#7x\n" % ( - "bConfigurationValue", self.bConfigurationValue) + \ - " %-21s:%#7x %s\n" % ( - "iConfiguration", self.iConfiguration, - _try_get_string(self.device, self.iConfiguration)) + \ - " %-21s:%#7x %s Powered%s\n" % ( - "bmAttributes", self.bmAttributes, powered, remote_wakeup - # bit 7 is high, bit 4..0 are 0 - ) + \ - " %-21s:%#7x (%d mA)" % ( - "bMaxPower", self.bMaxPower, - _lu.MAX_POWER_UNITS_USB2p0 * self.bMaxPower) - # FIXME : add a check for superspeed vs usb 2.0 - -class Device(_objfinalizer.AutoFinalizedObject): - r"""Device object. - - This class contains all fields of the Device Descriptor according to the - USB Specification. You may access them as class properties. For example, - to access the field bDescriptorType of the device descriptor, you can - do so: - - >>> import usb.core - >>> dev = usb.core.find() - >>> dev.bDescriptorType - - Additionally, the class provides methods to communicate with the hardware. - Typically, an application will first call the set_configuration() method to - put the device in a known configured state, optionally call the - set_interface_altsetting() to select the alternate setting (if there is - more than one) of the interface used, and call the write() and read() - methods to send and receive data, respectively. - - When working in a new hardware, the first try could be like this: - - >>> import usb.core - >>> dev = usb.core.find(idVendor=myVendorId, idProduct=myProductId) - >>> dev.set_configuration() - >>> dev.write(1, 'test') - - This sample finds the device of interest (myVendorId and myProductId should - be replaced by the corresponding values of your device), then configures - the device (by default, the configuration value is 1, which is a typical - value for most devices) and then writes some data to the endpoint 0x01. - - Timeout values for the write, read and ctrl_transfer methods are specified - in miliseconds. If the parameter is omitted, Device.default_timeout value - will be used instead. This property can be set by the user at anytime. - """ - - def __repr__(self): - return "<" + self._str() + ">" - - def __str__(self): - string = self._get_full_descriptor_str() - try: - for configuration in self: - string += "\n%s" % str(configuration) - except USBError: - try: - configuration = self.get_active_configuration() - string += "\n%s" % (configuration.info) - except USBError: - string += " USBError Accessing Configurations" - return string - - def configurations(self): - r"""Return a tuple of the device configurations.""" - return tuple(self) - - def __init__(self, dev, backend): - r"""Initialize the Device object. - - Library users should normally get a Device instance through - the find function. The dev parameter is the identification - of a device to the backend and its meaning is opaque outside - of it. The backend parameter is a instance of a backend - object. - """ - self._ctx = _ResourceManager(dev, backend) - self.__default_timeout = _DEFAULT_TIMEOUT - self._serial_number, self._product, self._manufacturer = None, None, None - self._langids = None - - desc = backend.get_device_descriptor(dev) - - _set_attr( - desc, - self, - ( - 'bLength', - 'bDescriptorType', - 'bcdUSB', - 'bDeviceClass', - 'bDeviceSubClass', - 'bDeviceProtocol', - 'bMaxPacketSize0', - 'idVendor', - 'idProduct', - 'bcdDevice', - 'iManufacturer', - 'iProduct', - 'iSerialNumber', - 'bNumConfigurations', - 'address', - 'bus', - 'port_number', - 'port_numbers', - 'speed', - ) - ) - - if desc.bus is not None: - self.bus = int(desc.bus) - else: - self.bus = None - - if desc.address is not None: - self.address = int(desc.address) - else: - self.address = None - - if desc.port_number is not None: - self.port_number = int(desc.port_number) - else: - self.port_number = None - - if desc.speed is not None: - self.speed = int(desc.speed) - else: - self.speed = None - - @property - def langids(self): - """ Return the USB device's supported language ID codes. - - These are 16-bit codes familiar to Windows developers, where for - example instead of en-US you say 0x0409. USB_LANGIDS.pdf on the usb.org - developer site for more info. String requests using a LANGID not - in this array should not be sent to the device. - - This property will cause some USB traffic the first time it is accessed - and cache the resulting value for future use. - """ - if self._langids is None: - try: - self._langids = util.get_langids(self) - except USBError: - self._langids = () - return self._langids - - @property - def serial_number(self): - """ Return the USB device's serial number string descriptor. - - This property will cause some USB traffic the first time it is accessed - and cache the resulting value for future use. - """ - if self._serial_number is None: - self._serial_number = util.get_string(self, self.iSerialNumber) - return self._serial_number - - @property - def product(self): - """ Return the USB device's product string descriptor. - - This property will cause some USB traffic the first time it is accessed - and cache the resulting value for future use. - """ - if self._product is None: - self._product = util.get_string(self, self.iProduct) - return self._product - - @property - def manufacturer(self): - """ Return the USB device's manufacturer string descriptor. - - This property will cause some USB traffic the first time it is accessed - and cache the resulting value for future use. - """ - if self._manufacturer is None: - self._manufacturer = util.get_string(self, self.iManufacturer) - return self._manufacturer - - @property - def backend(self): - """Return the backend being used by the device.""" - return self._ctx.backend - - def set_configuration(self, configuration = None): - r"""Set the active configuration. - - The configuration parameter is the bConfigurationValue field of the - configuration you want to set as active. If you call this method - without parameter, it will use the first configuration found. As a - device hardly ever has more than one configuration, calling the method - without arguments is enough to get the device ready. - """ - self._ctx.managed_set_configuration(self, configuration) - - def get_active_configuration(self): - r"""Return a Configuration object representing the current - configuration set. - """ - return self._ctx.get_active_configuration(self) - - def set_interface_altsetting(self, interface = None, alternate_setting = None): - r"""Set the alternate setting for an interface. - - When you want to use an interface and it has more than one alternate - setting, you should call this method to select the appropriate - alternate setting. If you call the method without one or the two - parameters, it will be selected the first one found in the Device in - the same way of the set_configuration method. - - Commonly, an interface has only one alternate setting and this call is - not necessary. For most devices, either it has more than one - alternate setting or not, it is not harmful to make a call to this - method with no arguments, as devices will silently ignore the request - when there is only one alternate setting, though the USB Spec allows - devices with no additional alternate setting return an error to the - Host in response to a SET_INTERFACE request. - - If you are in doubt, you may want to call it with no arguments wrapped - by a try/except clause: - - >>> try: - >>> dev.set_interface_altsetting() - >>> except usb.core.USBError: - >>> pass - """ - self._ctx.managed_set_interface(self, interface, alternate_setting) - - def clear_halt(self, ep): - r""" Clear the halt/stall condition for the endpoint ep.""" - if isinstance(ep, Endpoint): - ep = ep.bEndpointAddress - self._ctx.managed_open() - self._ctx.backend.clear_halt(self._ctx.handle, ep) - - def reset(self): - r"""Reset the device.""" - self._ctx.managed_open() - self._ctx.dispose(self, False) - self._ctx.backend.reset_device(self._ctx.handle) - self._ctx.dispose(self, True) - - def write(self, endpoint, data, timeout = None): - r"""Write data to the endpoint. - - This method is used to send data to the device. The endpoint parameter - corresponds to the bEndpointAddress member whose endpoint you want to - communicate with. - - The data parameter should be a sequence like type convertible to - the array type (see array module). - - The timeout is specified in miliseconds. - - The method returns the number of bytes written. - """ - backend = self._ctx.backend - - fn_map = { - util.ENDPOINT_TYPE_BULK:backend.bulk_write, - util.ENDPOINT_TYPE_INTR:backend.intr_write, - util.ENDPOINT_TYPE_ISO:backend.iso_write - } - - intf, ep = self._ctx.setup_request(self, endpoint) - fn = fn_map[util.endpoint_type(ep.bmAttributes)] - - return fn( - self._ctx.handle, - ep.bEndpointAddress, - intf.bInterfaceNumber, - _interop.as_array(data), - self.__get_timeout(timeout) - ) - - def read(self, endpoint, size_or_buffer, timeout = None): - r"""Read data from the endpoint. - - This method is used to receive data from the device. The endpoint - parameter corresponds to the bEndpointAddress member whose endpoint - you want to communicate with. The size_or_buffer parameter either - tells how many bytes you want to read or supplies the buffer to - receive the data (it *must* be an object of the type array). - - The timeout is specified in miliseconds. - - If the size_or_buffer parameter is the number of bytes to read, the - method returns an array object with the data read. If the - size_or_buffer parameter is an array object, it returns the number - of bytes actually read. - """ - backend = self._ctx.backend - - fn_map = { - util.ENDPOINT_TYPE_BULK:backend.bulk_read, - util.ENDPOINT_TYPE_INTR:backend.intr_read, - util.ENDPOINT_TYPE_ISO:backend.iso_read - } - - intf, ep = self._ctx.setup_request(self, endpoint) - fn = fn_map[util.endpoint_type(ep.bmAttributes)] - - if isinstance(size_or_buffer, array.array): - buff = size_or_buffer - else: # here we consider it is a integer - buff = util.create_buffer(size_or_buffer) - - ret = fn( - self._ctx.handle, - ep.bEndpointAddress, - intf.bInterfaceNumber, - buff, - self.__get_timeout(timeout)) - - if isinstance(size_or_buffer, array.array): - return ret - elif ret != len(buff) * buff.itemsize: - return buff[:ret] - else: - return buff - - def ctrl_transfer(self, bmRequestType, bRequest, wValue=0, wIndex=0, - data_or_wLength = None, timeout = None): - r"""Do a control transfer on the endpoint 0. - - This method is used to issue a control transfer over the endpoint 0 - (endpoint 0 is required to always be a control endpoint). - - The parameters bmRequestType, bRequest, wValue and wIndex are the same - of the USB Standard Control Request format. - - Control requests may or may not have a data payload to write/read. - In cases which it has, the direction bit of the bmRequestType - field is used to infer the desired request direction. For - host to device requests (OUT), data_or_wLength parameter is - the data payload to send, and it must be a sequence type convertible - to an array object. In this case, the return value is the number - of bytes written in the data payload. For device to host requests - (IN), data_or_wLength is either the wLength parameter of the control - request specifying the number of bytes to read in data payload, and - the return value is an array object with data read, or an array - object which the data will be read to, and the return value is the - number of bytes read. - """ - try: - buff = util.create_buffer(data_or_wLength) - except TypeError: - buff = _interop.as_array(data_or_wLength) - - self._ctx.managed_open() - - # Thanks to Johannes Stezenbach to point me out that we need to - # claim the recipient interface - recipient = bmRequestType & 3 - rqtype = bmRequestType & (3 << 5) - if recipient == util.CTRL_RECIPIENT_INTERFACE \ - and rqtype != util.CTRL_TYPE_VENDOR: - interface_number = wIndex & 0xff - self._ctx.managed_claim_interface(self, interface_number) - - ret = self._ctx.backend.ctrl_transfer( - self._ctx.handle, - bmRequestType, - bRequest, - wValue, - wIndex, - buff, - self.__get_timeout(timeout)) - - if isinstance(data_or_wLength, array.array) \ - or util.ctrl_direction(bmRequestType) == util.CTRL_OUT: - return ret - elif ret != len(buff) * buff.itemsize: - return buff[:ret] - else: - return buff - - def is_kernel_driver_active(self, interface): - r"""Determine if there is kernel driver associated with the interface. - - If a kernel driver is active, the object will be unable to perform - I/O. - - The interface parameter is the device interface number to check. - """ - self._ctx.managed_open() - return self._ctx.backend.is_kernel_driver_active( - self._ctx.handle, - interface) - - def detach_kernel_driver(self, interface): - r"""Detach a kernel driver. - - If successful, you will then be able to perform I/O. - - The interface parameter is the device interface number to detach the - driver from. - """ - self._ctx.managed_open() - self._ctx.backend.detach_kernel_driver( - self._ctx.handle, - interface) - - def attach_kernel_driver(self, interface): - r"""Re-attach an interface's kernel driver, which was previously - detached using detach_kernel_driver(). - - The interface parameter is the device interface number to attach the - driver to. - """ - self._ctx.managed_open() - self._ctx.backend.attach_kernel_driver( - self._ctx.handle, - interface) - - def __iter__(self): - r"""Iterate over all configurations of the device.""" - for i in range(self.bNumConfigurations): - yield Configuration(self, i) - - def __getitem__(self, index): - r"""Return the Configuration object in the given position.""" - return Configuration(self, index) - - def _finalize_object(self): - self._ctx.dispose(self) - - def __get_timeout(self, timeout): - if timeout is not None: - return timeout - return self.__default_timeout - - def __set_def_tmo(self, tmo): - if tmo < 0: - raise ValueError('Timeout cannot be a negative value') - self.__default_timeout = tmo - - def __get_def_tmo(self): - return self.__default_timeout - - def _str(self): - return "DEVICE ID %04x:%04x on Bus %03d Address %03d" % ( - self.idVendor, self.idProduct, self.bus, self.address) - - def _get_full_descriptor_str(self): - headstr = self._str() + " " - - if self.bcdUSB & 0xf: - low_bcd_usb = str(self.bcdUSB & 0xf) - else: - low_bcd_usb = "" - - if self.bcdDevice & 0xf: - low_bcd_device = str(self.bcdDevice & 0xf) - else: - low_bcd_device = "" - - return "%s%s\n" % (headstr, "=" * (60 - len(headstr))) + \ - " %-23s:%#7x (18 bytes)\n" % ( - "bLength", self.bLength) + \ - " %-23s:%#7x %s\n" % ( - "bDescriptorType", self.bDescriptorType, - _try_lookup(_lu.descriptors, self.bDescriptorType)) + \ - " %-23s:%#7x USB %d.%d%s\n" % ( - "bcdUSB", self.bcdUSB, (self.bcdUSB & 0xff00)>>8, - (self.bcdUSB & 0xf0) >> 4, low_bcd_usb) + \ - " %-23s:%#7x %s\n" % ( - "bDeviceClass", self.bDeviceClass, - _try_lookup(_lu.device_classes, self.bDeviceClass)) + \ - " %-23s:%#7x\n" % ( - "bDeviceSubClass", self.bDeviceSubClass) + \ - " %-23s:%#7x\n" % ( - "bDeviceProtocol", self.bDeviceProtocol) + \ - " %-23s:%#7x (%d bytes)\n" % ( - "bMaxPacketSize0", self.bMaxPacketSize0, self.bMaxPacketSize0) + \ - " %-23s: %#06x\n" % ( - "idVendor", self.idVendor) + \ - " %-23s: %#06x\n" % ( - "idProduct", self.idProduct) + \ - " %-23s:%#7x Device %d.%d%s\n" % ( - "bcdDevice", self.bcdDevice, (self.bcdDevice & 0xff00)>>8, - (self.bcdDevice & 0xf0) >> 4, low_bcd_device) + \ - " %-23s:%#7x %s\n" % ( - "iManufacturer", self.iManufacturer, - _try_get_string(self, self.iManufacturer)) + \ - " %-23s:%#7x %s\n" % ( - "iProduct", self.iProduct, - _try_get_string(self, self.iProduct)) + \ - " %-23s:%#7x %s\n" % ( - "iSerialNumber", self.iSerialNumber, - _try_get_string(self, self.iSerialNumber)) + \ - " %-23s:%#7x" % ( - "bNumConfigurations", self.bNumConfigurations) - - default_timeout = property( - __get_def_tmo, - __set_def_tmo, - doc = 'Default timeout for transfer I/O functions' - ) - - -def find(find_all=False, backend = None, custom_match = None, **args): - r"""Find an USB device and return it. - - find() is the function used to discover USB devices. You can pass as - arguments any combination of the USB Device Descriptor fields to match a - device. For example: - - find(idVendor=0x3f4, idProduct=0x2009) - - will return the Device object for the device with idVendor field equals - to 0x3f4 and idProduct equals to 0x2009. - - If there is more than one device which matchs the criteria, the first one - found will be returned. If a matching device cannot be found the function - returns None. If you want to get all devices, you can set the parameter - find_all to True, then find will return an iterator with all matched devices. - If no matching device is found, it will return an empty iterator. Example: - - for printer in find(find_all=True, bDeviceClass=7): - print (printer) - - This call will get all the USB printers connected to the system. (actually - may be not, because some devices put their class information in the - Interface Descriptor). - - You can also use a customized match criteria: - - dev = find(custom_match = lambda d: d.idProduct=0x3f4 and d.idvendor=0x2009) - - A more accurate printer finder using a customized match would be like - so: - - def is_printer(dev): - import usb.util - if dev.bDeviceClass == 7: - return True - for cfg in dev: - if usb.util.find_descriptor(cfg, bInterfaceClass=7) is not None: - return True - - for printer in find(find_all=True, custom_match = is_printer): - print (printer) - - Now even if the device class code is in the interface descriptor the - printer will be found. - - You can combine a customized match with device descriptor fields. In this - case, the fields must match and the custom_match must return True. In the - our previous example, if we would like to get all printers belonging to the - manufacturer 0x3f4, the code would be like so: - - printers = list(find(find_all=True, idVendor=0x3f4, custom_match=is_printer)) - - If you want to use find as a 'list all devices' function, just call - it with find_all = True: - - devices = list(find(find_all=True)) - - Finally, you can pass a custom backend to the find function: - - find(backend = MyBackend()) - - PyUSB has builtin backends for libusb 0.1, libusb 1.0 and OpenUSB. If you - do not supply a backend explicitly, find() function will select one of the - predefineds backends according to system availability. - - Backends are explained in the usb.backend module. - """ - def device_iter(**kwargs): - for dev in backend.enumerate_devices(): - d = Device(dev, backend) - tests = (val == getattr(d, key) for key, val in kwargs.items()) - if _interop._all(tests) and (custom_match is None or custom_match(d)): - yield d - - if backend is None: - import usb.backend.libusb1 as libusb1 - import usb.backend.libusb0 as libusb0 - import usb.backend.openusb as openusb - - for m in (libusb1, openusb, libusb0): - backend = m.get_backend() - if backend is not None: - _logger.info('find(): using backend "%s"', m.__name__) - break - else: - raise NoBackendError('No backend available') - - if find_all: - return device_iter(**args) - else: - try: - return _interop._next(device_iter(**args)) - except StopIteration: - return None - -def show_devices(verbose=False, **kwargs): - """Show information about connected devices. - - The verbose flag sets to verbose or not. - **kwargs are passed directly to the find() function. - """ - kwargs["find_all"] = True - devices = find(**kwargs) - strings = "" - for device in devices: - if not verbose: - strings += "%s, %s\n" % (device._str(), _try_lookup( - _lu.device_classes, device.bDeviceClass)) - else: - strings += "%s\n\n" % str(device) - - return _DescriptorInfo(strings) diff --git a/silhouette/pyusb-1.0.2/usb/core.pyc b/silhouette/pyusb-1.0.2/usb/core.pyc deleted file mode 100644 index 4be803aac46106a12b54572a294fc4c90bc02c83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43477 zcmeHwdvILWdEZ?C1OX5rD3Jn1J+CM;0u>6PWLvToQ6ULXHfjn~E+A2+rK}gb7vz$Q zU2yM0BowKxO~sZQ$4S#9OF8!QDZ1-?1&n}QDbLxemFXZiz88EG-?e-7l)#AxNE07qI0Nb z$Eb$-cDysXI1-)1v7L@a7ssM=WBznkba6a7H{nlrN9T6?J_&Iu$k0CYqXz-X4t3?bqp^=xtQKJ8IzZ z1JMcwcqi*$i=t1SyC-Vw)x-BjjeSvipKjk3Zr>j@rlRx#UELq9J{UFbj?!3H4}_}^ z5nir^d&1R&1f;uqZ@Bs}A?&W+7p{JQpijr5i-*+o{o%$pMCl_O9LM*7MmEhWjR!Td z!6ml*I_7dcTb`+Rx@r7aJj?%HT09xAq_y69H_c|o#+EKLvv{@BSZ}3qdUdVS z?Pbr5jm@R6H|u<)7S~&~EQ`D88tSL*UbB537uiTdb!Nt9JMER``SotC*X*>f|46-5 zt&wK+ZgZ{I>CTMJw|i-KrFMh&wc}=}Q+)DNyRp{6t?RzE9jCrZ@wt^|yD@!OPpz!C z>*{!~6Z3LmXaG-kp>w5b1I@O0fVbn`h19_!iye^g;6A|rY^~i$yYcB-vzq}lvz@G0 z>v5qOczY8#EJ3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@Fa1m|6|gu%Rgw9 zF_?UlzCm5s=sAsN;K-Zz6XX$%RF_I87h?J4Y_Qk?^XbNBvu;MTY(U)VUwo&1zx+$&z(AQk5BhvoHV3)>rf ztK=YE02cekmk|ztR5kASiJ7CKTW8kNHl786HmGUf$VtT|st6>8bNg4PSDEjriTL;< zMkEgh*csz<$(FcL!ThCa4k!ki1)mU7{kW#+#z9n;((_>8#wFs~>-ffJZ5bPsdp;wQ z8!75TuHgG?Y{#!k5+C0=3$HYOT89K2_NROkWny|-uC}9hAo41O%iL?9mWdZekqWOu zJcaxUsd+^!1X{0xyPaT-HW6 zh>qX5$5MigTRuJ!kUNh&;a|hOBxV5|jtuI=rz+;IClm5wud_BUnGl)M6d5ZOn=sJSNSz)5gp+Sz z3!^;R#bScRBnsips_-VCs)Uc+cv2Eh{||B|sO(2`ckbjjM(`KDiE;ehi`cJ8e4u;` z0kix4z5sTfK>P%L*;^=p{$|tWN5^plZ4fIDnkY<-SC<%cHTT+SDzjKQ*{7%+LjPlo zycQ}J0I(3+E3cSQ5%#^O@$BV?Rd_%}`16%k?L5^6=r>5|>n?%>gPs~`di2ptNT+w+2pTy7bpd^n z8oQ1PJOKKs=K}U%vQHC5P!VQ_pr*jWCJQkBAG0{<2JUDo%w%yNPeH<>XT3@rb+p*;k))L3+gP@Zzk|g;Mi^C`s%z>49+ScYB zoSdKKO_DV;S;?NKDLBDvgn9CfES_U=ghk5YTUi`up><6*Vd=5arjei%__p@*ZXAs> zit7~(PW}b!0?tuFi09L@4Z<%tK5Ja_InI2>ZVkf(ILYWuty%_-*b&w+*YCjS5JKH2 g$H%7d^^~a}p4vM#H1*l3FHU{-z`N0ZyYtik7m0qw1^@s6 diff --git a/silhouette/pyusb-1.0.2/usb/legacy.py b/silhouette/pyusb-1.0.2/usb/legacy.py deleted file mode 100644 index 07e21594..00000000 --- a/silhouette/pyusb-1.0.2/usb/legacy.py +++ /dev/null @@ -1,355 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -import usb.core as core -import usb.util as util -import usb._objfinalizer as _objfinalizer -import usb.control as control - -from itertools import groupby - -__author__ = 'Wander Lairson Costa' - -USBError = core.USBError - -CLASS_AUDIO = 1 -CLASS_COMM = 2 -CLASS_DATA = 10 -CLASS_HID = 3 -CLASS_HUB = 9 -CLASS_MASS_STORAGE = 8 -CLASS_PER_INTERFACE = 0 -CLASS_PRINTER = 7 -CLASS_VENDOR_SPEC = 255 -DT_CONFIG = 2 -DT_CONFIG_SIZE = 9 -DT_DEVICE = 1 -DT_DEVICE_SIZE = 18 -DT_ENDPOINT = 5 -DT_ENDPOINT_AUDIO_SIZE = 9 -DT_ENDPOINT_SIZE = 7 -DT_HID = 33 -DT_HUB = 41 -DT_HUB_NONVAR_SIZE = 7 -DT_INTERFACE = 4 -DT_INTERFACE_SIZE = 9 -DT_PHYSICAL = 35 -DT_REPORT = 34 -DT_STRING = 3 -ENDPOINT_ADDRESS_MASK = 15 -ENDPOINT_DIR_MASK = 128 -ENDPOINT_IN = 128 -ENDPOINT_OUT = 0 -ENDPOINT_TYPE_BULK = 2 -ENDPOINT_TYPE_CONTROL = 0 -ENDPOINT_TYPE_INTERRUPT = 3 -ENDPOINT_TYPE_ISOCHRONOUS = 1 -ENDPOINT_TYPE_MASK = 3 -ERROR_BEGIN = 500000 -MAXALTSETTING = 128 -MAXCONFIG = 8 -MAXENDPOINTS = 32 -MAXINTERFACES = 32 -RECIP_DEVICE = 0 -RECIP_ENDPOINT = 2 -RECIP_INTERFACE = 1 -RECIP_OTHER = 3 -REQ_CLEAR_FEATURE = 1 -REQ_GET_CONFIGURATION = 8 -REQ_GET_DESCRIPTOR = 6 -REQ_GET_INTERFACE = 10 -REQ_GET_STATUS = 0 -REQ_SET_ADDRESS = 5 -REQ_SET_CONFIGURATION = 9 -REQ_SET_DESCRIPTOR = 7 -REQ_SET_FEATURE = 3 -REQ_SET_INTERFACE = 11 -REQ_SYNCH_FRAME = 12 -TYPE_CLASS = 32 -TYPE_RESERVED = 96 -TYPE_STANDARD = 0 -TYPE_VENDOR = 64 - -class Endpoint(object): - r"""Endpoint descriptor object.""" - def __init__(self, ep): - self.address = ep.bEndpointAddress - self.interval = ep.bInterval - self.maxPacketSize = ep.wMaxPacketSize - self.type = util.endpoint_type(ep.bmAttributes) - -class Interface(object): - r"""Interface descriptor object.""" - def __init__(self, intf): - self.alternateSetting = intf.bAlternateSetting - self.interfaceNumber = intf.bInterfaceNumber - self.iInterface = intf.iInterface - self.interfaceClass = intf.bInterfaceClass - self.interfaceSubClass = intf.bInterfaceSubClass - self.interfaceProtocol = intf.bInterfaceProtocol - self.endpoints = [Endpoint(e) for e in intf] - -class Configuration(object): - r"""Configuration descriptor object.""" - def __init__(self, cfg): - self.iConfiguration = cfg.iConfiguration - self.maxPower = cfg.bMaxPower << 1 - self.remoteWakeup = (cfg.bmAttributes >> 5) & 1 - self.selfPowered = (cfg.bmAttributes >> 6) & 1 - self.totalLength = cfg.wTotalLength - self.value = cfg.bConfigurationValue - self.interfaces = [ - list(g) for k, g in groupby( - sorted( - [Interface(i) for i in cfg], - key=lambda i: i.interfaceNumber - ), - lambda i: i.alternateSetting) - ] - -class DeviceHandle(_objfinalizer.AutoFinalizedObject): - def __init__(self, dev): - self.dev = dev - self.__claimed_interface = None - - def _finalize_object(self): - util.dispose_resources(self.dev) - self.dev = None - - def bulkWrite(self, endpoint, buffer, timeout = 100): - r"""Perform a bulk write request to the endpoint specified. - - Arguments: - endpoint: endpoint number. - buffer: sequence data buffer to write. - This parameter can be any sequence type. - timeout: operation timeout in milliseconds. (default: 100) - Returns the number of bytes written. - """ - return self.dev.write(endpoint, buffer, timeout) - - def bulkRead(self, endpoint, size, timeout = 100): - r"""Performs a bulk read request to the endpoint specified. - - Arguments: - endpoint: endpoint number. - size: number of bytes to read. - timeout: operation timeout in milliseconds. (default: 100) - Returns a tuple with the data read. - """ - return self.dev.read(endpoint, size, timeout) - - def interruptWrite(self, endpoint, buffer, timeout = 100): - r"""Perform a interrupt write request to the endpoint specified. - - Arguments: - endpoint: endpoint number. - buffer: sequence data buffer to write. - This parameter can be any sequence type. - timeout: operation timeout in milliseconds. (default: 100) - Returns the number of bytes written. - """ - return self.dev.write(endpoint, buffer, timeout) - - def interruptRead(self, endpoint, size, timeout = 100): - r"""Performs a interrupt read request to the endpoint specified. - - Arguments: - endpoint: endpoint number. - size: number of bytes to read. - timeout: operation timeout in milliseconds. (default: 100) - Returns a tuple with the data read. - """ - return self.dev.read(endpoint, size, timeout) - - def controlMsg(self, requestType, request, buffer, value = 0, index = 0, timeout = 100): - r"""Perform a control request to the default control pipe on a device. - - Arguments: - requestType: specifies the direction of data flow, the type - of request, and the recipient. - request: specifies the request. - buffer: if the transfer is a write transfer, buffer is a sequence - with the transfer data, otherwise, buffer is the number of - bytes to read. - value: specific information to pass to the device. (default: 0) - index: specific information to pass to the device. (default: 0) - timeout: operation timeout in milliseconds. (default: 100) - Returns the number of bytes written. - """ - return self.dev.ctrl_transfer( - requestType, - request, - wValue = value, - wIndex = index, - data_or_wLength = buffer, - timeout = timeout) - - def clearHalt(self, endpoint): - r"""Clears any halt status on the specified endpoint. - - Arguments: - endpoint: endpoint number. - """ - self.dev.clear_halt(endpoint) - - def claimInterface(self, interface): - r"""Claims the interface with the Operating System. - - Arguments: - interface: interface number or an Interface object. - """ - if isinstance(interface, Interface): - interface = interface.interfaceNumber - - util.claim_interface(self.dev, interface) - self.__claimed_interface = interface - - def releaseInterface(self): - r"""Release an interface previously claimed with claimInterface.""" - util.release_interface(self.dev, self.__claimed_interface) - self.__claimed_interface = -1 - - def reset(self): - r"""Reset the specified device by sending a RESET - down the port it is connected to.""" - self.dev.reset() - - def resetEndpoint(self, endpoint): - r"""Reset all states for the specified endpoint. - - Arguments: - endpoint: endpoint number. - """ - self.clearHalt(endpoint) - - def setConfiguration(self, configuration): - r"""Set the active configuration of a device. - - Arguments: - configuration: a configuration value or a Configuration object. - """ - if isinstance(configuration, Configuration): - configuration = configuration.value - - self.dev.set_configuration(configuration) - - def setAltInterface(self, alternate): - r"""Sets the active alternate setting of the current interface. - - Arguments: - alternate: an alternate setting number or an Interface object. - """ - if isinstance(alternate, Interface): - alternate = alternate.alternateSetting - - self.dev.set_interface_altsetting(self.__claimed_interface, alternate) - - def getString(self, index, length, langid = None): - r"""Retrieve the string descriptor specified by index - and langid from a device. - - Arguments: - index: index of descriptor in the device. - length: number of bytes of the string (ignored) - langid: Language ID. If it is omitted, the first - language will be used. - """ - return util.get_string(self.dev, index, langid).encode('ascii') - - def getDescriptor(self, desc_type, desc_index, length, endpoint = -1): - r"""Retrieves a descriptor from the device identified by the type - and index of the descriptor. - - Arguments: - desc_type: descriptor type. - desc_index: index of the descriptor. - len: descriptor length. - endpoint: ignored. - """ - return control.get_descriptor(self.dev, length, desc_type, desc_index) - - def detachKernelDriver(self, interface): - r"""Detach a kernel driver from the interface (if one is attached, - we have permission and the operation is supported by the OS) - - Arguments: - interface: interface number or an Interface object. - """ - if isinstance(interface, Interface): - interface = interface.interfaceNumber - - self.dev.detach_kernel_driver(interface) - -class Device(object): - r"""Device descriptor object""" - def __init__(self, dev): - self.deviceClass = dev.bDeviceClass - self.deviceSubClass = dev.bDeviceSubClass - self.deviceProtocol = dev.bDeviceProtocol - self.deviceVersion = str((dev.bcdDevice >> 12) & 0xf) + \ - str((dev.bcdDevice >> 8) & 0xf) + \ - '.' + \ - str((dev.bcdDevice >> 4) & 0xf) + \ - str(dev.bcdDevice & 0xf) - self.devnum = dev.address - self.filename = '' - self.iManufacturer = dev.iManufacturer - self.iProduct = dev.iProduct - self.iSerialNumber = dev.iSerialNumber - self.idProduct = dev.idProduct - self.idVendor = dev.idVendor - self.maxPacketSize = dev.bMaxPacketSize0 - self.usbVersion = str((dev.bcdUSB >> 12) & 0xf) + \ - str((dev.bcdUSB >> 8) & 0xf) + \ - '.' + \ - str((dev.bcdUSB >> 4) & 0xf) + \ - str(dev.bcdUSB & 0xf) - self.configurations = [Configuration(c) for c in dev] - self.dev = dev - - def open(self): - r"""Open the device for use. - - Returns a DeviceHandle object - """ - return DeviceHandle(self.dev) - -class Bus(object): - r"""Bus object.""" - def __init__(self, devices): - self.dirname = '' - self.devices = [Device(d) for d in devices] - self.location = self.devices[0].dev.bus - -def busses(): - r"""Returns a tuple with the usb busses.""" - return (Bus(g) for k, g in groupby( - sorted(core.find(find_all=True), key=lambda d: d.bus), - lambda d: d.bus)) - diff --git a/silhouette/pyusb-1.0.2/usb/legacy.pyc b/silhouette/pyusb-1.0.2/usb/legacy.pyc deleted file mode 100644 index e39c6f81ea2acdfc0ab29b085281c1a328bac7c0..0000000000000000000000000000000000000000 GIT bin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?HQ>Mo9pJW1(5J2uYsm9wSbZyycG#d}gST0w?TSx$B`(!3B4;Wk1 z>b*y;dZqjz*@RhJZJO=mtkU~_ z`rce?3#C#(`_XF6T3&l_e|#PR1L-)2cEpsz_+a%`vvSXDHkxa# zJ*JX{%Mwi!G+wUV#S-aItdxIRe$Yk&zRgXOjRA?tPORcBnWvR>NYUJqU7EE@eKn@N zaDoOT-NX;mptPe1fQB{O_iCo#)U17ERUXtp(>t|td(Er~ZV0_wOIUHuEVt{;hU_r; zQmwTrW_=Z$pAN$g*<|F-q;ac_p{vx%+5@(50rOvd9} zgk>v8TRv)3?pb%t@=8sFT+^G1KyWLsJPt7*)~Xov5zZM3M0VCZm6{wsk# zIlF`vi2RpFk$)$?hUqjV3oe1AxEW&D%)dk1%yt}1)l!$<)c?`t7B8HJJXJhVkl*6T c;&icuyUAbkZ*hKR{^ ctypes.CDLL). - """ - try: - if lib_cls: - return lib_cls(lib) - else: - return ctypes.CDLL(lib) - except Exception: - if name: - lib_msg = '%s (%s)' % (name, lib) - else: - lib_msg = lib - - lib_msg += ' could not be loaded' - - if sys.platform == 'cygwin': - lib_msg += ' in cygwin' - _LOGGER.error(lib_msg, exc_info=True) - return None - -def load_locate_library(candidates, cygwin_lib, name, - win_cls=None, cygwin_cls=None, others_cls=None, - find_library=None, check_symbols=None): - """Locates and loads a library. - - Returns: the loaded library - - arguments: - * candidates -- candidates list for locate_library() - * cygwin_lib -- name of the cygwin library - * name -- lib identifier (for logging). Defaults to None. - * win_cls -- class that is used to instantiate the library on - win32 platforms. Defaults to None (-> ctypes.CDLL). - * cygwin_cls -- library class for cygwin platforms. - Defaults to None (-> ctypes.CDLL). - * others_cls -- library class for all other platforms. - Defaults to None (-> ctypes.CDLL). - * find_library -- see locate_library(). Defaults to None. - * check_symbols -- either None or a list of symbols that the loaded lib - must provide (hasattr(<>)) in order to be considered - valid. LibraryMissingSymbolsException is raised if - any symbol is missing. - - raises: - * NoLibraryCandidatesException - * LibraryNotFoundException - * LibraryNotLoadedException - * LibraryMissingSymbolsException - """ - if sys.platform == 'cygwin': - if cygwin_lib: - loaded_lib = load_library(cygwin_lib, name, cygwin_cls) - else: - raise NoLibraryCandidatesException(name) - elif candidates: - lib = locate_library(candidates, find_library) - if lib: - if sys.platform == 'win32': - loaded_lib = load_library(lib, name, win_cls) - else: - loaded_lib = load_library(lib, name, others_cls) - else: - _LOGGER.error('%r could not be found', (name or candidates)) - raise LibraryNotFoundException(name) - else: - raise NoLibraryCandidatesException(name) - - if loaded_lib is None: - raise LibraryNotLoadedException(name) - elif check_symbols: - symbols_missing = [ - s for s in check_symbols if not hasattr(loaded_lib, s) - ] - if symbols_missing: - msg = ('%r, missing symbols: %r', lib, symbols_missing ) - _LOGGER.error(msg) - raise LibraryMissingSymbolsException(lib) - else: - return loaded_lib - else: - return loaded_lib diff --git a/silhouette/pyusb-1.0.2/usb/libloader.pyc b/silhouette/pyusb-1.0.2/usb/libloader.pyc deleted file mode 100644 index 8fe04c38ec12ae43c2f05d0d750c75bd71ee9dc3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5552 zcmd5=-EP~+6+WcoAIWxCM>Ps@i))?2B?^}*T%mB4 z!Uhdi>8MW9rBn1b=@LpX>XKZczC+;}y&$?I`rQ$vYa~}q?|RwWV3o3AdN<16CR@p6 zuav!OY&h?2mA&gEiB31@^a_Pn=>_b!cxC*5jb30K*NR))iR*QGu|!ALxxeGxKt!Vd z;&Z64qInPlWI!Y7$qgm%+sy|D|NjMvP7lVgsK4(8j!YB;1R5O7e&&@ta zgHTqczdsxOJW?u32A#?9IE^a`u0SMCd(hgAt!sMSbOmAA!Apptx;rnZHqbv-$8AjH zVVRXj0SAD7jj!S}f%qLcQZ=Yuzs!!fZ&uZ}M{#)r;9bSD}@r+}*gfDx%&;5VGWeS?8(b+0x z?~r!r6#Q1B3x^Vbqi(p)p);4#Pgt@Pfc%9^&p)Oq(ZfIN(M64>E@i)`sUgshaSsKU zfqO9JMV+Q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qq`26C==bYm6)4xe}K38HUpXGbzb6MtbR`IX#5PLIY9REG;|$*)Ucd;TkeW$Ub5M$gR6$hV}mUZY-wdS!*q1JAO*a6;$meW z^#R6ZX12r(Kj}Q;QpCJ5vfE?!jkm{aiEp-qOMJVRY}4*9uVGe&nAZ1J%9}##zI{#h g;HNO8wsBc^%wMhMRR0?FR_#{tSHHg5dcWcP4?m1wKmY&$ diff --git a/silhouette/pyusb-1.0.2/usb/util.py b/silhouette/pyusb-1.0.2/usb/util.py deleted file mode 100644 index ea6490aa..00000000 --- a/silhouette/pyusb-1.0.2/usb/util.py +++ /dev/null @@ -1,330 +0,0 @@ -# Copyright (C) 2009-2014 Wander Lairson Costa -# -# The following terms apply to all files associated -# with the software unless explicitly disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. - -r"""usb.util - Utility functions. - -This module exports: - -endpoint_address - return the endpoint absolute address. -endpoint_direction - return the endpoint transfer direction. -endpoint_type - return the endpoint type -ctrl_direction - return the direction of a control transfer -build_request_type - build a bmRequestType field of a control transfer. -find_descriptor - find an inner descriptor. -claim_interface - explicitly claim an interface. -release_interface - explicitly release an interface. -dispose_resources - release internal resources allocated by the object. -get_langids - retrieve the list of supported string languages from the device. -get_string - retrieve a string descriptor from the device. -""" - -__author__ = 'Wander Lairson Costa' - -import operator -import array -from sys import hexversion -import usb._interop as _interop - -# descriptor type -DESC_TYPE_DEVICE = 0x01 -DESC_TYPE_CONFIG = 0x02 -DESC_TYPE_STRING = 0x03 -DESC_TYPE_INTERFACE = 0x04 -DESC_TYPE_ENDPOINT = 0x05 - -# endpoint direction -ENDPOINT_IN = 0x80 -ENDPOINT_OUT = 0x00 - -# endpoint type -ENDPOINT_TYPE_CTRL = 0x00 -ENDPOINT_TYPE_ISO = 0x01 -ENDPOINT_TYPE_BULK = 0x02 -ENDPOINT_TYPE_INTR = 0x03 - -# control request type -CTRL_TYPE_STANDARD = (0 << 5) -CTRL_TYPE_CLASS = (1 << 5) -CTRL_TYPE_VENDOR = (2 << 5) -CTRL_TYPE_RESERVED = (3 << 5) - -# control request recipient -CTRL_RECIPIENT_DEVICE = 0 -CTRL_RECIPIENT_INTERFACE = 1 -CTRL_RECIPIENT_ENDPOINT = 2 -CTRL_RECIPIENT_OTHER = 3 - -# control request direction -CTRL_OUT = 0x00 -CTRL_IN = 0x80 - -_ENDPOINT_ADDR_MASK = 0x0f -_ENDPOINT_DIR_MASK = 0x80 -_ENDPOINT_TRANSFER_TYPE_MASK = 0x03 -_CTRL_DIR_MASK = 0x80 - -# For compatibility between Python 2 and 3 -_dummy_s = '\x00'.encode('utf-8') - -# speed type -SPEED_LOW = 1 -SPEED_FULL = 2 -SPEED_HIGH = 3 -SPEED_SUPER = 4 -SPEED_UNKNOWN = 0 - -def endpoint_address(address): - r"""Return the endpoint absolute address. - - The address parameter is the bEndpointAddress field - of the endpoint descriptor. - """ - return address & _ENDPOINT_ADDR_MASK - -def endpoint_direction(address): - r"""Return the endpoint direction. - - The address parameter is the bEndpointAddress field - of the endpoint descriptor. - The possible return values are ENDPOINT_OUT or ENDPOINT_IN. - """ - return address & _ENDPOINT_DIR_MASK - -def endpoint_type(bmAttributes): - r"""Return the transfer type of the endpoint. - - The bmAttributes parameter is the bmAttributes field - of the endpoint descriptor. - The possible return values are: ENDPOINT_TYPE_CTRL, - ENDPOINT_TYPE_ISO, ENDPOINT_TYPE_BULK or ENDPOINT_TYPE_INTR. - """ - return bmAttributes & _ENDPOINT_TRANSFER_TYPE_MASK - -def ctrl_direction(bmRequestType): - r"""Return the direction of a control request. - - The bmRequestType parameter is the value of the - bmRequestType field of a control transfer. - The possible return values are CTRL_OUT or CTRL_IN. - """ - return bmRequestType & _CTRL_DIR_MASK - -def build_request_type(direction, type, recipient): - r"""Build a bmRequestType field for control requests. - - These is a conventional function to build a bmRequestType - for a control request. - - The direction parameter can be CTRL_OUT or CTRL_IN. - The type parameter can be CTRL_TYPE_STANDARD, CTRL_TYPE_CLASS, - CTRL_TYPE_VENDOR or CTRL_TYPE_RESERVED values. - The recipient can be CTRL_RECIPIENT_DEVICE, CTRL_RECIPIENT_INTERFACE, - CTRL_RECIPIENT_ENDPOINT or CTRL_RECIPIENT_OTHER. - - Return the bmRequestType value. - """ - return recipient | type | direction - -def create_buffer(length): - r"""Create a buffer to be passed to a read function. - - A read function may receive an out buffer so the data - is read inplace and the object can be reused, avoiding - the overhead of creating a new object at each new read - call. This function creates a compatible sequence buffer - of the given length. - """ - return array.array('B', _dummy_s * length) - -def find_descriptor(desc, find_all=False, custom_match=None, **args): - r"""Find an inner descriptor. - - find_descriptor works in the same way as the core.find() function does, - but it acts on general descriptor objects. For example, suppose you - have a Device object called dev and want a Configuration of this - object with its bConfigurationValue equals to 1, the code would - be like so: - - >>> cfg = util.find_descriptor(dev, bConfigurationValue=1) - - You can use any field of the Descriptor as a match criteria, and you - can supply a customized match just like core.find() does. The - find_descriptor function also accepts the find_all parameter to get - an iterator instead of just one descriptor. - """ - def desc_iter(**kwargs): - for d in desc: - tests = (val == getattr(d, key) for key, val in kwargs.items()) - if _interop._all(tests) and (custom_match is None or custom_match(d)): - yield d - - if find_all: - return desc_iter(**args) - else: - try: - return _interop._next(desc_iter(**args)) - except StopIteration: - return None - -def claim_interface(device, interface): - r"""Explicitly claim an interface. - - PyUSB users normally do not have to worry about interface claiming, - as the library takes care of it automatically. But there are situations - where you need deterministic interface claiming. For these uncommon - cases, you can use claim_interface. - - If the interface is already claimed, either through a previously call - to claim_interface or internally by the device object, nothing happens. - """ - device._ctx.managed_claim_interface(device, interface) - -def release_interface(device, interface): - r"""Explicitly release an interface. - - This function is used to release an interface previously claimed, - either through a call to claim_interface or internally by the - device object. - - Normally, you do not need to worry about claiming policies, as - the device object takes care of it automatically. - """ - device._ctx.managed_release_interface(device, interface) - -def dispose_resources(device): - r"""Release internal resources allocated by the object. - - Sometimes you need to provide deterministic resources - freeing, for example to allow another application to - talk to the device. As Python does not provide deterministic - destruction, this function releases all internal resources - allocated by the device, like device handle and interface - policy. - - After calling this function, you can continue using the device - object normally. If the resources will be necessary again, it - will be allocated automatically. - """ - device._ctx.dispose(device) - -def get_langids(dev): - r"""Retrieve the list of supported Language IDs from the device. - - Most client code should not call this function directly, but instead use - the langids property on the Device object, which will call this function as - needed and cache the result. - - USB LANGIDs are 16-bit integers familiar to Windows developers, where - for example instead of en-US you say 0x0409. See the file USB_LANGIDS.pdf - somewhere on the usb.org site for a list, which does not claim to be - complete. It requires "system software must allow the enumeration and - selection of LANGIDs that are not currently on this list." It also requires - "system software should never request a LANGID not defined in the LANGID - code array (string index = 0) presented by a device." Client code can - check this tuple before issuing string requests for a specific language ID. - - dev is the Device object whose supported language IDs will be retrieved. - - The return value is a tuple of integer LANGIDs, possibly empty if the - device does not support strings at all (which USB 3.1 r1.0 section - 9.6.9 allows). In that case client code should not request strings at all. - - A USBError may be raised from this function for some devices that have no - string support, instead of returning an empty tuple. The accessor for the - langids property on Device catches that case and supplies an empty tuple, - so client code can ignore this detail by using the langids property instead - of directly calling this function. - """ - from usb.control import get_descriptor - buf = get_descriptor( - dev, - 254, - DESC_TYPE_STRING, - 0 - ) - - # The array is retrieved by asking for string descriptor zero, which is - # never the index of a real string. The returned descriptor has bLength - # and bDescriptorType bytes followed by pairs of bytes representing - # little-endian LANGIDs. That is, buf[0] contains the length of the - # returned array, buf[2] is the least-significant byte of the first LANGID - # (if any), buf[3] is the most-significant byte, and in general the LSBs of - # all the LANGIDs are given by buf[2:buf[0]:2] and MSBs by buf[3:buf[0]:2]. - # If the length of buf came back odd, something is wrong. - - if len(buf) < 4 or buf[0] < 4 or buf[0]&1 != 0: - return () - - return tuple(map(lambda x,y: x+(y<<8), buf[2:buf[0]:2], buf[3:buf[0]:2])) - -def get_string(dev, index, langid = None): - r"""Retrieve a string descriptor from the device. - - dev is the Device object which the string will be read from. - - index is the string descriptor index and langid is the Language - ID of the descriptor. If langid is omitted, the string descriptor - of the first Language ID will be returned. - - Zero is never the index of a real string. The USB spec allows a device to - use zero in a string index field to indicate that no string is provided. - So the caller does not have to treat that case specially, this function - returns None if passed an index of zero, and generates no traffic - to the device. - - The return value is the unicode string present in the descriptor, or None - if the requested index was zero. - - It is a ValueError to request a real string (index not zero), if: the - device's langid tuple is empty, or with an explicit langid the device does - not support. - """ - if 0 == index: - return None - - from usb.control import get_descriptor - langids = dev.langids - - if 0 == len(langids): - raise ValueError("The device has no langid") - if langid is None: - langid = langids[0] - elif langid not in langids: - raise ValueError("The device does not support the specified langid") - - buf = get_descriptor( - dev, - 255, # Maximum descriptor size - DESC_TYPE_STRING, - index, - langid - ) - if hexversion >= 0x03020000: - return buf[2:buf[0]].tobytes().decode('utf-16-le') - else: - return buf[2:buf[0]].tostring().decode('utf-16-le') diff --git a/silhouette/pyusb-1.0.2/usb/util.pyc b/silhouette/pyusb-1.0.2/usb/util.pyc deleted file mode 100644 index 7b0045d2f5a0afc9cde88363bee45bfd427be1ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11587 zcmcIqOLH4ncD^7biiD_#<%cX=_FQX{F*QTMl09+89$96Iglxt%q%v@j5>tmDN-wm2DRJ0of(XER%I6-*@iqZUBTNPO2gat?t|R zaqfA3=iHwEuT$0UzB|6tR_@O{{{I+1^Jf*M0;P6vt*D)f3g%QWuX=N82RHV9UhT}w z{V~-$ruxU#&T&<7?-ta96Kdy#3edW!f(5m+qyn^5Rj{abPO4x@?JTRHs&-DP;H26) zE!Q*B|E%EB0zDGg)dQPdK*{uz;sHd;!yZA54M!GYM+gX&vrdF+PcO#?wNigh% zI(#%p(#(8Vt%h+hNTN7v`9Y9|#$a$7X2UerSr`4>TkY?fq&Lh$?Yh;WPMGSV{xO?oNeUv^qWxG$am;-cuWHqH&yV^o z@H0$1ew$kZt9wy9%6cO$FYP$@zE(}cUg(?fX+zxWsX;+x1_=g1V979ThgNDb5op5P zvEPFj^Ot_Fm$dyX4D{|u#G33rfXHgqy)bL_{CF=4oZQnWd>BfXUSu*d#0&>i6^u1m z8pV5>{fGV@*6gH7U-|~&!>AqF>0B?-B0HO(k1Y9gc&K>^T72J+1MqXpk5ZGwdOb0j zAN>Y@8Y}QKDy!ns4Ie!WQv;oj*cL(WRYZRj9pmLVFTdagKNX$9C1XEj_-2@OuKc9U zXZ|>J9Y3>(%VTteQ)|jf<_TK7Bbh-}}MaI55EF5s^A&R_(W zaOGOaF!{Z);WL zT`*eOH=DOtr@G#}yY<GYU zJ}e})coa$f3%ZXJC zPSdQ!oM#Ua{cdirH8$3~ja561w5@NgHJjGLWNvA^2V=YK(U{6MuimVC_v#zkIzwwy zToo8C8bn}$9;eZ(uW#PjtRt*!)bDMs*WH?BGa^piyS0Wl!V_7je4AT)K|}fK_V%ZB zn6!)mWVzVIcU|XtjEHy0CXHw9a-y z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