├── .gitignore ├── .tito ├── packages │ ├── .readme │ └── python-hwdata ├── releasers.conf └── tito.props ├── LICENSE ├── Makefile ├── README.md ├── example.py ├── html ├── api-objects.txt ├── class-tree.html ├── crarr.png ├── epydoc.css ├── epydoc.js ├── frames.html ├── help.html ├── hwdata-module.html ├── hwdata-pysrc.html ├── hwdata.PCI-class.html ├── hwdata.USB-class.html ├── identifier-index.html ├── index.html ├── module-tree.html ├── redirect.html ├── toc-everything.html ├── toc-hwdata-module.html └── toc.html ├── hwdata.py ├── pylintrc ├── pyproject.toml ├── python-hwdata.spec └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # PyInstaller 26 | # Usually these files are written by a python script from a template 27 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .cache 40 | nosetests.xml 41 | coverage.xml 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | -------------------------------------------------------------------------------- /.tito/packages/.readme: -------------------------------------------------------------------------------- 1 | the rel-eng/packages directory contains metadata files 2 | named after their packages. Each file has the latest tagged 3 | version and the project's relative directory. 4 | -------------------------------------------------------------------------------- /.tito/packages/python-hwdata: -------------------------------------------------------------------------------- 1 | 2.4.3-1 ./ 2 | -------------------------------------------------------------------------------- /.tito/releasers.conf: -------------------------------------------------------------------------------- 1 | [fedora-git-rawhide] 2 | releaser = tito.release.FedoraGitReleaser 3 | branches = rawhide 4 | 5 | [fedora-git-all] 6 | releaser = tito.release.FedoraGitReleaser 7 | branches = rawhide f28 f27 8 | 9 | [epel-all] 10 | #it is part of el7 already 11 | releaser = tito.release.FedoraGitReleaser 12 | branches = el6 13 | -------------------------------------------------------------------------------- /.tito/tito.props: -------------------------------------------------------------------------------- 1 | [buildconfig] 2 | builder = tito.builder.Builder 3 | tagger = tito.tagger.VersionTagger 4 | changelog_do_not_remove_cherrypick = 0 5 | changelog_format = %s (%ae) 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include ../../rel-eng/Makefile 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-hwdata 2 | 3 | Provides python interface to database stored in [hwdata](https://github.com/vcrhonek/hwdata) package. 4 | It allows you to get human readable description of USB and PCI devices. 5 | 6 | [![PyPI version](https://badge.fury.io/py/hwdata.svg)](https://pypi.org/project/hwdata/) 7 | [![PyPI - License](https://img.shields.io/pypi/l/hwdata)](https://opensource.org/licenses/) 8 | 9 | ## Example 10 | 11 | ``` 12 | #!/usr/bin/python 13 | 14 | from hwdata import PCI, USB, PNP 15 | 16 | # for obtaining real id of your devices you can use package python-gudev 17 | 18 | pci_vendor_id = '1002' 19 | pci_device_id = '687f' 20 | pci_subsystem_id = '1043:04c4' 21 | 22 | usb_vendor_id = '03f0' 23 | usb_device_id = '1f12' 24 | 25 | 26 | pci = PCI() 27 | print("Vendor: %s" % pci.get_vendor(pci_vendor_id)) 28 | print("Device: %s" % pci.get_device(pci_vendor_id, pci_device_id)) 29 | print("Subsystem: %s" % pci.get_subsystem(pci_vendor_id, pci_device_id, pci_subsystem_id)) 30 | 31 | 32 | usb = USB() 33 | print("Vendor: %s" % usb.get_vendor(usb_vendor_id)) 34 | print("Device: %s" % usb.get_device(usb_vendor_id, usb_device_id)) 35 | 36 | pnp = PNP() 37 | print("Vendor: %s" $ pnp.get_vendor('AAA')) 38 | ``` 39 | 40 | ## Upstream 41 | 42 | https://github.com/xsuchy/python-hwdata 43 | 44 | ## Build package 45 | 46 | When you run: 47 | ``` 48 | tito build --tgz 49 | ``` 50 | you will get latest tar.gz file. 51 | 52 | When you run: 53 | ``` 54 | tito build --rpm 55 | ``` 56 | you will get latest rpm package. 57 | 58 | ## Distributions 59 | 60 | This package is present in [Fedora and EPEL](http://koji.fedoraproject.org/koji/packageinfo?packageID=10271). You should be able to just `dnf install python-hwdata`. 61 | 62 | ## License 63 | 64 | GPL-2.0-or-later 65 | -------------------------------------------------------------------------------- /example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from hwdata import PCI, USB, PNP 4 | 5 | # for obtaining real id of your devices you can use package python-gudev 6 | 7 | pci_vendor_id = '1002' 8 | pci_device_id = '687f' 9 | pci_subsystem_id = '1043:04c4' 10 | 11 | usb_vendor_id = '03f0' 12 | usb_device_id = '1f12' 13 | 14 | 15 | pci = PCI() 16 | print("Vendor: %s" % pci.get_vendor(pci_vendor_id)) 17 | print("Device: %s" % pci.get_device(pci_vendor_id, pci_device_id)) 18 | print("Subsystem: %s" % pci.get_subsystem(pci_vendor_id, pci_device_id, pci_subsystem_id)) 19 | 20 | 21 | usb = USB() 22 | print("Vendor: %s" % usb.get_vendor(usb_vendor_id)) 23 | print("Device: %s" % usb.get_device(usb_vendor_id, usb_device_id)) 24 | 25 | pnp = PNP() 26 | print("Vendor: %s" % pnp.get_vendor('AAA')) 27 | -------------------------------------------------------------------------------- /html/api-objects.txt: -------------------------------------------------------------------------------- 1 | hwdata hwdata-module.html 2 | hwdata.__package__ hwdata-module.html#__package__ 3 | hwdata.PCI hwdata.PCI-class.html 4 | hwdata.PCI.__init__ hwdata.PCI-class.html#__init__ 5 | hwdata.PCI.get_vendor hwdata.PCI-class.html#get_vendor 6 | hwdata.PCI.filename hwdata.PCI-class.html#filename 7 | hwdata.PCI.devices hwdata.PCI-class.html#devices 8 | hwdata.PCI.get_device hwdata.PCI-class.html#get_device 9 | hwdata.USB hwdata.USB-class.html 10 | hwdata.USB.__init__ hwdata.USB-class.html#__init__ 11 | hwdata.USB.get_vendor hwdata.USB-class.html#get_vendor 12 | hwdata.USB.filename hwdata.USB-class.html#filename 13 | hwdata.USB.devices hwdata.USB-class.html#devices 14 | hwdata.USB.get_device hwdata.USB-class.html#get_device 15 | -------------------------------------------------------------------------------- /html/class-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 |
53 | [ Module Hierarchy 54 | | Class Hierarchy ] 55 |

56 |

Class Hierarchy

57 |
    58 |
  • hwdata.PCI: 59 | Interace to pci.ids from hwdata package 60 |
  • 61 |
  • hwdata.USB: 62 | Interace to usb.ids from hwdata package 63 |
  • 64 |
65 | 66 | 68 | 69 | 70 | 72 | 73 | 74 | 76 | 77 | 78 | 80 | 81 | 82 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 93 | 97 | 98 |
99 | 100 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /html/crarr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsuchy/python-hwdata/8bd5ea6863f55faaf43483d5b1553ec1d8b427ea/html/crarr.png -------------------------------------------------------------------------------- /html/epydoc.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Epydoc CSS Stylesheet 4 | * 5 | * This stylesheet can be used to customize the appearance of epydoc's 6 | * HTML output. 7 | * 8 | */ 9 | 10 | /* Default Colors & Styles 11 | * - Set the default foreground & background color with 'body'; and 12 | * link colors with 'a:link' and 'a:visited'. 13 | * - Use bold for decision list terms. 14 | * - The heading styles defined here are used for headings *within* 15 | * docstring descriptions. All headings used by epydoc itself use 16 | * either class='epydoc' or class='toc' (CSS styles for both 17 | * defined below). 18 | */ 19 | body { background: #ffffff; color: #000000; } 20 | p { margin-top: 0.5em; margin-bottom: 0.5em; } 21 | a:link { color: #0000ff; } 22 | a:visited { color: #204080; } 23 | dt { font-weight: bold; } 24 | h1 { font-size: +140%; font-style: italic; 25 | font-weight: bold; } 26 | h2 { font-size: +125%; font-style: italic; 27 | font-weight: bold; } 28 | h3 { font-size: +110%; font-style: italic; 29 | font-weight: normal; } 30 | code { font-size: 100%; } 31 | /* N.B.: class, not pseudoclass */ 32 | a.link { font-family: monospace; } 33 | 34 | /* Page Header & Footer 35 | * - The standard page header consists of a navigation bar (with 36 | * pointers to standard pages such as 'home' and 'trees'); a 37 | * breadcrumbs list, which can be used to navigate to containing 38 | * classes or modules; options links, to show/hide private 39 | * variables and to show/hide frames; and a page title (using 40 | *

). The page title may be followed by a link to the 41 | * corresponding source code (using 'span.codelink'). 42 | * - The footer consists of a navigation bar, a timestamp, and a 43 | * pointer to epydoc's homepage. 44 | */ 45 | h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } 46 | h2.epydoc { font-size: +130%; font-weight: bold; } 47 | h3.epydoc { font-size: +115%; font-weight: bold; 48 | margin-top: 0.2em; } 49 | td h3.epydoc { font-size: +115%; font-weight: bold; 50 | margin-bottom: 0; } 51 | table.navbar { background: #a0c0ff; color: #000000; 52 | border: 2px groove #c0d0d0; } 53 | table.navbar table { color: #000000; } 54 | th.navbar-select { background: #70b0ff; 55 | color: #000000; } 56 | table.navbar a { text-decoration: none; } 57 | table.navbar a:link { color: #0000ff; } 58 | table.navbar a:visited { color: #204080; } 59 | span.breadcrumbs { font-size: 85%; font-weight: bold; } 60 | span.options { font-size: 70%; } 61 | span.codelink { font-size: 85%; } 62 | td.footer { font-size: 85%; } 63 | 64 | /* Table Headers 65 | * - Each summary table and details section begins with a 'header' 66 | * row. This row contains a section title (marked by 67 | * 'span.table-header') as well as a show/hide private link 68 | * (marked by 'span.options', defined above). 69 | * - Summary tables that contain user-defined groups mark those 70 | * groups using 'group header' rows. 71 | */ 72 | td.table-header { background: #70b0ff; color: #000000; 73 | border: 1px solid #608090; } 74 | td.table-header table { color: #000000; } 75 | td.table-header table a:link { color: #0000ff; } 76 | td.table-header table a:visited { color: #204080; } 77 | span.table-header { font-size: 120%; font-weight: bold; } 78 | th.group-header { background: #c0e0f8; color: #000000; 79 | text-align: left; font-style: italic; 80 | font-size: 115%; 81 | border: 1px solid #608090; } 82 | 83 | /* Summary Tables (functions, variables, etc) 84 | * - Each object is described by a single row of the table with 85 | * two cells. The left cell gives the object's type, and is 86 | * marked with 'code.summary-type'. The right cell gives the 87 | * object's name and a summary description. 88 | * - CSS styles for the table's header and group headers are 89 | * defined above, under 'Table Headers' 90 | */ 91 | table.summary { border-collapse: collapse; 92 | background: #e8f0f8; color: #000000; 93 | border: 1px solid #608090; 94 | margin-bottom: 0.5em; } 95 | td.summary { border: 1px solid #608090; } 96 | code.summary-type { font-size: 85%; } 97 | table.summary a:link { color: #0000ff; } 98 | table.summary a:visited { color: #204080; } 99 | 100 | 101 | /* Details Tables (functions, variables, etc) 102 | * - Each object is described in its own div. 103 | * - A single-row summary table w/ table-header is used as 104 | * a header for each details section (CSS style for table-header 105 | * is defined above, under 'Table Headers'). 106 | */ 107 | table.details { border-collapse: collapse; 108 | background: #e8f0f8; color: #000000; 109 | border: 1px solid #608090; 110 | margin: .2em 0 0 0; } 111 | table.details table { color: #000000; } 112 | table.details a:link { color: #0000ff; } 113 | table.details a:visited { color: #204080; } 114 | 115 | /* Fields */ 116 | dl.fields { margin-left: 2em; margin-top: 1em; 117 | margin-bottom: 1em; } 118 | dl.fields dd ul { margin-left: 0em; padding-left: 0em; } 119 | dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } 120 | div.fields { margin-left: 2em; } 121 | div.fields p { margin-bottom: 0.5em; } 122 | 123 | /* Index tables (identifier index, term index, etc) 124 | * - link-index is used for indices containing lists of links 125 | * (namely, the identifier index & term index). 126 | * - index-where is used in link indices for the text indicating 127 | * the container/source for each link. 128 | * - metadata-index is used for indices containing metadata 129 | * extracted from fields (namely, the bug index & todo index). 130 | */ 131 | table.link-index { border-collapse: collapse; 132 | background: #e8f0f8; color: #000000; 133 | border: 1px solid #608090; } 134 | td.link-index { border-width: 0px; } 135 | table.link-index a:link { color: #0000ff; } 136 | table.link-index a:visited { color: #204080; } 137 | span.index-where { font-size: 70%; } 138 | table.metadata-index { border-collapse: collapse; 139 | background: #e8f0f8; color: #000000; 140 | border: 1px solid #608090; 141 | margin: .2em 0 0 0; } 142 | td.metadata-index { border-width: 1px; border-style: solid; } 143 | table.metadata-index a:link { color: #0000ff; } 144 | table.metadata-index a:visited { color: #204080; } 145 | 146 | /* Function signatures 147 | * - sig* is used for the signature in the details section. 148 | * - .summary-sig* is used for the signature in the summary 149 | * table, and when listing property accessor functions. 150 | * */ 151 | .sig-name { color: #006080; } 152 | .sig-arg { color: #008060; } 153 | .sig-default { color: #602000; } 154 | .summary-sig { font-family: monospace; } 155 | .summary-sig-name { color: #006080; font-weight: bold; } 156 | table.summary a.summary-sig-name:link 157 | { color: #006080; font-weight: bold; } 158 | table.summary a.summary-sig-name:visited 159 | { color: #006080; font-weight: bold; } 160 | .summary-sig-arg { color: #006040; } 161 | .summary-sig-default { color: #501800; } 162 | 163 | /* Subclass list 164 | */ 165 | ul.subclass-list { display: inline; } 166 | ul.subclass-list li { display: inline; } 167 | 168 | /* To render variables, classes etc. like functions */ 169 | table.summary .summary-name { color: #006080; font-weight: bold; 170 | font-family: monospace; } 171 | table.summary 172 | a.summary-name:link { color: #006080; font-weight: bold; 173 | font-family: monospace; } 174 | table.summary 175 | a.summary-name:visited { color: #006080; font-weight: bold; 176 | font-family: monospace; } 177 | 178 | /* Variable values 179 | * - In the 'variable details' sections, each varaible's value is 180 | * listed in a 'pre.variable' box. The width of this box is 181 | * restricted to 80 chars; if the value's repr is longer than 182 | * this it will be wrapped, using a backslash marked with 183 | * class 'variable-linewrap'. If the value's repr is longer 184 | * than 3 lines, the rest will be ellided; and an ellipsis 185 | * marker ('...' marked with 'variable-ellipsis') will be used. 186 | * - If the value is a string, its quote marks will be marked 187 | * with 'variable-quote'. 188 | * - If the variable is a regexp, it is syntax-highlighted using 189 | * the re* CSS classes. 190 | */ 191 | pre.variable { padding: .5em; margin: 0; 192 | background: #dce4ec; color: #000000; 193 | border: 1px solid #708890; } 194 | .variable-linewrap { color: #604000; font-weight: bold; } 195 | .variable-ellipsis { color: #604000; font-weight: bold; } 196 | .variable-quote { color: #604000; font-weight: bold; } 197 | .variable-group { color: #008000; font-weight: bold; } 198 | .variable-op { color: #604000; font-weight: bold; } 199 | .variable-string { color: #006030; } 200 | .variable-unknown { color: #a00000; font-weight: bold; } 201 | .re { color: #000000; } 202 | .re-char { color: #006030; } 203 | .re-op { color: #600000; } 204 | .re-group { color: #003060; } 205 | .re-ref { color: #404040; } 206 | 207 | /* Base tree 208 | * - Used by class pages to display the base class hierarchy. 209 | */ 210 | pre.base-tree { font-size: 80%; margin: 0; } 211 | 212 | /* Frames-based table of contents headers 213 | * - Consists of two frames: one for selecting modules; and 214 | * the other listing the contents of the selected module. 215 | * - h1.toc is used for each frame's heading 216 | * - h2.toc is used for subheadings within each frame. 217 | */ 218 | h1.toc { text-align: center; font-size: 105%; 219 | margin: 0; font-weight: bold; 220 | padding: 0; } 221 | h2.toc { font-size: 100%; font-weight: bold; 222 | margin: 0.5em 0 0 -0.3em; } 223 | 224 | /* Syntax Highlighting for Source Code 225 | * - doctest examples are displayed in a 'pre.py-doctest' block. 226 | * If the example is in a details table entry, then it will use 227 | * the colors specified by the 'table pre.py-doctest' line. 228 | * - Source code listings are displayed in a 'pre.py-src' block. 229 | * Each line is marked with 'span.py-line' (used to draw a line 230 | * down the left margin, separating the code from the line 231 | * numbers). Line numbers are displayed with 'span.py-lineno'. 232 | * The expand/collapse block toggle button is displayed with 233 | * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not 234 | * modify the font size of the text.) 235 | * - If a source code page is opened with an anchor, then the 236 | * corresponding code block will be highlighted. The code 237 | * block's header is highlighted with 'py-highlight-hdr'; and 238 | * the code block's body is highlighted with 'py-highlight'. 239 | * - The remaining py-* classes are used to perform syntax 240 | * highlighting (py-string for string literals, py-name for names, 241 | * etc.) 242 | */ 243 | pre.py-doctest { padding: .5em; margin: 1em; 244 | background: #e8f0f8; color: #000000; 245 | border: 1px solid #708890; } 246 | table pre.py-doctest { background: #dce4ec; 247 | color: #000000; } 248 | pre.py-src { border: 2px solid #000000; 249 | background: #f0f0f0; color: #000000; } 250 | .py-line { border-left: 2px solid #000000; 251 | margin-left: .2em; padding-left: .4em; } 252 | .py-lineno { font-style: italic; font-size: 90%; 253 | padding-left: .5em; } 254 | a.py-toggle { text-decoration: none; } 255 | div.py-highlight-hdr { border-top: 2px solid #000000; 256 | border-bottom: 2px solid #000000; 257 | background: #d8e8e8; } 258 | div.py-highlight { border-bottom: 2px solid #000000; 259 | background: #d0e0e0; } 260 | .py-prompt { color: #005050; font-weight: bold;} 261 | .py-more { color: #005050; font-weight: bold;} 262 | .py-string { color: #006030; } 263 | .py-comment { color: #003060; } 264 | .py-keyword { color: #600000; } 265 | .py-output { color: #404040; } 266 | .py-name { color: #000050; } 267 | .py-name:link { color: #000050 !important; } 268 | .py-name:visited { color: #000050 !important; } 269 | .py-number { color: #005000; } 270 | .py-defname { color: #000060; font-weight: bold; } 271 | .py-def-name { color: #000060; font-weight: bold; } 272 | .py-base-class { color: #000060; } 273 | .py-param { color: #000060; } 274 | .py-docstring { color: #006030; } 275 | .py-decorator { color: #804020; } 276 | /* Use this if you don't want links to names underlined: */ 277 | /*a.py-name { text-decoration: none; }*/ 278 | 279 | /* Graphs & Diagrams 280 | * - These CSS styles are used for graphs & diagrams generated using 281 | * Graphviz dot. 'img.graph-without-title' is used for bare 282 | * diagrams (to remove the border created by making the image 283 | * clickable). 284 | */ 285 | img.graph-without-title { border: none; } 286 | img.graph-with-title { border: 1px solid #000000; } 287 | span.graph-title { font-weight: bold; } 288 | span.graph-caption { } 289 | 290 | /* General-purpose classes 291 | * - 'p.indent-wrapped-lines' defines a paragraph whose first line 292 | * is not indented, but whose subsequent lines are. 293 | * - The 'nomargin-top' class is used to remove the top margin (e.g. 294 | * from lists). The 'nomargin' class is used to remove both the 295 | * top and bottom margin (but not the left or right margin -- 296 | * for lists, that would cause the bullets to disappear.) 297 | */ 298 | p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; 299 | margin: 0; } 300 | .nomargin-top { margin-top: 0; } 301 | .nomargin { margin-top: 0; margin-bottom: 0; } 302 | 303 | /* HTML Log */ 304 | div.log-block { padding: 0; margin: .5em 0 .5em 0; 305 | background: #e8f0f8; color: #000000; 306 | border: 1px solid #000000; } 307 | div.log-error { padding: .1em .3em .1em .3em; margin: 4px; 308 | background: #ffb0b0; color: #000000; 309 | border: 1px solid #000000; } 310 | div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; 311 | background: #ffffb0; color: #000000; 312 | border: 1px solid #000000; } 313 | div.log-info { padding: .1em .3em .1em .3em; margin: 4px; 314 | background: #b0ffb0; color: #000000; 315 | border: 1px solid #000000; } 316 | h2.log-hdr { background: #70b0ff; color: #000000; 317 | margin: 0; padding: 0em 0.5em 0em 0.5em; 318 | border-bottom: 1px solid #000000; font-size: 110%; } 319 | p.log { font-weight: bold; margin: .5em 0 .5em 0; } 320 | tr.opt-changed { color: #000000; font-weight: bold; } 321 | tr.opt-default { color: #606060; } 322 | pre.log { margin: 0; padding: 0; padding-left: 1em; } 323 | -------------------------------------------------------------------------------- /html/epydoc.js: -------------------------------------------------------------------------------- 1 | function toggle_private() { 2 | // Search for any private/public links on this page. Store 3 | // their old text in "cmd," so we will know what action to 4 | // take; and change their text to the opposite action. 5 | var cmd = "?"; 6 | var elts = document.getElementsByTagName("a"); 7 | for(var i=0; i...
"; 127 | elt.innerHTML = s; 128 | } 129 | } 130 | 131 | function toggle(id) { 132 | elt = document.getElementById(id+"-toggle"); 133 | if (elt.innerHTML == "-") 134 | collapse(id); 135 | else 136 | expand(id); 137 | return false; 138 | } 139 | 140 | function highlight(id) { 141 | var elt = document.getElementById(id+"-def"); 142 | if (elt) elt.className = "py-highlight-hdr"; 143 | var elt = document.getElementById(id+"-expanded"); 144 | if (elt) elt.className = "py-highlight"; 145 | var elt = document.getElementById(id+"-collapsed"); 146 | if (elt) elt.className = "py-highlight"; 147 | } 148 | 149 | function num_lines(s) { 150 | var n = 1; 151 | var pos = s.indexOf("\n"); 152 | while ( pos > 0) { 153 | n += 1; 154 | pos = s.indexOf("\n", pos+1); 155 | } 156 | return n; 157 | } 158 | 159 | // Collapse all blocks that mave more than `min_lines` lines. 160 | function collapse_all(min_lines) { 161 | var elts = document.getElementsByTagName("div"); 162 | for (var i=0; i 0) 166 | if (elt.id.substring(split, elt.id.length) == "-expanded") 167 | if (num_lines(elt.innerHTML) > min_lines) 168 | collapse(elt.id.substring(0, split)); 169 | } 170 | } 171 | 172 | function expandto(href) { 173 | var start = href.indexOf("#")+1; 174 | if (start != 0 && start != href.length) { 175 | if (href.substring(start, href.length) != "-") { 176 | collapse_all(4); 177 | pos = href.indexOf(".", start); 178 | while (pos != -1) { 179 | var id = href.substring(start, pos); 180 | expand(id); 181 | pos = href.indexOf(".", pos+1); 182 | } 183 | var id = href.substring(start, href.length); 184 | expand(id); 185 | highlight(id); 186 | } 187 | } 188 | } 189 | 190 | function kill_doclink(id) { 191 | var parent = document.getElementById(id); 192 | parent.removeChild(parent.childNodes.item(0)); 193 | } 194 | function auto_kill_doclink(ev) { 195 | if (!ev) var ev = window.event; 196 | if (!this.contains(ev.toElement)) { 197 | var parent = document.getElementById(this.parentID); 198 | parent.removeChild(parent.childNodes.item(0)); 199 | } 200 | } 201 | 202 | function doclink(id, name, targets_id) { 203 | var elt = document.getElementById(id); 204 | 205 | // If we already opened the box, then destroy it. 206 | // (This case should never occur, but leave it in just in case.) 207 | if (elt.childNodes.length > 1) { 208 | elt.removeChild(elt.childNodes.item(0)); 209 | } 210 | else { 211 | // The outer box: relative + inline positioning. 212 | var box1 = document.createElement("div"); 213 | box1.style.position = "relative"; 214 | box1.style.display = "inline"; 215 | box1.style.top = 0; 216 | box1.style.left = 0; 217 | 218 | // A shadow for fun 219 | var shadow = document.createElement("div"); 220 | shadow.style.position = "absolute"; 221 | shadow.style.left = "-1.3em"; 222 | shadow.style.top = "-1.3em"; 223 | shadow.style.background = "#404040"; 224 | 225 | // The inner box: absolute positioning. 226 | var box2 = document.createElement("div"); 227 | box2.style.position = "relative"; 228 | box2.style.border = "1px solid #a0a0a0"; 229 | box2.style.left = "-.2em"; 230 | box2.style.top = "-.2em"; 231 | box2.style.background = "white"; 232 | box2.style.padding = ".3em .4em .3em .4em"; 233 | box2.style.fontStyle = "normal"; 234 | box2.onmouseout=auto_kill_doclink; 235 | box2.parentID = id; 236 | 237 | // Get the targets 238 | var targets_elt = document.getElementById(targets_id); 239 | var targets = targets_elt.getAttribute("targets"); 240 | var links = ""; 241 | target_list = targets.split(","); 242 | for (var i=0; i" + 246 | target[0] + ""; 247 | } 248 | 249 | // Put it all together. 250 | elt.insertBefore(box1, elt.childNodes.item(0)); 251 | //box1.appendChild(box2); 252 | box1.appendChild(shadow); 253 | shadow.appendChild(box2); 254 | box2.innerHTML = 255 | "Which "+name+" do you want to see documentation for?" + 256 | ""; 261 | } 262 | return false; 263 | } 264 | 265 | function get_anchor() { 266 | var href = location.href; 267 | var start = href.indexOf("#")+1; 268 | if ((start != 0) && (start != href.length)) 269 | return href.substring(start, href.length); 270 | } 271 | function redirect_url(dottedName) { 272 | // Scan through each element of the "pages" list, and check 273 | // if "name" matches with any of them. 274 | for (var i=0; i-m" or "-c"; 277 | // extract the portion & compare it to dottedName. 278 | var pagename = pages[i].substring(0, pages[i].length-2); 279 | if (pagename == dottedName.substring(0,pagename.length)) { 280 | 281 | // We've found a page that matches `dottedName`; 282 | // construct its URL, using leftover `dottedName` 283 | // content to form an anchor. 284 | var pagetype = pages[i].charAt(pages[i].length-1); 285 | var url = pagename + ((pagetype=="m")?"-module.html": 286 | "-class.html"); 287 | if (dottedName.length > pagename.length) 288 | url += "#" + dottedName.substring(pagename.length+1, 289 | dottedName.length); 290 | return url; 291 | } 292 | } 293 | } 294 | -------------------------------------------------------------------------------- /html/frames.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /html/help.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Help 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 | 53 |

API Documentation

54 | 55 |

This document contains the API (Application Programming Interface) 56 | documentation for this project. Documentation for the Python 57 | objects defined by the project is divided into separate pages for each 58 | package, module, and class. The API documentation also includes two 59 | pages containing information about the project as a whole: a trees 60 | page, and an index page.

61 | 62 |

Object Documentation

63 | 64 |

Each Package Documentation page contains:

65 |
    66 |
  • A description of the package.
  • 67 |
  • A list of the modules and sub-packages contained by the 68 | package.
  • 69 |
  • A summary of the classes defined by the package.
  • 70 |
  • A summary of the functions defined by the package.
  • 71 |
  • A summary of the variables defined by the package.
  • 72 |
  • A detailed description of each function defined by the 73 | package.
  • 74 |
  • A detailed description of each variable defined by the 75 | package.
  • 76 |
77 | 78 |

Each Module Documentation page contains:

79 |
    80 |
  • A description of the module.
  • 81 |
  • A summary of the classes defined by the module.
  • 82 |
  • A summary of the functions defined by the module.
  • 83 |
  • A summary of the variables defined by the module.
  • 84 |
  • A detailed description of each function defined by the 85 | module.
  • 86 |
  • A detailed description of each variable defined by the 87 | module.
  • 88 |
89 | 90 |

Each Class Documentation page contains:

91 |
    92 |
  • A class inheritance diagram.
  • 93 |
  • A list of known subclasses.
  • 94 |
  • A description of the class.
  • 95 |
  • A summary of the methods defined by the class.
  • 96 |
  • A summary of the instance variables defined by the class.
  • 97 |
  • A summary of the class (static) variables defined by the 98 | class.
  • 99 |
  • A detailed description of each method defined by the 100 | class.
  • 101 |
  • A detailed description of each instance variable defined by the 102 | class.
  • 103 |
  • A detailed description of each class (static) variable defined 104 | by the class.
  • 105 |
106 | 107 |

Project Documentation

108 | 109 |

The Trees page contains the module and class hierarchies:

110 |
    111 |
  • The module hierarchy lists every package and module, with 112 | modules grouped into packages. At the top level, and within each 113 | package, modules and sub-packages are listed alphabetically.
  • 114 |
  • The class hierarchy lists every class, grouped by base 115 | class. If a class has more than one base class, then it will be 116 | listed under each base class. At the top level, and under each base 117 | class, classes are listed alphabetically.
  • 118 |
119 | 120 |

The Index page contains indices of terms and 121 | identifiers:

122 |
    123 |
  • The term index lists every term indexed by any object's 124 | documentation. For each term, the index provides links to each 125 | place where the term is indexed.
  • 126 |
  • The identifier index lists the (short) name of every package, 127 | module, class, method, function, variable, and parameter. For each 128 | identifier, the index provides a short description, and a link to 129 | its documentation.
  • 130 |
131 | 132 |

The Table of Contents

133 | 134 |

The table of contents occupies the two frames on the left side of 135 | the window. The upper-left frame displays the project 136 | contents, and the lower-left frame displays the module 137 | contents:

138 | 139 | 140 | 141 | 143 | 146 | 147 | 148 | 151 | 152 |
142 | Project
Contents
...
144 | API
Documentation
Frame


145 |
149 | Module
Contents
 
...
  150 |

153 | 154 |

The project contents frame contains a list of all packages 155 | and modules that are defined by the project. Clicking on an entry 156 | will display its contents in the module contents frame. Clicking on a 157 | special entry, labeled "Everything," will display the contents of 158 | the entire project.

159 | 160 |

The module contents frame contains a list of every 161 | submodule, class, type, exception, function, and variable defined by a 162 | module or package. Clicking on an entry will display its 163 | documentation in the API documentation frame. Clicking on the name of 164 | the module, at the top of the frame, will display the documentation 165 | for the module itself.

166 | 167 |

The "frames" and "no frames" buttons below the top 168 | navigation bar can be used to control whether the table of contents is 169 | displayed or not.

170 | 171 |

The Navigation Bar

172 | 173 |

A navigation bar is located at the top and bottom of every page. 174 | It indicates what type of page you are currently viewing, and allows 175 | you to go to related pages. The following table describes the labels 176 | on the navigation bar. Note that not some labels (such as 177 | [Parent]) are not displayed on all pages.

178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 192 | 193 | 194 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 |
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object 191 |
[Module]viewing a modulethe module containing the current object 195 |
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
209 | 210 |

The "show private" and "hide private" buttons below 211 | the top navigation bar can be used to control whether documentation 212 | for private objects is displayed. Private objects are usually defined 213 | as objects whose (short) names begin with a single underscore, but do 214 | not end with an underscore. For example, "_x", 215 | "__pprint", and "epydoc.epytext._tokenize" 216 | are private objects; but "re.sub", 217 | "__init__", and "type_" are not. However, 218 | if a module defines the "__all__" variable, then its 219 | contents are used to decide which objects are private.

220 | 221 |

A timestamp below the bottom navigation bar indicates when each 222 | page was last updated.

223 | 224 | 226 | 227 | 228 | 230 | 231 | 232 | 234 | 235 | 236 | 238 | 239 | 240 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 251 | 255 | 256 |
257 | 258 | 267 | 268 | 269 | -------------------------------------------------------------------------------- /html/hwdata-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hwdata 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 43 | 54 | 55 |
39 | 40 | Module hwdata 41 | 42 | 44 | 45 | 46 | 48 | 52 |
[hide private]
[frames] | no frames]
53 |
56 | 57 |

Module hwdata

source code

58 |

Query hwdata database and return decription of vendor and/or 59 | device.

60 | 61 | 62 | 63 | 65 | 66 | 77 | 78 | 79 | 85 | 86 | 87 | 93 | 94 |
67 | 68 | 69 | 70 | 74 | 75 |
Classes[hide private]
76 |
80 |   81 | 82 | USB
83 | Interace to usb.ids from hwdata package 84 |
88 |   89 | 90 | PCI
91 | Interace to pci.ids from hwdata package 92 |
95 | 96 | 97 | 99 | 100 | 111 | 112 | 113 | 118 | 119 |
101 | 102 | 103 | 104 | 108 | 109 |
Variables[hide private]
110 |
114 |   115 | 116 | __package__ = None 117 |
120 | 121 | 123 | 124 | 125 | 127 | 128 | 129 | 131 | 132 | 133 | 135 | 136 | 137 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 148 | 152 | 153 |
154 | 155 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /html/hwdata-pysrc.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hwdata 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 43 | 54 | 55 |
39 | 40 | Module hwdata 41 | 42 | 44 | 45 | 46 | 48 | 52 |
[hide private]
[frames] | no frames]
53 |
56 |

Source Code for Module hwdata

57 |
 58 |   1  # 
 59 |   2  # Copyright (c) 1999--2010 Red Hat Inc. 
 60 |   3  # 
 61 |   4  # This software is licensed to you under the GNU General Public License, 
 62 |   5  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 63 |   6  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 64 |   7  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 65 |   8  # along with this software; if not, see 
 66 |   9  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
 67 |  10  # 
 68 |  11  # Red Hat trademarks are not licensed under GPLv2. No permission is 
 69 |  12  # granted to use or replicate Red Hat trademarks that are incorporated 
 70 |  13  # in this software or its documentation. 
 71 |  14  # 
 72 |  15   
 73 |  16  """ Query hwdata database and return decription of vendor and/or device. """ 
 74 |  17   
 75 | 
18 -class USB: 76 |
19 """ Interace to usb.ids from hwdata package """ 77 | 20 filename = '/usr/share/hwdata/usb.ids' 79 | 21 devices = None 81 | 22 82 |
23 - def __init__(self, filename=None): 83 |
24 """ Load pci.ids from file to internal data structure. 84 | 25 parameter 'filename' can specify location of this file 85 | 26 """ 86 | 27 if filename: 88 | 28 self.filename = filename 91 | 29 else: 92 | 30 self.filename = USB.filename 95 | 31 self.cache = 1 96 | 32 97 | 33 if self.cache and not USB.devices: 99 | 34 # parse usb.ids 100 | 35 USB.devices = {} 102 | 36 for line in open(self.filename).readlines(): 104 | 37 l = line.split() 105 | 38 if line.startswith('#'): 106 | 39 if line.startswith('# List of known device classes, subclasses and protocols'): 107 | 40 break # end of database of devices, rest is protocols, types etc. 108 | 41 else: 109 | 42 continue 110 | 43 elif len(l) == 0: 111 | 44 continue 112 | 45 elif line.startswith('\t\t'): 113 | 46 interface_id = l[0].lower() 114 | 47 if len(l) > 2: 115 | 48 interface_name = ' '.join(l[1:]) 116 | 49 else: 117 | 50 interface_name = '' 118 | 51 USB.devices[vendor][1][device][0][interface_id] = interface_name 120 | 52 elif line.startswith('\t'): 121 | 53 device = l[0].lower() 122 | 54 device_name = ' '.join(l[1:]) 123 | 55 USB.devices[vendor][1][device] = [device_name, {}] 125 | 56 else: 126 | 57 vendor = l[0].lower() 127 | 58 vendor_name = ' '.join(l[1:]) 128 | 59 if not USB.devices.has_key(vendor): 130 | 60 USB.devices[vendor] = [vendor_name, {}] 132 | 61 else: # this should not happen 133 | 62 USB.devices[vendor][0] = vendor_name 135 |
63 136 |
64 - def get_vendor(self, vendor): 137 |
65 """ Return description of vendor. Parameter is two byte code in hexa. 138 | 66 If vendor is unknown None is returned. 139 | 67 """ 140 | 68 vendor = vendor.lower() 141 | 69 if self.cache: 142 | 70 if USB.devices.has_key(vendor): 144 | 71 return USB.devices[vendor][0] 146 | 72 else: 147 | 73 return None 148 | 74 else: 149 | 75 raise # not implemented yet 150 |
76 151 |
77 - def get_device(self, vendor, device): 152 |
78 """ Return description of device. Parameters are two byte code variables in hexa. 153 | 79 If device is unknown None is returned. 154 | 80 """ 155 | 81 vendor = vendor.lower() 156 | 82 device = device.lower() 157 | 83 if self.cache: 158 | 84 if USB.devices.has_key(vendor): 160 | 85 if USB.devices[vendor][1].has_key(device): 162 | 86 return USB.devices[vendor][1][device][0] 164 | 87 else: 165 | 88 return None 166 | 89 else: 167 | 90 return None 168 | 91 else: 169 | 92 raise # not implemented yet 170 |
93 171 |
94 -class PCI: 172 |
95 """ Interace to pci.ids from hwdata package """ 173 | 96 filename = '/usr/share/hwdata/pci.ids' 175 | 97 devices = None 177 | 98 178 |
99 - def __init__(self, filename=None): 179 |
100 """ Load pci.ids from file to internal data structure. 180 | 101 parameter 'filename' can specify location of this file 181 | 102 """ 182 | 103 if filename: 184 | 104 self.filename = filename 187 | 105 else: 188 | 106 self.filename = PCI.filename 191 | 107 self.cache = 1 192 | 108 193 | 109 if self.cache and not PCI.devices: 195 | 110 # parse pci.ids 196 | 111 pcirec = {} 197 | 112 PCI.devices = {} 199 | 113 for line in open(self.filename).readlines(): 201 | 114 l = line.split() 202 | 115 if line.startswith('#'): 203 | 116 continue 204 | 117 elif len(l) == 0: 205 | 118 continue 206 | 119 elif line.startswith('\t\t'): 207 | 120 subvendor = l[0].lower() 208 | 121 if len(l) > 2: 209 | 122 subdevice = l[1].lower() 210 | 123 else: 211 | 124 subdevice = '' 212 | 125 if len(l) > 3: 213 | 126 subsystem_name = ' '.join(l[2:]) 214 | 127 else: 215 | 128 subsystem_name = '' 216 | 129 if not PCI.devices.has_key(subvendor): 218 | 130 PCI.devices[subvendor] = [vendor_name, {subdevice: subsystem_name}] 220 | 131 else: # this should not happen 221 | 132 PCI.devices[subvendor][1][subdevice] = subsystem_name 223 | 133 elif line.startswith('\t'): 224 | 134 device = l[0].lower() 225 | 135 device_name = ' '.join(l[1:]) 226 | 136 PCI.devices[vendor][1][device] = device_name 228 | 137 else: 229 | 138 vendor = l[0].lower() 230 | 139 vendor_name = ' '.join(l[1:]) 231 | 140 if not PCI.devices.has_key(vendor): 233 | 141 PCI.devices[vendor] = [vendor_name, {}] 235 | 142 else: # this should not happen 236 | 143 PCI.devices[vendor][0] = vendor_name 238 |
144 239 |
145 - def get_vendor(self, vendor): 240 |
146 """ Return description of vendor. Parameter is two byte code in hexa. 241 | 147 If vendor is unknown None is returned. 242 | 148 """ 243 | 149 vendor = vendor.lower() 244 | 150 if self.cache: 245 | 151 if PCI.devices.has_key(vendor): 247 | 152 return PCI.devices[vendor][0] 249 | 153 else: 250 | 154 return None 251 | 155 else: 252 | 156 raise # not implemented yet 253 |
157 254 |
158 - def get_device(self, vendor, device): 255 |
159 """ Return description of device. Parameters are two byte code variables in hexa. 256 | 160 If device is unknown None is returned. 257 | 161 """ 258 | 162 vendor = vendor.lower() 259 | 163 device = device.lower() 260 | 164 if self.cache: 261 | 165 if PCI.devices.has_key(vendor): 263 | 166 if PCI.devices[vendor][1].has_key(device): 265 | 167 return PCI.devices[vendor][1][device] 267 | 168 else: 268 | 169 return None 269 | 170 else: 270 | 171 return None 271 | 172 else: 272 | 173 raise # not implemented yet 273 |
174 278 |
279 |
280 | 281 | 283 | 284 | 285 | 287 | 288 | 289 | 291 | 292 | 293 | 295 | 296 | 297 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 308 | 312 | 313 |
314 | 315 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /html/hwdata.PCI-class.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hwdata.PCI 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Module hwdata :: 41 | Class PCI 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Class PCI

source code

59 |

Interace to pci.ids from hwdata package

60 | 61 | 62 | 63 | 65 | 66 | 77 | 78 | 79 | 95 | 96 | 97 | 113 | 114 | 115 | 132 | 133 |
67 | 68 | 69 | 70 | 74 | 75 |
Instance Methods[hide private]
76 |
80 |   81 | 82 | 83 | 84 | 87 | 91 | 92 |
__init__(self, 85 | filename=None)
86 | Load pci.ids from file to internal data structure.
88 | source code 89 | 90 |
93 | 94 |
98 |   99 | 100 | 101 | 102 | 105 | 109 | 110 |
get_vendor(self, 103 | vendor)
104 | Return description of vendor.
106 | source code 107 | 108 |
111 | 112 |
116 |   117 | 118 | 119 | 120 | 124 | 128 | 129 |
get_device(self, 121 | vendor, 122 | device)
123 | Return description of device.
125 | source code 126 | 127 |
130 | 131 |
134 | 135 | 136 | 138 | 139 | 150 | 151 | 152 | 157 | 158 | 159 | 164 | 165 |
140 | 141 | 142 | 143 | 147 | 148 |
Class Variables[hide private]
149 |
153 |   154 | 155 | filename = '/usr/share/hwdata/pci.ids' 156 |
160 |   161 | 162 | devices = None 163 |
166 | 167 | 168 | 170 | 171 | 182 | 183 |
172 | 173 | 174 | 175 | 179 | 180 |
Method Details[hide private]
181 |
184 | 185 |
186 | 188 |
189 | 190 | 198 |
191 |

__init__(self, 192 | filename=None) 193 |
(Constructor) 194 |

195 |
source code  197 |
199 | 200 |

Load pci.ids from file to internal data structure. parameter 201 | 'filename' can specify location of this file

202 |
203 |
204 |
205 |
206 | 207 |
208 | 210 |
211 | 212 | 219 |
213 |

get_vendor(self, 214 | vendor) 215 |

216 |
source code  218 |
220 | 221 |

Return description of vendor. Parameter is two byte code in hexa. If 222 | vendor is unknown None is returned.

223 |
224 |
225 |
226 |
227 | 228 |
229 | 231 |
232 | 233 | 241 |
234 |

get_device(self, 235 | vendor, 236 | device) 237 |

238 |
source code  240 |
242 | 243 |

Return description of device. Parameters are two byte code variables 244 | in hexa. If device is unknown None is returned.

245 |
246 |
247 |
248 |
249 |
250 | 251 | 253 | 254 | 255 | 257 | 258 | 259 | 261 | 262 | 263 | 265 | 266 | 267 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 278 | 282 | 283 |
284 | 285 | 294 | 295 | 296 | -------------------------------------------------------------------------------- /html/hwdata.USB-class.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hwdata.USB 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Module hwdata :: 41 | Class USB 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Class USB

source code

59 |

Interace to usb.ids from hwdata package

60 | 61 | 62 | 63 | 65 | 66 | 77 | 78 | 79 | 95 | 96 | 97 | 113 | 114 | 115 | 132 | 133 |
67 | 68 | 69 | 70 | 74 | 75 |
Instance Methods[hide private]
76 |
80 |   81 | 82 | 83 | 84 | 87 | 91 | 92 |
__init__(self, 85 | filename=None)
86 | Load pci.ids from file to internal data structure.
88 | source code 89 | 90 |
93 | 94 |
98 |   99 | 100 | 101 | 102 | 105 | 109 | 110 |
get_vendor(self, 103 | vendor)
104 | Return description of vendor.
106 | source code 107 | 108 |
111 | 112 |
116 |   117 | 118 | 119 | 120 | 124 | 128 | 129 |
get_device(self, 121 | vendor, 122 | device)
123 | Return description of device.
125 | source code 126 | 127 |
130 | 131 |
134 | 135 | 136 | 138 | 139 | 150 | 151 | 152 | 157 | 158 | 159 | 164 | 165 |
140 | 141 | 142 | 143 | 147 | 148 |
Class Variables[hide private]
149 |
153 |   154 | 155 | filename = '/usr/share/hwdata/usb.ids' 156 |
160 |   161 | 162 | devices = None 163 |
166 | 167 | 168 | 170 | 171 | 182 | 183 |
172 | 173 | 174 | 175 | 179 | 180 |
Method Details[hide private]
181 |
184 | 185 |
186 | 188 |
189 | 190 | 198 |
191 |

__init__(self, 192 | filename=None) 193 |
(Constructor) 194 |

195 |
source code  197 |
199 | 200 |

Load pci.ids from file to internal data structure. parameter 201 | 'filename' can specify location of this file

202 |
203 |
204 |
205 |
206 | 207 |
208 | 210 |
211 | 212 | 219 |
213 |

get_vendor(self, 214 | vendor) 215 |

216 |
source code  218 |
220 | 221 |

Return description of vendor. Parameter is two byte code in hexa. If 222 | vendor is unknown None is returned.

223 |
224 |
225 |
226 |
227 | 228 |
229 | 231 |
232 | 233 | 241 |
234 |

get_device(self, 235 | vendor, 236 | device) 237 |

238 |
source code  240 |
242 | 243 |

Return description of device. Parameters are two byte code variables 244 | in hexa. If device is unknown None is returned.

245 |
246 |
247 |
248 |
249 |
250 | 251 | 253 | 254 | 255 | 257 | 258 | 259 | 261 | 262 | 263 | 265 | 266 | 267 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 278 | 282 | 283 |
284 | 285 | 294 | 295 | 296 | -------------------------------------------------------------------------------- /html/identifier-index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Identifier Index 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 | 53 |
54 |

Identifier Index

55 |
56 | [ 57 | A 58 | B 59 | C 60 | D 61 | E 62 | F 63 | G 64 | H 65 | I 66 | J 67 | K 68 | L 69 | M 70 | N 71 | O 72 | P 73 | Q 74 | R 75 | S 76 | T 77 | U 78 | V 79 | W 80 | X 81 | Y 82 | Z 83 | _ 84 | ] 85 |
86 | 87 | 88 | 100 | 101 | 113 | 114 | 132 | 133 | 143 | 144 | 155 | 156 | 167 | 168 | 181 |

D

89 | 90 | 91 | 93 | 95 | 96 | 97 | 98 | 99 |

F

102 | 103 | 104 | 106 | 108 | 109 | 110 | 111 | 112 |

G

115 | 116 | 117 | 119 | 121 | 122 | 123 | 124 | 126 | 128 | 129 | 130 | 131 |

H

134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |

P

145 | 146 | 147 | 149 | 150 | 151 | 152 | 153 | 154 |

U

157 | 158 | 159 | 161 | 162 | 163 | 164 | 165 | 166 |

_

169 | 170 | 171 | 173 | 175 | 177 | 178 | 179 | 180 |
182 |

183 | 185 | 186 | 187 | 189 | 190 | 191 | 193 | 194 | 195 | 197 | 198 | 199 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 210 | 214 | 215 |
216 | 217 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /html/module-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Module Hierarchy 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 |
53 | [ Module Hierarchy 54 | | Class Hierarchy ] 55 |

56 |

Module Hierarchy

57 |
    58 |
  • hwdata: Query hwdata database and return decription of vendor and/or 59 | device.
  • 60 |
61 | 62 | 64 | 65 | 66 | 68 | 69 | 70 | 72 | 73 | 74 | 76 | 77 | 78 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 89 | 93 | 94 |
95 | 96 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /html/redirect.html: -------------------------------------------------------------------------------- 1 | Epydoc Redirect Page 2 | 3 | 4 | 5 | 6 | 7 | 8 | 18 | 19 |

Epydoc Auto-redirect page

20 | 21 |

When javascript is enabled, this page will redirect URLs of 22 | the form redirect.html#dotted.name to the 23 | documentation for the object with the given fully-qualified 24 | dotted name.

25 |

 

26 | 27 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /html/toc-everything.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Everything 7 | 8 | 9 | 10 | 11 | 13 |

Everything

14 |
15 |

All Classes

16 | hwdata.PCI
hwdata.USB

All Variables

19 | hwdata.__package__

21 | [hide private] 23 | 24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /html/toc-hwdata-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hwdata 7 | 8 | 9 | 10 | 11 | 13 |

Module hwdata

14 |
15 |

Classes

16 | PCI
USB

Variables

19 | __package__

21 | [hide private] 23 | 24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /html/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Table of Contents 7 | 8 | 9 | 10 | 11 | 13 |

Table of Contents

14 |
15 | Everything 16 |
17 |

Modules

18 | hwdata

20 | [hide private] 22 | 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /hwdata.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 1999--2012 Red Hat, Inc. 3 | # 4 | # This software is licensed to you under the GNU General Public License, 5 | # version 2 (GPLv2). There is NO WARRANTY for this software, express or 6 | # implied, including the implied warranties of MERCHANTABILITY or FITNESS 7 | # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 8 | # along with this software; if not, see 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 10 | # 11 | # Red Hat trademarks are not licensed under GPLv2. No permission is 12 | # granted to use or replicate Red Hat trademarks that are incorporated 13 | # in this software or its documentation. 14 | # 15 | import sys 16 | 17 | """ Query hwdata database and return decription of vendor and/or device. """ 18 | 19 | # pylint: disable=misplaced-bare-raise 20 | 21 | class USB: 22 | """ Interace to usb.ids from hwdata package """ 23 | filename = '/usr/share/hwdata/usb.ids' 24 | devices = None 25 | 26 | def __init__(self, filename=None): 27 | """ Load pci.ids from file to internal data structure. 28 | parameter 'filename' can specify location of this file 29 | """ 30 | if filename: 31 | self.filename = filename 32 | else: 33 | self.filename = USB.filename 34 | self.cache = 1 35 | 36 | if self.cache and not USB.devices: 37 | # parse usb.ids 38 | USB.devices = {} 39 | f = open(self.filename, encoding='ISO8859-1') 40 | lineno = 0 41 | vendor = None 42 | device = None 43 | for line in f.readlines(): 44 | lineno += 1 45 | l = line.split() 46 | if line.startswith('#'): 47 | if line.startswith('# List of known device classes, subclasses and protocols'): 48 | break # end of database of devices, rest is protocols, types etc. 49 | else: 50 | continue 51 | elif len(l) == 0: 52 | continue 53 | elif line.startswith('\t\t'): 54 | interface_id = l[0].lower() 55 | if len(l) > 2: 56 | interface_name = ' '.join(l[1:]) 57 | else: 58 | interface_name = '' 59 | try: 60 | USB.devices[vendor][1][device][0][interface_id] = interface_name 61 | except TypeError: 62 | sys.stderr.write("Unknown line at line {0} in {1}.\n".format(lineno, self.filename)) 63 | elif line.startswith('\t'): 64 | device = l[0].lower() 65 | device_name = ' '.join(l[1:]) 66 | USB.devices[vendor][1][device] = [device_name, {}] 67 | else: 68 | vendor = l[0].lower() 69 | vendor_name = ' '.join(l[1:]) 70 | if vendor not in USB.devices: 71 | USB.devices[vendor] = [vendor_name, {}] 72 | else: # this should not happen 73 | USB.devices[vendor][0] = vendor_name 74 | 75 | def get_vendor(self, vendor): 76 | """ Return description of vendor. Parameter is two byte code in hexa. 77 | If vendor is unknown None is returned. 78 | """ 79 | vendor = vendor.lower() 80 | if self.cache: 81 | if vendor in USB.devices: 82 | return USB.devices[vendor][0] 83 | else: 84 | return None 85 | else: 86 | raise NotImplementedError() 87 | 88 | def get_device(self, vendor, device): 89 | """ Return description of device. Parameters are two byte code variables in hexa. 90 | If device is unknown None is returned. 91 | """ 92 | vendor = vendor.lower() 93 | device = device.lower() 94 | if self.cache: 95 | if vendor in USB.devices: 96 | if device in USB.devices[vendor][1]: 97 | return USB.devices[vendor][1][device][0] 98 | else: 99 | return None 100 | else: 101 | return None 102 | else: 103 | raise NotImplementedError() 104 | 105 | class PCI: 106 | """ Interace to pci.ids from hwdata package """ 107 | filename = '/usr/share/hwdata/pci.ids' 108 | devices = None 109 | 110 | def __init__(self, filename=None): 111 | """ Load pci.ids from file to internal data structure. 112 | parameter 'filename' can specify location of this file 113 | """ 114 | if filename: 115 | self.filename = filename 116 | else: 117 | self.filename = PCI.filename 118 | self.cache = 1 119 | 120 | if self.cache and not PCI.devices: 121 | # parse pci.ids 122 | PCI.devices = {} 123 | f = open(self.filename, encoding='ISO8859-1') 124 | vendor = None 125 | device = None 126 | for line in f.readlines(): 127 | l = line.split() 128 | if line.startswith('#'): 129 | continue 130 | elif len(l) == 0: 131 | continue 132 | elif line.startswith('\t\t'): 133 | subsystem = '{0}:{1}'.format(l[0].lower(), l[1].lower()) 134 | subsystem_name = ' '.join(l[2:]) 135 | PCI.devices[vendor][1][device][1][subsystem] = subsystem_name 136 | elif line.startswith('\t'): 137 | device = l[0].lower() 138 | device_name = ' '.join(l[1:]) 139 | PCI.devices[vendor][1][device] = [device_name, {}] 140 | else: 141 | vendor = l[0].lower() 142 | vendor_name = ' '.join(l[1:]) 143 | if not vendor in list(PCI.devices.keys()): 144 | PCI.devices[vendor] = [vendor_name, {}] 145 | else: # this should not happen 146 | PCI.devices[vendor][0] = vendor_name 147 | 148 | def get_vendor(self, vendor): 149 | """ Return description of vendor. Parameter is two byte code in hexa. 150 | If vendor is unknown None is returned. 151 | """ 152 | vendor = vendor.lower() 153 | if self.cache: 154 | if vendor in list(PCI.devices.keys()): 155 | return PCI.devices[vendor][0] 156 | else: 157 | return None 158 | else: 159 | raise NotImplementedError() 160 | 161 | def get_device(self, vendor, device): 162 | """ Return description of device. Parameters are two byte code variables in hexa. 163 | If device is unknown None is returned. 164 | """ 165 | vendor = vendor.lower() 166 | device = device.lower() 167 | if self.cache: 168 | if vendor in list(PCI.devices.keys()): 169 | if device in list(PCI.devices[vendor][1].keys()): 170 | return PCI.devices[vendor][1][device][0] 171 | else: 172 | return None 173 | else: 174 | return None 175 | else: 176 | raise NotImplementedError() 177 | 178 | def get_subsystem(self, vendor, device, subsystem): 179 | """ Return description of subsystem. 180 | 'vendor' and 'device' are two byte code variables in hexa. 181 | 'subsystem' is two colon separated hexa values. 182 | If subsystem is unknown None is returned. 183 | """ 184 | vendor = vendor.lower() 185 | device = device.lower() 186 | subsystem = subsystem.lower() 187 | if self.cache: 188 | if vendor in list(PCI.devices.keys()): 189 | if device in list(PCI.devices[vendor][1].keys()): 190 | if subsystem in list(PCI.devices[vendor][1][device][1].keys()): 191 | return PCI.devices[vendor][1][device][1][subsystem] 192 | else: 193 | return None 194 | else: 195 | return None 196 | else: 197 | return None 198 | else: 199 | raise NotImplementedError() 200 | 201 | class PNP: 202 | """ Interace to pnp.ids from hwdata package """ 203 | filename = '/usr/share/hwdata/pnp.ids' 204 | VENDORS = None 205 | 206 | def __init__(self, filename=None): 207 | """ Load pnp.ids from file to internal data structure. 208 | parameter 'filename' can specify location of this file 209 | """ 210 | if filename: 211 | self.filename = filename 212 | else: 213 | self.filename = PNP.filename 214 | self.cache = 1 215 | 216 | if self.cache and not PNP.VENDORS: 217 | # parse pnp.ids 218 | PNP.VENDORS = {} 219 | f = open(self.filename, encoding='ISO8859-1') 220 | for line in f.readlines(): 221 | l = line.split() 222 | if line.startswith('#'): 223 | continue 224 | elif len(l) == 0: 225 | continue 226 | else: 227 | vendor_id = l[0].upper() 228 | PNP.VENDORS[vendor_id] = ' '.join(l[1:]) 229 | 230 | def get_vendor(self, vendor_id): 231 | """ Return description of vendor. Parameter is 3 character long id of vendor. 232 | If vendor is unknown None is returned. 233 | """ 234 | vendor_id = vendor_id.upper() 235 | if self.cache: 236 | if vendor_id in list(PNP.VENDORS.keys()): 237 | return PNP.VENDORS[vendor_id] 238 | else: 239 | return None 240 | else: 241 | raise NotImplementedError() 242 | -------------------------------------------------------------------------------- /pylintrc: -------------------------------------------------------------------------------- 1 | # copr-frontend pylint configuration 2 | 3 | [MASTER] 4 | 5 | # Pickle collected data for later comparisons. 6 | persistent=no 7 | 8 | extension-pkg-whitelist=SQLAlchemy 9 | ignored-modules = SQLAlchemy 10 | 11 | [MESSAGES CONTROL] 12 | 13 | # Disable the message(s) with the given id(s). 14 | disable=I0011,C0302,C0111,R0801,R0902,R0904,R0912,R0913,R0914,R0915,R0921,R0922,W0142,W0403,W0603,C1001,W0121,useless-else-on-loop,bad-whitespace,unpacking-non-sequence,superfluous-parens,cyclic-import,len-as-condition,no-else-return 15 | 16 | # list of disabled messages: 17 | #I0011: 62: Locally disabling R0201 18 | #C0302: 1: Too many lines in module (2425) 19 | #C0111: 1: Missing docstring 20 | #R0902: 19:RequestedChannels: Too many instance attributes (9/7) 21 | #R0904: 26:Transport: Too many public methods (22/20) 22 | #R0912:171:set_slots_from_cert: Too many branches (59/20) 23 | #R0913:101:GETServer.__init__: Too many arguments (11/10) 24 | #R0914:171:set_slots_from_cert: Too many local variables (38/20) 25 | #R0915:171:set_slots_from_cert: Too many statements (169/50) 26 | #W0142:228:MPM_Package.write: Used * or ** magic 27 | #W0403: 28: Relative import 'rhnLog', should be 'backend.common.rhnLog' 28 | #W0603: 72:initLOG: Using the global statement 29 | # for pylint-1.0 we also disable 30 | #C1001: 46, 0: Old-style class defined. (old-style-class) 31 | #W0121: 33,16: Use raise ErrorClass(args) instead of raise ErrorClass, args. (old-raise-syntax) 32 | #W:243, 8: Else clause on loop without a break statement (useless-else-on-loop) 33 | # pylint-1.1 checks 34 | #C:334, 0: No space allowed after bracket (bad-whitespace) 35 | #W:162, 8: Attempting to unpack a non-sequence defined at line 6 of (unpacking-non-sequence) 36 | #C: 37, 0: Unnecessary parens after 'not' keyword (superfluous-parens) 37 | #C:301, 0: Unnecessary parens after 'if' keyword (superfluous-parens) 38 | 39 | [REPORTS] 40 | 41 | # Set the output format. Available formats are text, parseable, colorized, msvs 42 | # (visual studio) and html 43 | output-format=text 44 | 45 | # Tells whether to display a full report or only the messages 46 | reports=no 47 | 48 | 49 | [VARIABLES] 50 | 51 | # A regular expression matching names used for dummy variables (i.e. not used). 52 | dummy-variables-rgx=_|dummy 53 | 54 | 55 | [BASIC] 56 | 57 | # Regular expression which should only match correct module names 58 | #module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 59 | module-rgx=([a-zA-Z_][a-zA-Z0-9_]+)$ 60 | 61 | # Regular expression which should only match correct module level names 62 | const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$ 63 | 64 | # Regular expression which should only match correct class names 65 | class-rgx=[a-zA-Z_][a-zA-Z0-9_]+$ 66 | 67 | # Regular expression which should only match correct function names 68 | function-rgx=[a-z_][a-zA-Z0-9_]{,42}$ 69 | 70 | # Regular expression which should only match correct method names 71 | method-rgx=[a-z_][a-zA-Z0-9_]{,42}$ 72 | 73 | # Regular expression which should only match correct instance attribute names 74 | attr-rgx=[a-z_][a-zA-Z0-9_]{,30}$ 75 | 76 | # Regular expression which should only match correct argument names 77 | argument-rgx=[a-z_][a-zA-Z0-9_]{,30}$ 78 | 79 | # Regular expression which should only match correct variable names 80 | variable-rgx=[a-z_][a-zA-Z0-9_]{,30}$ 81 | 82 | # Regular expression which should only match correct list comprehension / 83 | # generator expression variable names 84 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 85 | 86 | # Regular expression which should only match correct class sttribute names 87 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,42}|(__.*__))$ 88 | 89 | # Good variable names which should always be accepted, separated by a comma 90 | good-names=i,j,k,ex,Run,_ 91 | 92 | # Bad variable names which should always be refused, separated by a comma 93 | bad-names=foo,bar,baz,toto,tutu,tata 94 | 95 | # List of builtins function names that should not be used, separated by a comma 96 | bad-functions=apply,input 97 | 98 | 99 | [DESIGN] 100 | 101 | # Maximum number of arguments for function / method 102 | max-args=10 103 | 104 | # Maximum number of locals for function / method body 105 | max-locals=20 106 | 107 | # Maximum number of return / yield for function / method body 108 | max-returns=6 109 | 110 | # Maximum number of branch for function / method body 111 | max-branchs=20 112 | 113 | # Maximum number of statements in function / method body 114 | max-statements=50 115 | 116 | # Maximum number of parents for a class (see R0901). 117 | max-parents=7 118 | 119 | # Maximum number of attributes for a class (see R0902). 120 | max-attributes=7 121 | 122 | # Minimum number of public methods for a class (see R0903). 123 | min-public-methods=1 124 | 125 | # Maximum number of public methods for a class (see R0904). 126 | max-public-methods=20 127 | 128 | 129 | [CLASSES] 130 | 131 | 132 | [FORMAT] 133 | 134 | # Maximum number of characters on a single line. 135 | max-line-length=120 136 | 137 | # Maximum number of lines in a module 138 | max-module-lines=1000 139 | 140 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 141 | # tab). 142 | indent-string=' ' 143 | 144 | 145 | [MISCELLANEOUS] 146 | 147 | # List of note tags to take in consideration, separated by a comma. 148 | notes= 149 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /python-hwdata.spec: -------------------------------------------------------------------------------- 1 | Name: python-hwdata 2 | Version: 2.4.3 3 | Release: 1%{?dist} 4 | Summary: Python bindings to hwdata package 5 | BuildArch: noarch 6 | License: GPL-2.0-or-later 7 | URL: https://github.com/xsuchy/python-hwdata 8 | # git clone https://github.com/xsuchy/python-hwdata.git 9 | # cd python-hwdata 10 | # tito build --tgz 11 | Source0: %{name}-%{version}.tar.gz 12 | 13 | %description 14 | Provide python interface to database stored in hwdata package. 15 | It allows you to get human readable description of USB and PCI devices. 16 | 17 | %package -n python3-hwdata 18 | Summary: Python bindings to hwdata package 19 | 20 | BuildRequires: python3-devel 21 | 22 | %{?python_provide:%python_provide python3-hwdata} 23 | 24 | %description -n python3-hwdata 25 | Provide python interface to database stored in hwdata package. 26 | It allows you to get human readable description of USB and PCI devices. 27 | 28 | This is the Python 3 build of the module. 29 | 30 | %generate_buildrequires 31 | %pyproject_buildrequires 32 | 33 | %prep 34 | %setup -q 35 | 36 | %build 37 | %pyproject_wheel 38 | 39 | %install 40 | %pyproject_install 41 | 42 | %check 43 | %py3_check_import hwdata 44 | 45 | %files -n python3-hwdata 46 | %license LICENSE 47 | %doc README.md example.py 48 | %doc html 49 | %{python3_sitelib}/* 50 | 51 | %changelog 52 | * Mon Jun 09 2025 Miroslav Suchý 2.4.3-1 53 | - do not run linter in check section (msuchy@redhat.com) 54 | - modernize specfile (msuchy@redhat.com) 55 | 56 | * Tue Jan 21 2025 Miroslav Suchý 2.4.2-1 57 | - modernize setup.py (msuchy@redhat.com) 58 | 59 | * Fri Nov 10 2023 Miroslav Suchý 2.4.1-1 60 | - remove python2 code 61 | - spec: generate only python3 package 62 | - use SPDX identifier for license 63 | - add PCI subsystem support (jussi.kuokkanen@protonmail.com) 64 | 65 | * Wed Nov 30 2022 Miroslav Suchý 2.3.8-1 66 | - use spdx license 67 | - update README 68 | - Add NotImplementedError (kaveshnikov.denis@hotmail.com) 69 | 70 | * Fri Jul 22 2022 Fedora Release Engineering - 2.3.7-16 71 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild 72 | 73 | * Mon Jun 13 2022 Python Maint - 2.3.7-15 74 | - Rebuilt for Python 3.11 75 | 76 | * Fri Jan 21 2022 Fedora Release Engineering - 2.3.7-14 77 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild 78 | 79 | * Fri Jul 23 2021 Fedora Release Engineering - 2.3.7-13 80 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild 81 | 82 | * Fri Jun 04 2021 Python Maint - 2.3.7-12 83 | - Rebuilt for Python 3.10 84 | 85 | * Wed Jan 27 2021 Fedora Release Engineering - 2.3.7-11 86 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild 87 | 88 | * Wed Jul 29 2020 Fedora Release Engineering - 2.3.7-10 89 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild 90 | 91 | * Tue May 26 2020 Miro Hrončok - 2.3.7-9 92 | - Rebuilt for Python 3.9 93 | 94 | * Thu Jan 30 2020 Fedora Release Engineering - 2.3.7-8 95 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild 96 | 97 | * Thu Oct 03 2019 Miro Hrončok - 2.3.7-7 98 | - Rebuilt for Python 3.8.0rc1 (#1748018) 99 | 100 | * Mon Aug 19 2019 Miro Hrončok - 2.3.7-6 101 | - Rebuilt for Python 3.8 102 | 103 | * Fri Jul 26 2019 Fedora Release Engineering - 2.3.7-5 104 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild 105 | 106 | * Sat Feb 02 2019 Fedora Release Engineering - 2.3.7-4 107 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild 108 | 109 | * Sat Jul 14 2018 Fedora Release Engineering - 2.3.7-3 110 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild 111 | 112 | * Tue Jun 19 2018 Miro Hrončok - 2.3.7-2 113 | - Rebuilt for Python 3.7 114 | 115 | * Fri Mar 23 2018 Miroslav Suchý 2.3.7-1 116 | - remove python2 subpackage for F30+ 117 | 118 | * Mon Feb 12 2018 Miroslav Suchý 2.3.6-1 119 | - Update Python 2 dependency declarations to new packaging standards 120 | 121 | * Wed Aug 09 2017 Miroslav Suchý 2.3.5-1 122 | - create python2-hwdata subpackage 123 | - use dnf instead of yum in README 124 | - remove rhel5 compatibilities from spec 125 | 126 | * Thu Sep 22 2016 Miroslav Suchý 2.3.4-1 127 | - run pylint in %%check 128 | - require hwdata in python 3 package too (jdobes@redhat.com) 129 | - implement PNP interface 130 | - errors in usb.ids should not be fatal 131 | - change upstream url in setup.py 132 | 133 | * Wed Jan 28 2015 Miroslav Suchý 2.3.3-1 134 | - upstream location changed 135 | 136 | * Wed Jan 28 2015 Miroslav Suchý 137 | - move upstream location 138 | 139 | * Wed Dec 04 2013 Miroslav Suchý 1.10.1-1 140 | - create python3-hwdata subpackage 141 | - Bumping package versions for 1.9 142 | - %%defattr is not needed since rpm 4.4 143 | 144 | * Fri Mar 02 2012 Miroslav Suchý 1.7.3-1 145 | - 798375 - fix PCI device name translation (Joshua.Roys@gtri.gatech.edu) 146 | - use setup from distutils 147 | 148 | * Fri Mar 02 2012 Jan Pazdziora 1.7.2-1 149 | - Update the copyright year info. 150 | 151 | * Fri Mar 02 2012 Jan Pazdziora 1.7.1-1 152 | - correct indentation (mzazrivec@redhat.com) 153 | 154 | * Mon Oct 31 2011 Miroslav Suchý 1.6.2-1 155 | - point URL to specific python-hwdata page 156 | 157 | * Fri Jul 22 2011 Jan Pazdziora 1.6.1-1 158 | - We only support version 14 and newer of Fedora, removing conditions for old 159 | versions. 160 | 161 | * Mon Apr 26 2010 Miroslav Suchý 1.2-1 162 | - 585138 - change %%files section and patial support for python3 163 | 164 | * Fri Apr 23 2010 Miroslav Suchý 1.1-1 165 | - initial release 166 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from setuptools import setup 3 | 4 | setup (name = 'hwdata', 5 | version = '2.4.3', 6 | description = 'Interface to hwdata', 7 | author = 'Miroslav Suchý', 8 | author_email = 'msuchy@redhat.com', 9 | license = 'setup.py', 10 | url = 'https://github.com/xsuchy/python-hwdata', 11 | py_modules = ['hwdata']) 12 | --------------------------------------------------------------------------------