pycdio-2.1.0/0000775000175000017500000000000013530476326013314 5ustar rockyrocky00000000000000pycdio-2.1.0/AUTHORS0000664000175000017500000000007513530441774014365 0ustar rockyrocky00000000000000R. Bernstein (rocky@gnu.org) Thomas Vander Stichele - CDText pycdio-2.1.0/COPYING0000664000175000017500000010451313530441774014352 0ustar rockyrocky00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pycdio-2.1.0/ChangeLog0000664000175000017500000005467413530441774015105 0ustar rockyrocky000000000000002018-01-25 rocky * .gitignore, README.txt, __pkginfo__.py, admin-tools/how-to-make-a-release.md, cdio.py, setup.py, swig/device.swg, swig/device_const.swg, swig/pyiso9660.i, test/test-cdio.py: Ready for Release 2.0.0 * Update API to 2.0.0. Assume version 2.0.0 or greater of libcdio. * remove old compatibilty code. * Update usual Python administrivia and package info. 2013-09-06 rocky * : commit 6d8e002ca3c04f69fdbc5c9b5fb26b66ea327327 Author: rocky Date: Fri Sep 6 02:51:03 2013 -0400 2013-09-06 rocky * ChangeLog, NEWS, README.txt, __pkginfo__.py, example/device.py, test/test-iso.py: Update README to put into proper ReStructuredText. Add an example. Get ready for release 0.20. 2013-03-06 rocky * setup.py, swig/device.swg: Savannah bug #38477 2013-02-20 rocky * MANIFEST.in: Add test/Makefile 2013-02-20 rocky * setup.py: Reorder build commands in setup.py. Patch and thanks again to Benjamin Eitzner. 2013-02-16 rocky * PKG-INFO, README.txt, __pkginfo__.py: README.txt is now in ReStructuredText for Pypi. PKG-INFO is now autogenerated and lives in pycdio.egg-info __pkginfo__.py: bump version 2013-02-16 rocky * : commit 1e1c7975c799e9daa595b99aa6ab989a9d4f0959 Author: rocky Date: Sat Feb 16 03:58:44 2013 -0500 2013-02-16 rocky * .gitignore, Makefile, setup.py, swig/device.swg: Last of the changes to get this to work on Python3 2013-02-13 R. Bernstein * __pkginfo__.py, cdio.py, iso9660.py, setup.py, test/test-iso.py: Closer to having Python3 but not quite there yet. 2013-02-13 R. Bernstein * example/cd-read.py, example/cdtext.py, example/device.py, example/drives.py, example/eject.py, example/iso1.py, example/iso2.py, example/iso3.py, example/tracks.py, setup.py: Start python3k compatibility 2013-02-13 R. Bernstein * example/Makefile: Remove circular dependency 2013-02-13 R. Bernstein * Makefile, example/Makefile, example/cdtext.py, example/iso2.py: Fix up CD-Text example program 2013-02-13 R. Bernstein * THANKS: Add Adrian 2013-02-13 R. Bernstein * MANIFEST.in, Makefile, swig/Makefile: swig/Makefile: Put more code in swig/Makefile as a backup to setup.py MANIFEST.in: Add swig/makefile Makefile: correct a distclean filename 2013-02-12 R. Bernstein * MANIFEST.in, Makefile, iso9660.py, setup.py, swig/device.swg: MANIFEST.in: Add ChangeLog and Makefile Makefile: remove more derived files iso9660.py: add missing import pycdio - thanks to Benjamin Eitzner setup.py: remove more files is usin libcdio 0.83 devices.swg: Think I got it this time. 2013-02-11 R. Bernstein * MANIFEST.in, THANKS: Start a THANKS page 2013-02-11 R. Bernstein * MANIFEST.in, __pkginfo__.py: Add COPYING 2013-02-11 R. Bernstein * cdio.py, iso9660.py, setup.py, swig/device.swg: cdio.py Python indentation. Typo in return variable. iso9660.py: more typos. setup.py allegedly helps to use abspath. Patches from Benjamin Eitzner. swig/devicd.swg: fix bug in returning lists of strings. 2013-01-30 R. Bernstein * Makefile, __pkginfo__.py, cdio.py, swig/cdtext_new.swg: Deal with compatibilty of CD-Text field name pre 0.90. Savannah #38185. 2013-01-07 R. Bernstein * ChangeLog, Makefile, NEWS, setup.cfg, swig/device.swg, swig/device_const.swg, swig/pyiso9660.i: Get ready for release 0.18 2012-04-16 r * swig/.gitignore, swig/cdtext_new.swg: use MIN_CDTEXT_FIELD from libcdio. Add another ignored file. 2012-04-15 R. Bernstein * example/cdtext.py, swig/cdtext_new.swg: Add pycdio.MIN_CDTEXT_FIELDS and remove CVS $Id line. 2012-03-27 Leon Merten Lohse * Makefile, cdio.py, setup.py, swig/cdtext_new.swg, swig/{cdtext.swg => cdtext_old.swg}, swig/compat.swg, swig/pycdio.i, swig/pyiso9660.i, swig/track.swg, swig/types.swg, test/test-cdtext.py: removed compatibility with pre 0.80 libcdio. made compatible with recent CD-Text api changes. 2012-03-13 r * Makefile: Add "build" target and remake-style comments 2011-09-25 R. Bernstein * example/tracks.py: From chris clark: patch to use one of the heuristics in showing a hidden track. 2011-07-30 R. Bernstein * : commit faaff5c28865e0995c0e1ca6df4aeecb90fa0928 Author: r Date: Sat Jul 30 11:48:21 2011 -0400 2011-07-30 r * NEWS, example/Makefile, example/drives.py, swig/Makefile, swig/audio.swg, swig/cdtext.swg, swig/compat.swg, swig/device.swg, swig/device_const.swg, swig/disc.swg, swig/pycdio.i, swig/types.swg, test/Makefile, test/cdda.toc: Add audio_set_volume_levels from Jerry G Geiger's patch for Perl Device::Cdio. Remove CVS $Id lines. Update copyright. 2011-07-30 r * Makefile: Looks like nosetests is now a standalone command 2011-07-30 r * : libcdio results may have changed 2010-10-27 R. Bernstein * ChangeLog, NEWS, __pkginfo__.py: Update for release. 2010-10-27 R. Bernstein * test/test-isocopy.py: Make it work on both new and old libcdio. 2010-10-26 r * test/test-isocopy.py: Add test when file is not found 2010-10-26 r * example/.gitignore, iso9660.py, swig/pyiso9660.i, swig/read.swg, test/test-isocopy.py: Make sure we return None on error as we say we do. COPYING->copying because we translate filenames. May need further investigation. 2010-10-11 r * example/cd-read.py: example/cd-read.py: Better --mode error message 2010-09-30 R. Bernstein * PKG-INFO, README.txt: Revise dependencies - don't put in dependent library numbers; they are likely to be wrong. 2010-09-30 R. Bernstein * setup.py: Give a better error message if pkg-config is not available. 2010-09-29 R. Bernstein * PKG-INFO, README.txt: Need to have "apt-get install python-dev" as well. Thanks to Peter Carlsson. 2010-09-29 R. Bernstein * PKG-INFO, README.txt: Add requirements. 2009-10-27 R. Bernstein * __pkginfo__.py: version update -- this time, for sure! 2009-10-27 R. Bernstein * NEWS: Last before rlease. 2009-10-21 R. Bernstein * ChangeLog, NEWS: Update before 0.16 release. 2009-09-27 R. Bernstein * ChangeLog, __pkginfo__.py, cdio.py: Off-by-one compensation in get_devices_* not needed anymore. Reported by Alex Butcher for Fedora. Correct setup information. 2009-07-28 R. Bernstein * cdio.py, iso9660.py: Remove shbang from cdio.py and ios9660.py. Bug report/fix from Jay Greguske of Redhat who relates that this helps Fedora packaging. 2009-05-18 R. Bernstein * ChangeLog, ChangeLog.1: Update ChangeLog before release 2009-05-17 R. Bernstein * NEWS, __pkginfo__.py: What's up 2009-05-17 R. Bernstein * README.txt, example/README, example/cdtext.py: Doc update 2009-05-14 R. Bernstein * swig/track.swg: Small cosmetic change 2009-05-13 R. Bernstein * AUTHORS: Add Thomas 2009-05-13 R. Bernstein * : commit f77b2a764a69fb68725aea3776aeb84e03484009 Author: Thomas Vander Stichele Date: Tue May 12 11:30:29 2009 +0200 2009-05-12 Thomas Vander Stichele * swig/cdtext.swg: add cdtext.swg 2009-05-12 Thomas Vander Stichele * cdio.py, example/cdtext.py, swig/pycdio.i, swig/track.swg, test/cdtext.toc, test/test-cdtext.py: add CDText support, an example, and unittests 2009-05-11 rocky * ChangeLog: Administrivia 2008-12-10 R. Bernstein * MANIFEST.in: Forgot to add __pkginfo__ 2008-12-07 R. Bernstein * __pkginfo__.py, setup.py: Lint things 2008-12-07 R. Bernstein * setup.py: Python 2.6 complains about duplicate modname. It's right. 2008-12-07 R. Bernstein * example/device.py: Small output formatting change 2008-12-07 R. Bernstein * example/device.py: List drivers only once. 2008-12-07 Windows XP * Makefile, cdio.py, swig/device_const.swg: Address DRIVER_NETBSD not defined problem. distclean removes DLLs for cygwin. 2008-12-06 R. Bernstein * Makefile, cdio.py, example/device.py, example/drives.py, swig/device.swg, swig/device_const.swg, test/test-isocopy.py: device.swg: Remove bug in returning null device list. device_const.swg, cdio.py: Add NetBSD driver id. test/test-isocopyFix.py: bug in test path. cdio.py: DRY code a little. Makefile: add install target. example/drives.py: Reinstate code removed because of device.swg bug Makefeli: Add install 2008-12-06 R. Bernstein * .cvsignore, .gitignore, COPYING, INSTALL, MANIFEST.in, Makefile, Makefile.am, README => README.txt, __init__.py, __pkginfo__.py, autogen.sh, configure.ac, cvs2cl_header, cvs2cl_usermap, example/.cvsignore, example/.gitignore, get-cygwin-python-libs, git2authors.txt, include-path.py, pycdio.m4, setup.cfg, setup.py, site-packages-path.py, swig/.gitignore, swig/{pycdio.swg => pycdio.i}, swig/{pyiso9660.swg => pyiso9660.i}, test/.gitignore, test/cdda.toc, test/test-cdio.py: Rework to use setuptools. 2008-11-24 rocky * test/isocopy.py: Administrivia 2008-11-24 rocky * Makefile.am, test/{cdiotest.py => test-cdio.py}, test/{isotest.py => test-iso.py}, test/test-isocopy.py: Make more setuptools and distutils friendly. Rename test programs to start with test- (in the test directory). 2008-11-24 rocky * example/.cvsignore: Administrivia. 2008-11-24 rocky * example/cd-read.py, example/iso1.py, example/iso2.py, test/isocopy.py: Remove some bugs caught by pyflakes, and fix remove unused imports, etc. 2008-11-24 rocky * example/device.py, example/drives.py, example/eject.py, example/tracks.py: Add missing "import os". 2008-11-24 rocky * Makefile.am, configure.ac, example/audio.py.in, example/{cd-read.py.in => cd-read.py}, example/cdchange.py.in, example/{device.py.in => device.py}, example/drives.py, example/drives.py.in, example/{eject.py.in => eject.py}, example/{iso1.py.in => iso1.py}, example/{iso2.py.in => iso2.py}, example/{iso3.py.in => iso3.py}, example/{tracks.py.in => tracks.py}, test/{cdiotest.py.in => cdiotest.py}, test/{isocopy.py.in => isocopy.py}, test/{isotest.py.in => isotest.py}: More Pythonic less autoconf-ish and closer to being able to use distutils. 2008-05-01 karl * Makefile.am, cdio.py, configure.ac, example/audio.py.in, example/cd-read.py.in, example/cdchange.py.in, example/device.py.in, example/drives.py.in, example/eject.py.in, example/iso1.py.in, example/iso2.py.in, example/iso3.py.in, example/tracks.py.in, iso9660.py, swig/audio.swg, swig/compat.swg, swig/device.swg, swig/device_const.swg, swig/disc.swg, swig/pycdio.swg, swig/pyiso9660.swg, swig/read.swg, swig/track.swg, swig/types.swg: gplv3+ 2007-10-27 rocky * .cvsignore, ChangeLog: Release 0.13 done. 2007-10-27 rocky * ChangeLog, INSTALL: INSTALL: customize instructions a little. 2007-10-21 rocky * Makefile.am, NEWS, configure.ac: NetBSD seems to work like GNU/linux for shared libraries. 2007-10-14 rocky * swig/device.swg: Swig depricates adding python. Remove it. 2007-10-14 rocky * Makefile.am, swig/device.swg: device.swg: typemap and t_output_helper usage seems to have changed in SWIG. Makefile.am: replace := with = since the latter is more portable. 2007-10-14 rocky * ChangeLog, README: . 2007-08-01 rocky * swig/pyiso9660.swg: Remove python from typemap as suggested by deprication warning. 2007-08-01 rocky * ChangeLog, swig/pyiso9660.swg: Memory allocation was off by one in the name_translate function. This could lead to a buffer overflow when the translated name is as long as the original. Patch by Martin Ferrari on the Perl code. 2006-12-16 rocky * example/cd-read.py.in: Add hexdump of data. 2006-12-10 rocky * ChangeLog: [no log message] 2006-12-10 rocky * NEWS: Note recent bug. 2006-12-10 rocky * ChangeLog, cdio.py, configure.ac: configure.ac: get ready for 0.12 release cdio.py: A couple of bug fixes: - if we get a string back from get_device turn it into a list - set default values on input parameters correctly. 2006-12-10 rocky * example/drives.py.in: Address change. 2006-12-07 rocky * NEWS: [no log message] 2006-12-04 rocky * iso9660.py, swig/device.swg, swig/read.swg: iosy9660.py: correct bugs in pathname_isofy devices.swg: correct bug close_tray 2006-12-03 rocky * .cvsignore: [no log message] 2006-12-03 rocky * Makefile.am, swig/disc.swg, swig/pyiso9660.swg: Miscellaneous small improvements. 2006-12-03 rocky * iso9660.py: Add pathname_isofy and remove refereneces to psz. 2006-11-28 rocky * AUTHORS, example/iso1.py.in, example/iso2.py.in, example/iso3.py.in: Correct email address. 2006-11-28 rocky * example/README: Replace Perl module names with Python equivalents 2006-11-27 rocky * example/README, example/audio.py.in, example/cdchange.py.in, iso9660.py, swig/pyiso9660.swg, test/cdiotest.py.in, test/isofs-m1.cue: Mostly email address changes. Some typos. Use data from data directory. 2006-11-13 rocky * AUTHORS, cdio.py, example/audio.py.in, example/device.py.in, example/tracks.py.in: Address change. 2006-11-12 rocky * swig/audio.swg, swig/compat.swg, swig/device.swg, swig/device_const.swg, swig/disc.swg, swig/pycdio.swg, swig/pyiso9660.swg, swig/read.swg, swig/track.swg, swig/types.swg: email address change. 2006-11-12 rocky * cdio.py, example/tracks.py.in, swig/track.swg: Add get_msf(). Basically paralleling code from Perl's Device::Cdio. 2006-06-19 rocky * configure.ac: Error message makes it clear that it might be an old version of libcdio that's at fault. 2006-03-31 rocky * README: Note ISO 9660 library. 2006-03-31 rocky * test/cdiotest.py.in, test/isotest.py.in: Untabify. 2006-03-31 rocky * test/cdiotest.py.in, test/isocopy.py.in, test/isotest.py.in: Darwin and old Python fixes 2006-03-31 rocky * ChangeLog, Makefile.am, NEWS: Makefile.am: Add SWIG-derived C file to distribution so folks don't need SWIG to create this. *: last change before release 0.11. Really! 2006-03-31 rocky * ChangeLog, NEWS, test/isocopy.py.in: isocopy.py.in: things needed for "make distcheck" NEWS: note cygwin and Solaris fixes 2006-03-31 rocky * .cvsignore, Makefile.am, configure.ac, get-cygwin-python-libs, test/.cvsignore, test/cdiotest.py.in, test/isoread.py.in: Changes to get cygwin working. isoread.py.in -> isocopy.py.in 2006-03-30 rocky * .cvsignore: .cvsignore 2006-03-30 rocky * cdio.py, swig/pyiso9660.swg, test/cdiotest.py.in: pyiso9660.swg: wasn't allocating enough for strnpad_cpy. cdio.py: Note IOError can be returned sometimes cdiotest.py.in: Allow for IOError exceptions. 2006-03-30 rocky * configure.ac: Solaris needs -fPIC 2006-03-28 rocky * test/isoread.py.in: Regression test for ISO 9660 CD and ISO image reading. 2006-03-28 rocky * ChangeLog, Makefile.am, NEWS, configure.ac: Forgot to add iso9660 swig file to distribution. 2006-03-28 rocky * ChangeLog, test/cdiotest.py.in, test/isotest.py.in: Changes to make build outside of source tree (or "make distcheck") work. 2006-03-27 rocky * ChangeLog, Makefile.am, configure.ac, test/isotest.py.in: Add iso image reading regression test. 2006-03-27 rocky * Makefile.am: Closer to getting "make distcheck" work. 2006-03-27 rocky * .cvsignore: . 2006-03-27 rocky * Makefile.am, configure.ac: Get isocopy.py run in regression tests. 2006-03-27 rocky * example/.cvsignore, test/.cvsignore: [no log message] 2006-03-27 rocky * test/isocopy.py.in, test/isotest.py.in: Add file extraction test. 2006-03-24 rocky * Makefile.am, configure.ac, data/isofs-m1.cue, example/iso2.py.in, example/iso3.py.in, iso9660.py, test/isotest.py.in: iso9660.py: Add CD Image fileystems routines example/iso2.py.in: Example ISO 9660 file extraction from CD image data/*: Sample CD image for ISO 9660 Makefile.am, configure.ac: boilerplate configuration to make above work. test/isotest.py.in: test of ISO 9660 image info (I'm a little behind in regression testing) 2006-03-24 rocky * Makefile.am, configure.ac, iso9660.py, swig/pyiso9660.swg: Get ISO 9660 extraction program working which meant fixing the bugs in seek_read. 2006-03-24 rocky * example/.cvsignore, example/iso1.py.in: iso1.py.in: didn't get the latest set of necessary changes in. This time, for sure! 2006-03-24 rocky * Makefile.am: Add data files to distribution 2006-03-24 rocky * Makefile.am, configure.ac, example/iso1.py.in, iso9660.py, swig/pyiso9660.swg: Fixed up iso9660.py enough to get the first example ISO9660 program working (albeit in a little bit of a hacky way.) 2006-03-23 rocky * iso9660.py, test/isotest.py.in: isotest.py.in: reinstate test_ prefix had messed up test names iso9660.py: start ISO9660.IFS class. 2006-03-23 rocky * iso9660.py, swig/pyiso9660.swg, test/isotest.py.in: iso9660.swg: add iso9660 stat list routines isotest.py.in: break out tests into smaller pieces. 2006-03-17 rocky * swig/pyiso9660.swg, test/isotest.py.in: Address bugs in ltime getting. 2006-03-16 rocky * swig/pyiso9660.swg, test/isotest.py.in: A couple more ISO966O routines added (dtime). 2006-03-16 rocky * swig/pyiso9660.swg, test/isotest.py.in: Chip away more at getting ISO 9660 support more comlete, more tested. 2006-03-15 rocky * Makefile.am: Changes because we removed cdio.py.in (and use cdio.py) 2006-03-15 rocky * .cvsignore, Makefile.am, cdio.py.in => cdio.py, example/.cvsignore, iso9660.py, test/.cvsignore, test/isotest.py.in: Misc autobuild lint. 2006-03-15 rocky * Makefile.am, configure.ac, test/cdiotest.py.in: Add first ISO9660 unit test. 2006-03-15 rocky * configure.ac: Check for ISO9660 library. 2006-03-14 rocky * Makefile.am, cdio.py.in, iso9660.py, swig/device.swg, swig/device_const.swg, swig/pycdio.swg, swig/read.swg: FSF address change. 2006-03-14 rocky * Makefile.am, cdio.py.in, configure.ac, example/drives.py.in, iso9660.py, swig/pycdio.swg, swig/pyiso9660.swg, swig/read.swg: First attempt at adding ISO9660 library. 2006-02-14 rocky * cdio.py.in, swig/device.swg, test/cdiotest.py.in: device.swg: documenation changes cdio.py.in: test for some error conditions cdiotest.py.in: disable some ops pending understanding why it's failing on Darwin. 2006-02-13 rocky * configure.ac: Note Solaris load command and flags. 2006-02-13 rocky * Makefile.am, configure.ac, swig/device.swg, swig/types.swg: Add NEED_LONG needed for cygwin. 2006-02-13 rocky * ChangeLog, Makefile.am, configure.ac: Get ready for another release. 2006-02-13 rocky * example/.cvsignore, example/drives.py.in: Add drive example from libcdio and Perl 2006-02-13 rocky * cdio.py.in, configure.ac, example/device.py.in, swig/device.swg, swig/device_const.swg, swig/pycdio.swg: Include routines which give a list of devices back. 2006-02-13 rocky * example/tracks.py.in: tracks.py.in: guard against no track retrieved. Print MCN. 2006-02-13 rocky * Makefile.am, cdio.py.in, configure.ac, example/device.py.in, swig/device.swg, swig/disc.swg, swig/read.swg, swig/types.swg, test/cdiotest.py.in: Makefile.am, configure.ac: include pycdio_wrap.c in distribution. So we merely warn about missing swig. device.swg, device.py.in: start routines which return char ** (deviceLIst_t) add get_mcn. cdio.py.in: Add get_mcn, get_devices. Alphabetize routine names. Move some non-device routines out of the device class and into package cdio. cdiotest.py.in: add test of get_mcn example/device.py.in: show hw_info. More like Perl. 2006-02-05 rocky * swig/device.swg, test/cdiotest.py.in: get_default_device now returns two parameters as it does in libcdio. Add test for that too. 2006-02-03 rocky * NEWS, example/audio.py.in, swig/device.swg, test/cdiotest.py.in: device.swg: Add get_hwinfo (tentatively) audio.py.in doc fix. 2006-02-01 rocky * swig/device.swg, test/cdiotest.py.in: Remove bug in is_device for DRIVER_UNKNOWN and DRIVER_DEVICE cdiotest.py.in: allow 0.77 to do more tests. 2006-01-31 rocky * swig/device.swg: cdio_is_nrg does not allocate an object 2006-01-30 rocky * swig/device.swg: Output return type should probably match reference input parameter 2006-01-26 rocky * cdio.py.in: No functional change (I hope). Just more idiomatic Python. 2006-01-26 rocky * test/cdiotest.py.in: Tolerance for libcdio as far back as 0.74 2006-01-26 rocky * swig/types.swg: Set libcdio version number as a constant 2006-01-26 rocky * Makefile.am, configure.ac: Fixes for darwin linking; Allow libcdio 0.74 2006-01-26 rocky * test/cdiotest.py.in: Keep compatibility with unittest 1.46 2006-01-25 rocky * .cvsignore: .cvsignore 2006-01-25 rocky * ChangeLog, Makefile.am: Wasn't installing shared object. 2006-01-25 rocky * README: Revise a little. 2006-01-25 rocky * ChangeLog: [no log message] 2006-01-25 rocky * Makefile.am: Add old ChangeLog. 2006-01-25 rocky * Makefile.am: Forgot to add cd-read to distribution. 2006-01-25 rocky * configure.ac: Changes for older shells 2006-01-25 rocky * configure.ac: Get ready for release. cd-read.py now created too. 2006-01-25 rocky * configure.ac: -fPIC option not added correctly. 2006-01-25 rocky * Makefile.am, configure.ac: Changes to make work better on cygwin 2006-01-25 rocky * Initial revision pycdio-2.1.0/MANIFEST.in0000664000175000017500000000105213530444246015044 0ustar rockyrocky00000000000000exclude swig/cdtext.swg include AUTHORS include COPYING include ChangeLog include Makefile include NEWS.md include THANKS include VERSION.py include __pkginfo__.py include data/copying.iso include data/isofs-m1.bin include data/isofs-m1.cue include example/*.py include example/README include pycdio.py include pyiso9660.py include swig/*.swg include swig/Makefile include test/Makefile include test/cdda.bin include test/cdda.cue include test/cdda.toc include test/cdtext.toc include test/copying.iso include test/isofs-m1.bin include test/isofs-m1.cue pycdio-2.1.0/Makefile0000664000175000017500000000243713530471270014753 0ustar rockyrocky00000000000000# Compatibility for us old-timers. # Note: This makefile include remake-style target comments. # These comments before the targets start with #: # remake --tasks to shows the targets and the comments PHONY=check clean dist distclean test GIT2CL ?= git2cl PYTHON ?= python #: Default target. Same as "build" all: build #: Run all tests check: build ./setup.py nosetests #: Remove OS- and platform-specific derived files. clean: $(PYTHON) ./setup.py clean --all && rm -f *.so || /bin/true #: Create source and binary distribution dist: $(PYTHON) ./setup.py sdist bdist #: Do what it takes to build software locally build: $(PYTHON) ./setup.py build # It is too much work to figure out how to add a new command to distutils # to do the following. I'm sure distutils will someday get there. DISTCLEAN_FILES = build dist *.egg-info *.pyc *.so *.dll py*.py \ swig/cdtext.swg pycdio.py pyiso9660.py \ example/*.pyc example/copying swig/py*_wrap.c test/*.pyc #: Remove all derived files. Like "clean" on steroids. distclean: clean -rm -fr $(DISTCLEAN_FILES) || true #: Install package install: $(PYTHON) ./setup.py install #: Same as check test: check #: create ChangeLog fom git log via git2cl ChangeLog: git log --pretty --numstat --summary | $(GIT2CL) >$@ .PHONY: $(PHONY) pycdio-2.1.0/NEWS.md0000664000175000017500000000340013530454001014371 0ustar rockyrocky000000000000002.0.1 2019-08-25 --------------- - Python 3 tolerance - move to github 2.0.0 2018-02-5 --------------- - Update to libcdio 2.0.0 API - remove old compability code before 2.0.0 We no longer support obsolte CD-Text interface - Update Python packaging info 0.20 2013-09-6 -------------- - Bug fixes and update README.txt 0.19 2013-02-16 --------------- - Bug fixes for libcdio =< 0.82 versus libcdio >= 0.90 - Make this work on Python3 0.18 2013-01-07 ---------------- - Adjust for libcdio 0.90 0.17 2010-10-27 --------------- - Minor instruction and bug fixes 0.16 2009-10-27 Halala ngosuku lokuzalwa ---------------------------------------- - Remove shbang from cdio.py and ios9660.py which helps Fedora packaging - Off-by-one compensation in get_devices_* not needed anymore 0.15 2009-05-18 --------------- - Add Access to CDText thanks to Thomas Vander Stichele 0.14 2008-12-10 --------------- - Make more setuptools and distutils friendly. Small cleanups. 0.13 2007-10-27 --------------- - Small bugfix 0.12 2006-12-10 --------------- - Add get_msg() - Add pathname_isofy() in iso9660.py - Correct bugs in SWIG pathname_isofy() and close_tray() - Correct bug in get_devices when there was only one device. 0.11 2006-03-27 --------------- - Add ISO 9660 library: * add example programs to extract a file from an ISO fileystem * add regression tsets - Changes to make building outside of source tree (e.g. "make distcheck") work - Include SWIG-derived files. In theory you don't need SWIG installed any more (although you do need a C compiler and libcdio installed). - Remove bug in is_device() - Fixes for Solaris and cygwin builds (compilation/linking flags) - Minor SWIG changes to be more precise. 0.10 2006-01-30 --------------- Initial Python wrapper pycdio-2.1.0/PKG-INFO0000664000175000017500000001606413530476326014420 0ustar rockyrocky00000000000000Metadata-Version: 1.1 Name: pycdio Version: 2.1.0 Summary: Python OO interface to libcdio (CD Input and Control library) Home-page: http://www.gnu.org/software/libcdio Author: Rocky Bernstein Author-email: rocky@gnu.org License: GPL Description: Introduction ============== pycdio is a Python interface to the *libcdio*, the CD Input and Control library http://www.gnu.org/software/libcdio You can get the source at the same place as libcdio: ftp://ftp.gnu.org:/pub/gnu/libcdio/ The *pycdio* and *libcdio* libraries encapsulate CD-ROM reading and control. Python programs wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Sample Usage ============ Getting CD-ROM Drive Information -------------------------------- .. code-block:: python import sys import cdio, pycdio try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) ok, vendor, model, release = d.get_hwinfo() print("drive: %s, vendor: %s, model: %s, release: %s" \ % (drive_name, vendor, model, release)) # Show CD-Text for an audio CD cdt = d.get_cdtext() i_tracks = d.get_num_tracks() i_first_track = pycdio.get_first_track_num(d.cd) for t in range(i_first_track, i_tracks + i_first_track): for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS): value = cdt.get(i, t) # value can be empty but exist, compared to NULL values if value is not None: print("\t%s: %s" % (pycdio.cdtext_field2str(i), value)) pass pass pass return d.close() Other sample code can be found in the *example* directory of the distribution. Requirements ============= * A C compiler so the extension can be compiled when it is installed. * libcdio (http://www.gnu.org/software/libcdio) and it's header files installed. * SWIG http://www.swig.org * pkg-config http://pkg-config.freedesktop.org To build on Debian (e.g. Ubuntu): ------------------------------------- :: $ apt-get install python-dev $ apt-get install libcdio-dev $ apt-get install libiso9660-dev $ apt-get install swig pkg-config $ pip install -e . $ make check SWIG Problems =============== I've tried to make this work back to Python 2.3 or so. I've noticed however problems in various distutils. If you see a message like this when running `make check`: :: File "/home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py", line 207, in library_dir_option return "-L" + dir TypeError: Can't convert 'bytes' object to str implicitly Copy in a recent ditutils `unixccompiler.py` like this: :: $ cp admin-tools/unixccompiler.py /home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py The distutils distribution says that it tries to be compatible with all Python versions from 2.3. The `unixccompiler.py` in `admin_tools` is from the Python 3.7.4 distribution. Completeness ============= *libcdio* is rather large and yet may still grow a bit. What is in *pycdio* is incomplete; over time it may grow to completion depending on various factors: e.g. interest, whether others help out. Sections of *libcdio* that are currently missing are the (SCSI) MMC commands, and the cdparanoia library. Of the audio controls, I put in those things that didn't require any thought. The ISO 9660 library is pretty complete, except file *stat()* information which is at present is pretty minimal. That said, what's in there is very usable. It contains probably more access capabilities than what most media players that don't use libcdio have. The encapsulation by SWIG is done in two parts. The lower-level python interface is called pycdio and is generated by SWIG. The more object-oriented module is *cdio*; it is a Python class that uses pycdio. Although pycdio is perfectly usable on its own, it is expected that *cdio* is what most people will use. As *pycdio* more closely models the C interface, it is conceivable (if unlikely) that diehard libcdio C users who are very familiar with that interface could prefer that. It is probably possible to change the SWIG in such a way to combine these pieces. However there are the problems. First, I'm not that much of a SWIG expert. Second it looks as though the resulting SWIG code would be more complex. Third the separation makes translation very straight forward to understand and maintain: first get what's in C into Python as a one-to-one translation. Then we implement some nice abstraction off of that. The abstraction can be modified without having to redo the underlying translation. (But the reverse is generally not true: usually changes to the C-to-python translation, pycdio, do result in small, but obvious and straightforward changes to the abstraction layer cdio.) There is much to be done - you want to help out, please do so! Standalone documentation is missing although many of the methods, classes and functions have some document strings. See also the programs in the example directory. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.4 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 pycdio-2.1.0/README.rst0000664000175000017500000001152613530476147015011 0ustar rockyrocky00000000000000Introduction ============== pycdio is a Python interface to the *libcdio*, the CD Input and Control library http://www.gnu.org/software/libcdio You can get the source at the same place as libcdio: ftp://ftp.gnu.org:/pub/gnu/libcdio/ The *pycdio* and *libcdio* libraries encapsulate CD-ROM reading and control. Python programs wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Sample Usage ============ Getting CD-ROM Drive Information -------------------------------- .. code-block:: python import sys import cdio, pycdio try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) ok, vendor, model, release = d.get_hwinfo() print("drive: %s, vendor: %s, model: %s, release: %s" \ % (drive_name, vendor, model, release)) # Show CD-Text for an audio CD cdt = d.get_cdtext() i_tracks = d.get_num_tracks() i_first_track = pycdio.get_first_track_num(d.cd) for t in range(i_first_track, i_tracks + i_first_track): for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS): value = cdt.get(i, t) # value can be empty but exist, compared to NULL values if value is not None: print("\t%s: %s" % (pycdio.cdtext_field2str(i), value)) pass pass pass return d.close() Other sample code can be found in the *example* directory of the distribution. Requirements ============= * A C compiler so the extension can be compiled when it is installed. * libcdio (http://www.gnu.org/software/libcdio) and it's header files installed. * SWIG http://www.swig.org * pkg-config http://pkg-config.freedesktop.org To build on Debian (e.g. Ubuntu): ------------------------------------- :: $ apt-get install python-dev $ apt-get install libcdio-dev $ apt-get install libiso9660-dev $ apt-get install swig pkg-config $ pip install -e . $ make check SWIG Problems =============== I've tried to make this work back to Python 2.3 or so. I've noticed however problems in various distutils. If you see a message like this when running `make check`: :: File "/home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py", line 207, in library_dir_option return "-L" + dir TypeError: Can't convert 'bytes' object to str implicitly Copy in a recent ditutils `unixccompiler.py` like this: :: $ cp admin-tools/unixccompiler.py /home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py The distutils distribution says that it tries to be compatible with all Python versions from 2.3. The `unixccompiler.py` in `admin_tools` is from the Python 3.7.4 distribution. Completeness ============= *libcdio* is rather large and yet may still grow a bit. What is in *pycdio* is incomplete; over time it may grow to completion depending on various factors: e.g. interest, whether others help out. Sections of *libcdio* that are currently missing are the (SCSI) MMC commands, and the cdparanoia library. Of the audio controls, I put in those things that didn't require any thought. The ISO 9660 library is pretty complete, except file *stat()* information which is at present is pretty minimal. That said, what's in there is very usable. It contains probably more access capabilities than what most media players that don't use libcdio have. The encapsulation by SWIG is done in two parts. The lower-level python interface is called pycdio and is generated by SWIG. The more object-oriented module is *cdio*; it is a Python class that uses pycdio. Although pycdio is perfectly usable on its own, it is expected that *cdio* is what most people will use. As *pycdio* more closely models the C interface, it is conceivable (if unlikely) that diehard libcdio C users who are very familiar with that interface could prefer that. It is probably possible to change the SWIG in such a way to combine these pieces. However there are the problems. First, I'm not that much of a SWIG expert. Second it looks as though the resulting SWIG code would be more complex. Third the separation makes translation very straight forward to understand and maintain: first get what's in C into Python as a one-to-one translation. Then we implement some nice abstraction off of that. The abstraction can be modified without having to redo the underlying translation. (But the reverse is generally not true: usually changes to the C-to-python translation, pycdio, do result in small, but obvious and straightforward changes to the abstraction layer cdio.) There is much to be done - you want to help out, please do so! Standalone documentation is missing although many of the methods, classes and functions have some document strings. See also the programs in the example directory. pycdio-2.1.0/THANKS0000664000175000017500000000010413530441774014221 0ustar rockyrocky00000000000000Benjamin Eltzner - Debian packaging Adrian Reber - Fedora packaging pycdio-2.1.0/VERSION.py0000664000175000017500000000034613530473333015011 0ustar rockyrocky00000000000000# This file is needs to be multi-lingual in both Python and POSIX # shell which "execfile" or "source" it respectively. # This file should define a variable VERSION which we use as the # debugger version number. VERSION='2.1.0' pycdio-2.1.0/__pkginfo__.py0000664000175000017500000000452413530474141016115 0ustar rockyrocky00000000000000# Copyright (C) 2006, 2008-2009, 2013, 2016, 2018 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """pycdio packaging information""" modname = 'pycdio' # VERSION.py sets variable VERSION. import os.path exec(compile(open(os.path.join(os.path.dirname(__file__), 'VERSION.py')).read(), os.path.join(os.path.dirname(__file__), 'VERSION.py'), 'exec')) license = 'GPL' copyright = '''Copyright (C) 2006, 2008-2010, 2013, 2018 Rocky Bernstein .''' short_desc = 'Python OO interface to libcdio (CD Input and Control library)' author = "Rocky Bernstein" author_email = "rocky@gnu.org" web = 'http://www.gnu.org/software/libcdio' ftp = "ftp://ftp.gnu.org/pub/gnu/libcdio/%s-%s.tar.gz" % (modname, VERSION) mailinglist = "mailto:libcdio-pycdio-devel@gnu.org" classifiers = ['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License (GPL)', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.4', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] pycdio-2.1.0/cdio.py0000664000175000017500000007630613530471346014615 0ustar rockyrocky00000000000000# Copyright (C) 2006, 2008-2009, 2013, 2018-2019 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """The CD Input and Control library (pycdio) encapsulates CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library.""" import pycdio import _pycdio import sys import types PYTHON2 = sys.version_info[0] <= 2 OVER_PYTHON_25 = sys.version_info[0:1] >= (2, 5) class DeviceException(Exception): """General device or driver exceptions""" class DriverError(DeviceException): pass class DriverUnsupportedError(DeviceException): pass class DriverUninitError(DeviceException): pass class DriverNotPermittedError(DeviceException): pass class DriverBadParameterError(DeviceException): pass class DriverBadPointerError(DeviceException): pass class NoDriverError(DeviceException): pass class TrackError(DeviceException): pass pycdio.CDTEXT_FIELD_ARRANGER = _pycdio.CDTEXT_ARRANGER pycdio.CDTEXT_FIELD_COMPOSER = _pycdio.CDTEXT_COMPOSER pycdio.CDTEXT_FIELD_DISCID = _pycdio.CDTEXT_DISCID pycdio.CDTEXT_FIELD_MESSAGE = _pycdio.CDTEXT_MESSAGE pycdio.CDTEXT_FIELD_PERFORMER = _pycdio.CDTEXT_PERFORMER pycdio.CDTEXT_FIELD_ISRC = _pycdio.CDTEXT_PERFORMER # Note: the keys below match those the names returned by # cdio_get_driver_name() drivers = { "Unknown": pycdio.DRIVER_UNKNOWN, "AIX": pycdio.DRIVER_AIX, "FreeBSD": pycdio.DRIVER_FREEBSD, "GNU/Linux": pycdio.DRIVER_LINUX, "linux": pycdio.DRIVER_LINUX, "Solaris": pycdio.DRIVER_SOLARIS, "OS X": pycdio.DRIVER_OSX, "osx": pycdio.DRIVER_OSX, "WIN32": pycdio.DRIVER_WIN32, "CDRDAO": pycdio.DRIVER_CDRDAO, "BIN/CUE": pycdio.DRIVER_BINCUE, "NRG": pycdio.DRIVER_NRG, "Nero": pycdio.DRIVER_NRG, "device": pycdio.DRIVER_DEVICE, } if pycdio.VERSION_NUM >= 82: drivers["NetBSD"] = pycdio.DRIVER_NETBSD for name in list(drivers.keys()): drivers[name.lower()] = drivers[name] read_mode2blocksize = { pycdio.READ_MODE_AUDIO: pycdio.CD_FRAMESIZE_RAW, pycdio.READ_MODE_M1F1: pycdio.M2RAW_SECTOR_SIZE, pycdio.READ_MODE_M1F2: pycdio.CD_FRAMESIZE, pycdio.READ_MODE_M2F1: pycdio.M2RAW_SECTOR_SIZE, pycdio.READ_MODE_M2F2: pycdio.CD_FRAMESIZE, } def __possibly_raise_exception__(drc, msg=None): """Raise a Driver Error exception on error as determined by drc""" if drc == pycdio.DRIVER_OP_SUCCESS: return if drc == pycdio.DRIVER_OP_ERROR: raise DriverError if drc == pycdio.DRIVER_OP_UNINIT: raise DriverUninitError if drc == pycdio.DRIVER_OP_UNSUPPORTED: raise DriverUnsupportedError if drc == pycdio.DRIVER_OP_NOT_PERMITTED: raise DriverUnsupportedError if drc == pycdio.DRIVER_OP_BAD_PARAMETER: raise DriverBadParameterError if drc == pycdio.DRIVER_OP_BAD_POINTER: raise DriverBadPointerError if drc == pycdio.DRIVER_OP_NO_DRIVER: raise NoDriverError raise DeviceException("unknown exception %d" % drc) def close_tray(drive=None, driver_id=pycdio.DRIVER_UNKNOWN): """close_tray(drive=None, driver_id=DRIVER_UNKNOWN) -> driver_id close media tray in CD drive if there is a routine to do so. The driver id is returned. A DeviceException is thrown on error.""" drc, found_driver_id = pycdio.close_tray(drive, driver_id) __possibly_raise_exception__(drc) return found_driver_id def get_default_device_driver(driver_id=pycdio.DRIVER_DEVICE): """get_default_device_driver(self, driver_id=pycdio.DRIVER_DEVICE) ->[device, driver] Return a string containing the default CD device if none is specified. if driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then one set the default device for that. None is returned as the device if we couldn't get a default device.""" result = pycdio.get_default_device_driver(driver_id) if type(result) == type([1, 2]): return result return None def get_devices(driver_id=pycdio.DRIVER_UNKNOWN): """ get_devices(driver_id)->[device1, device2, ...] Get an list of device names. """ result = pycdio.get_devices(driver_id) if OVER_PYTHON_25 and type(result) == bytes: return [result] else: return result def get_devices_ret(driver_id=pycdio.DRIVER_UNKNOWN): """ get_devices_ret(driver_id)->[device1, device2, ... driver_id] Like get_devices, but return the p_driver_id which may be different from the passed-in driver_id if it was pycdio.DRIVER_DEVICE or pycdio.DRIVER_UNKNOWN. The return driver_id may be useful because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. """ return pycdio.get_devices_ret(driver_id) def get_devices_with_cap(capabilities, any=False): """ get_devices_with_cap(capabilities, any=False)->[device1, device2...] Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If any is False then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If any is True, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask pycdio.CDIO_FS_MATCH_ALL. The array of device names is returned or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. """ return pycdio.get_devices_with_cap(capabilities, any) def get_devices_with_cap_ret(capabilities, any=False): """ get_devices_with_cap(capabilities, any=False) [device1, device2..., driver_id] Like cdio_get_devices_with_cap but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. """ return pycdio.get_devices_with_cap_ret(capabilities, any) def have_driver(driver_id): """ have_driver(driver_id) -> bool Return True if we have driver driver_id. """ if OVER_PYTHON_25: check_types = (bytes, str) else: check_types = (str,) if isinstance(driver_id, int) or (PYTHON2 and isinstance(driver_id, long)): return pycdio.have_driver(driver_id) elif type(driver_id) in check_types and driver_id in drivers: ret = pycdio.have_driver(drivers[driver_id]) if ret == 0: return False if ret == 1: return True raise ValueError("internal error: driver id came back %d" % ret) else: raise ValueError("need either a number or string driver id") def is_binfile(binfile_name): """ is_binfile(binfile_name)->cue_name Determine if binfile_name is the BIN file part of a CDRWIN CD disk image. Return the corresponding CUE file if bin_name is a BIN file or None if not a BIN file. """ return pycdio.is_binfile(binfile_name) def is_cuefile(cuefile_name): """ is_cuefile(cuefile_name)->bin_name Determine if cuefile_name is the CUE file part of a CDRWIN CD disk image. Return the corresponding BIN file if bin_name is a CUE file or None if not a CUE file. """ return pycdio.is_cuefile(cuefile_name) def is_device(source, driver_id=pycdio.DRIVER_UNKNOWN): """ is_device(source, driver_id=pycdio.DRIVER_UNKNOWN)->bool Return True if source refers to a real hardware CD-ROM. """ if driver_id is None: driver_id = pycdio.DRIVER_UNKNOWN return pycdio.is_device(source, driver_id) def is_nrg(nrgfile_name): """ is_nrg(nrgfile_name)->bool Determine if nrgfile_name is a Nero CD disc image """ return pycdio.is_nrg(nrgfile_name) def is_tocfile(tocfile_name): """ is_tocfile(tocfile_name)->bool Determine if tocfile_name is a cdrdao CD disc image """ return pycdio.is_tocfile(tocfile_name) def convert_drive_cap_misc(bitmask): """Convert bit mask for miscellaneous drive properties into a dictionary of drive capabilities""" result = {} if bitmask & pycdio.DRIVE_CAP_ERROR: result["DRIVE_CAP_ERROR"] = True if bitmask & pycdio.DRIVE_CAP_UNKNOWN: result["DRIVE_CAP_UNKNOWN"] = True if bitmask & pycdio.DRIVE_CAP_MISC_CLOSE_TRAY: result["DRIVE_CAP_MISC_CLOSE_TRAY"] = True if bitmask & pycdio.DRIVE_CAP_MISC_EJECT: result["DRIVE_CAP_MISC_EJECT"] = True if bitmask & pycdio.DRIVE_CAP_MISC_LOCK: result["DRIVE_CAP_MISC_LOCK"] = True if bitmask & pycdio.DRIVE_CAP_MISC_SELECT_SPEED: result["DRIVE_CAP_MISC_SELECT_SPEED"] = True if bitmask & pycdio.DRIVE_CAP_MISC_SELECT_DISC: result["DRIVE_CAP_MISC_SELECT_DISC"] = True if bitmask & pycdio.DRIVE_CAP_MISC_MULTI_SESSION: result["DRIVE_CAP_MISC_MULTI_SESSION"] = True if bitmask & pycdio.DRIVE_CAP_MISC_MEDIA_CHANGED: result["DRIVE_CAP_MISC_MEDIA_CHANGED"] = True if bitmask & pycdio.DRIVE_CAP_MISC_RESET: result["DRIVE_CAP_MISC_RESET"] = True if bitmask & pycdio.DRIVE_CAP_MISC_FILE: result["DRIVE_CAP_MISC_FILE"] = True return result def convert_drive_cap_read(bitmask): """Convert bit mask for drive read properties into a dictionary of drive capabilities""" result = {} if bitmask & pycdio.DRIVE_CAP_READ_AUDIO: result["DRIVE_CAP_READ_AUDIO"] = True if bitmask & pycdio.DRIVE_CAP_READ_CD_DA: result["DRIVE_CAP_READ_CD_DA"] = True if bitmask & pycdio.DRIVE_CAP_READ_CD_G: result["DRIVE_CAP_READ_CD_G"] = True if bitmask & pycdio.DRIVE_CAP_READ_CD_R: result["DRIVE_CAP_READ_CD_R"] = True if bitmask & pycdio.DRIVE_CAP_READ_CD_RW: result["DRIVE_CAP_READ_CD_RW"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_R: result["DRIVE_CAP_READ_DVD_R"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_PR: result["DRIVE_CAP_READ_DVD_PR"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_RAM: result["DRIVE_CAP_READ_DVD_RAM"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_ROM: result["DRIVE_CAP_READ_DVD_ROM"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_RW: result["DRIVE_CAP_READ_DVD_RW"] = True if bitmask & pycdio.DRIVE_CAP_READ_DVD_RPW: result["DRIVE_CAP_READ_DVD_RPW"] = True if bitmask & pycdio.DRIVE_CAP_READ_C2_ERRS: result["DRIVE_CAP_READ_C2_ERRS"] = True if bitmask & pycdio.DRIVE_CAP_READ_MODE2_FORM1: result["DRIVE_CAP_READ_MODE2_FORM1"] = True if bitmask & pycdio.DRIVE_CAP_READ_MODE2_FORM2: result["DRIVE_CAP_READ_MODE2_FORM2"] = True if bitmask & pycdio.DRIVE_CAP_READ_MCN: result["DRIVE_CAP_READ_MCN"] = True if bitmask & pycdio.DRIVE_CAP_READ_ISRC: result["DRIVE_CAP_READ_ISRC"] = True return result def convert_drive_cap_write(bitmask): """Convert bit mask for drive write properties into a dictionary of drive capabilities""" result = {} if bitmask & pycdio.DRIVE_CAP_WRITE_CD_R: result["DRIVE_CAP_WRITE_CD_R"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_CD_RW: result["DRIVE_CAP_WRITE_CD_RW"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_DVD_R: result["DRIVE_CAP_WRITE_DVD_R"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_DVD_PR: result["DRIVE_CAP_WRITE_DVD_PR"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_DVD_RAM: result["DRIVE_CAP_WRITE_DVD_RAM"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_DVD_RW: result["DRIVE_CAP_WRITE_DVD_RW"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_DVD_RPW: result["DRIVE_CAP_WRITE_DVD_RPW"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_MT_RAINIER: result["DRIVE_CAP_WRITE_MT_RAINIER"] = True if bitmask & pycdio.DRIVE_CAP_WRITE_BURN_PROOF: result["DRIVE_CAP_WRITE_BURN_PROOF"] = True return result class Device: """CD Input and control class for discs/devices""" def __init__(self, source=None, driver_id=None, access_mode=None): self.cd = None if source is not None or driver_id is not None: self.open(source, driver_id, access_mode) def audio_pause(self): """ audio_pause(cdio)->status Pause playing CD through analog output. A DeviceError exception may be raised. """ drc = pycdio.audio_pause(self.cd) __possibly_raise_exception__(drc) def audio_play_lsn(self, start_lsn, end_lsn): """ auto_play_lsn(cdio, start_lsn, end_lsn)->status Playing CD through analog output at the given lsn to the ending lsn A DeviceError exception may be raised. """ drc = pycdio.audio_play_lsn(self.cd, start_lsn, end_lsn) __possibly_raise_exception__(drc) def audio_resume(self): """ audio_resume(cdio)->status Resume playing an audio CD through the analog interface. A DeviceError exception may be raised. """ drc = pycdio.audio_resume(self.cd) __possibly_raise_exception__(drc) def audio_stop(self): """ audio_stop(cdio)->status Stop playing an audio CD through the analog interface. A DeviceError exception may be raised. """ drc = pycdio.audio_stop(self.cd) __possibly_raise_exception__(drc) def close(self): """close(self) Free resources associated with p_cdio. Call this when done using using CD reading/control operations for the current device. """ if self.cd is not None: pycdio.close(self.cd) else: print("***No object to close") self.cd = None def eject_media(self): """eject_media(self) Eject media in CD drive if there is a routine to do so. A DeviceError exception may be raised. """ drc = pycdio.eject_media(self.cd) self.cd = None __possibly_raise_exception__(drc) ### FIXME: combine into above by testing if drive is the string ### None versus drive = pycdio.DRIVER_UNKNOWN def eject_media_drive(self, drive=None): """eject_media_drive(self, drive=None) Eject media in CD drive if there is a routine to do so. An exception is thrown on error.""" pycdio.eject_media_drive(drive) def get_arg(self, key): """get_arg(self, key)->string Get the value associatied with key.""" return pycdio.get_arg(self.cd, key) if pycdio.VERSION_NUM > 83: def get_cdtext(self): return CDText(pycdio.get_cdtext(self.cd)) def get_device(self): """get_device(self)->str Get the default CD device. If we haven't initialized a specific device driver), then find a suitable one and return the default device for that. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return None even though there may be a hardware CD-ROM.""" if self.cd is not None: return pycdio.get_arg(self.cd, "source") return pycdio.get_device(self.cd) def get_disc_last_lsn(self): """ get_disc_last_lsn(self)->int Get the LSN of the end of the CD DriverError and IOError may raised on error. """ lsn = pycdio.get_disc_last_lsn(self.cd) if lsn == pycdio.INVALID_LSN: raise DriverError("Invalid LSN returned") return lsn def get_disc_mode(self): """ get_disc_mode(p_cdio) -> str Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc. that we've got. The notion of 'CD' is extended a little to include DVD's. """ return pycdio.get_disc_mode(self.cd) def get_drive_cap(self): """ get_drive_cap(self)->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM. get_drive_cap_dev()->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM.""" b_read_cap, b_write_cap, b_misc_cap = pycdio.get_drive_cap(self.cd) return ( convert_drive_cap_read(b_read_cap), convert_drive_cap_write(b_write_cap), convert_drive_cap_misc(b_misc_cap), ) ### FIXME: combine into above by testing on the type of device. def get_drive_cap_dev(self, device=None): b_read_cap, b_write_cap, b_misc_cap = pycdio.get_drive_cap_dev(device) return ( convert_drive_cap_read(b_read_cap), convert_drive_cap_write(b_write_cap), convert_drive_cap_misc(b_misc_cap), ) def get_driver_name(self): """ get_driver_name(self)-> string return a string containing the name of the driver in use. An IOError exception is raised on error. """ return pycdio.get_driver_name(self.cd) def get_driver_id(self): """ get_driver_id(self)-> int Return the driver id of the driver in use. if object has not been initialized or is None, return pycdio.DRIVER_UNKNOWN. """ return pycdio.get_driver_id(self.cd) def get_first_track(self): """ get_first_track(self)->Track return a Track object of the first track. None is returned if there was a problem. """ track = pycdio.get_first_track_num(self.cd) if track == pycdio.INVALID_TRACK: return None return Track(self.cd, track) def get_hwinfo(self): """ get_hwinfo(self)->[vendor, model, release] Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. """ return pycdio.get_hwinfo(self.cd) def get_joliet_level(self): """ get_joliet_level(self)->int Return the Joliet level recognized for cdio. This only makes sense for something that has an ISO-9660 filesystem. """ return pycdio.get_joliet_level(self.cd) def get_last_session(self): """get_last_session(self) -> int Get the LSN of the first track of the last session of on the CD. An exception is thrown on error.""" drc, session = pycdio.get_last_session(self.cd) __possibly_raise_exception__(drc) return session def get_last_track(self): """ get_last_track(self)->Track return a Track object of the first track. None is returned if there was a problem. """ track = pycdio.get_last_track_num(self.cd) if track == pycdio.INVALID_TRACK: return None return Track(self.cd, track) def get_mcn(self): """ get_mcn(self) -> str Get the media catalog number (MCN) from the CD. """ return pycdio.get_mcn(self.cd) def get_media_changed(self): """ get_media_changed(self) -> bool Find out if media has changed since the last call. Return True if media has changed since last call. An exception Error is given on error. """ drc = pycdio.get_media_changed(self.cd) if drc == 0: return False if drc == 1: return True __possibly_raise_exception__(drc) raise DeviceException("Unknown return value %d" % drc) def get_num_tracks(self): """ get_num_tracks(self)->int Return the number of tracks on the CD. A TrackError or IOError exception may be raised on error. """ track = pycdio.get_num_tracks(self.cd) if track == pycdio.INVALID_TRACK: raise TrackError("Invalid track returned") return track def get_track(self, track_num): """ get_track(self, track_num)->track Return a track object for the given track number. """ return Track(self.cd, track_num) def get_track_for_lsn(self, lsn): """ get_track_for_lsn(self, lsn)->Track Find the track which contains lsn. None is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track, A track object with a 0 track is returned. Otherwise we return the track that spans the lsn. """ track = pycdio.get_last_track_num(self.cd) if track == pycdio.INVALID_TRACK: return None return Track(self.cd, track) def have_ATAPI(self): """have_ATAPI(self)->bool return True if CD-ROM understand ATAPI commands.""" return pycdio.have_ATAPI(self.cd) def lseek(self, offset, whence): """ lseek(self, offset, whence)->int Reposition read offset Similar to (if not the same as) libc's fseek() cdio is object to get adjested, offset is amount to seek and whence is like corresponding parameter in libc's lseek, e.g. it should be SEEK_SET or SEEK_END. the offset is returned or -1 on error. """ return pycdio.lseek(self.cd, offset, whence) def open(self, source=None, driver_id=pycdio.DRIVER_UNKNOWN, access_mode=None): """ open(self, source=None, driver_id=pycdio.DRIVER_UNKNOWN, access_mode=None) Sets up to read from place specified by source, driver_id and access mode. This should be called before using any other routine except those that act on a CD-ROM drive by name. If None is given as the source, we'll use the default driver device. If None is given as the driver_id, we'll find a suitable device driver. If device object was, previously opened it is closed first. Device is opened so that subsequent operations can be performed. """ if driver_id is None: driver_id = pycdio.DRIVER_UNKNOWN if self.cd is not None: self.close() self.cd = pycdio.open_cd(source, driver_id, access_mode) def read(self, size): """ read(self, size)->[size, data] Reads the next size bytes. Similar to (if not the same as) libc's read() The number of bytes read and the data is returned. A DeviceError exception may be raised. """ size, data = pycdio.read_cd(self.cd, size) __possibly_raise_exception__(size) return [size, data] def read_data_blocks(self, lsn, blocks=1): """ read_data_blocks(blocks, lsn, blocks=1)->[size, data] Reads a number of data sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. A DeviceError exception may be raised. """ size = pycdio.ISO_BLOCKSIZE * blocks size, data = pycdio.read_data_bytes(self.cd, size, lsn, pycdio.ISO_BLOCKSIZE) if size < 0: __possibly_raise_exception__(size) return [size, data] def read_sectors(self, lsn, read_mode, blocks=1): """ read_sectors(self, lsn, read_mode, blocks=1)->[blocks, data] Reads a number of sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. If read_mode is pycdio.MODE_AUDIO, the return buffer size will be truncated to multiple of pycdio.CDIO_FRAMESIZE_RAW i_blocks bytes. If read_mode is pycdio.MODE_DATA, buffer will be truncated to a multiple of pycdio.ISO_BLOCKSIZE, pycdio.M1RAW_SECTOR_SIZE or pycdio.M2F2_SECTOR_SIZE bytes depending on what mode the data is in. If read_mode is pycdio.MODE_M2F1, buffer will be truncated to a multiple of pycdio.M2RAW_SECTOR_SIZE bytes. If read_mode is pycdio.MODE_M2F2, the return buffer size will be truncated to a multiple of pycdio.CD_FRAMESIZE bytes. The number of bytes read and the data is returned. A DeviceError exception may be raised. """ try: blocksize = read_mode2blocksize[read_mode] size = blocks * blocksize except KeyError: raise DriverBadParameterError("Bad read mode %d" % read_mode) size, data = pycdio.read_sectors(self.cd, size, lsn, read_mode) if size < 0: __possibly_raise_exception__(size) blocks = size / blocksize return [blocks, data] def set_blocksize(self, blocksize): """set_blocksize(self, blocksize) Set the blocksize for subsequent reads. An exception is thrown on error. """ drc = pycdio.set_blocksize(self.cd, blocksize) __possibly_raise_exception__(drc) def set_speed(self, speed): """set_speed(self, speed) Set the drive speed. An exception is thrown on error.""" drc = pycdio.set_speed(self.cd, speed) __possibly_raise_exception__(drc) class Track: """CD Input and control track class""" def __init__(self, device, track_num): if type(track_num) != int: raise TrackError("track number parameter is not an integer") self.track = track_num # See if the device parameter is a string or # a device object. if OVER_PYTHON_25 and type(device) == bytes: self.device = Device(device) else: test_device = Device() ## FIXME: would like a way to test if device ## is a PySwigObject self.device = device def get_audio_channels(self): """ get_audio_channels(self, track)->int Return number of channels in track: 2 or 4 Not meaningful if track is not an audio track. An exception can be raised on error. """ channels = pycdio.get_track_channels(self.device, self.track) if -2 == channels: raise DriverUnsupportedError elif -1 == channels: raise TrackError else: return channels def get_copy_permit(self): """ get_copy_permit(self, track)->int Return copy protection status on a track. Is this meaningful not an audio track? """ if pycdio.get_track_copy_permit(self.device, self.track): return "OK" else: return "no" def get_format(self): """ get_format(self)->format Get the format (e.g. 'audio', 'mode2', 'mode1') of track. """ return pycdio.get_track_format(self.device, self.track) def get_last_lsn(self): """ get_last_lsn(self)->lsn Return the ending LSN for a track A TrackError or IOError exception may be raised on error. """ lsn = pycdio.get_track_last_lsn(self.device, self.track) if lsn == pycdio.INVALID_LSN: raise TrackError("Invalid LSN returned") return lsn def get_lba(self): """ get_lsn(self)->lba Return the starting LBA for a track A TrackError exception is raised on error. """ lba = pycdio.get_track_lba(self.device, self.track) if lba == pycdio.INVALID_LBA: raise TrackError("Invalid LBA returned") return lba def get_lsn(self): """ get_lsn(self)->lsn Return the starting LSN for a track A TrackError exception is raised on error. """ lsn = pycdio.get_track_lsn(self.device, self.track) if lsn == pycdio.INVALID_LSN: raise TrackError("Invalid LSN returned") return lsn def get_msf(self): """ get_msf(self)->str Return the starting MSF (minutes/secs/frames) for track number track. Track numbers usually start at something greater than 0, usually 1. Returns string of the form mm:ss:ff if all good, or string None on error. """ return pycdio.get_track_msf(self.device, self.track) def get_preemphasis(self): """ get_preemphaisis(self)->result Get linear preemphasis status on an audio track. This is not meaningful if not an audio track? A TrackError exception is raised on error. """ rc = pycdio.get_track_preemphasis(self.device, self.track) if rc == pycdio.TRACK_FLAG_FALSE: return "none" elif rc == pycdio.TRACK_FLAG_TRUE: return "preemphasis" elif rc == pycdio.TRACK_FLAG_UNKNOWN: return "unknown" else: raise TrackError("Invalid return value %d" % rc) def get_track_sec_count(self): """ get_track_sec_count(self)->int Get the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. Track numbers usually start at something greater than 0, usually 1. A TrackError exception is raised on error. """ sec_count = pycdio.get_track_sec_count(self.device, self.track) if sec_count == 0: raise TrackError return sec_count def is_green(self): """ is_track_green(self, track) -> bool Return True if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 """ return pycdio.is_track_green(self.device, self.track) def set_track(self, track_num): """ set_track(self, track_num) Set a new track number. """ self.track = track_num if pycdio.VERSION_NUM <= 83: def get_cdtext(self): return CDText(pycdio.get_cdtext(self.device, self.track)) class CDText: def __init__(self, opaque): self._cdtext = opaque if pycdio.VERSION_NUM <= 83: def get(self, key): """ get(self, key)->string Get the value associatied with key. """ return pycdio.cdtext_get(key, self._cdtext) def set(self, key, string): """ set(self, key, string)->None Set the value associatied with key. """ return pycdio.cdtext_set(key, string, self._cdtext) else: def get(self, key, track): """ get(self, key, track)->string Get the value associatied with key. """ return pycdio.cdtext_get(self._cdtext, key, track) # # Local variables: # mode: Python # End: pycdio-2.1.0/data/0000775000175000017500000000000013530476326014225 5ustar rockyrocky00000000000000pycdio-2.1.0/data/copying.iso0000664000175000017500000040000013530441774016402 0ustar rockyrocky00000000000000CD001LINUX CDROM @@ "j0  MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2006032706561400200603270656140000000000000000002006032706561400 CD001MKI Mon Mar 27 06:56:14 2006 mkisofs 1.15a40 .../isofs/"j0 "j0 ,HFFHj8 COPYING.;1 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pycdio-2.1.0/data/isofs-m1.bin0000664000175000017500000255324013530441774016367 0ustar rockyrocky00000000000000h+R5}&VA-.HDeCEC8kee¯C|6=v؅ugA5/evCgNu* ~TA(&`eCC+ z=Gh5=Ӹ&iA -9tD%evšCE(buN W]AgUTCeC$~ pG1+S}bV)[AT  &e5C ڇ!q\א2K?gA*~Au#͎e†CN[z Z}sA9~hje5_CD|S4J#d2VJbvަyA a3eC^|?:H/q d^AЈ{eCe0 BeByƋAn\ej¾CGSV=)Ȑdj1k$չ8A$Π2egCҡQ/X,t y` !@5A MI$eRCI$]Fo}ANcRey‹C"'}=CD001LINUX CDROM @@"g. MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2003042012291800200304201229180000000000000000002003042012291800 E)5_,HʼnZ\qօ$tY{Y{}b޶kJ}K2 Nq8=x/T ־MJZy]'=EtKK 3{/-?O91TThOahY\La:|GO$*qY*< ]Env9r*0M¡Bh` ~ԻBDfh1 3]l# MafCD001x բ U<[?m7Aw23KGqL-t$CwDxOv`"943MKI Sun Apr 20 12:29:18 2003 mkisofs 1.15a22 -R -o cdimage.raw /tmp/cdio-test dvrb~\ ,., " NJD4&66JBNF4\ZXBUFX;91?.'%"%!'#.-,!5vӯ#,0cYLEOLym e2an:([&+9O^uj3D et^\(C\ۺr<^iH,NuRDOC_xE67 <$Ar]f]leVNCZҡZrZ)w{W _OAG6xe\  <FhALi+[?r9KH}eCqj1p8HOu"j_b<yԾA[ 8e{CfBQʐe#g.SPRRPX$AATFg.g g.CEfg.RRPX$AATFg.g g.|HFFHf'5 COPYING.;1RRNM COPYINGPX$TFf'5g g pg 5DOCRRNMdocPX$AATFg 5g g 5ԡ [?hPs凈RC09J ɴMTj&f$~p;*iQk:QbrPh߸J%d7/$Cs&<&4i0;y&9n :`‡jvb_xϹ,(,Pl:\(?KzdhUJ!9j5~iƮe}X]&JV nкy2Ӵ3!4o9!6V_&>CM$fg 5RRPX$AATFg 5g g 5fg.RRPX$AATFg.g g.##g 5 README.TXT;1RRNMreadme.txtPX$TFg 5g g 5FU5kq> Q5'4qrCZ ɀlb,U&;BVLEgky8!Nn%窠),) !FS,bX"Riƛ4%R&Dᠩ۰sN}5 zcKg@E%vVlEo@Hp'3ڭ/UN4)}V,=p$´oo*.KM%&e>%ER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.47Q Ҙ5jKDɏMGi~v AN҂rĈiA K7+^{9>om}H4zz"2"Οv!4\"Jf71FI{Y̐2䖻2<_-y>aGpg&yN rI)e(]$ґC !i'GEwiOU)ʿX[K$gwMS_OO1P-; E 3M& GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for eacjxYu\k ~ %862L8Sn3IWpealqrX0-M  [CBWDdO01*mySU];o? #j2#>3&ÒMSIsPvt )Km3apO /5D`m81'y2VV@_ؐ>fG*K-E-a%çw% Q{995n;5Ҝ?Z`s_^9zE3T8jHQ3p@<'h author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuoua_xl3X8i$ ?8Lo^4c k)c\CƥxfQ\Y>x~S ̚D)]ΜP) ({o:ǧIz0k.*S loӐSv%ϨeDy`_'^IF{f8Q~L$$yX[H/mB~4jƃK',|NWm\r$$kNW\/jD ܩ 550"ڽaߋXyzaFZIP{tQ(sly and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute thJ?v77i֜:.sCȠ[ft)0^E {% `gu=;GU#g;aE5QQ9 cAT#6Ka%*AE&ƫ^ =qM6EWآq:wSKɁVO].Cڧܯ'4oq$%+v GvHU!F*NfpÑ7zP"G}թÓ߳8MHX B&)em as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executar|DL F$ J7lFK\kSۀx[Un(V cOJOu08WI^WCX^ܠ oHnJu(QxuC:/U b;ՊRƳJ0TifQL\cL\WݮX-nYWWBemҏʀĂ>zQ:M8शf<|qT"49dF|>>P0nPkjӮ!040mB0ble work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may n2 XQu҄.Fݱ 4 ;ڈ9v&b9W8:9h=Dfʫ=:mmR@t@Ua&]<}U;٪ +`y WA݀]W~cat+2[N.( yyFp݃Y!j!}I\A O\܉<3Ix0).'6*>E&J@m`32'c .^:`!o+V/j_4 )Q)QQ2LZ9t1+0K1ot impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents EM$W̖x 4  nUuπpx7;+,=ł(Ps;ӔKhn5/xYZd Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License alonvd> |1[i,QAtF5M ff$`iG []7 p&ո }8Lq3lڳPqZ .KWQ*ljf-/1/@9eZ5þrlbJ5O^XSr<(Q@nߘ+lOvY9(4j?"g~3f,&\jlj#7 ᕤ0 y*oO?k]}vn~^L:mZTƒuY4g with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. #.l$k e۫pK[x/W8,¢?`cai34D|VDLhK.'}i?w$DWĽgZ0hG*v) kI4Gb 0SN 2)aN3EWg{&忢MoM0[X7eRxJnKElqe;]WF8\4sAYMt뙘>&Ueu8+7'\5 5This library is to encapsulate CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependant properties of a CD-ROM can use this library. Some support for disk image types like BIN/CUE and NRG is available, so applications that use this library also have the ability to read disc images as though they were CD's. Immediate uses are VCDImager, a navigation-capable Video CD plugin and CD-DA plugin for the media player xine. A sample utility, cdinfo, is included which displayings CD info. If libcddb (http://libcddb.sourceforge.net) is available, the cdinfo program will display CDDB matches on CD-DA discs. @?8i?]T,՞Z1 XzkZ-,LAMN\MmdEu2Q^ṁܬQ4k*|G35OC a!U|AP^D?QyKk s4mIlO6MΔ6\G N1.>?]|nGV~OdxI; m[WX[~ϕ䍬AȨgW qʲu;npTm{2C=qf۱?ζD X;6$9zW.Aj|09"uaeC}]l1"E7:],mAKwa^OeeCKfIՐ18l|a صA-eµCzc{9`.Π+2A ;He$lCf{f3U@wD͙̼}#Ay\xe9eȨA4PpGdXseYCPNaΐgC1vSbA[)e2CjD:^/qDx> < oAH;eC9 MCEfy1AC UP+=eJC5˨5(F*&rb~jTLA1aqL;e¨Ce_^ZGDOz9=q.AjgϮ^e/qC}d0&$6H>[pB^h8|Af1pweCsȓU I>QBC|qA=h7pe C¦a[t RP.N`r 0E\ A0(+fe3UCRN$qmwQ=KcGzA=n*oeŒC꼀J1[KRn2J܇A]MeVCfaM~;Sb!1>MA%8e#CppT `m@AieCFQR|>BUzݜEfz3%A8'JeECj*vVs,dFt 2XA|e΃%e¹Cq9/;AeAWX:ُ,eAJHe@e `C7ˋ9Iѐ7X"Jf@DA)àWieC⪼MPyYg[/nȩq7{ζ^AA e CSNvkb1S`S@R' :AW^De"fC{|U%ax.X4]A9T!e¿C- JbsgOA^h? eGC-T?SF9c8kBH8!p{AӦۗsN{eC`x>sdS;I3M"vA<5e%C#װj~?Ae]6^FZ#lAseTCHsYwf1D/S "-bA[+RظeŠCj y7Cg_7AzE[be1SCw$vӐ4hQ&g ϱAؓ!xKeC‰+xiF4N\'5hA%f.e9C{*S`0PpY3%Av ('=yZe-wC/T1Jq^ F>/ AW朏>#?e®C[ w2arWyO\.wA#E.eHCl{YD̐fs$2*lV&~HdTA(~Zi eC 2X!h\.rt Xm-,6YAs;lJBe4Ch RuV@6_$%8rˏewT w0w P`#yӥ'\eewno:H wټ1vSeb[p)eew7j*:= w,T6t$eXPGdsevw uw7y=CU+=eCw]t(z= GwwN>ߜoH ;J\evwR Ou wOQ9.jkLCewp}r0ٌG wU*nr~TagL &e5we֡א 2w/>qB+^|2q +hpewh[ z w [ha,=f뒖je5_wUS d2 VwKcݧg10n*ew5*1[ w,.tr X\ +{ew$גwe w#qM]ejwZȐd w&2jJL1?MegwfMaX, twEza 駵sR-'6:sWYewh/|%g w"k<սmK{h%s{e{wJ`0xʐe w#);{MgRvئeTw܀SZ- ww$6^8zZFlWܧJeawGs4Y Ew%LSY;Mvvi< 5ehw/ w&&7EH[ew whvX w'ny: -+Ze w7  0w(40<\(hg3ewi*( w)Q&!F%xVe+}wԷ Tw0 >(=#"e3wH0[w w193.%" =GewI w22*V~Ud_Tz(E~Z etw2Xh? w35W1O"_Sjb[#eEwjl!D vw4o^XTޛ0Pmepwh9zx< Dw5P S&Y;?l*BegwRVt w6 $88Ur:aewGP:E w7rsi^^Rq}mew-{}Ր 1w8b Gc_գ-ew`^{ w9.͡E/}5h11VHe$lwI0IJrf3 Uw@vNa}.uxeg=!5C"/@eYwΐg wCgu=έ>ke2w#^/ qwDhx= <;-%eweEo CwEb &9n`eJw+ wF+ң}kV[$ O ;ew@8!\Z wG NBz`W=@Tg然^e/qwGɲ~p$ 6wHZZ5p_8j~hhwew|J wI?g@A~Wuا#/e w#7N RwP/`Eqd0^i :0fe3Uw0  wQYJ*~Ty(;aw3ew^?-ŧK wR#1$)8n2geVw 7/; wS{ yb1Š\ e#wV pwTo NWʁRew'@6=|> BwUhf"y3<5- IƴeEwEI] v wVr:duN2Gt.}%ewgȏA wW<H_D9x.yv@e `w֫4*ѐ 7wXF?A~+<Oiew*y wYfnd7C#}6  e wpA5b1 Sw`ħ@,QI ÕS6_FLDe"fw_X-  wa~7Y_nOٟ !ew6߮mJ wbJ K[eceGw̺cX}9 wc\jbB9!.j 8Vew}cBQ swdR2#Mwe%wOuhHo~? Awe97uFKY#rnܮ!wM-eTw!Cw wf!DRc" /BNlewZxgC wgUD-6媈oLbe1Sw:èCӐ 4wha"%fDD,49Kewv1 Kx wiN 2'y*~`.e9w^-g`0 PwpU'Gco"va;Ze-ww:@Vf wqb=0^GP/z`BdL&?ewTm0a wrV\n.!Fv6eHw]-)I̐f ws@3U'f:M8qewߍ¯\. rwt sX,,uf^¼t^мe4w-Z"v @wUoe@:7GQ qzRNraF]bee@٧)_!OHGQu|aiܦ,@!Mee@ry$=GQ+}2ViB Me@v6B\$GuQ߂9|9K.rjePe@C}z=GGQN\4K> nev@q=p6uGQI7Y nٗ- ,Ce@eY+GGQl,tXS3܅&e@5_ ^TbcאG2Q8S:Hm,pZR meNe@)@I>zGQ ]@6Zl{c-"je5@_;dѦ1d2GVQM_tkX=e@w*(iGQ(?xL8*P_oz{e@ȧLPEeGQMQG]jej@8;ȐdGQ7(Y8,xnPfV2y-:e@g~)|CX,GtQXp' :]EH5Čte@RWGFQRߊRaNG˒ey@]^wloGQ=k>0G zBl% []e@{YGQpu Gcgy8e@$iq |W"G3Q asC©B9e@KVGQJ +CTte:@N.pK.GWQ Bƺ[Q'VXkd$ jRB Ye@3ghgGQ"mbV<Ĭ.cEe{@xI9ʐeGQ#30 U f%6[e@TeH{Z-GwQ$081P`k6}ye@aBB/GEQ%uU=!=/ eh@k捤WGQ& pW`@@e@Χo+m<)XGQ'W:?!}*.$e @"D"D G0Q(-0wTnZ 0eJN:43e@3nGQ)W,eîunsFVe+@}FGTQ0H  c{xl"e@3j7lGQ1.aru\)G+Ge@g wIGQ24h\L'hЃ-{;2et@ECZ?GQ3 Q"I *Z|e@Et3dvGvQ4i "fDPPݚe@p0HxkvdeY@/ƉsΐgGQC^F W,jUe@24- ^/GqQD;x7M<IvV%e@]_GCQE;M%vKۘ(QeJ@ާJ3C&.'GQF-Fw- Z6s; A4;e@h:LnZGQGH#z+؀e=2 FRbB^e/@qlO4B$G6QHc\p48ƸaIfVwe@§ d QGQI9l Krш埰e @ 2fGRQP)s2`{V0Rd^|$fe3@U-(ƪ;GQQ`LW8ۮlԧ e@F4KGQRSh;٦37eV@;l;GQSBÜbƔX1%8Y]C"e@#g1GpQT1S<qcb([+{K 1le@j?ȴ@|>GBQU'ڡqfis3N_z %veE@ϧQll8#vGQVtd3|25"fC%e@ݱSAGQW3 "i 0k!@e @`HC 1+ѐG7QX~ kxLO!ie@ӧ4+yGQY`fn/-76Jsxp̸ e@ ,h5Zyb1GSQ`n)@g[{ RiΙrDe"@f@;uGGQaGLSbYf!e@p.Nv?JGQb N;@`G}]eG@ɧRRڿTO9GQcelއB!ء=K4e@.Y,cGsQdT,t?XXNGe@%WYUSx]~?GAQe1jFSپ#beSr 2eT@79YnqwGQf DȼQ"{#q#*Ue@0|kCGQg"fD%_8z퐂W<be1@SvӐG4QhXe/ yAjKe@qnI9yxGQiɋ{NF' /q^.e@9rAU`0GPQpʛdC+}4'_Ze-@wP"q}X.GQq[^b/tI3?e@L. aGQrPD{\%̍.͠T*eH@ا{RK̐fGQsy5_a"j<~e@r@3\.GrQt &Xj,L11c2`e@45gG@Q?O*_,zze6)$D0P4mp1SbK,[Ap_ Eee6)jJ֟|H4ށ ,~jUUee6)HƢ-=4O`3k",,ev6)P%؍u4И8%k,VeC6)3&z=G4*s~7T,^И2%ev6)-]'u4H#Xe/F,;bBCe6)O>BG4-SFwZ, 4&e56):nא24r9$KlrH,OaS}e6)k z4 \84۸u,nf:Vje5_6)d۶Qd2V4LW=ݘK,f% e6)JF4q);2{MVRvd,l$b{e6)(P+;e4‡[ %,R8YCr"ej6)٤g1Ȑd4S;-6,s37G5eg6)hÄX,t4qs& S, {% eR6) Ql0#ɍF46yZ܋<lc(,+K ley6)? 4ɺ3F"i,W ǂkå]e6)1ԇY4tY<| (貣,vة*C8e$6)/'׬"34n`.r-\6,sLxZe6)hP5,Z4~߂ a,xjO!te:N6)K+ƍW4 ǧLTSq,bS[j{LR,1iY|rYe6)@e;ʐg4"l<21,K]e{6)5̸^Ycʐe4#t  ; ,@4`}C]eT6)JReOZ-w4$1j8Sb,SNr2ea6)9ѵqȍE4%Td3",4Xeh6)PW=YS]4&ԡaY_,z#0ֵ<e6)r~X4'3D:UQf#,qUe 6)õ0E| 04(I30ۀU f,%y/pq,^3e6)eU4)eu/[, AkVe+}6)nyǍT40 pbe,IE3t"e36)7LP41J,ްt+X},t'3Ge6)"Jqk}.I425_"j%<,8׫#et6)̦?43hP {"Р,dTd*eE6)eRٍv44h%,c(dep6)p[pXx,r{e6)MiȬc4B|>KiG,cBZMeY6)6$ΐg4C:=N|Gatz,B,!e26)rb^/q4D\xO4L<Ӄ,յe>ne6)=r6ʍC4E__9Kr,PIeJ6)I4F,)t,X3,f7Y;e6) T͜Z4G}Izہ =,GƲ ,^e/q6)8e:+$64H]6p Z8l,Rcw-we6)Mdn4I8SH1p-, ߮Ne 6)\U@>ōR4P(`x807P,KBofe3U6)̜̯E4QM 9.,jt_ke6)}b*iK4R(8xsSP,Vˋ:eV6)_~|\;4S&7MbjY1Ln,]2ce#6)Mgۍp4TҾkRRa,NNH/G)e6)w|>B4UCUfp3],oEnteE6)::v4Vud 22,g%y~%e6)i| WA4Wauk0 ,l 9[@e `6)G{ѐ74X- 6C,~ie6)|b.Ky4YanC7 9,_N9 e 6)ܐb1S4`Ú@X y), RDe"f6) g4a# eFQ',ju,nJTFKe6)W.x4iNꃌn'G ,e:֠.e96)!`0P4paﳭA)=,!aZe-w6)γ4q?^A /~,Gx?e6)xjla4rQ\.}I,eH6)"tv̐f4s4 '\`L:h@,*{@2e6)W'CZ\.r4t GX&k,,$Pi x|e46)ҬIdˍ@4S :,aV5ee>KɓIs.i[r\Xhree>٘{1/eH؛pycdio-2.1.0/data/isofs-m1.cue0000664000175000017500000000011213530441774016352 0ustar rockyrocky00000000000000FILE "ISOFS-M1.BIN" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 pycdio-2.1.0/example/0000775000175000017500000000000013530476326014747 5ustar rockyrocky00000000000000pycdio-2.1.0/example/README0000664000175000017500000000303113530441774015623 0ustar rockyrocky00000000000000A description of the example programs. audio.py show mostly audio (analog) controls. Can be used to play a CD. Because libcdio supports Disc Images as well as a real CD-ROM, a CDRWIN (BIN/CUE), cdrdao (TOC) or Nero NRG disc image can be played as well. Run --help to get a list of options cdchange.py: A program to test if a CD has been changed since the last change test. cdtext.py: Program to show using cdtext. Similar to examples/cdtext.c from libcdio. device.py A program to show drive capabilities.. Various drives on various OS/s may or may not report information correctly. (Perhaps someday libcdio will figure out enough work arounds. voluneteers welcome!) drives.py: A program list CD-ROMs and CD properties in the drives. Various drives on various OS/s may or may not report information correctly. (Perhaps someday libcdio will figure out enough work arounds. voluneteers welcome!) eject.py A program to eject a CD from a CD-ROM drive and then close the door again. iso1.py: A program to show using iso9660.ISO9660.IFS to list files in a directory of an ISO-9660 image. iso2.py: A program to show using iso9660.ISO9660.FS to extract a file from a CDRWIN cue/bin CD image. iso3.py: A program to show using iso9660.ISO9660.IFS to extract a file from an ISO-9660 image. tracks.py A program to list track numbers and logical sector numbers of a Compact Disc pycdio-2.1.0/example/cd-read.py0000775000175000017500000000762013530441774016627 0ustar rockyrocky00000000000000#!/usr/bin/env python """Program to read CD blocks. See read-cd from the libcdio distribution for a more complete program. """ # # Copyright (C) 2006, 2008, 2010, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import sys, os from optparse import OptionParser libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio read_modes = { 'audio': pycdio.READ_MODE_AUDIO, 'm1f1' : pycdio.READ_MODE_M1F1, 'm1f2' : pycdio.READ_MODE_M1F2, 'm2f1' : pycdio.READ_MODE_M2F1, 'm2f2' : pycdio.READ_MODE_M2F2, 'data' : None } def process_options(): program = os.path.basename(sys.argv[0]) usage_str="""%s --mode *mode* [options] [device] Read blocks of a CD""" % program optparser = OptionParser(usage=usage_str) optparser.add_option("-m", "--mode", dest="mode", action="store", type='string', help="CD Reading mode: audio, m1f1, m1f2, " + "m2f1 or m2f2") optparser.add_option("-s", "--start", dest="start", action="store", type='int', default=1, help="Starting block") optparser.add_option("-n", "--number", dest="number", action="store", type='int', default=1, help="Number of blocks") (opts, argv) = optparser.parse_args() if opts.mode is None: print("Mode option must given via --mode " + \ "and one of: audio, m1f1, m1f2, m1f2 or m1f2.") sys.exit(1) try: read_mode = read_modes[opts.mode] except KeyError: print("Need to use the --mode option with one of" + \ "audio, m1f1, m1f2, m1f2 or m1f2") sys.exit(2) return opts, argv, read_mode import re PRINTABLE = r'[ -~]' pat = re.compile(PRINTABLE) def isprint(c): global pat return pat.match(c) def hexdump (buffer, just_hex=False): i = 0 s = '' while i < len(buffer): if (i % 16) == 0: s += ("0x%04x: " % i) pass s += ("%02x%02x " % (ord(buffer[i]), ord(buffer[i+1]))) if (i % 16) == 14: if not just_hex: s += " " for j in range(i-14, i+2): if isprint(buffer[j]): s += buffer[j] else: s += '.' pass pass print(s) s = '' i += 2 pass print('') return opts, argv, read_mode = process_options() # While sys.argv[0] is a program name and sys.argv[1] the first # option, argv[0] is the first unprocessed option -- roughly # the equivalent of sys.argv[1]. if argv[0:]: try: d = cdio.Device(argv[0]) except IOError: print("Problem opening CD-ROM: %s" % argv[0]) sys.exit(1) else: try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) except IOError: print("Problem finding a CD-ROM") sys.exit(1) ## All this setup just to issue this one of these commands. if read_mode == None: blocks, data=d.read_data_blocks(opts.start, opts.number) else: blocks, data=d.read_sectors(opts.start, read_mode, opts.number) hexdump(data) pycdio-2.1.0/example/cdtext.py0000775000175000017500000000535113530441774016622 0ustar rockyrocky00000000000000#!/usr/bin/env python """Program to show cdtext, similar to examples/cdtext.c""" # # Copyright (C) 2006, 2008, 2009, 2012 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio def print_cdtext_track_info_old(device, track, message): print(message) t = device.get_track(track) cdt = t.get_cdtext() for i in range(pycdio.MIN_CDTEXT_FIELDS, pycdio.MAX_CDTEXT_FIELDS): value = cdt.get(i) # value can be empty but exist, compared to NULL values if value is not None: print("\t%s: %s" % (pycdio.cdtext_field2str(i), value)) pass pass return def print_cdtext_info_new(device, message): print(message) cdt = device.get_cdtext() i_tracks = device.get_num_tracks() i_first_track = pycdio.get_first_track_num(device.cd) for t in range(i_first_track, i_tracks + i_first_track): for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS): value = cdt.get(i, t) # value can be empty but exist, compared to NULL values if value is not None: print("\t%s: %s" % (pycdio.cdtext_field2str(i), value)) pass pass pass return if sys.argv[1:]: try: drive_name = sys.argv[1] d = cdio.Device(sys.argv[1]) except IOError: print("Problem opening CD-ROM: %s" % drive_name) sys.exit(1) else: try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) if pycdio.VERSION_NUM < 83: i_tracks = d.get_num_tracks() i_first_track = pycdio.get_first_track_num(d.cd) print_cdtext_track_info_old(d, 0, 'CD-Text for Disc:') for i in range(i_first_track, i_tracks + i_first_track): print_cdtext_track_info_old(d, i, 'CD-Text for Track %d:' % i) pass pass else: print_cdtext_info_new(d, 'CD-Text for disk') pass pycdio-2.1.0/example/device.py0000775000175000017500000000446413530441774016572 0ustar rockyrocky00000000000000#!/usr/bin/env python """Program to show CD-ROM device information""" # # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio def sort_dict_keys(dict): """Return sorted keys of a dictionary. There's probably an easier way to do this that I'm not aware of.""" keys=list(dict.keys()) keys.sort() return keys if sys.argv[1:]: try: drive_name = sys.argv[1] d = cdio.Device(drive_name) except IOError: print("Problem opening CD-ROM: %s" % drive_name) sys.exit(1) else: try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) # Should there should be no "ok"? ok, vendor, model, release = d.get_hwinfo() print("drive: %s, vendor: %s, model: %s, release: %s" \ % (drive_name, vendor, model, release)) read_cap, write_cap, misc_cap = d.get_drive_cap() print("Drive Capabilities for %s..." % drive_name) s = "\n\t".join(cap for cap in sort_dict_keys(read_cap) + sort_dict_keys(write_cap) + sort_dict_keys(misc_cap)) print "\t%s" % s print("\nDriver Availability...") seen = {} for driver_name in sort_dict_keys(cdio.drivers): try: driver_id = cdio.drivers[driver_name] if cdio.have_driver(driver_name) and not driver_id in seen: print("\tDriver %s (%d) is installed." % (driver_name, driver_id,)) seen[driver_id] = True except ValueError: pass d.close() pycdio-2.1.0/example/drives.py0000775000175000017500000000355113530441774016623 0ustar rockyrocky00000000000000#!/usr/bin/python """Program to read CD blocks. See read-cd from the libcdio distribution for a more complete program.""" # # Copyright (C) 2006, 2008, 2011, 2013 Rocky Bernstein # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio def print_drive_class(msg, bitmask, any_capability): """ run and show output of cdio.get_devices_with_cap() """ drives = cdio.get_devices_with_cap(bitmask, any_capability) print("%s..." % msg) for d in drives: print("Drive %s" % d) print("-----") cd_drives = cdio.get_devices(pycdio.DRIVER_DEVICE) for drive in cd_drives: print("Drive %s" % drive) print("-----") print_drive_class("All CD-ROM drives (again)", pycdio.FS_MATCH_ALL, False) print_drive_class("All CD-DA drives...", pycdio.FS_AUDIO, False) print_drive_class("All drives with ISO 9660...", pycdio.FS_ISO_9660, False) print_drive_class("VCD drives...", (pycdio.FS_ANAL_SVCD|pycdio.FS_ANAL_CVD| pycdio.FS_ANAL_VIDEOCD|pycdio.FS_UNKNOWN), True) pycdio-2.1.0/example/eject.py0000775000175000017500000000343313530441774016420 0ustar rockyrocky00000000000000#!/usr/bin/env python """Program to Eject and close CD-ROM drive""" # # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio if sys.argv[1:]: try: drive_name=sys.argv[1] d = cdio.Device(drive_name) except IOError: print("Problem opening CD-ROM: %s" % drive_name) sys.exit(1) else: try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) try: print("Ejecting CD in drive %s" % drive_name) d.eject_media() try: cdio.close_tray(drive_name) print("Closed tray of CD-ROM drive %s" % drive_name) except cdio.DeviceException: print("Closing tray of CD-ROM drive %s failed" % drive_name) except cdio.DriverUnsupportedError: print("Eject not supported for %s" % drive_name) except cdio.DeviceException: print("Eject of CD-ROM drive %s failed" % drive_name) pycdio-2.1.0/example/iso1.py0000775000175000017500000000465413530441774016207 0ustar rockyrocky00000000000000#!/usr/bin/env python """ A simple program to show using libiso9660 to list files in a directory of an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used.""" # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import iso9660 # The default ISO 9660 image if none given ISO9660_IMAGE_PATH="../data" ISO9660_IMAGE=os.path.join(ISO9660_IMAGE_PATH, "copying.iso") if len(sys.argv) > 1: iso_image_fname = sys.argv[1] else: iso_image_fname = ISO9660_IMAGE iso = iso9660.ISO9660.IFS(source=iso_image_fname) if not iso.is_open(): print("Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname) sys.exit(1) path = '/' file_stats = iso.readdir(path) id = iso.get_application_id() if id is not None: print("Application ID: %s" % id) id = iso.get_preparer_id() if id is not None: print("Preparer ID: %s" % id) id = iso.get_publisher_id() if id is not None: print("Publisher ID: %s" % id) id = iso.get_system_id() if id is not None: print("System ID: %s" % id) id = iso.get_volume_id() if id is not None: print("Volume ID: %s" % id) id = iso.get_volumeset_id() if id is not None: print("Volumeset ID: %s" % id) dir_tr=['-', 'd'] for stat in file_stats: # FIXME filename = stat[0] LSN = stat[1] size = stat[2] sec_size = stat[3] is_dir = stat[4] == 2 print("%s [LSN %6d] %8d %s%s" % (dir_tr[is_dir], LSN, size, path, iso9660.name_translate(filename))) iso.close() sys.exit(0) pycdio-2.1.0/example/iso2.py0000775000175000017500000000626713530441774016212 0ustar rockyrocky00000000000000#!/usr/bin/env python """A program to show using iso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used. A program to show using iso9660 to extract a file from an ISO-9660 image.""" # # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import iso9660 PY3 = sys.version_info[0] == 3 # Python has rounding (round) and trucation (int), but what about an integer # ceiling function? Until I learn what it is... def ceil(x): return int(round(x+0.5)) # The default CD image if none given cd_image_path="../data" cd_image_fname=os.path.join(cd_image_path, "isofs-m1.cue") # File to extract if none given. iso9660_path="/" local_filename="copying" if len(sys.argv) > 1: cd_image_fname = sys.argv[1] if len(sys.argv) > 2: local_filename = sys.argv[1] if len(sys.argv) > 3: print(""" usage: %s [CD-ROM-or-image [filename]] Extracts filename from CD-ROM-or-image. """ % sys.argv[0]) sys.exit(1) try: cd = iso9660.ISO9660.FS(source=cd_image_fname) except: print("Sorry, couldn't open %s as a CD image." % cd_image_fname) sys.exit(1) statbuf = cd.stat (local_filename, False) if statbuf is None: print("Could not get ISO-9660 file information for file %s in %s" \ % (local_filename, cd_image_fname)) cd.close() sys.exit(2) try: OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0o664) except: print("Can't open %s for writing" % local_filename) # Copy the blocks from the ISO-9660 filesystem to the local filesystem. blocks = ceil(statbuf['size'] / pycdio.ISO_BLOCKSIZE) for i in range(blocks): lsn = statbuf['LSN'] + i size, buf = cd.read_data_blocks(lsn) if size < 0: print("Error reading ISO 9660 file %s at LSN %d" % ( local_filename, lsn)) sys.exit(4) pass if PY3: os.write(OUTPUT, bytes(buf, 'UTF-8')) else: os.write(OUTPUT, buf) pass # Make sure the file size has the exact same byte size. Without the # truncate below, the file will a multiple of ISO_BLOCKSIZE. os.ftruncate(OUTPUT, statbuf['size']) print("Extraction of file '%s' from %s successful." % ( local_filename, cd_image_fname)) os.close(OUTPUT) cd.close() sys.exit(0) pycdio-2.1.0/example/iso3.py0000775000175000017500000000620113530441774016177 0ustar rockyrocky00000000000000#!/usr/bin/env python """A program to show using iso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used.""" # # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import iso9660 PY3 = sys.version_info[0] == 3 # Python has rounding (round) and truncation (int), but what about an integer # ceiling function? Until I learn what it is... def ceil(x): return int(round(x+0.5)) # The default ISO 9660 image if none given ISO9660_IMAGE_PATH="../data" ISO9660_IMAGE=os.path.join(ISO9660_IMAGE_PATH, "copying.iso") # File to extract if none given. local_filename="copying" iso_image_fname = ISO9660_IMAGE if len(sys.argv) > 1: iso_image_fname = sys.argv[1] if len(sys.argv) > 2: local_filename = sys.argv[1] if len(sys.argv) > 3: print(""" usage: %s [ISO9660-image.ISO [filename]] Extracts filename from ISO9660-image.ISO. """ % sys.argv[0]) sys.exit(1) iso = iso9660.ISO9660.IFS(source=iso_image_fname) if not iso.is_open(): print("Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname) sys.exit(1) statbuf = iso.stat (local_filename, True) if statbuf is None: print("Could not get ISO-9660 file information for file %s" \ % local_filename) iso.close() sys.exit(2) try: OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0o664) except: print("Can't open %s for writing" % local_filename) # Copy the blocks from the ISO-9660 filesystem to the local filesystem. blocks = ceil(statbuf['size'] / pycdio.ISO_BLOCKSIZE) for i in range(blocks): lsn = statbuf['LSN'] + i size, buf = iso.seek_read (lsn) if size <= 0: print("Error reading ISO 9660 file %s at LSN %d" % ( local_filename, lsn)) sys.exit(4) if PY3: os.write(OUTPUT, bytes(buf, 'UTF-8')) else: os.write(OUTPUT, buf) pass # Make sure the file size has the exact same byte size. Without the # truncate below, the file will a multiple of ISO_BLOCKSIZE. os.ftruncate(OUTPUT, statbuf['size']) print("Extraction of file '%s' from %s successful." % ( local_filename, iso_image_fname)) os.close(OUTPUT) iso.close() sys.exit(0) pycdio-2.1.0/example/tracks.py0000775000175000017500000000471113530441774016615 0ustar rockyrocky00000000000000#!/usr/bin/env python """A program to show CD information.""" # # Copyright (C) 2006, 2008, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio if sys.argv[1:]: try: d = cdio.Device(sys.argv[1]) except IOError: print("Problem opening CD-ROM: %s" % sys.argv[1]) sys.exit(1) else: try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) except IOError: print("Problem finding a CD-ROM") sys.exit(1) t = d.get_first_track() if t is None: print("Problem getting first track") sys.exit(2) first_track = t.track num_tracks = d.get_num_tracks() last_track = first_track+num_tracks-1 try: last_session = d.get_last_session() print("CD-ROM %s has %d track(s) and %d session(s)." % \ (d.get_device(), d.get_num_tracks(), last_session)) except cdio.DriverUnsupportedError: print("CD-ROM %s has %d track(s). " % (d.get_device(), d.get_num_tracks())) print("Track format is %s." % d.get_disc_mode()) mcn = d.get_mcn() if mcn: print("Media Catalog Number: %s" % mcn) print("%3s: %-6s %s" % ("#", "LSN", "Format")) i=first_track while (i <= last_track): try: t = d.get_track(i) print("%3d: %06lu %-6s %s" % (t.track, t.get_lsn(), t.get_msf(), t.get_format())) except cdio.TrackError: pass i += 1 print("%3X: %06lu leadout" \ % (pycdio.CDROM_LEADOUT_TRACK, d.get_disc_last_lsn())) # check first track LSN t = d.get_track(1) lsn = t.get_lsn() if lsn > 100: # cd-info simple heuristic, ideally use cdio_guess_cd_type print('\nHidden Track') # see http://en.wikipedia.org/wiki/Hidden_Track d.close() pycdio-2.1.0/iso9660.py0000664000175000017500000004621413530441774015013 0ustar rockyrocky00000000000000# Copyright (C) 2006, 2008, 2010, 2013 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import pycdio import pyiso9660 import cdio import types check_types = { 'nocheck' : pyiso9660.NOCHECK, '7bit' : pyiso9660.SEVEN_BIT, 'achars' : pyiso9660.ACHARS, 'dchars' : pyiso9660.DCHARS } def dirname_valid_p(path): """dirname_valid_p(path)->bool Check that path is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. True is returned if path is valid.""" return pyiso9660.dirname_valid(path) def is_achar(achar): """is_achar(achar)->bool Return 1 if achar is an ACHAR. achar should either be a string of length one or the ord() of a string of length 1. These are the DCHAR's plus some ASCII symbols including the space symbol.""" if type(achar) != int: # Not integer. Should be a string of length one then. # We'll turn it into an integer. try: achar = ord(achar) except: return 0 else: # Is an integer. Is it too large? if achar > 255: return 0 return pyiso9660.is_achar(achar) def is_dchar(dchar): """is_dchar(dchar)->bool Return 1 if dchar is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore. dchar should either be a string of length one or the ord() of a string of length 1.""" if type(dchar) != int: # Not integer. Should be a string of length one then. # We'll turn it into an integer. try: dchar = ord(dchar) except: return 0 else: # Is an integer. Is it too large? if dchar > 255: return 0 return pyiso9660.is_dchar(dchar) def pathname_valid_p(path): """pathname_valid_p(path)->bool Check that path is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. True is returned if path is valid.""" return pyiso9660.pathame_valid(path) def pathname_isofy(path, version=1): """pathname_valid_p(path, version=1)->string Take path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followed by ';' and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned.""" return pyiso9660.pathname_isofy(path, version) def name_translate(filename, joliet_level=0): """name_translate(name, joliet_level=0)->str Convert an ISO-9660 file name of the kind that is that stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers. If joliet_level is not given it is 0 which means use no Joliet Extensions. Otherwise use the specified the Joliet level. The translated string is returned and it will be larger than the input filename.""" return pyiso9660.name_translate_ext(filename, joliet_level) # FIXME: should be # def stat_array_to_dict(*args): # Probably have a SWIG error. def stat_array_to_dict(filename, LSN, size, sec_size, is_dir): """stat_array_to_dict(filename, LSN, size, sec_size, is_dir)->stat Convert a ISO 9660 array to an hash reference of the values. Used internally in convert from C code.""" stat = {} stat['filename'] = filename stat['LSN'] = LSN stat['size'] = size stat['sec_size'] = sec_size stat['is_dir'] = is_dir == 2 return stat def strncpy_pad(name, len, check): """strncpy_pad(src, len, check='nocheck')->str Pad string 'name' with spaces to size len and return this. If 'len' is less than the length of 'src', the return value will be truncated to the first len characters of 'name'. 'name' can also be scanned to see if it contains only ACHARs, DCHARs, or 7-bit ASCII chars, and this is specified via the 'check' parameter. If the I parameter is given it must be one of the 'nocheck', '7bit', 'achars' or 'dchars'. Case is not significant.""" if check not in check_types: print("*** A CHECK parameter must be one of %s\n" % \ ', '.join(list(check_types.keys()))) return None return pyiso9660.strncpy_pad(name, len, check_types[check]) class ISO9660: """ """ class IFS: """ISO 9660 Filesystem image reading""" def __init__(self, source=None, iso_mask=pyiso9660.EXTENSION_NONE): """Create a new ISO 9660 object. If source is given, open() is called using that and the optional iso_mask parameter; iso_mask is used only if source is specified. If source is given but opening fails, undef is returned. If source is not given, an object is always returned.""" self.iso9660 = None if source is not None: self.open(source, iso_mask) def close(self): """close(self)->bool Close previously opened ISO 9660 image and free resources associated with ISO9660. Call this when done using using an ISO 9660 image.""" if self.iso9660 is not None: pyiso9660.close(self.iso9660) else: print("***No object to close") self.iso9660 = None def find_lsn(self, lsn): """find_lsn(self, lsn)->[stat_href] Find the filesystem entry that contains LSN and return file stat information about it. None is returned on error.""" if pycdio.VERSION_NUM <= 76: print("*** Routine available only in libcdio versions >= 0.76") return None filename, LSN, size, sec_size, is_dir = \ pyiso9660.ifs_find_lsn(self.iso9660, lsn) return stat_array_to_dict(filename, LSN, size, sec_size, is_dir) def get_application_id(self): """get_application_id(self)->id Get the application ID stored in the Primary Volume Descriptor. None is returned if there is some problem.""" return pyiso9660.ifs_get_application_id(self.iso9660) def get_preparer_id(self): """get_preparer_id(self)->id Get the preparer ID stored in the Primary Volume Descriptor. None is returned if there is some problem.""" return pyiso9660.ifs_get_preparer_id(self.iso9660) def get_publisher_id(self): """get_publisher_id()->id Get the publisher ID stored in the Primary Volume Descriptor. undef is returned if there is some problem.""" return pyiso9660.ifs_get_publisher_id(self.iso9660) def get_root_lsn(self): """get_root_lsn(self)->lsn Get the Root LSN stored in the Primary Volume Descriptor. undef is returned if there is some problem.""" return pyiso9660.ifs_get_root_lsn(self.iso9660) def get_system_id(self): """get_system_id(self)->id Get the Volume ID stored in the Primary Volume Descriptor. undef is returned if there is some problem.""" return pyiso9660.ifs_get_system_id(self.iso9660) def get_volume_id(self): """get_volume_id()->id Get the Volume ID stored in the Primary Volume Descriptor. undef is returned if there is some problem.""" return pyiso9660.ifs_get_volume_id(self.iso9660) def get_volumeset_id(self): """get_volume_id(self)->id Get the Volume ID stored in the Primary Volume Descriptor. undef is returned if there is some problem.""" return pyiso9660.ifs_get_volumeset_id(self.iso9660) def is_open(self): """is_open(self)->bool Return true if we have an ISO9660 image open. """ return self.iso9660 is not None def open(self, source, iso_mask=pyiso9660.EXTENSION_NONE): """open(source, iso_mask=pyiso9660.EXTENSION_NONE)->bool Open an ISO 9660 image for reading. Subsequent operations will read from this ISO 9660 image. This should be called before using any other routine except possibly new. It is implicitly called when a new is done specifying a source. If device object was previously opened it is closed first. See also open_fuzzy.""" if self.iso9660 is not None: self.close() self.iso9660 = pyiso9660.open_ext(source, iso_mask) return self.iso9660 is not None def open_fuzzy(self, source, iso_mask=pyiso9660.EXTENSION_NONE, fuzz=20): """open_fuzzy(source, iso_mask=pyiso9660.EXTENSION_NONE, fuzz=20)->bool Open an ISO 9660 image for reading. Subsequent operations will read from this ISO 9660 image. Some tolerence allowed for positioning the ISO9660 image. We scan for pyiso9660.STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= fuzz). This should be called before using any other routine except possibly new (which must be called first. It is implicitly called when a new is done specifying a source. See also open.""" if self.iso9660 is not None: self.close() if type(fuzz) != int: print("*** Expecting fuzz to be an integer; got 'fuzz'") return False self.iso9660 = pyiso9660.open_fuzzy_ext(source, iso_mask, fuzz) return self.iso9660 is not None def read_fuzzy_superblock(self, iso_mask=pyiso9660.EXTENSION_NONE, fuzz=20): """read_fuzzy_superblock(iso_mask=pyiso9660.EXTENSION_NONE, fuzz=20)->bool Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem.""" if type(fuzz) != int: print("*** Expecting fuzz to be an integer; got 'fuzz'") return False return pyiso9660.ifs_fuzzy_read_superblock(self.iso9660, iso_mask, fuzz) def readdir(self, dirname): """readdir(dirname)->[LSN, size, sec_size, filename, XA, is_dir] Read path (a directory) and return a list of iso9660 stat references Each item of @iso_stat is a hash reference which contains * LSN - the Logical sector number (an integer) * size - the total size of the file in bytes * sec_size - the number of sectors allocated * filename - the file name of the statbuf entry * XA - if the file has XA attributes; 0 if not * is_dir - 1 if a directory; 0 if a not; FIXME: If you look at iso9660.h you'll see more fields, such as for Rock-Ridge specific fields or XA specific fields. Eventually these will be added. Volunteers?""" return pyiso9660.ifs_readdir(self.iso9660, dirname) def read_pvd(self): """read_pvd()->pvd Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.""" return pyiso9660.ifs_read_pvd(self.iso9660) def read_superblock(self, iso_mask=pyiso9660.EXTENSION_NONE): """read_superblock(iso_mask=pyiso9660.EXTENSION_NONE)->bool Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.""" return pyiso9660.ifs_read_superblock(self.iso9660, iso_mask) def seek_read(self, start, size=1): """seek_read(self, start, size=1) ->(size, str) Seek to a position and then read n blocks. A block is pycdio.ISO_BLOCKSIZE (2048) bytes. The Size in BYTES (not blocks) is returned.""" size *= pyiso9660.ISO_BLOCKSIZE return pyiso9660.seek_read(self.iso9660, start, size) def stat(self, path, translate=False): """stat(self, path, translate=False)->{stat} Return file status for path name path. None is returned on error. If translate is True, version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. Each item of the return is a hash reference which contains: * LSN - the Logical sector number (an integer) * size - the total size of the file in bytes * sec_size - the number of sectors allocated * filename - the file name of the statbuf entry * XA - if the file has XA attributes; False if not * is_dir - True if a directory; False if a not.""" if translate: values = pyiso9660.ifs_stat_translate(self.iso9660, path) else: values = pyiso9660.ifs_stat(self.iso9660, path) return stat_array_to_dict(values[0], values[1], values[2], values[3], values[4]) class FS(cdio.Device): """ISO 9660 CD reading""" def __init__(self, source=None, driver_id=None, access_mode=None): """Create a new ISO 9660 object. If source is given, open() is called using that and the optional iso_mask parameter; iso_mask is used only if source is specified. If source is given but opening fails, undef is returned. If source is not given, an object is always returned.""" cdio.Device.__init__(self, source, driver_id, access_mode) def find_lsn(self, lsn): """find_lsn(self, lsn)->[stat_href] Find the filesystem entry that contains LSN and return file stat information about it. None is returned on error.""" filename, LSN, size, sec_size, is_dir = \ pyiso9660.fs_find_lsn(self.cd, lsn) return stat_array_to_dict(filename, LSN, size, sec_size, is_dir) def readdir(self, dirname): """readdir(dirname)->[LSN, size, sec_size, filename, XA, is_dir] Read path (a directory) and return a list of iso9660 stat references Each item of @iso_stat is a hash reference which contains * LSN - the Logical sector number (an integer) * size - the total size of the file in bytes * sec_size - the number of sectors allocated * filename - the file name of the statbuf entry * XA - if the file has XA attributes; 0 if not * is_dir - 1 if a directory; 0 if a not; FIXME: If you look at iso9660.h you'll see more fields, such as for Rock-Ridge specific fields or XA specific fields. Eventually these will be added. Volunteers?""" return pyiso9660.fs_readdir(self.cd, dirname) def read_pvd(self): """read_pvd()->pvd Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.""" return pyiso9660.fs_read_pvd(self.cd) def read_superblock(self, iso_mask=pyiso9660.EXTENSION_NONE): """read_superblock(iso_mask=pyiso9660.EXTENSION_NONE)->bool Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.""" return pyiso9660.fs_read_superblock(self.cd, iso_mask) def stat(self, path, translate=False): """stat(self, path, translate=False)->{stat} Return file status for path name path. None is returned on error. If translate is True, version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. Each item of the return is a hash reference which contains: * LSN - the Logical sector number (an integer) * size - the total size of the file in bytes * sec_size - the number of sectors allocated * filename - the file name of the statbuf entry * XA - if the file has XA attributes; False if not * is_dir - True if a directory; False if a not.""" if translate: values = pyiso9660.fs_stat_translate(self.cd, path) else: values = pyiso9660.fs_stat(self.cd, path) pass if values: return stat_array_to_dict(values[0], values[1], values[2], values[3], values[4]) else: return None pass pass pass pycdio-2.1.0/pycdio.egg-info/0000775000175000017500000000000013530476326016275 5ustar rockyrocky00000000000000pycdio-2.1.0/pycdio.egg-info/PKG-INFO0000664000175000017500000001606413530476326017401 0ustar rockyrocky00000000000000Metadata-Version: 1.1 Name: pycdio Version: 2.1.0 Summary: Python OO interface to libcdio (CD Input and Control library) Home-page: http://www.gnu.org/software/libcdio Author: Rocky Bernstein Author-email: rocky@gnu.org License: GPL Description: Introduction ============== pycdio is a Python interface to the *libcdio*, the CD Input and Control library http://www.gnu.org/software/libcdio You can get the source at the same place as libcdio: ftp://ftp.gnu.org:/pub/gnu/libcdio/ The *pycdio* and *libcdio* libraries encapsulate CD-ROM reading and control. Python programs wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Sample Usage ============ Getting CD-ROM Drive Information -------------------------------- .. code-block:: python import sys import cdio, pycdio try: d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN) drive_name = d.get_device() except IOError: print("Problem finding a CD-ROM") sys.exit(1) ok, vendor, model, release = d.get_hwinfo() print("drive: %s, vendor: %s, model: %s, release: %s" \ % (drive_name, vendor, model, release)) # Show CD-Text for an audio CD cdt = d.get_cdtext() i_tracks = d.get_num_tracks() i_first_track = pycdio.get_first_track_num(d.cd) for t in range(i_first_track, i_tracks + i_first_track): for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS): value = cdt.get(i, t) # value can be empty but exist, compared to NULL values if value is not None: print("\t%s: %s" % (pycdio.cdtext_field2str(i), value)) pass pass pass return d.close() Other sample code can be found in the *example* directory of the distribution. Requirements ============= * A C compiler so the extension can be compiled when it is installed. * libcdio (http://www.gnu.org/software/libcdio) and it's header files installed. * SWIG http://www.swig.org * pkg-config http://pkg-config.freedesktop.org To build on Debian (e.g. Ubuntu): ------------------------------------- :: $ apt-get install python-dev $ apt-get install libcdio-dev $ apt-get install libiso9660-dev $ apt-get install swig pkg-config $ pip install -e . $ make check SWIG Problems =============== I've tried to make this work back to Python 2.3 or so. I've noticed however problems in various distutils. If you see a message like this when running `make check`: :: File "/home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py", line 207, in library_dir_option return "-L" + dir TypeError: Can't convert 'bytes' object to str implicitly Copy in a recent ditutils `unixccompiler.py` like this: :: $ cp admin-tools/unixccompiler.py /home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py The distutils distribution says that it tries to be compatible with all Python versions from 2.3. The `unixccompiler.py` in `admin_tools` is from the Python 3.7.4 distribution. Completeness ============= *libcdio* is rather large and yet may still grow a bit. What is in *pycdio* is incomplete; over time it may grow to completion depending on various factors: e.g. interest, whether others help out. Sections of *libcdio* that are currently missing are the (SCSI) MMC commands, and the cdparanoia library. Of the audio controls, I put in those things that didn't require any thought. The ISO 9660 library is pretty complete, except file *stat()* information which is at present is pretty minimal. That said, what's in there is very usable. It contains probably more access capabilities than what most media players that don't use libcdio have. The encapsulation by SWIG is done in two parts. The lower-level python interface is called pycdio and is generated by SWIG. The more object-oriented module is *cdio*; it is a Python class that uses pycdio. Although pycdio is perfectly usable on its own, it is expected that *cdio* is what most people will use. As *pycdio* more closely models the C interface, it is conceivable (if unlikely) that diehard libcdio C users who are very familiar with that interface could prefer that. It is probably possible to change the SWIG in such a way to combine these pieces. However there are the problems. First, I'm not that much of a SWIG expert. Second it looks as though the resulting SWIG code would be more complex. Third the separation makes translation very straight forward to understand and maintain: first get what's in C into Python as a one-to-one translation. Then we implement some nice abstraction off of that. The abstraction can be modified without having to redo the underlying translation. (But the reverse is generally not true: usually changes to the C-to-python translation, pycdio, do result in small, but obvious and straightforward changes to the abstraction layer cdio.) There is much to be done - you want to help out, please do so! Standalone documentation is missing although many of the methods, classes and functions have some document strings. See also the programs in the example directory. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.4 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 pycdio-2.1.0/pycdio.egg-info/SOURCES.txt0000664000175000017500000000155413530476326020166 0ustar rockyrocky00000000000000AUTHORS COPYING ChangeLog MANIFEST.in Makefile NEWS.md README.rst THANKS VERSION.py __pkginfo__.py cdio.py iso9660.py pycdio.py pyiso9660.py setup.cfg setup.py data/copying.iso data/isofs-m1.bin data/isofs-m1.cue example/README example/cd-read.py example/cdtext.py example/device.py example/drives.py example/eject.py example/iso1.py example/iso2.py example/iso3.py example/tracks.py pycdio.egg-info/PKG-INFO pycdio.egg-info/SOURCES.txt pycdio.egg-info/dependency_links.txt pycdio.egg-info/top_level.txt swig/Makefile swig/audio.swg swig/cdtext.swg swig/device.swg swig/device_const.swg swig/disc.swg swig/pycdio.i swig/pyiso9660.i swig/read.swg swig/track.swg swig/types.swg test/Makefile test/cdda.bin test/cdda.cue test/cdda.toc test/cdtext.toc test/copying.iso test/isofs-m1.bin test/isofs-m1.cue test/test-cdio.py test/test-cdtext.py test/test-iso.py test/test-isocopy.pypycdio-2.1.0/pycdio.egg-info/dependency_links.txt0000664000175000017500000000000113530476326022343 0ustar rockyrocky00000000000000 pycdio-2.1.0/pycdio.egg-info/top_level.txt0000664000175000017500000000006113530476326021024 0ustar rockyrocky00000000000000_pycdio _pyiso9660 cdio iso9660 pycdio pyiso9660 pycdio-2.1.0/pycdio.py0000664000175000017500000011434113530476322015155 0ustar rockyrocky00000000000000# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. """ This is a wrapper for The CD Input and Control library (libcdio) which encapsulates CD-ROM reading and control. Python programs wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. """ from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_import_helper(): import importlib pkg = __name__.rpartition('.')[0] mname = '.'.join((pkg, '_pycdio')).lstrip('.') try: return importlib.import_module(mname) except ImportError: return importlib.import_module('_pycdio') _pycdio = swig_import_helper() del swig_import_helper elif _swig_python_version_info >= (2, 6, 0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_pycdio', [dirname(__file__)]) except ImportError: import _pycdio return _pycdio try: _mod = imp.load_module('_pycdio', fp, pathname, description) finally: if fp is not None: fp.close() return _mod _pycdio = swig_import_helper() del swig_import_helper else: import _pycdio del _swig_python_version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. try: import builtins as __builtin__ except ImportError: import __builtin__ def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name, None) if method: return method(self, value) if (not static): if _newclass: object.__setattr__(self, name, value) else: self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self, class_type, name, value): return _swig_setattr_nondynamic(self, class_type, name, value, 0) def _swig_getattr(self, class_type, name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name, None) if method: return method(self) raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except __builtin__.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 except __builtin__.Exception: class _object: pass _newclass = 0 class imaxdiv_t(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, imaxdiv_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, imaxdiv_t, name) __repr__ = _swig_repr __swig_setmethods__["quot"] = _pycdio.imaxdiv_t_quot_set __swig_getmethods__["quot"] = _pycdio.imaxdiv_t_quot_get if _newclass: quot = _swig_property(_pycdio.imaxdiv_t_quot_get, _pycdio.imaxdiv_t_quot_set) __swig_setmethods__["rem"] = _pycdio.imaxdiv_t_rem_set __swig_getmethods__["rem"] = _pycdio.imaxdiv_t_rem_get if _newclass: rem = _swig_property(_pycdio.imaxdiv_t_rem_get, _pycdio.imaxdiv_t_rem_set) def __init__(self): """ get_num_tracks(p_cdio)->int Return the number of tracks on the CD. On error pycdio.INVALID_TRACK is returned. """ this = _pycdio.new_imaxdiv_t() try: self.this.append(this) except __builtin__.Exception: self.this = this __swig_destroy__ = _pycdio.delete_imaxdiv_t __del__ = lambda self: None imaxdiv_t_swigregister = _pycdio.imaxdiv_t_swigregister imaxdiv_t_swigregister(imaxdiv_t) def imaxabs(n): return _pycdio.imaxabs(n) imaxabs = _pycdio.imaxabs def imaxdiv(numer, denom): return _pycdio.imaxdiv(numer, denom) imaxdiv = _pycdio.imaxdiv def wcstoimax(nptr, endptr, base): return _pycdio.wcstoimax(nptr, endptr, base) wcstoimax = _pycdio.wcstoimax def wcstoumax(nptr, endptr, base): return _pycdio.wcstoumax(nptr, endptr, base) wcstoumax = _pycdio.wcstoumax def strtoimax(nptr, endptr, base): return _pycdio.strtoimax(nptr, endptr, base) strtoimax = _pycdio.strtoimax def strtoumax(nptr, endptr, base): return _pycdio.strtoumax(nptr, endptr, base) strtoumax = _pycdio.strtoumax VERSION_NUM = _pycdio.VERSION_NUM INVALID_LBA = _pycdio.INVALID_LBA INVALID_LSN = _pycdio.INVALID_LSN CD_FRAMESIZE = _pycdio.CD_FRAMESIZE CD_FRAMESIZE_RAW = _pycdio.CD_FRAMESIZE_RAW ISO_BLOCKSIZE = _pycdio.ISO_BLOCKSIZE M2F2_SECTOR_SIZE = _pycdio.M2F2_SECTOR_SIZE M2RAW_SECTOR_SIZE = _pycdio.M2RAW_SECTOR_SIZE def audio_pause(p_cdio): """ audio_pause(cdio)->status Pause playing CD through analog output. """ return _pycdio.audio_pause(p_cdio) def audio_play_lsn(p_cdio, start_lsn, end_lsn): """ auto_play_lsn(cdio, start_lsn, end_lsn)->status Playing CD through analog output at the given lsn to the ending lsn """ return _pycdio.audio_play_lsn(p_cdio, start_lsn, end_lsn) def audio_resume(p_cdio): """ audio_resume(cdio)->status Resume playing an audio CD. """ return _pycdio.audio_resume(p_cdio) def audio_set_volume_levels(p_cdio, vol1, vol2, arg4, arg5): """ audio_resume(cdio)->status Resume playing an audio CD. """ return _pycdio.audio_set_volume_levels(p_cdio, vol1, vol2, arg4, arg5) def audio_stop(p_cdio): """ audio_stop(cdio)->status Stop playing an audio CD. """ return _pycdio.audio_stop(p_cdio) READ_MODE_AUDIO = _pycdio.READ_MODE_AUDIO READ_MODE_M1F1 = _pycdio.READ_MODE_M1F1 READ_MODE_M1F2 = _pycdio.READ_MODE_M1F2 READ_MODE_M2F1 = _pycdio.READ_MODE_M2F1 READ_MODE_M2F2 = _pycdio.READ_MODE_M2F2 def lseek(*args): """ lseek(cdio, offset, whence)->int Reposition read offset Similar to (if not the same as) libc's fseek() cdio is object to get adjested, offset is amount to seek and whence is like corresponding parameter in libc's lseek, e.g. it should be SEEK_SET or SEEK_END. the offset is returned or -1 on error. """ return _pycdio.lseek(*args) def read_cd(p_cdio, p_buf): """ read_cd(cdio, size)->[size, data] Reads into buf the next size bytes. Similar to (if not the same as) libc's read() The number of reads read is returned. -1 is returned on error. """ return _pycdio.read_cd(p_cdio, p_buf) def read_sectors(p_cdio, p_buf, i_lsn, read_mode): """ read_sectors(bytes, lsn, read_mode)->[size, data] Reads a number of sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. If read_mode is pycdio.MODE_AUDIO, the return buffer size will be truncated to multiple of pycdio.CDIO_FRAMESIZE_RAW i_blocks bytes. If read_mode is pycdio.MODE_DATA, buffer will be truncated to a multiple of pycdio.ISO_BLOCKSIZE, pycdio.M1RAW_SECTOR_SIZE or pycdio.M2F2_SECTOR_SIZE bytes depending on what mode the data is in. If read_mode is pycdio.CDIO_MODE_M2F1, buffer will be truncated to a multiple of pycdio.M2RAW_SECTOR_SIZE bytes. If read_mode is CDIO_MODE_M2F2, the return buffer size will be truncated to a multiple of pycdio.CD_FRAMESIZE bytes. If size <= 0 an error has occurred. """ return _pycdio.read_sectors(p_cdio, p_buf, i_lsn, read_mode) def read_data_bytes(p_cdio, p_buf, i_lsn, i_blocksize): """ read_data_bytes(lsn, bytes) Reads a number of data sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is pycdio.M2RAW_SECTOR_SIZE. If size <= 0 an error has occurred. """ return _pycdio.read_data_bytes(p_cdio, p_buf, i_lsn, i_blocksize) TRACK_FORMAT_AUDIO = _pycdio.TRACK_FORMAT_AUDIO TRACK_FORMAT_CDI = _pycdio.TRACK_FORMAT_CDI TRACK_FORMAT_XA = _pycdio.TRACK_FORMAT_XA TRACK_FORMAT_DATA = _pycdio.TRACK_FORMAT_DATA TRACK_FORMAT_PSX = _pycdio.TRACK_FORMAT_PSX CDIO_TRACK_FLAG_FALSE = _pycdio.CDIO_TRACK_FLAG_FALSE CDIO_TRACK_FLAG_TRUE = _pycdio.CDIO_TRACK_FLAG_TRUE CDIO_TRACK_FLAG_ERROR = _pycdio.CDIO_TRACK_FLAG_ERROR CDIO_TRACK_FLAG_UNKNOWN = _pycdio.CDIO_TRACK_FLAG_UNKNOWN CDIO_CDROM_LBA = _pycdio.CDIO_CDROM_LBA CDIO_CDROM_MSF = _pycdio.CDIO_CDROM_MSF CDIO_CDROM_DATA_TRACK = _pycdio.CDIO_CDROM_DATA_TRACK CDIO_CDROM_CDI_TRACK = _pycdio.CDIO_CDROM_CDI_TRACK CDIO_CDROM_XA_TRACK = _pycdio.CDIO_CDROM_XA_TRACK AUDIO = _pycdio.AUDIO MODE1 = _pycdio.MODE1 MODE1_RAW = _pycdio.MODE1_RAW MODE2 = _pycdio.MODE2 MODE2_FORM1 = _pycdio.MODE2_FORM1 MODE2_FORM2 = _pycdio.MODE2_FORM2 MODE2_FORM_MIX = _pycdio.MODE2_FORM_MIX MODE2_RAW = _pycdio.MODE2_RAW INVALID_TRACK = _pycdio.INVALID_TRACK CDROM_LEADOUT_TRACK = _pycdio.CDROM_LEADOUT_TRACK def get_first_track_num(p_cdio): """ get_first_track_num(p_cdio) -> int Get the number of the first track. return the track number or pycdio.INVALID_TRACK if there was a problem. """ return _pycdio.get_first_track_num(p_cdio) def get_last_track_num(p_cdio): """ get_last_track_num Return the last track number. pycdio.INVALID_TRACK is if there was a problem. """ return _pycdio.get_last_track_num(p_cdio) def get_track(p_cdio, lsn): """ cdio_get_track(lsn)->int Find the track which contains lsn. pycdio.INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track, 0 is returned. Otherwise we return the track that spans the lsn. """ return _pycdio.get_track(p_cdio, lsn) def get_track_channels(p_cdio, i_track): """ get_track_channels(cdio, track)->int Return number of channels in track: 2 or 4; -2 if implemented or -1 for error. Not meaningful if track is not an audio track. """ return _pycdio.get_track_channels(p_cdio, i_track) def get_track_copy_permit(p_cdio, i_track): """ get_copy_permit(cdio, track)->int Return copy protection status on a track. Is this meaningful not an audio track? """ return _pycdio.get_track_copy_permit(p_cdio, i_track) def get_track_format(p_cdio, i_track): """ get_track_format(cdio, track)->format Get the format (audio, mode2, mode1) of track. """ return _pycdio.get_track_format(p_cdio, i_track) def is_track_green(p_cdio, i_track): """ is_track_green(cdio, track) -> bool Return True if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? """ return _pycdio.is_track_green(p_cdio, i_track) def get_track_last_lsn(p_cdio, i_track): """ cdio_get_track_last_lsn(cdio, track)->lsn Return the ending LSN for track number track in cdio. CDIO_INVALID_LSN is returned on error. """ return _pycdio.get_track_last_lsn(p_cdio, i_track) def get_track_lba(p_cdio, i_track): """ cdio_get_track_lba Get the starting LBA for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @param p_cdio object to get information from @param i_track the track number we want the LSN for @return the starting LBA or CDIO_INVALID_LBA on error. """ return _pycdio.get_track_lba(p_cdio, i_track) def get_track_lsn(p_cdio, i_track): """ cdio_get_track_lsn (cdio, track)->int Return the starting LSN for track number. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track pycdio.CDROM_LEADOUT_TRACK or the total tracks+1. pycdio.INVALID_LSN is returned on error. """ return _pycdio.get_track_lsn(p_cdio, i_track) def get_track_msf(p_cdio, i_track): """ get_track_msf(cdio,track)->string Return the starting MSF (minutes/secs/frames) for track number track. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @return string mm:ss:ff if all good, or string 'error' on error. """ return _pycdio.get_track_msf(p_cdio, i_track) def get_track_preemphasis(p_cdio, i_track): """ cdio_get_track_preemphasis(cdio, track) Get linear preemphasis status on an audio track. This is not meaningful if not an audio track? """ return _pycdio.get_track_preemphasis(p_cdio, i_track) def get_track_sec_count(p_cdio, i_track): """ get_track_sec_count(cdio, track)->int Get the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. Track numbers usually start at something greater than 0, usually 1. 0 is returned if there is an error. """ return _pycdio.get_track_sec_count(p_cdio, i_track) CDTEXT_ARRANGER = _pycdio.CDTEXT_ARRANGER CDTEXT_COMPOSER = _pycdio.CDTEXT_COMPOSER CDTEXT_DISCID = _pycdio.CDTEXT_DISCID CDTEXT_ISRC = _pycdio.CDTEXT_ISRC CDTEXT_MESSAGE = _pycdio.CDTEXT_MESSAGE CDTEXT_PERFORMER = _pycdio.CDTEXT_PERFORMER CDTEXT_FIELD_TITLE = _pycdio.CDTEXT_FIELD_TITLE CDTEXT_FIELD_SONGWRITER = _pycdio.CDTEXT_FIELD_SONGWRITER CDTEXT_FIELD_UPC_EAN = _pycdio.CDTEXT_FIELD_UPC_EAN CDTEXT_GENRE = _pycdio.CDTEXT_GENRE CDTEXT_FIELD_INVALID = _pycdio.CDTEXT_FIELD_INVALID CDTEXT_GENRE_UNUSED = _pycdio.CDTEXT_GENRE_UNUSED CDTEXT_GENRE_UNDEFINED = _pycdio.CDTEXT_GENRE_UNDEFINED CDTEXT_GENRE_ADULT_CONTEMP = _pycdio.CDTEXT_GENRE_ADULT_CONTEMP CDTEXT_GENRE_ALT_ROCK = _pycdio.CDTEXT_GENRE_ALT_ROCK CDTEXT_GENRE_CHILDRENS = _pycdio.CDTEXT_GENRE_CHILDRENS CDTEXT_GENRE_CLASSIC = _pycdio.CDTEXT_GENRE_CLASSIC CDTEXT_GENRE_CHRIST_CONTEMP = _pycdio.CDTEXT_GENRE_CHRIST_CONTEMP CDTEXT_GENRE_COUNTRY = _pycdio.CDTEXT_GENRE_COUNTRY CDTEXT_GENRE_DANCE = _pycdio.CDTEXT_GENRE_DANCE CDTEXT_GENRE_EASY_LISTENING = _pycdio.CDTEXT_GENRE_EASY_LISTENING CDTEXT_GENRE_EROTIC = _pycdio.CDTEXT_GENRE_EROTIC CDTEXT_GENRE_FOLK = _pycdio.CDTEXT_GENRE_FOLK CDTEXT_GENRE_GOSPEL = _pycdio.CDTEXT_GENRE_GOSPEL CDTEXT_GENRE_HIPHOP = _pycdio.CDTEXT_GENRE_HIPHOP CDTEXT_GENRE_JAZZ = _pycdio.CDTEXT_GENRE_JAZZ CDTEXT_GENRE_LATIN = _pycdio.CDTEXT_GENRE_LATIN CDTEXT_GENRE_MUSICAL = _pycdio.CDTEXT_GENRE_MUSICAL CDTEXT_GENRE_NEWAGE = _pycdio.CDTEXT_GENRE_NEWAGE CDTEXT_GENRE_OPERA = _pycdio.CDTEXT_GENRE_OPERA CDTEXT_GENRE_OPERETTA = _pycdio.CDTEXT_GENRE_OPERETTA CDTEXT_GENRE_POP = _pycdio.CDTEXT_GENRE_POP CDTEXT_GENRE_RAP = _pycdio.CDTEXT_GENRE_RAP CDTEXT_GENRE_REGGAE = _pycdio.CDTEXT_GENRE_REGGAE CDTEXT_GENRE_ROCK = _pycdio.CDTEXT_GENRE_ROCK CDTEXT_GENRE_RYTHMANDBLUES = _pycdio.CDTEXT_GENRE_RYTHMANDBLUES CDTEXT_GENRE_SOUNDEFFECTS = _pycdio.CDTEXT_GENRE_SOUNDEFFECTS CDTEXT_GENRE_SOUNDTRACK = _pycdio.CDTEXT_GENRE_SOUNDTRACK CDTEXT_GENRE_SPOKEN_WORD = _pycdio.CDTEXT_GENRE_SPOKEN_WORD CDTEXT_GENRE_WORLD_MUSIC = _pycdio.CDTEXT_GENRE_WORLD_MUSIC CDTEXT_LANGUAGE_UNKNOWN = _pycdio.CDTEXT_LANGUAGE_UNKNOWN CDTEXT_LANGUAGE_ALBANIAN = _pycdio.CDTEXT_LANGUAGE_ALBANIAN CDTEXT_LANGUAGE_BRETON = _pycdio.CDTEXT_LANGUAGE_BRETON CDTEXT_LANGUAGE_CATALAN = _pycdio.CDTEXT_LANGUAGE_CATALAN CDTEXT_LANGUAGE_CROATIAN = _pycdio.CDTEXT_LANGUAGE_CROATIAN CDTEXT_LANGUAGE_WELSH = _pycdio.CDTEXT_LANGUAGE_WELSH CDTEXT_LANGUAGE_CZECH = _pycdio.CDTEXT_LANGUAGE_CZECH CDTEXT_LANGUAGE_DANISH = _pycdio.CDTEXT_LANGUAGE_DANISH CDTEXT_LANGUAGE_GERMAN = _pycdio.CDTEXT_LANGUAGE_GERMAN CDTEXT_LANGUAGE_ENGLISH = _pycdio.CDTEXT_LANGUAGE_ENGLISH CDTEXT_LANGUAGE_SPANISH = _pycdio.CDTEXT_LANGUAGE_SPANISH CDTEXT_LANGUAGE_ESPERANTO = _pycdio.CDTEXT_LANGUAGE_ESPERANTO CDTEXT_LANGUAGE_ESTONIAN = _pycdio.CDTEXT_LANGUAGE_ESTONIAN CDTEXT_LANGUAGE_BASQUE = _pycdio.CDTEXT_LANGUAGE_BASQUE CDTEXT_LANGUAGE_FAROESE = _pycdio.CDTEXT_LANGUAGE_FAROESE CDTEXT_LANGUAGE_FRENCH = _pycdio.CDTEXT_LANGUAGE_FRENCH CDTEXT_LANGUAGE_FRISIAN = _pycdio.CDTEXT_LANGUAGE_FRISIAN CDTEXT_LANGUAGE_IRISH = _pycdio.CDTEXT_LANGUAGE_IRISH CDTEXT_LANGUAGE_GAELIC = _pycdio.CDTEXT_LANGUAGE_GAELIC CDTEXT_LANGUAGE_GALICIAN = _pycdio.CDTEXT_LANGUAGE_GALICIAN CDTEXT_LANGUAGE_ICELANDIC = _pycdio.CDTEXT_LANGUAGE_ICELANDIC CDTEXT_LANGUAGE_ITALIAN = _pycdio.CDTEXT_LANGUAGE_ITALIAN CDTEXT_LANGUAGE_LAPPISH = _pycdio.CDTEXT_LANGUAGE_LAPPISH CDTEXT_LANGUAGE_LATIN = _pycdio.CDTEXT_LANGUAGE_LATIN CDTEXT_LANGUAGE_LATVIAN = _pycdio.CDTEXT_LANGUAGE_LATVIAN CDTEXT_LANGUAGE_LUXEMBOURGIAN = _pycdio.CDTEXT_LANGUAGE_LUXEMBOURGIAN CDTEXT_LANGUAGE_LITHUANIAN = _pycdio.CDTEXT_LANGUAGE_LITHUANIAN CDTEXT_LANGUAGE_HUNGARIAN = _pycdio.CDTEXT_LANGUAGE_HUNGARIAN CDTEXT_LANGUAGE_MALTESE = _pycdio.CDTEXT_LANGUAGE_MALTESE CDTEXT_LANGUAGE_DUTCH = _pycdio.CDTEXT_LANGUAGE_DUTCH CDTEXT_LANGUAGE_NORWEGIAN = _pycdio.CDTEXT_LANGUAGE_NORWEGIAN CDTEXT_LANGUAGE_OCCITAN = _pycdio.CDTEXT_LANGUAGE_OCCITAN CDTEXT_LANGUAGE_POLISH = _pycdio.CDTEXT_LANGUAGE_POLISH CDTEXT_LANGUAGE_PORTUGUESE = _pycdio.CDTEXT_LANGUAGE_PORTUGUESE CDTEXT_LANGUAGE_ROMANIAN = _pycdio.CDTEXT_LANGUAGE_ROMANIAN CDTEXT_LANGUAGE_ROMANSH = _pycdio.CDTEXT_LANGUAGE_ROMANSH CDTEXT_LANGUAGE_SERBIAN = _pycdio.CDTEXT_LANGUAGE_SERBIAN CDTEXT_LANGUAGE_SLOVAK = _pycdio.CDTEXT_LANGUAGE_SLOVAK CDTEXT_LANGUAGE_SLOVENIAN = _pycdio.CDTEXT_LANGUAGE_SLOVENIAN CDTEXT_LANGUAGE_FINNISH = _pycdio.CDTEXT_LANGUAGE_FINNISH CDTEXT_LANGUAGE_SWEDISH = _pycdio.CDTEXT_LANGUAGE_SWEDISH CDTEXT_LANGUAGE_TURKISH = _pycdio.CDTEXT_LANGUAGE_TURKISH CDTEXT_LANGUAGE_FLEMISH = _pycdio.CDTEXT_LANGUAGE_FLEMISH CDTEXT_LANGUAGE_WALLON = _pycdio.CDTEXT_LANGUAGE_WALLON CDTEXT_LANGUAGE_ZULU = _pycdio.CDTEXT_LANGUAGE_ZULU CDTEXT_LANGUAGE_VIETNAMESE = _pycdio.CDTEXT_LANGUAGE_VIETNAMESE CDTEXT_LANGUAGE_UZBEK = _pycdio.CDTEXT_LANGUAGE_UZBEK CDTEXT_LANGUAGE_URDU = _pycdio.CDTEXT_LANGUAGE_URDU CDTEXT_LANGUAGE_UKRAINIAN = _pycdio.CDTEXT_LANGUAGE_UKRAINIAN CDTEXT_LANGUAGE_THAI = _pycdio.CDTEXT_LANGUAGE_THAI CDTEXT_LANGUAGE_TELUGU = _pycdio.CDTEXT_LANGUAGE_TELUGU CDTEXT_LANGUAGE_TATAR = _pycdio.CDTEXT_LANGUAGE_TATAR CDTEXT_LANGUAGE_TAMIL = _pycdio.CDTEXT_LANGUAGE_TAMIL CDTEXT_LANGUAGE_TADZHIK = _pycdio.CDTEXT_LANGUAGE_TADZHIK CDTEXT_LANGUAGE_SWAHILI = _pycdio.CDTEXT_LANGUAGE_SWAHILI CDTEXT_LANGUAGE_SRANANTONGO = _pycdio.CDTEXT_LANGUAGE_SRANANTONGO CDTEXT_LANGUAGE_SOMALI = _pycdio.CDTEXT_LANGUAGE_SOMALI CDTEXT_LANGUAGE_SINHALESE = _pycdio.CDTEXT_LANGUAGE_SINHALESE CDTEXT_LANGUAGE_SHONA = _pycdio.CDTEXT_LANGUAGE_SHONA CDTEXT_LANGUAGE_SERBO_CROAT = _pycdio.CDTEXT_LANGUAGE_SERBO_CROAT CDTEXT_LANGUAGE_RUTHENIAN = _pycdio.CDTEXT_LANGUAGE_RUTHENIAN CDTEXT_LANGUAGE_RUSSIAN = _pycdio.CDTEXT_LANGUAGE_RUSSIAN CDTEXT_LANGUAGE_QUECHUA = _pycdio.CDTEXT_LANGUAGE_QUECHUA CDTEXT_LANGUAGE_PUSHTU = _pycdio.CDTEXT_LANGUAGE_PUSHTU CDTEXT_LANGUAGE_PUNJABI = _pycdio.CDTEXT_LANGUAGE_PUNJABI CDTEXT_LANGUAGE_PERSIAN = _pycdio.CDTEXT_LANGUAGE_PERSIAN CDTEXT_LANGUAGE_PAPAMIENTO = _pycdio.CDTEXT_LANGUAGE_PAPAMIENTO CDTEXT_LANGUAGE_ORIYA = _pycdio.CDTEXT_LANGUAGE_ORIYA CDTEXT_LANGUAGE_NEPALI = _pycdio.CDTEXT_LANGUAGE_NEPALI CDTEXT_LANGUAGE_NDEBELE = _pycdio.CDTEXT_LANGUAGE_NDEBELE CDTEXT_LANGUAGE_MARATHI = _pycdio.CDTEXT_LANGUAGE_MARATHI CDTEXT_LANGUAGE_MOLDAVIAN = _pycdio.CDTEXT_LANGUAGE_MOLDAVIAN CDTEXT_LANGUAGE_MALAYSIAN = _pycdio.CDTEXT_LANGUAGE_MALAYSIAN CDTEXT_LANGUAGE_MALAGASAY = _pycdio.CDTEXT_LANGUAGE_MALAGASAY CDTEXT_LANGUAGE_MACEDONIAN = _pycdio.CDTEXT_LANGUAGE_MACEDONIAN CDTEXT_LANGUAGE_LAOTIAN = _pycdio.CDTEXT_LANGUAGE_LAOTIAN CDTEXT_LANGUAGE_KOREAN = _pycdio.CDTEXT_LANGUAGE_KOREAN CDTEXT_LANGUAGE_KHMER = _pycdio.CDTEXT_LANGUAGE_KHMER CDTEXT_LANGUAGE_KAZAKH = _pycdio.CDTEXT_LANGUAGE_KAZAKH CDTEXT_LANGUAGE_KANNADA = _pycdio.CDTEXT_LANGUAGE_KANNADA CDTEXT_LANGUAGE_JAPANESE = _pycdio.CDTEXT_LANGUAGE_JAPANESE CDTEXT_LANGUAGE_INDONESIAN = _pycdio.CDTEXT_LANGUAGE_INDONESIAN CDTEXT_LANGUAGE_HINDI = _pycdio.CDTEXT_LANGUAGE_HINDI CDTEXT_LANGUAGE_HEBREW = _pycdio.CDTEXT_LANGUAGE_HEBREW CDTEXT_LANGUAGE_HAUSA = _pycdio.CDTEXT_LANGUAGE_HAUSA CDTEXT_LANGUAGE_GURANI = _pycdio.CDTEXT_LANGUAGE_GURANI CDTEXT_LANGUAGE_GUJURATI = _pycdio.CDTEXT_LANGUAGE_GUJURATI CDTEXT_LANGUAGE_GREEK = _pycdio.CDTEXT_LANGUAGE_GREEK CDTEXT_LANGUAGE_GEORGIAN = _pycdio.CDTEXT_LANGUAGE_GEORGIAN CDTEXT_LANGUAGE_FULANI = _pycdio.CDTEXT_LANGUAGE_FULANI CDTEXT_LANGUAGE_DARI = _pycdio.CDTEXT_LANGUAGE_DARI CDTEXT_LANGUAGE_CHURASH = _pycdio.CDTEXT_LANGUAGE_CHURASH CDTEXT_LANGUAGE_CHINESE = _pycdio.CDTEXT_LANGUAGE_CHINESE CDTEXT_LANGUAGE_BURMESE = _pycdio.CDTEXT_LANGUAGE_BURMESE CDTEXT_LANGUAGE_BULGARIAN = _pycdio.CDTEXT_LANGUAGE_BULGARIAN CDTEXT_LANGUAGE_BENGALI = _pycdio.CDTEXT_LANGUAGE_BENGALI CDTEXT_LANGUAGE_BIELORUSSIAN = _pycdio.CDTEXT_LANGUAGE_BIELORUSSIAN CDTEXT_LANGUAGE_BAMBORA = _pycdio.CDTEXT_LANGUAGE_BAMBORA CDTEXT_LANGUAGE_AZERBAIJANI = _pycdio.CDTEXT_LANGUAGE_AZERBAIJANI CDTEXT_LANGUAGE_ASSAMESE = _pycdio.CDTEXT_LANGUAGE_ASSAMESE CDTEXT_LANGUAGE_ARMENIAN = _pycdio.CDTEXT_LANGUAGE_ARMENIAN CDTEXT_LANGUAGE_ARABIC = _pycdio.CDTEXT_LANGUAGE_ARABIC CDTEXT_LANGUAGE_AMHARIC = _pycdio.CDTEXT_LANGUAGE_AMHARIC MIN_CDTEXT_FIELD = _pycdio.MIN_CDTEXT_FIELD MAX_CDTEXT_FIELDS = _pycdio.MAX_CDTEXT_FIELDS def cdtext_field2str(i): """cdtext_field2str(cdtext_field_t i) -> char const *""" return _pycdio.cdtext_field2str(i) def cdtext_lang2str(i): """cdtext_lang2str(cdtext_lang_t i) -> char const *""" return _pycdio.cdtext_lang2str(i) def cdtext_genre2str(i): """cdtext_genre2str(cdtext_genre_t i) -> char const *""" return _pycdio.cdtext_genre2str(i) def cdtext_init(): """cdtext_init() -> cdtext_t *""" return _pycdio.cdtext_init() def cdtext_destroy(p_cdtext): """cdtext_destroy(cdtext_t * p_cdtext)""" return _pycdio.cdtext_destroy(p_cdtext) def cdtext_get(p_cdtext, key, track): """cdtext_get(cdtext_t const * p_cdtext, cdtext_field_t key, track_t track) -> char *""" return _pycdio.cdtext_get(p_cdtext, key, track) def cdtext_get_const(p_cdtext, key, track): """cdtext_get_const(cdtext_t const * p_cdtext, cdtext_field_t key, track_t track) -> char const *""" return _pycdio.cdtext_get_const(p_cdtext, key, track) def cdtext_get_language(p_cdtext): """cdtext_get_language(cdtext_t const * p_cdtext) -> cdtext_lang_t""" return _pycdio.cdtext_get_language(p_cdtext) def cdtext_select_language(p_cdtext, lang): """cdtext_select_language(cdtext_t * p_cdtext, cdtext_lang_t lang) -> bool""" return _pycdio.cdtext_select_language(p_cdtext, lang) def cdtext_list_languages(p_cdtext): """cdtext_list_languages(cdtext_t const * p_cdtext) -> cdtext_lang_t *""" return _pycdio.cdtext_list_languages(p_cdtext) def cdtext_set(p_cdtext, key, value, track, charset): """cdtext_set(cdtext_t * p_cdtext, cdtext_field_t key, uint8_t const * value, track_t track, char const * charset)""" return _pycdio.cdtext_set(p_cdtext, key, value, track, charset) def get_cdtext(p_cdio): """get_cdtext(CdIo_t * p_cdio) -> cdtext_t *""" return _pycdio.get_cdtext(p_cdio) DRIVE_CAP_ERROR = _pycdio.DRIVE_CAP_ERROR DRIVE_CAP_UNKNOWN = _pycdio.DRIVE_CAP_UNKNOWN DRIVE_CAP_MISC_CLOSE_TRAY = _pycdio.DRIVE_CAP_MISC_CLOSE_TRAY DRIVE_CAP_MISC_EJECT = _pycdio.DRIVE_CAP_MISC_EJECT DRIVE_CAP_MISC_LOCK = _pycdio.DRIVE_CAP_MISC_LOCK DRIVE_CAP_MISC_SELECT_SPEED = _pycdio.DRIVE_CAP_MISC_SELECT_SPEED DRIVE_CAP_MISC_SELECT_DISC = _pycdio.DRIVE_CAP_MISC_SELECT_DISC DRIVE_CAP_MISC_MULTI_SESSION = _pycdio.DRIVE_CAP_MISC_MULTI_SESSION DRIVE_CAP_MISC_MEDIA_CHANGED = _pycdio.DRIVE_CAP_MISC_MEDIA_CHANGED DRIVE_CAP_MISC_RESET = _pycdio.DRIVE_CAP_MISC_RESET DRIVE_CAP_MISC_FILE = _pycdio.DRIVE_CAP_MISC_FILE DRIVE_CAP_READ_AUDIO = _pycdio.DRIVE_CAP_READ_AUDIO DRIVE_CAP_READ_CD_DA = _pycdio.DRIVE_CAP_READ_CD_DA DRIVE_CAP_READ_CD_G = _pycdio.DRIVE_CAP_READ_CD_G DRIVE_CAP_READ_CD_R = _pycdio.DRIVE_CAP_READ_CD_R DRIVE_CAP_READ_CD_RW = _pycdio.DRIVE_CAP_READ_CD_RW DRIVE_CAP_READ_DVD_R = _pycdio.DRIVE_CAP_READ_DVD_R DRIVE_CAP_READ_DVD_PR = _pycdio.DRIVE_CAP_READ_DVD_PR DRIVE_CAP_READ_DVD_RAM = _pycdio.DRIVE_CAP_READ_DVD_RAM DRIVE_CAP_READ_DVD_ROM = _pycdio.DRIVE_CAP_READ_DVD_ROM DRIVE_CAP_READ_DVD_RW = _pycdio.DRIVE_CAP_READ_DVD_RW DRIVE_CAP_READ_DVD_RPW = _pycdio.DRIVE_CAP_READ_DVD_RPW DRIVE_CAP_READ_C2_ERRS = _pycdio.DRIVE_CAP_READ_C2_ERRS DRIVE_CAP_READ_MODE2_FORM1 = _pycdio.DRIVE_CAP_READ_MODE2_FORM1 DRIVE_CAP_READ_MODE2_FORM2 = _pycdio.DRIVE_CAP_READ_MODE2_FORM2 DRIVE_CAP_READ_MCN = _pycdio.DRIVE_CAP_READ_MCN DRIVE_CAP_READ_ISRC = _pycdio.DRIVE_CAP_READ_ISRC DRIVE_CAP_WRITE_CD_R = _pycdio.DRIVE_CAP_WRITE_CD_R DRIVE_CAP_WRITE_CD_RW = _pycdio.DRIVE_CAP_WRITE_CD_RW DRIVE_CAP_WRITE_DVD_R = _pycdio.DRIVE_CAP_WRITE_DVD_R DRIVE_CAP_WRITE_DVD_PR = _pycdio.DRIVE_CAP_WRITE_DVD_PR DRIVE_CAP_WRITE_DVD_RAM = _pycdio.DRIVE_CAP_WRITE_DVD_RAM DRIVE_CAP_WRITE_DVD_RW = _pycdio.DRIVE_CAP_WRITE_DVD_RW DRIVE_CAP_WRITE_DVD_RPW = _pycdio.DRIVE_CAP_WRITE_DVD_RPW DRIVE_CAP_WRITE_MT_RAINIER = _pycdio.DRIVE_CAP_WRITE_MT_RAINIER DRIVE_CAP_WRITE_BURN_PROOF = _pycdio.DRIVE_CAP_WRITE_BURN_PROOF DRIVE_CAP_WRITE_CD = _pycdio.DRIVE_CAP_WRITE_CD DRIVE_CAP_WRITE_DVD = _pycdio.DRIVE_CAP_WRITE_DVD DRIVE_CAP_WRITE = _pycdio.DRIVE_CAP_WRITE MMC_HW_VENDOR_LEN = _pycdio.MMC_HW_VENDOR_LEN MMC_HW_MODEL_LEN = _pycdio.MMC_HW_MODEL_LEN MMC_HW_REVISION_LEN = _pycdio.MMC_HW_REVISION_LEN SRC_IS_DISK_IMAGE_MASK = _pycdio.SRC_IS_DISK_IMAGE_MASK SRC_IS_DEVICE_MASK = _pycdio.SRC_IS_DEVICE_MASK SRC_IS_SCSI_MASK = _pycdio.SRC_IS_SCSI_MASK SRC_IS_NATIVE_MASK = _pycdio.SRC_IS_NATIVE_MASK DRIVER_UNKNOWN = _pycdio.DRIVER_UNKNOWN DRIVER_AIX = _pycdio.DRIVER_AIX DRIVER_FREEBSD = _pycdio.DRIVER_FREEBSD DRIVER_LINUX = _pycdio.DRIVER_LINUX DRIVER_SOLARIS = _pycdio.DRIVER_SOLARIS DRIVER_OSX = _pycdio.DRIVER_OSX DRIVER_NETBSD = _pycdio.DRIVER_NETBSD DRIVER_WIN32 = _pycdio.DRIVER_WIN32 DRIVER_CDRDAO = _pycdio.DRIVER_CDRDAO DRIVER_BINCUE = _pycdio.DRIVER_BINCUE DRIVER_NRG = _pycdio.DRIVER_NRG DRIVER_DEVICE = _pycdio.DRIVER_DEVICE DRIVER_OP_SUCCESS = _pycdio.DRIVER_OP_SUCCESS DRIVER_OP_ERROR = _pycdio.DRIVER_OP_ERROR DRIVER_OP_UNSUPPORTED = _pycdio.DRIVER_OP_UNSUPPORTED DRIVER_OP_UNINIT = _pycdio.DRIVER_OP_UNINIT DRIVER_OP_NOT_PERMITTED = _pycdio.DRIVER_OP_NOT_PERMITTED DRIVER_OP_BAD_PARAMETER = _pycdio.DRIVER_OP_BAD_PARAMETER DRIVER_OP_BAD_POINTER = _pycdio.DRIVER_OP_BAD_POINTER DRIVER_OP_NO_DRIVER = _pycdio.DRIVER_OP_NO_DRIVER FS_AUDIO = _pycdio.FS_AUDIO FS_HIGH_SIERRA = _pycdio.FS_HIGH_SIERRA FS_ISO_9660 = _pycdio.FS_ISO_9660 FS_INTERACTIVE = _pycdio.FS_INTERACTIVE FS_HFS = _pycdio.FS_HFS FS_UFS = _pycdio.FS_UFS FS_EXT2 = _pycdio.FS_EXT2 FS_ISO_HFS = _pycdio.FS_ISO_HFS FS_ISO_9660_INTERACTIVE = _pycdio.FS_ISO_9660_INTERACTIVE FS_3DO = _pycdio.FS_3DO FS_XISO = _pycdio.FS_XISO FS_UDFX = _pycdio.FS_UDFX FS_UDF = _pycdio.FS_UDF FS_ISO_UDF = _pycdio.FS_ISO_UDF FS_ANAL_XA = _pycdio.FS_ANAL_XA FS_ANAL_MULTISESSION = _pycdio.FS_ANAL_MULTISESSION FS_ANAL_PHOTO_CD = _pycdio.FS_ANAL_PHOTO_CD FS_ANAL_HIDDEN_TRACK = _pycdio.FS_ANAL_HIDDEN_TRACK FS_ANAL_CDTV = _pycdio.FS_ANAL_CDTV FS_ANAL_BOOTABLE = _pycdio.FS_ANAL_BOOTABLE FS_ANAL_VIDEOCD = _pycdio.FS_ANAL_VIDEOCD FS_ANAL_ROCKRIDGE = _pycdio.FS_ANAL_ROCKRIDGE FS_ANAL_JOLIET = _pycdio.FS_ANAL_JOLIET FS_ANAL_SVCD = _pycdio.FS_ANAL_SVCD FS_ANAL_CVD = _pycdio.FS_ANAL_CVD FS_ANAL_XISO = _pycdio.FS_ANAL_XISO FS_MATCH_ALL = _pycdio.FS_MATCH_ALL FS_UNKNOWN = _pycdio.FS_UNKNOWN def close_tray(*args): """ close_tray(drive=None, driver_id=None) -> [status, driver_id] close media tray in CD drive if there is a routine to do so. The driver id is returned. An exception is thrown on error. """ return _pycdio.close_tray(*args) def close(p_cdio): """ destroy(p_cdio) Free resources associated with p_cdio. Call this when done using using CD reading/control operations for the current device. """ return _pycdio.close(p_cdio) def eject_media(p_cdio): """ eject_media(cdio)->return_code Eject media in CD drive if there is a routine to do so. """ return _pycdio.eject_media(p_cdio) def eject_media_drive(psz_drive=None): """ eject_media_drive(drive=None)->return_code Eject media in CD drive if there is a routine to do so. psz_drive: the name of the device to be acted upon. The operation status is returned. """ return _pycdio.eject_media_drive(psz_drive) def get_arg(p_cdio, key): """ get_arg(p_cdio, key)->string Get the value associatied with key. """ return _pycdio.get_arg(p_cdio, key) def get_device(p_cdio=None): """ get_device(cdio)->str Get the CD device associated with cdio. If cdio is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return None even though there may be a hardware CD-ROM. """ return _pycdio.get_device(p_cdio) def get_default_device_driver(p_driver_id): """ get_default_device_driver(driver_id=None)->[device, driver] Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that. None is returned as the device if we couldn't get a default device. """ return _pycdio.get_default_device_driver(p_driver_id) def get_devices(driver_id): """ get_devices(driver_id)->[device1, device2, ...] Get an list of device names. """ return _pycdio.get_devices(driver_id) def get_devices_ret(driver_id): """ get_devices_ret(driver_id)->[device1, device2, ... driver_id] Like get_devices, but return the p_driver_id which may be different from the passed-in driver_id if it was pycdio.DRIVER_DEVICE or pycdio.DRIVER_UNKNOWN. The return driver_id may be useful because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. """ return _pycdio.get_devices_ret(driver_id) def get_devices_with_cap(capabilities, b_any): """ get_devices_with_cap(capabilities, any)->[device1, device2...] Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If any is False then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If any is True, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask pycdio.CDIO_FS_MATCH_ALL. The array of device names is returned or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. """ return _pycdio.get_devices_with_cap(capabilities, b_any) def get_devices_with_cap_ret(capabilities, b_any): """ Like cdio_get_devices_with_cap but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. """ return _pycdio.get_devices_with_cap_ret(capabilities, b_any) def get_drive_cap(*args): """ get_drive_cap()->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM. get_drive_cap_dev()->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM. """ return _pycdio.get_drive_cap(*args) def get_driver_name(p_cdio): """ get_driver_name(cdio)-> string return a string containing the name of the driver in use. An IOError exception is raised on error. """ return _pycdio.get_driver_name(p_cdio) def get_driver_id(p_cdio): """ get_driver_id(cdio)-> int Return the driver id of the driver in use. if cdio has not been initialized or is None, return pycdio.DRIVER_UNKNOWN. """ return _pycdio.get_driver_id(p_cdio) def get_last_session(p_cdio): """ get_last_session(p_cdio) -> int Get the LSN of the first track of the last session of on the CD. An exception is thrown on error. """ return _pycdio.get_last_session(p_cdio) def have_driver(driver_id): """ have_driver(driver_id) -> int Return 1 if we have driver driver_id, 0 if not and -1 if driver id is out of range. """ return _pycdio.have_driver(driver_id) def have_ATAPI(p_cdio): """ have_ATAPI(CdIo_t *p_cdio)->bool return True if CD-ROM understand ATAPI commands. """ return _pycdio.have_ATAPI(p_cdio) def is_binfile(bin_name): """ is_binfile(binfile_name)->cue_name Determine if binfile_name is the BIN file part of a CDRWIN CD disk image. Return the corresponding CUE file if bin_name is a BIN file or None if not a BIN file. """ return _pycdio.is_binfile(bin_name) def is_cuefile(cue_name): """ is_cuefile(cuefile_name)->bin_name Determine if cuefile_name is the CUE file part of a CDRWIN CD disk image. Return the corresponding BIN file if bin_name is a CUE file or None if not a CUE file. """ return _pycdio.is_cuefile(cue_name) def is_device(*args): """ is_cuefile(cuefile_name)->bin_name Determine if cuefile_name is the CUE file part of a CDRWIN CD disk image. Return the corresponding BIN file if bin_name is a CUE file or None if not a CUE file. """ return _pycdio.is_device(*args) def is_nrg(nrg_name): """ is_nrg(cue_name)->bool Determine if nrg_name is a Nero CD disc image """ return _pycdio.is_nrg(nrg_name) def is_tocfile(tocfile_name): """ is_tocfile(tocfile_name)->bool Determine if tocfile_name is a cdrdao CD disc image """ return _pycdio.is_tocfile(tocfile_name) def get_media_changed(p_cdio): """ get_media_changed(cdio) -> int Find out if media has changed since the last call. Return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t """ return _pycdio.get_media_changed(p_cdio) def get_hwinfo(p_cdio): """ get_hwinfo(p_cdio)->[drc, vendor, model, release] Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. """ return _pycdio.get_hwinfo(p_cdio) def set_blocksize(p_cdio, i_blocksize): """ set_blocksize(cdio, blocksize)->return_status Set the blocksize for subsequent reads. """ return _pycdio.set_blocksize(p_cdio, i_blocksize) def set_speed(p_cdio, i_speed): """ cdio_set_speed(cdio, speed)->return_status Set the drive speed. """ return _pycdio.set_speed(p_cdio, i_speed) def open_cd(*args): """ open_cd(source=NULL, driver_id=None, access_mode=None) Sets up to read from place specified by source, driver_id and access mode. This should be called before using any other routine except those that act on a CD-ROM drive by name. If None is given as the source, we'll use the default driver device. If None is given as the driver_id, we'll find a suitable device driver. Return the a pointer than can be used in subsequent operations or None on error or no device. """ return _pycdio.open_cd(*args) def set_python_errstring(drc): """ open_cd(source=NULL, driver_id=None, access_mode=None) Sets up to read from place specified by source, driver_id and access mode. This should be called before using any other routine except those that act on a CD-ROM drive by name. If None is given as the source, we'll use the default driver device. If None is given as the driver_id, we'll find a suitable device driver. Return the a pointer than can be used in subsequent operations or None on error or no device. """ return _pycdio.set_python_errstring(drc) DISC_MODE_CD_DA = _pycdio.DISC_MODE_CD_DA DISC_MODE_CD_DATA = _pycdio.DISC_MODE_CD_DATA DISC_MODE_CD_XA = _pycdio.DISC_MODE_CD_XA DISC_MODE_CD_MIXED = _pycdio.DISC_MODE_CD_MIXED DISC_MODE_DVD_ROM = _pycdio.DISC_MODE_DVD_ROM DISC_MODE_DVD_RAM = _pycdio.DISC_MODE_DVD_RAM DISC_MODE_DVD_R = _pycdio.DISC_MODE_DVD_R DISC_MODE_DVD_RW = _pycdio.DISC_MODE_DVD_RW DISC_MODE_DVD_PR = _pycdio.DISC_MODE_DVD_PR DISC_MODE_DVD_PRW = _pycdio.DISC_MODE_DVD_PRW DISC_MODE_DVD_OTHER = _pycdio.DISC_MODE_DVD_OTHER DISC_MODE_NO_INFO = _pycdio.DISC_MODE_NO_INFO DISC_MODE_ERROR = _pycdio.DISC_MODE_ERROR DISC_MODE_CD_I = _pycdio.DISC_MODE_CD_I def get_disc_last_lsn(p_cdio): """ get_disc_last_lsn(cdio)->lsn Get the LSN of the end of the CD. pycdio.INVALID_LSN is returned on error. """ return _pycdio.get_disc_last_lsn(p_cdio) def get_disc_mode(p_cdio): """ get_disc_mode(p_cdio) -> str Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, ...) that we've got. The notion of 'CD' is extended a little to include DVD's. """ return _pycdio.get_disc_mode(p_cdio) def get_joliet_level(p_cdio): """ get_joliet_level(cdio)->int Return the Joliet level recognized for cdio. This only makes sense for something that has an ISO-9660 filesystem. """ return _pycdio.get_joliet_level(p_cdio) def get_mcn(p_cdio): """ get_mcn(cdio) -> str Get the media catalog number (MCN) from the CD. """ return _pycdio.get_mcn(p_cdio) def get_num_tracks(p_cdio): """ get_num_tracks(p_cdio)->int Return the number of tracks on the CD. On error pycdio.INVALID_TRACK is returned. """ return _pycdio.get_num_tracks(p_cdio) INCLUDE_CLASS = _pycdio.INCLUDE_CLASS # This file is compatible with both classic and new-style classes. cvar = _pycdio.cvar pycdio-2.1.0/pyiso9660.py0000664000175000017500000005033313530476324015360 0ustar rockyrocky00000000000000# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. """ This is a wrapper for The CD Input and Control library's ISO-9660 library See also the ISO-9660 specification. The freely available European equivalant standard is called ECMA-119. """ from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_import_helper(): import importlib pkg = __name__.rpartition('.')[0] mname = '.'.join((pkg, '_pyiso9660')).lstrip('.') try: return importlib.import_module(mname) except ImportError: return importlib.import_module('_pyiso9660') _pyiso9660 = swig_import_helper() del swig_import_helper elif _swig_python_version_info >= (2, 6, 0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_pyiso9660', [dirname(__file__)]) except ImportError: import _pyiso9660 return _pyiso9660 try: _mod = imp.load_module('_pyiso9660', fp, pathname, description) finally: if fp is not None: fp.close() return _mod _pyiso9660 = swig_import_helper() del swig_import_helper else: import _pyiso9660 del _swig_python_version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. try: import builtins as __builtin__ except ImportError: import __builtin__ def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name, None) if method: return method(self, value) if (not static): if _newclass: object.__setattr__(self, name, value) else: self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self, class_type, name, value): return _swig_setattr_nondynamic(self, class_type, name, value, 0) def _swig_getattr(self, class_type, name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name, None) if method: return method(self) raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except __builtin__.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 except __builtin__.Exception: class _object: pass _newclass = 0 class imaxdiv_t(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, imaxdiv_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, imaxdiv_t, name) __repr__ = _swig_repr __swig_setmethods__["quot"] = _pyiso9660.imaxdiv_t_quot_set __swig_getmethods__["quot"] = _pyiso9660.imaxdiv_t_quot_get if _newclass: quot = _swig_property(_pyiso9660.imaxdiv_t_quot_get, _pyiso9660.imaxdiv_t_quot_set) __swig_setmethods__["rem"] = _pyiso9660.imaxdiv_t_rem_set __swig_getmethods__["rem"] = _pyiso9660.imaxdiv_t_rem_get if _newclass: rem = _swig_property(_pyiso9660.imaxdiv_t_rem_get, _pyiso9660.imaxdiv_t_rem_set) def __init__(self): """Return true if ISO 9660 image has extended attrributes (XA).""" this = _pyiso9660.new_imaxdiv_t() try: self.this.append(this) except __builtin__.Exception: self.this = this __swig_destroy__ = _pyiso9660.delete_imaxdiv_t __del__ = lambda self: None imaxdiv_t_swigregister = _pyiso9660.imaxdiv_t_swigregister imaxdiv_t_swigregister(imaxdiv_t) def imaxabs(n): return _pyiso9660.imaxabs(n) imaxabs = _pyiso9660.imaxabs def imaxdiv(numer, denom): return _pyiso9660.imaxdiv(numer, denom) imaxdiv = _pyiso9660.imaxdiv def wcstoimax(nptr, endptr, base): return _pyiso9660.wcstoimax(nptr, endptr, base) wcstoimax = _pyiso9660.wcstoimax def wcstoumax(nptr, endptr, base): return _pyiso9660.wcstoumax(nptr, endptr, base) wcstoumax = _pyiso9660.wcstoumax def strtoimax(nptr, endptr, base): return _pyiso9660.strtoimax(nptr, endptr, base) strtoimax = _pyiso9660.strtoimax def strtoumax(nptr, endptr, base): return _pyiso9660.strtoumax(nptr, endptr, base) strtoumax = _pyiso9660.strtoumax VERSION_NUM = _pyiso9660.VERSION_NUM INVALID_LBA = _pyiso9660.INVALID_LBA INVALID_LSN = _pyiso9660.INVALID_LSN CD_FRAMESIZE = _pyiso9660.CD_FRAMESIZE CD_FRAMESIZE_RAW = _pyiso9660.CD_FRAMESIZE_RAW ISO_BLOCKSIZE = _pyiso9660.ISO_BLOCKSIZE M2F2_SECTOR_SIZE = _pyiso9660.M2F2_SECTOR_SIZE M2RAW_SECTOR_SIZE = _pyiso9660.M2RAW_SECTOR_SIZE PVD_SECTOR = _pyiso9660.PVD_SECTOR EVD_SECTOR = _pyiso9660.EVD_SECTOR LEN_ISONAME = _pyiso9660.LEN_ISONAME MAX_SYSTEM_ID = _pyiso9660.MAX_SYSTEM_ID MAX_ISONAME = _pyiso9660.MAX_ISONAME MAX_PREPARER_ID = _pyiso9660.MAX_PREPARER_ID MAX_ISOPATHNAME = _pyiso9660.MAX_ISOPATHNAME FILE = _pyiso9660.FILE EXISTENCE = _pyiso9660.EXISTENCE DIRECTORY = _pyiso9660.DIRECTORY ASSOCIATED = _pyiso9660.ASSOCIATED RECORD = _pyiso9660.RECORD PROTECTION = _pyiso9660.PROTECTION DRESERVED1 = _pyiso9660.DRESERVED1 DRESERVED2 = _pyiso9660.DRESERVED2 MULTIEXTENT = _pyiso9660.MULTIEXTENT VD_BOOT_RECORD = _pyiso9660.VD_BOOT_RECORD VD_PRIMARY = _pyiso9660.VD_PRIMARY VD_SUPPLEMENTARY = _pyiso9660.VD_SUPPLEMENTARY VD_PARITION = _pyiso9660.VD_PARITION VD_END = _pyiso9660.VD_END MAX_PUBLISHER_ID = _pyiso9660.MAX_PUBLISHER_ID MAX_APPLICATION_ID = _pyiso9660.MAX_APPLICATION_ID MAX_VOLUME_ID = _pyiso9660.MAX_VOLUME_ID MAX_VOLUMESET_ID = _pyiso9660.MAX_VOLUMESET_ID STANDARD_ID = _pyiso9660.STANDARD_ID NOCHECK = _pyiso9660.NOCHECK SEVEN_BIT = _pyiso9660.SEVEN_BIT ACHARS = _pyiso9660.ACHARS DCHARS = _pyiso9660.DCHARS EXTENSION_JOLIET_LEVEL1 = _pyiso9660.EXTENSION_JOLIET_LEVEL1 EXTENSION_JOLIET_LEVEL2 = _pyiso9660.EXTENSION_JOLIET_LEVEL2 EXTENSION_JOLIET_LEVEL3 = _pyiso9660.EXTENSION_JOLIET_LEVEL3 EXTENSION_ROCK_RIDGE = _pyiso9660.EXTENSION_ROCK_RIDGE EXTENSION_HIGH_SIERRA = _pyiso9660.EXTENSION_HIGH_SIERRA EXTENSION_ALL = _pyiso9660.EXTENSION_ALL EXTENSION_NONE = _pyiso9660.EXTENSION_NONE EXTENSION_JOLIET = _pyiso9660.EXTENSION_JOLIET def open_iso(psz_path): """ open_iso(path) Open an ISO 9660 image for reading. Maybe in the future we will have mode. None is returned on error. """ return _pyiso9660.open_iso(psz_path) def open_ext(psz_path, iso_extension_mask): """ Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. None is returned on error. """ return _pyiso9660.open_ext(psz_path, iso_extension_mask) def open_fuzzy(psz_path, i_fuzz): """ Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. None is returned on error. see iso9660_open """ return _pyiso9660.open_fuzzy(psz_path, i_fuzz) def iso9660_open_fuzzy_ext(psz_path, iso_extension_mask, i_fuzz): """ Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. None is returned on error. see open_iso """ return _pyiso9660.iso9660_open_fuzzy_ext(psz_path, iso_extension_mask, i_fuzz) def ifs_fuzzy_read_superblock(p_iso, iso_extension_mask, i_fuzz): """ Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. """ return _pyiso9660.ifs_fuzzy_read_superblock(p_iso, iso_extension_mask, i_fuzz) def close(p_iso): """ Close previously opened ISO 9660 image. True is unconditionally returned. If there was an error false would be returned. """ return _pyiso9660.close(p_iso) def seek_read(p_iso, start, p_buf): """ Seek to a position and then read n bytes. (buffer, size) are returned. """ return _pyiso9660.seek_read(p_iso, start, p_buf) def fs_read_pvd(p_cdio): """ Read the Primary Volume Descriptor for a CD. None is returned if there was an error. """ return _pyiso9660.fs_read_pvd(p_cdio) def ifs_read_pvd(p_iso): """ Read the Primary Volume Descriptor for an ISO 9660 image. None is returned if there was an error. """ return _pyiso9660.ifs_read_pvd(p_iso) def fs_read_superblock(p_cdio, iso_extension_mask): """ Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. """ return _pyiso9660.fs_read_superblock(p_cdio, iso_extension_mask) def ifs_read_superblock(p_iso, iso_extension_mask): """ Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. """ return _pyiso9660.ifs_read_superblock(p_iso, iso_extension_mask) def set_dtime(year, mon, mday, hour, min, sec): """Set time in format used in ISO 9660 directory index record""" return _pyiso9660.set_dtime(year, mon, mday, hour, min, sec) def set_ltime(year, mon, mday, hour, min, sec): """Set 'long' time in format used in ISO 9660 primary volume descriptor""" return _pyiso9660.set_ltime(year, mon, mday, hour, min, sec) def get_dtime(p_dtime, use_localtime): """ Get Unix time structure from format use in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in idr_date, they are calculated from the other fields. If tm is to reflect the localtime, set 'use_localtime' true, otherwise tm will reported in GMT. """ return _pyiso9660.get_dtime(p_dtime, use_localtime) def get_ltime(p_ltime): """ Get 'long' time in format used in ISO 9660 primary volume descriptor from a Unix time structure. """ return _pyiso9660.get_ltime(p_ltime) def is_dchar(c): """ Return true if c is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore. """ return _pyiso9660.is_dchar(c) def is_achar(c): """ Return true if c is an ACHAR - These are the DCHAR's plus some ASCII symbols including the space symbol. """ return _pyiso9660.is_achar(c) def name_translate(psz_oldname): """ Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @return length of the translated string is returned. """ return _pyiso9660.name_translate(psz_oldname) def name_translate_ext(psz_oldname, i_joliet_level): """ Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @param i_joliet_level 0 if not using Joliet Extension. Otherwise the Joliet level. @return length of the translated string is returned. It will be no greater than the length of psz_oldname. """ return _pyiso9660.name_translate_ext(psz_oldname, i_joliet_level) def strncpy_pad(src, len, _check): """ Pad string src with spaces to size len and copy this to dst. If en is less than the length of src, dst will be truncated to the first len characters of src. src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check. In addition to getting changed, dst is the return value. Note: this string might not be NULL terminated. """ return _pyiso9660.strncpy_pad(src, len, _check) def dirname_valid_p(psz_path): """ Check that psz_path is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. True is returned if psz_path is valid. """ return _pyiso9660.dirname_valid_p(psz_path) def pathname_isofy(psz_path, i_version=1): """ Take psz_path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followed by ';' and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned. """ return _pyiso9660.pathname_isofy(psz_path, i_version) def pathname_valid_p(psz_path): """ Check that psz_path is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. True is returned if psz_path is valid. """ return _pyiso9660.pathname_valid_p(psz_path) def fs_stat(p_cdio, psz_path): """Return file status for psz_path. None is returned on error.""" return _pyiso9660.fs_stat(p_cdio, psz_path) def fs_stat_translate(p_cdio, psz_path): """ Return file status for path name psz_path. None is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. """ return _pyiso9660.fs_stat_translate(p_cdio, psz_path) def ifs_stat(p_iso, psz_path): """Return file status for pathname. None is returned on error.""" return _pyiso9660.ifs_stat(p_iso, psz_path) def ifs_stat_translate(p_iso, psz_path): """ Return file status for path name psz_path. undef is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. """ return _pyiso9660.ifs_stat_translate(p_iso, psz_path) def fs_readdir(p_cdio, psz_path): """ Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. """ return _pyiso9660.fs_readdir(p_cdio, psz_path) def ifs_readdir(p_iso, psz_path): """ Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. """ return _pyiso9660.ifs_readdir(p_iso, psz_path) def get_application_id(p_pvd): """ Return the PVD's application ID. None is returned if there is some problem in getting this. """ return _pyiso9660.get_application_id(p_pvd) def ifs_get_application_id(p_iso): """ Get the application ID. Return None if there is some problem in getting this. """ return _pyiso9660.ifs_get_application_id(p_iso) def get_joliet_level(p_iso): """Return the Joliet level recognized for p_iso.""" return _pyiso9660.get_joliet_level(p_iso) def get_dir_len(p_idr): """Return the Joliet level recognized for p_iso.""" return _pyiso9660.get_dir_len(p_idr) def iso9660_dir_to_name(p_iso9660_dir): """Return the directory name stored in the iso9660_dir_t.""" return _pyiso9660.iso9660_dir_to_name(p_iso9660_dir) def get_posix_filemode(p_iso_dirent): """Returns a POSIX mode for a given p_iso_dirent.""" return _pyiso9660.get_posix_filemode(p_iso_dirent) def get_preparer_id(p_pvd): """ Return a string containing the preparer id with trailing blanks removed. """ return _pyiso9660.get_preparer_id(p_pvd) def ifs_get_preparer_id(p_iso): """ Get the preparer ID. Return None if there is some problem in getting this. """ return _pyiso9660.ifs_get_preparer_id(p_iso) def get_publisher_id(p_pvd): """ Return a string containing the PVD's publisher id with trailing blanks removed. """ return _pyiso9660.get_publisher_id(p_pvd) def ifs_get_publisher_id(p_iso): """ Get the publisher ID. Return None if there is some problem in getting this. """ return _pyiso9660.ifs_get_publisher_id(p_iso) def get_pvd_type(p_pvd): """ Get the publisher ID. Return None if there is some problem in getting this. """ return _pyiso9660.get_pvd_type(p_pvd) def get_pvd_id(p_pvd): """ Get the publisher ID. Return None if there is some problem in getting this. """ return _pyiso9660.get_pvd_id(p_pvd) def get_pvd_space_size(p_pvd): """ Get the publisher ID. Return None if there is some problem in getting this. """ return _pyiso9660.get_pvd_space_size(p_pvd) def get_pvd_block_size(p_pvd): """ Get the publisher ID. Return None if there is some problem in getting this. """ return _pyiso9660.get_pvd_block_size(p_pvd) def get_pvd_version(pvd): """ Return the primary volume id version number (of pvd). If there is an error 0 is returned. """ return _pyiso9660.get_pvd_version(pvd) def get_system_id(p_pvd): """ Return a string containing the PVD's system id with trailing blanks removed. """ return _pyiso9660.get_system_id(p_pvd) def ifs_get_system_id(p_iso): """ Get the system ID. None is returned if there is some problem in getting this. """ return _pyiso9660.ifs_get_system_id(p_iso) def get_root_lsn(p_pvd): """ Return the LSN of the root directory for pvd. If there is an error INVALID_LSN is returned. """ return _pyiso9660.get_root_lsn(p_pvd) def get_volume_id(p_pvd): """Return the PVD's volume ID.""" return _pyiso9660.get_volume_id(p_pvd) def ifs_get_volume_id(p_iso): """ Get the system ID. None is returned if there is some problem in getting this. """ return _pyiso9660.ifs_get_volume_id(p_iso) def get_volumeset_id(p_pvd): """ Return the PVD's volumeset ID. None is returned if there is some problem in getting this. """ return _pyiso9660.get_volumeset_id(p_pvd) def ifs_get_volumeset_id(p_iso): """ Get the volumeset ID. None is returned if there is some problem in getting this. """ return _pyiso9660.ifs_get_volumeset_id(p_iso) def pathtable_init(pt): """Zero's out pathable. Do this first.""" return _pyiso9660.pathtable_init(pt) def pathtable_get_size(pt): """Zero's out pathable. Do this first.""" return _pyiso9660.pathtable_get_size(pt) def pathtable_l_add_entry(pt, name, extent, parent): """Zero's out pathable. Do this first.""" return _pyiso9660.pathtable_l_add_entry(pt, name, extent, parent) def pathtable_m_add_entry(pt, name, extent, parent): """Zero's out pathable. Do this first.""" return _pyiso9660.pathtable_m_add_entry(pt, name, extent, parent) def set_evd(pd): """Zero's out pathable. Do this first.""" return _pyiso9660.set_evd(pd) def is_xa(p_iso): """Return true if ISO 9660 image has extended attrributes (XA).""" return _pyiso9660.is_xa(p_iso) # This file is compatible with both classic and new-style classes. pycdio-2.1.0/setup.cfg0000664000175000017500000000027013530476326015134 0ustar rockyrocky00000000000000[nosetests] where = ./test exe = on verbosity = 2 detailed-errors = 1 [bdist_rpm] packager = Rocky Bernstein provides = pycdio [egg_info] tag_build = tag_date = 0 pycdio-2.1.0/setup.py0000775000175000017500000001222513530471020015015 0ustar rockyrocky00000000000000#!/usr/bin/env python # Copyright (C) 2015, 2018-2019 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ distutils setup (setup.py) for pycdio. This gets a bit of package info from __pkginfo__.py file """ # Get the required package information from __pkginfo__ import ( modname, VERSION, license, short_desc, web, author, author_email, classifiers, ) from setuptools import setup from distutils.core import Extension from distutils.command.build import build from subprocess import * import os import shutil import sys OVER_PYTHON_25 = sys.version_info[0:1] >= (2, 5) top_dir = os.path.dirname(os.path.abspath(__file__)) README = os.path.join(top_dir, "README.rst") pkg_config = os.getenv("PKG_CONFIG") or "pkg-config" def rm_file(*paths): global top_dir toast = os.path.join(top_dir, *paths) try: os.remove(toast) except: pass return # Description in package will come from the README file. long_description = open(README).read() + "\n\n" # We store swig sources in ./swig, but we want the generated python # module not to appear in that directory, but instead in the top-level # directory where we have the other modules. I'd move *all* of the modules # to their own directory if I knew how to do that in distutils. swig_opts = ["-outdir", top_dir] class custom_build(build): # Reorder build commands such that swig generated files are also copied. sub_commands = [ ("build_ext", build.has_ext_modules), ("build_py", build.has_pure_modules), ("build_clib", build.has_c_libraries), ("build_scripts", build.has_scripts), ] def run(self): # Account for API change after 0.83 ge_2 = call([pkg_config, "--atleast-version=2.0.0", "libcdio"]) assert ge_2 == 0, "Need at least libcdio 2.0.0 to use this" print("libcdio version >= 2.0.0") build.run(self) # Find runtime library directories for libcdio and libiso9660 using # pkg-config. Then create the right Extension object lists which later # get fed into setup()'s list of ext_modules. modules = [] for lib_name in ("libcdio", "libiso9660"): short_libname = lib_name[3:] # Strip off "lib" from name # FIXME: DRY this code. try: p = Popen([pkg_config, "--libs-only-L", lib_name], stdout=PIPE) except: print("** Error trying to run pkg-config. Is it installed?") print("** If not, see http://pkg-config.freedesktop.org") raise pass if p.returncode is None: # Strip off blanks and initial '-L' L_flag = "-L" if OVER_PYTHON_25: L_flag = bytes(L_flag, "utf-8") dirs = p.communicate()[0].split(L_flag)[1:] runtime_lib_dirs = [d.strip() for d in dirs] else: print( ( "** Didn't the normal return code running pkg-config," + "on %s. got:\n\t%s" % [lib_name, p.returncode] ) ) print("** Will try to add %s anyway." % short_libname) runtime_lib_dirs = None library_dirs = runtime_lib_dirs p = Popen([pkg_config, "--cflags-only-I", lib_name], stdout=PIPE) if p.returncode is None: # String starts '-I' so the first entry is ''; Discard that, # the others we want. I_flag = "-I" if OVER_PYTHON_25: I_flag = bytes(I_flag, "utf-8") dirs = p.communicate()[0].split(I_flag)[1:] include_dirs = [d.strip() for d in dirs] p = Popen([pkg_config, "--libs-only-l", lib_name], stdout=PIPE) if p.returncode is None: # String starts '-l' so the first entry is ''; Discard that, # the others we want. l_flag = "-l" if OVER_PYTHON_25: l_flag = bytes(l_flag, "utf-8") dirs = p.communicate()[0].split(l_flag)[1:] libraries = [d.strip().decode("utf-8") for d in dirs] pass py_shortname = "py" + short_libname modules.append( Extension( "_" + py_shortname, libraries=libraries, swig_opts=swig_opts, include_dirs=include_dirs, library_dirs=library_dirs, runtime_library_dirs=runtime_lib_dirs, sources=["swig/%s.i" % py_shortname], ) ) setup( author=author, author_email=author_email, classifiers=classifiers, cmdclass={"build": custom_build}, description=short_desc, ext_modules=modules, license=license, long_description=long_description, name=modname, py_modules=["cdio", "iso9660", "pycdio", "pyiso9660"], test_suite="nose.collector", url=web, version=VERSION, ) pycdio-2.1.0/swig/0000775000175000017500000000000013530476326014265 5ustar rockyrocky00000000000000pycdio-2.1.0/swig/Makefile0000664000175000017500000000127513530441774015731 0ustar rockyrocky00000000000000# Until I master distutils better. It's good to have this around # as an alternative #: makes all SWIG-derived C files. (setup.py build_ext also does this) all: pycdio_wrap.c pyiso9660_wrap.c #: SWIGs pycdio.i - the CDIO module pycdio_wrap.c: pycdio.i swig -python -o pycdio_wrap.c pycdio.i #: SWIGs pycdio.i - ISO9660 module pyiso9660_wrap.c: pyiso9660.i swig -python -o pyiso9660_wrap.c pyiso9660.i # It is too much work to figure out how to add a new command to distutils # to do the following. CLEAN_FILES = *.pyc py*_wrap.c #: Remove all derived files. clean: clean rm -f $(CLEAN_FILES) || true #: whatever else you want to do retry it in the parent Makefile. %: pyiso $(MAKE) -C .. $@ pycdio-2.1.0/swig/audio.swg0000664000175000017500000001214113530441774016106 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** NOTE: THIS IS THE EASILY CONVERTED SUBSET OF LIBCDIO WE CAN DO. **/ /* See for more extensive documentation. */ %rename cdio_audio_pause audio_pause; %feature("autodoc", "audio_pause(cdio)->status Pause playing CD through analog output."); driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio); %feature("autodoc", "auto_play_lsn(cdio, start_lsn, end_lsn)->status Playing CD through analog output at the given lsn to the ending lsn"); driver_return_code_t audio_play_lsn (CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn); %inline %{ driver_return_code_t audio_play_lsn (CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn) { msf_t start_msf; msf_t end_msf; cdio_lsn_to_msf (start_lsn, &start_msf); cdio_lsn_to_msf (end_lsn, &end_msf); return cdio_audio_play_msf(p_cdio, &start_msf, &end_msf); } %} %rename cdio_audio_resume audio_resume; %feature("autodoc", "audio_resume(cdio)->status Resume playing an audio CD."); driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio); int audio_set_volume_levels(CdIo_t *p_cdio, int vol1, int vol2, int vol3, int vol3); %inline %{ int audio_set_volume_levels(CdIo_t *p_cdio, int vol1, int vol2, int vol3, int vol4) { static cdio_audio_volume_t audio_volume; audio_volume.level[0] = vol1 & 255; audio_volume.level[1] = vol2 & 255; audio_volume.level[2] = vol3 & 255; audio_volume.level[3] = vol4 & 255; return cdio_audio_set_volume(p_cdio, &audio_volume); } %} %rename cdio_audio_stop audio_stop; %feature("autodoc", "audio_stop(cdio)->status Stop playing an audio CD."); driver_return_code_t cdio_audio_stop (CdIo_t *p_cdio); %feature("autodoc", "return audio volume levels array"); /** FIXME: Convert this from Perl to Python */ /* %typemap(out) uint8_t,int { */ /* $result = sv_newmortal(); */ /* sv_setiv($result,(IV) $1); */ /* argvi++; */ /* } */ /* %typemap(out) uint8_t*,int* { */ /* AV *myav; */ /* SV **svs; */ /* if ($1) { */ /* svs = (SV **) malloc(4*sizeof(SV *)); */ /* svs[0] = sv_newmortal(); */ /* sv_setiv((SV*) svs[0],$1[0]); */ /* svs[1] = sv_newmortal(); */ /* sv_setiv((SV*) svs[1],$1[1]); */ /* svs[2] = sv_newmortal(); */ /* sv_setiv((SV*) svs[2],$1[2]); */ /* svs[3] = sv_newmortal(); */ /* sv_setiv((SV*) svs[3],$1[3]); */ /* myav = av_make(4,svs); */ /* free(svs); */ /* $result = newRV_noinc((SV*)myav); */ /* sv_2mortal($result); */ /* argvi++; */ /* } */ /* } */ /* %apply int *OUTPUT { int *rc }; */ /* uint8_t *audio_get_volume_levels (CdIo_t *p_cdio, int *rc); */ /* %inline %{ */ /* uint8_t *audio_get_volume_levels (CdIo_t *p_cdio, int *rc) */ /* { */ /* static uint8_t _volume[4]; */ /* driver_return_code_t drc; */ /* drc = cdio_audio_get_volume (p_cdio, (cdio_audio_volume_t*)&_volume); */ /* *rc = drc; */ /* return _volume; */ /* } */ /* %} */ /* %inline %{ */ /* typedef struct { */ /* uint8_t format; */ /* uint8_t audio_status; */ /* uint8_t address: 4; */ /* uint8_t control: 4; */ /* uint8_t track; */ /* uint8_t index; */ /* uint8_t abs_m; // msft_t abs_addr; */ /* uint8_t abs_s; */ /* uint8_t abs_f; */ /* uint8_t rel_m; // msft_t rel_addr; */ /* uint8_t rel_s; */ /* uint8_t rel_f; */ /* } SUBChannel; */ /* %} */ /** FIXME: Convert this from Perl to Python */ /* %apply int *OUTPUT { int *drc }; */ /* const SUBChannel * audio_get_status ( CdIo_t *p_cdio, int *drc); */ /* %inline %{ */ /* #include */ /* //static cdio_subchannel_t cdio_subchannel; */ /* const SUBChannel * audio_get_status ( CdIo_t *p_cdio, int *drc) */ /* { */ /* static cdio_subchannel_t sub; */ /* driver_return_code_t rc; */ /* rc = cdio_audio_read_subchannel(p_cdio, &sub); */ /* *drc = rc; */ /* /\* unsigned int msf_seconds(msf_t *msf) or */ /* * uint8_t cdio_from_bcd8(uint8_t p) */ /* *\/ */ /* sub.abs_addr.m = cdio_from_bcd8(sub.abs_addr.m); */ /* sub.abs_addr.s = cdio_from_bcd8(sub.abs_addr.s); */ /* sub.abs_addr.f = cdio_from_bcd8(sub.abs_addr.f); */ /* sub.rel_addr.m = cdio_from_bcd8(sub.rel_addr.m); */ /* sub.rel_addr.s = cdio_from_bcd8(sub.rel_addr.s); */ /* sub.rel_addr.f = cdio_from_bcd8(sub.rel_addr.f); */ /* return (const SUBChannel *) ⊂ */ /* } */ /* %} */ pycdio-2.1.0/swig/cdtext.swg0000664000175000017500000002672313530441774016313 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2009, Thomas Vander Stichele This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See For more extensive documentation */ %feature("autodoc",1); %constant int CDTEXT_ARRANGER = CDTEXT_FIELD_ARRANGER; %constant int CDTEXT_COMPOSER = CDTEXT_FIELD_COMPOSER; %constant int CDTEXT_DISCID = CDTEXT_FIELD_DISCID; %constant int CDTEXT_ISRC = CDTEXT_FIELD_ISRC; %constant int CDTEXT_MESSAGE = CDTEXT_FIELD_MESSAGE; %constant int CDTEXT_PERFORMER = CDTEXT_FIELD_PERFORMER; %constant int CDTEXT_FIELD_TITLE = CDTEXT_FIELD_TITLE; %constant int CDTEXT_FIELD_SONGWRITER = CDTEXT_FIELD_SONGWRITER; %constant int CDTEXT_FIELD_UPC_EAN = CDTEXT_FIELD_UPC_EAN; %constant int CDTEXT_GENRE = CDTEXT_FIELD_GENRE; %constant int CDTEXT_FIELD_INVALID = CDTEXT_FIELD_INVALID; %constant int CDTEXT_GENRE_UNUSED = CDTEXT_GENRE_UNUSED; %constant int CDTEXT_GENRE_UNDEFINED = CDTEXT_GENRE_UNDEFINED; %constant int CDTEXT_GENRE_ADULT_CONTEMP = CDTEXT_GENRE_ADULT_CONTEMP; %constant int CDTEXT_GENRE_ALT_ROCK = CDTEXT_GENRE_ALT_ROCK; %constant int CDTEXT_GENRE_CHILDRENS = CDTEXT_GENRE_CHILDRENS; %constant int CDTEXT_GENRE_CLASSIC = CDTEXT_GENRE_CLASSIC; %constant int CDTEXT_GENRE_CHRIST_CONTEMP = CDTEXT_GENRE_CHRIST_CONTEMP; %constant int CDTEXT_GENRE_COUNTRY = CDTEXT_GENRE_COUNTRY; %constant int CDTEXT_GENRE_DANCE = CDTEXT_GENRE_DANCE; %constant int CDTEXT_GENRE_EASY_LISTENING = CDTEXT_GENRE_EASY_LISTENING; %constant int CDTEXT_GENRE_EROTIC = CDTEXT_GENRE_EROTIC; %constant int CDTEXT_GENRE_FOLK = CDTEXT_GENRE_FOLK; %constant int CDTEXT_GENRE_GOSPEL = CDTEXT_GENRE_GOSPEL; %constant int CDTEXT_GENRE_HIPHOP = CDTEXT_GENRE_HIPHOP; %constant int CDTEXT_GENRE_JAZZ = CDTEXT_GENRE_JAZZ; %constant int CDTEXT_GENRE_LATIN = CDTEXT_GENRE_LATIN; %constant int CDTEXT_GENRE_MUSICAL = CDTEXT_GENRE_MUSICAL; %constant int CDTEXT_GENRE_NEWAGE = CDTEXT_GENRE_NEWAGE; %constant int CDTEXT_GENRE_OPERA = CDTEXT_GENRE_OPERA; %constant int CDTEXT_GENRE_OPERETTA = CDTEXT_GENRE_OPERETTA; %constant int CDTEXT_GENRE_POP = CDTEXT_GENRE_POP; %constant int CDTEXT_GENRE_RAP = CDTEXT_GENRE_RAP; %constant int CDTEXT_GENRE_REGGAE = CDTEXT_GENRE_REGGAE; %constant int CDTEXT_GENRE_ROCK = CDTEXT_GENRE_ROCK; %constant int CDTEXT_GENRE_RYTHMANDBLUES = CDTEXT_GENRE_RYTHMANDBLUES; %constant int CDTEXT_GENRE_SOUNDEFFECTS = CDTEXT_GENRE_SOUNDEFFECTS; %constant int CDTEXT_GENRE_SOUNDTRACK = CDTEXT_GENRE_SOUNDTRACK; %constant int CDTEXT_GENRE_SPOKEN_WORD = CDTEXT_GENRE_SPOKEN_WORD; %constant int CDTEXT_GENRE_WORLD_MUSIC = CDTEXT_GENRE_WORLD_MUSIC; %constant int CDTEXT_LANGUAGE_UNKNOWN = CDTEXT_LANGUAGE_UNKNOWN; %constant int CDTEXT_LANGUAGE_ALBANIAN = CDTEXT_LANGUAGE_ALBANIAN; %constant int CDTEXT_LANGUAGE_BRETON = CDTEXT_LANGUAGE_BRETON; %constant int CDTEXT_LANGUAGE_CATALAN = CDTEXT_LANGUAGE_CATALAN; %constant int CDTEXT_LANGUAGE_CROATIAN = CDTEXT_LANGUAGE_CROATIAN; %constant int CDTEXT_LANGUAGE_WELSH = CDTEXT_LANGUAGE_WELSH; %constant int CDTEXT_LANGUAGE_CZECH = CDTEXT_LANGUAGE_CZECH; %constant int CDTEXT_LANGUAGE_DANISH = CDTEXT_LANGUAGE_DANISH; %constant int CDTEXT_LANGUAGE_GERMAN = CDTEXT_LANGUAGE_GERMAN; %constant int CDTEXT_LANGUAGE_ENGLISH = CDTEXT_LANGUAGE_ENGLISH; %constant int CDTEXT_LANGUAGE_SPANISH = CDTEXT_LANGUAGE_SPANISH; %constant int CDTEXT_LANGUAGE_ESPERANTO = CDTEXT_LANGUAGE_ESPERANTO; %constant int CDTEXT_LANGUAGE_ESTONIAN = CDTEXT_LANGUAGE_ESTONIAN; %constant int CDTEXT_LANGUAGE_BASQUE = CDTEXT_LANGUAGE_BASQUE; %constant int CDTEXT_LANGUAGE_FAROESE = CDTEXT_LANGUAGE_FAROESE; %constant int CDTEXT_LANGUAGE_FRENCH = CDTEXT_LANGUAGE_FRENCH; %constant int CDTEXT_LANGUAGE_FRISIAN = CDTEXT_LANGUAGE_FRISIAN; %constant int CDTEXT_LANGUAGE_IRISH = CDTEXT_LANGUAGE_IRISH; %constant int CDTEXT_LANGUAGE_GAELIC = CDTEXT_LANGUAGE_GAELIC; %constant int CDTEXT_LANGUAGE_GALICIAN = CDTEXT_LANGUAGE_GALICIAN; %constant int CDTEXT_LANGUAGE_ICELANDIC = CDTEXT_LANGUAGE_ICELANDIC; %constant int CDTEXT_LANGUAGE_ITALIAN = CDTEXT_LANGUAGE_ITALIAN; %constant int CDTEXT_LANGUAGE_LAPPISH = CDTEXT_LANGUAGE_LAPPISH; %constant int CDTEXT_LANGUAGE_LATIN = CDTEXT_LANGUAGE_LATIN; %constant int CDTEXT_LANGUAGE_LATVIAN = CDTEXT_LANGUAGE_LATVIAN; %constant int CDTEXT_LANGUAGE_LUXEMBOURGIAN = CDTEXT_LANGUAGE_LUXEMBOURGIAN; %constant int CDTEXT_LANGUAGE_LITHUANIAN = CDTEXT_LANGUAGE_LITHUANIAN; %constant int CDTEXT_LANGUAGE_HUNGARIAN = CDTEXT_LANGUAGE_HUNGARIAN; %constant int CDTEXT_LANGUAGE_MALTESE = CDTEXT_LANGUAGE_MALTESE; %constant int CDTEXT_LANGUAGE_DUTCH = CDTEXT_LANGUAGE_DUTCH; %constant int CDTEXT_LANGUAGE_NORWEGIAN = CDTEXT_LANGUAGE_NORWEGIAN; %constant int CDTEXT_LANGUAGE_OCCITAN = CDTEXT_LANGUAGE_OCCITAN; %constant int CDTEXT_LANGUAGE_POLISH = CDTEXT_LANGUAGE_POLISH; %constant int CDTEXT_LANGUAGE_PORTUGUESE = CDTEXT_LANGUAGE_PORTUGUESE; %constant int CDTEXT_LANGUAGE_ROMANIAN = CDTEXT_LANGUAGE_ROMANIAN; %constant int CDTEXT_LANGUAGE_ROMANSH = CDTEXT_LANGUAGE_ROMANSH; %constant int CDTEXT_LANGUAGE_SERBIAN = CDTEXT_LANGUAGE_SERBIAN; %constant int CDTEXT_LANGUAGE_SLOVAK = CDTEXT_LANGUAGE_SLOVAK; %constant int CDTEXT_LANGUAGE_SLOVENIAN = CDTEXT_LANGUAGE_SLOVENIAN; %constant int CDTEXT_LANGUAGE_FINNISH = CDTEXT_LANGUAGE_FINNISH; %constant int CDTEXT_LANGUAGE_SWEDISH = CDTEXT_LANGUAGE_SWEDISH; %constant int CDTEXT_LANGUAGE_TURKISH = CDTEXT_LANGUAGE_TURKISH; %constant int CDTEXT_LANGUAGE_FLEMISH = CDTEXT_LANGUAGE_FLEMISH; %constant int CDTEXT_LANGUAGE_WALLON = CDTEXT_LANGUAGE_WALLON; %constant int CDTEXT_LANGUAGE_ZULU = CDTEXT_LANGUAGE_ZULU; %constant int CDTEXT_LANGUAGE_VIETNAMESE = CDTEXT_LANGUAGE_VIETNAMESE; %constant int CDTEXT_LANGUAGE_UZBEK = CDTEXT_LANGUAGE_UZBEK; %constant int CDTEXT_LANGUAGE_URDU = CDTEXT_LANGUAGE_URDU; %constant int CDTEXT_LANGUAGE_UKRAINIAN = CDTEXT_LANGUAGE_UKRAINIAN; %constant int CDTEXT_LANGUAGE_THAI = CDTEXT_LANGUAGE_THAI; %constant int CDTEXT_LANGUAGE_TELUGU = CDTEXT_LANGUAGE_TELUGU; %constant int CDTEXT_LANGUAGE_TATAR = CDTEXT_LANGUAGE_TATAR; %constant int CDTEXT_LANGUAGE_TAMIL = CDTEXT_LANGUAGE_TAMIL; %constant int CDTEXT_LANGUAGE_TADZHIK = CDTEXT_LANGUAGE_TADZHIK; %constant int CDTEXT_LANGUAGE_SWAHILI = CDTEXT_LANGUAGE_SWAHILI; %constant int CDTEXT_LANGUAGE_SRANANTONGO = CDTEXT_LANGUAGE_SRANANTONGO; %constant int CDTEXT_LANGUAGE_SOMALI = CDTEXT_LANGUAGE_SOMALI; %constant int CDTEXT_LANGUAGE_SINHALESE = CDTEXT_LANGUAGE_SINHALESE; %constant int CDTEXT_LANGUAGE_SHONA = CDTEXT_LANGUAGE_SHONA; %constant int CDTEXT_LANGUAGE_SERBO_CROAT = CDTEXT_LANGUAGE_SERBO_CROAT; %constant int CDTEXT_LANGUAGE_RUTHENIAN = CDTEXT_LANGUAGE_RUTHENIAN; %constant int CDTEXT_LANGUAGE_RUSSIAN = CDTEXT_LANGUAGE_RUSSIAN; %constant int CDTEXT_LANGUAGE_QUECHUA = CDTEXT_LANGUAGE_QUECHUA; %constant int CDTEXT_LANGUAGE_PUSHTU = CDTEXT_LANGUAGE_PUSHTU; %constant int CDTEXT_LANGUAGE_PUNJABI = CDTEXT_LANGUAGE_PUNJABI; %constant int CDTEXT_LANGUAGE_PERSIAN = CDTEXT_LANGUAGE_PERSIAN; %constant int CDTEXT_LANGUAGE_PAPAMIENTO = CDTEXT_LANGUAGE_PAPAMIENTO; %constant int CDTEXT_LANGUAGE_ORIYA = CDTEXT_LANGUAGE_ORIYA; %constant int CDTEXT_LANGUAGE_NEPALI = CDTEXT_LANGUAGE_NEPALI; %constant int CDTEXT_LANGUAGE_NDEBELE = CDTEXT_LANGUAGE_NDEBELE; %constant int CDTEXT_LANGUAGE_MARATHI = CDTEXT_LANGUAGE_MARATHI; %constant int CDTEXT_LANGUAGE_MOLDAVIAN = CDTEXT_LANGUAGE_MOLDAVIAN; %constant int CDTEXT_LANGUAGE_MALAYSIAN = CDTEXT_LANGUAGE_MALAYSIAN; %constant int CDTEXT_LANGUAGE_MALAGASAY = CDTEXT_LANGUAGE_MALAGASAY; %constant int CDTEXT_LANGUAGE_MACEDONIAN = CDTEXT_LANGUAGE_MACEDONIAN; %constant int CDTEXT_LANGUAGE_LAOTIAN = CDTEXT_LANGUAGE_LAOTIAN; %constant int CDTEXT_LANGUAGE_KOREAN = CDTEXT_LANGUAGE_KOREAN; %constant int CDTEXT_LANGUAGE_KHMER = CDTEXT_LANGUAGE_KHMER; %constant int CDTEXT_LANGUAGE_KAZAKH = CDTEXT_LANGUAGE_KAZAKH; %constant int CDTEXT_LANGUAGE_KANNADA = CDTEXT_LANGUAGE_KANNADA; %constant int CDTEXT_LANGUAGE_JAPANESE = CDTEXT_LANGUAGE_JAPANESE; %constant int CDTEXT_LANGUAGE_INDONESIAN = CDTEXT_LANGUAGE_INDONESIAN; %constant int CDTEXT_LANGUAGE_HINDI = CDTEXT_LANGUAGE_HINDI; %constant int CDTEXT_LANGUAGE_HEBREW = CDTEXT_LANGUAGE_HEBREW; %constant int CDTEXT_LANGUAGE_HAUSA = CDTEXT_LANGUAGE_HAUSA; %constant int CDTEXT_LANGUAGE_GURANI = CDTEXT_LANGUAGE_GURANI; %constant int CDTEXT_LANGUAGE_GUJURATI = CDTEXT_LANGUAGE_GUJURATI; %constant int CDTEXT_LANGUAGE_GREEK = CDTEXT_LANGUAGE_GREEK; %constant int CDTEXT_LANGUAGE_GEORGIAN = CDTEXT_LANGUAGE_GEORGIAN; %constant int CDTEXT_LANGUAGE_FULANI = CDTEXT_LANGUAGE_FULANI; %constant int CDTEXT_LANGUAGE_DARI = CDTEXT_LANGUAGE_DARI; %constant int CDTEXT_LANGUAGE_CHURASH = CDTEXT_LANGUAGE_CHURASH; %constant int CDTEXT_LANGUAGE_CHINESE = CDTEXT_LANGUAGE_CHINESE; %constant int CDTEXT_LANGUAGE_BURMESE = CDTEXT_LANGUAGE_BURMESE; %constant int CDTEXT_LANGUAGE_BULGARIAN = CDTEXT_LANGUAGE_BULGARIAN; %constant int CDTEXT_LANGUAGE_BENGALI = CDTEXT_LANGUAGE_BENGALI; %constant int CDTEXT_LANGUAGE_BIELORUSSIAN = CDTEXT_LANGUAGE_BIELORUSSIAN; %constant int CDTEXT_LANGUAGE_BAMBORA = CDTEXT_LANGUAGE_BAMBORA; %constant int CDTEXT_LANGUAGE_AZERBAIJANI = CDTEXT_LANGUAGE_AZERBAIJANI; %constant int CDTEXT_LANGUAGE_ASSAMESE = CDTEXT_LANGUAGE_ASSAMESE; %constant int CDTEXT_LANGUAGE_ARMENIAN = CDTEXT_LANGUAGE_ARMENIAN; %constant int CDTEXT_LANGUAGE_ARABIC = CDTEXT_LANGUAGE_ARABIC; %constant int CDTEXT_LANGUAGE_AMHARIC = CDTEXT_LANGUAGE_AMHARIC; %constant int MIN_CDTEXT_FIELD = MIN_CDTEXT_FIELD; %constant int MAX_CDTEXT_FIELDS = MAX_CDTEXT_FIELDS; typedef int cdtext_field_t; typedef int cdtext_lang_t; typedef int cdtext_genre_t; const char *cdtext_field2str (cdtext_field_t i); const char *cdtext_lang2str (cdtext_lang_t i); const char *cdtext_genre2str (cdtext_genre_t i); cdtext_t *cdtext_init (void); void cdtext_destroy (cdtext_t *p_cdtext); char *cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track); const char *cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track); cdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext); bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t lang); cdtext_lang_t *cdtext_list_languages (const cdtext_t *p_cdtext); void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset); %rename cdio_get_cdtext get_cdtext; cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio); pycdio-2.1.0/swig/device.swg0000664000175000017500000004015413530441774016251 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011, 2013, 2017, 2018 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See for more extensive documentation. */ %include "device_const.swg" /* Set up to allow functions returning device lists of type "char **". We'll use a typedef so we can make sure to isolate this. I don't think we need to in this program, but it I think it makes thing clearer. */ %inline %{ typedef char ** DeviceList_t; %} %typemap(newfree) DeviceList_t "cdio_free_device_list($1);"; %typemap(out) DeviceList_t { // result is of type DeviceList_t char **p = result; resultobj = PyList_New(0); if (result && *result) { /* For each element in the array of strings, push that * onto the result object. */ for ( ; *p; p++) { %#if PY_VERSION_HEX >= 0x03000000 PyObject *o = PyUnicode_FromStringAndSize(*p, strlen(*p)); %#else PyObject *o = PyString_FromStringAndSize(*p, strlen(*p)); %#endif PyList_Append(resultobj, o); } } } %rename cdio_close_tray close_tray; %feature("autodoc", "close_tray(drive=None, driver_id=None) -> [status, driver_id] close media tray in CD drive if there is a routine to do so. The driver id is returned. An exception is thrown on error."); %apply driver_id_t *OUTPUT { driver_id_t *p_out_driver_id }; driver_return_code_t close_tray(const char *psz_drive, driver_id_t p_driver_id=DRIVER_UNKNOWN, driver_id_t *p_out_driver_id); %inline %{ driver_return_code_t close_tray(const char *psz_drive, driver_id_t p_driver_id, driver_id_t *p_out_driver_id) { *p_out_driver_id = p_driver_id; return cdio_close_tray(psz_drive, p_out_driver_id); } %} %rename cdio_destroy close; %feature("autodoc", "destroy(p_cdio) Free resources associated with p_cdio. Call this when done using using CD reading/control operations for the current device. "); void cdio_destroy(CdIo_t *p_cdio); %feature("autodoc", "eject_media(cdio)->return_code Eject media in CD drive if there is a routine to do so. "); driver_return_code_t eject_media (CdIo_t *p_cdio); %inline %{ driver_return_code_t eject_media (CdIo_t *p_cdio) { /* libcdio routines uses a Cdio_t **p_cdio, so we have to pass in something it can clobber. */ CdIo_t **pp_cdio = &p_cdio; return cdio_eject_media (pp_cdio); } %} %rename cdio_eject_media_drive eject_media_drive; %feature("autodoc", "eject_media_drive(drive=None)->return_code Eject media in CD drive if there is a routine to do so. psz_drive: the name of the device to be acted upon. The operation status is returned."); driver_return_code_t cdio_eject_media_drive (const char *psz_drive=NULL); %rename cdio_get_arg get_arg; %feature("autodoc", "get_arg(p_cdio, key)->string Get the value associatied with key."); const char *cdio_get_arg (const CdIo_t *p_cdio, const char key[]); %newobject cdio_get_default_device; // free malloc'd return value %rename cdio_get_default_device get_device; %feature("autodoc", "get_device(cdio)->str Get the CD device associated with cdio. If cdio is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return None even though there may be a hardware CD-ROM."); char *cdio_get_default_device (const CdIo_t *p_cdio=NULL); %newobject get_default_device_driver; // free malloc'd return value %feature("autodoc", "get_default_device_driver(driver_id=None)->[device, driver] Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that. None is returned as the device if we couldn't get a default device."); %apply driver_id_t *OUTPUT { driver_id_t *p_out_driver_id }; char *get_default_device_driver (driver_id_t p_driver_id, driver_id_t *p_out_driver_id); %inline %{ char * get_default_device_driver(driver_id_t driver_id, driver_id_t *p_out_driver_id) { *p_out_driver_id = driver_id; return cdio_get_default_device_driver(p_out_driver_id); } %} %rename cdio_get_devices get_devices; %newobject cdio_get_devices; %feature("autodoc", "get_devices(driver_id)->[device1, device2, ...] Get an list of device names."); DeviceList_t cdio_get_devices (driver_id_t driver_id); %newobject get_devices_ret; %feature("autodoc", "get_devices_ret(driver_id)->[device1, device2, ... driver_id] Like get_devices, but return the p_driver_id which may be different from the passed-in driver_id if it was pycdio.DRIVER_DEVICE or pycdio.DRIVER_UNKNOWN. The return driver_id may be useful because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well."); DeviceList_t get_devices_ret (driver_id_t driver_id, driver_id_t *p_out_driver_id); %inline %{ DeviceList_t get_devices_ret (driver_id_t driver_id, driver_id_t *p_out_driver_id) { *p_out_driver_id = driver_id; return cdio_get_devices_ret (p_out_driver_id); } %} %feature("autodoc", "get_devices_with_cap(capabilities, any)->[device1, device2...] Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If any is False then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If any is True, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask pycdio.CDIO_FS_MATCH_ALL. The array of device names is returned or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found."); DeviceList_t get_devices_with_cap (unsigned int capabilities, bool b_any); %inline %{ DeviceList_t get_devices_with_cap (unsigned int capabilities, bool b_any) { /* FIXME: ? libcdio allows one to specify a list (char **) of devices to search. Don't know how to do that via SWIG though. */ return cdio_get_devices_with_cap (NULL, (cdio_fs_anal_t) capabilities, b_any); } %} %apply driver_id_t *OUTPUT { driver_id_t *p_out_driver_id }; %newobject get_devices_with_cap_ret; %feature("autodoc", "Like cdio_get_devices_with_cap but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well."); DeviceList_t get_devices_with_cap_ret (unsigned int capabilities, bool b_any, driver_id_t *p_out_driver_id); %inline %{ DeviceList_t get_devices_with_cap_ret (unsigned int capabilities, bool b_any, driver_id_t *p_out_driver_id) { /* FIXME: ? libcdio allows one to specify a list (char **) of devices to search. Don't know how to do that via SWIG though. */ return cdio_get_devices_with_cap_ret (NULL, (cdio_fs_anal_t) capabilities, b_any, p_out_driver_id); } %} %rename cdio_get_drive_cap get_drive_cap; %feature("autodoc", "get_drive_cap()->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM."); %apply uint32_t *OUTPUT { uint32_t *p_read_cap, uint32_t *p_write_cap, uint32_t *p_misc_cap }; void cdio_get_drive_cap (const CdIo_t *p_cdio, uint32_t *p_read_cap, uint32_t *p_write_cap, uint32_t *p_misc_cap); %rename cdio_get_drive_cap_dev get_drive_cap; %feature("autodoc", "get_drive_cap_dev()->(read_cap, write_cap, misc_cap) Get drive capabilities of device. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as empty even though there is a hardware CD-ROM."); void cdio_get_drive_cap_dev(const char *device=NULL, uint32_t *p_read_cap, uint32_t *p_write_cap, uint32_t *p_misc_cap); %rename cdio_get_driver_name get_driver_name; %feature("autodoc", "get_driver_name(cdio)-> string return a string containing the name of the driver in use. An IOError exception is raised on error. "); %exception cdio_get_driver_name { $action if (NULL == result) { PyErr_SetString(PyExc_IOError, "Error getting driver name."); return NULL; } } const char *cdio_get_driver_name (const CdIo_t *p_cdio); %rename cdio_get_driver_id get_driver_id; %feature("autodoc", "get_driver_id(cdio)-> int Return the driver id of the driver in use. if cdio has not been initialized or is None, return pycdio.DRIVER_UNKNOWN."); driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio); %rename cdio_get_last_session get_last_session; %feature("autodoc", "get_last_session(p_cdio) -> int Get the LSN of the first track of the last session of on the CD. An exception is thrown on error."); %apply int *OUTPUT { lsn_t *i_last_session }; driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, lsn_t *i_last_session); %feature("autodoc", "have_driver(driver_id) -> int Return 1 if we have driver driver_id, 0 if not and -1 if driver id is out of range."); %inline %{ int have_driver (unsigned int driver_id) { if (cdio_have_driver(driver_id)) return 1; return 0; } %} %feature("autodoc", "have_ATAPI(CdIo_t *p_cdio)->bool return True if CD-ROM understand ATAPI commands."); %inline %{ /*! True if CD-ROM understand ATAPI commands. */ bool have_ATAPI (CdIo_t *p_cdio) { return cdio_have_atapi(p_cdio) == yep; } %} %newobject cdio_is_binfile; // free malloc'd return value %rename cdio_is_binfile is_binfile; %feature("autodoc", "is_binfile(binfile_name)->cue_name Determine if binfile_name is the BIN file part of a CDRWIN CD disk image. Return the corresponding CUE file if bin_name is a BIN file or None if not a BIN file."); char *cdio_is_binfile(const char *bin_name); %newobject cdio_is_cuefile; // free malloc'd return value %rename cdio_is_cuefile is_cuefile; %feature("autodoc", "is_cuefile(cuefile_name)->bin_name Determine if cuefile_name is the CUE file part of a CDRWIN CD disk image. Return the corresponding BIN file if bin_name is a CUE file or None if not a CUE file."); char *cdio_is_cuefile(const char *cue_name); %rename cdio_is_device is_device; bool cdio_is_device(const char *psz_source, driver_id_t driver_id=DRIVER_UNKNOWN); %rename cdio_is_nrg is_nrg; %feature("autodoc", "is_nrg(cue_name)->bool Determine if nrg_name is a Nero CD disc image"); bool cdio_is_nrg(const char *nrg_name); %rename cdio_is_tocfile is_tocfile; %feature("autodoc", "is_tocfile(tocfile_name)->bool Determine if tocfile_name is a cdrdao CD disc image"); bool cdio_is_tocfile(const char *tocfile_name); %rename cdio_get_media_changed get_media_changed; %feature("autodoc", "get_media_changed(cdio) -> int Find out if media has changed since the last call. Return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t"); int cdio_get_media_changed(CdIo_t *p_cdio); %feature("autodoc", "get_hwinfo(p_cdio)->[drc, vendor, model, release] Get the CD-ROM hardware info via a SCSI MMC INQUIRY command."); %cstring_bounded_output(char *vendor, CDIO_MMC_HW_VENDOR_LEN); %cstring_bounded_output(char *model, CDIO_MMC_HW_MODEL_LEN); %cstring_bounded_output(char *revision, CDIO_MMC_HW_REVISION_LEN); int get_hwinfo ( const CdIo_t *p_cdio, char *vendor, char *model, char *revision ); %inline %{ int get_hwinfo ( const CdIo_t *p_cdio, char *vendor, char *model, char *revision ) { /** There's a bug somewhere here. If we take off the static, we clobber our parameters. So get_hwinfo sizes must not agree. **/ static cdio_hwinfo_t hw_info; bool b_got_hwinfo = cdio_get_hwinfo(p_cdio, &hw_info); if (b_got_hwinfo) { strncpy(vendor, hw_info.psz_vendor, CDIO_MMC_HW_VENDOR_LEN); strncpy(model, hw_info.psz_model, CDIO_MMC_HW_MODEL_LEN); strncpy(revision, hw_info.psz_revision, CDIO_MMC_HW_REVISION_LEN); } return b_got_hwinfo; } %} %rename cdio_set_blocksize set_blocksize; %feature("autodoc", "set_blocksize(cdio, blocksize)->return_status Set the blocksize for subsequent reads."); driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio, int i_blocksize ); %rename cdio_set_speed set_speed; %feature("autodoc", "cdio_set_speed(cdio, speed)->return_status Set the drive speed."); driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio, int i_speed ); /** FIXME: the below works, but is clunky. In the next release of libcdio (or CVS right now) we have a way to get the strings from the exception code so we don't need the switch statement. */ %exception { $action if (DRIVER_OP_SUCCESS == drc) goto out; set_python_errstring(drc); return NULL; out: ; } /*=================================================================* NOTE: ALL ROUTINES DEFINED BELOW CAN GIVE A DRIVER_RETURN_CODE_T EXCEPTION. *=================================================================*/ /**** Using the name open() conflicts with some C routine. So we use open_cd() instead. ***/ %feature("autodoc", "open_cd(source=NULL, driver_id=None, access_mode=None) Sets up to read from place specified by source, driver_id and access mode. This should be called before using any other routine except those that act on a CD-ROM drive by name. If None is given as the source, we'll use the default driver device. If None is given as the driver_id, we'll find a suitable device driver. Return the a pointer than can be used in subsequent operations or None on error or no device."); CdIo_t *open_cd(const char *psz_source=NULL, driver_id_t driver_id=DRIVER_UNKNOWN, const char *psz_access_mode=NULL); %inline %{ /* FIXME: Instead of a static variable drc which doesn't allow for multiple threads, we should change the C code to return the status parameter and have the exception handling code work off of this. Although this is easily done in C and the SWIG-generated C wrapper code, I don't the SWIG lingo to make the generated C wrapper do this. Basically, we need a way to tell SWIG not to translate the %inline C code return value into a Python return value, but save the value anyway to pick it value up in the SWIG %exception. */ static driver_return_code_t drc = DRIVER_OP_SUCCESS; static void set_python_errstring(driver_return_code_t drc) { switch(drc) { case DRIVER_OP_SUCCESS: break; case DRIVER_OP_ERROR: PyErr_SetString(PyExc_IOError, "driver I/O error."); break; case DRIVER_OP_UNINIT: PyErr_SetString(PyExc_IOError, "driver not initialized."); break; case DRIVER_OP_UNSUPPORTED: PyErr_SetString(PyExc_IOError, "driver operatation not supported."); break; case DRIVER_OP_NOT_PERMITTED: PyErr_SetString(PyExc_IOError, "driver operatation not permitted."); break; case DRIVER_OP_BAD_PARAMETER: PyErr_SetString(PyExc_IOError, "bad parameter passed."); break; case DRIVER_OP_BAD_POINTER: PyErr_SetString(PyExc_IOError, "bad pointer to memory area."); break; case DRIVER_OP_NO_DRIVER: PyErr_SetString(PyExc_IOError, "driver not available."); break; default: PyErr_SetString(PyExc_IOError, "unknown error."); break; } } CdIo_t *open_cd(const char *psz_source, driver_id_t driver_id, const char *psz_access_mode) { /* FIXME: On error we return a funny "NULL" Object. */ CdIo_t *p_cdio = cdio_open_am(psz_source, driver_id, psz_access_mode); if (NULL == p_cdio) { drc = DRIVER_OP_ERROR; } else { drc = DRIVER_OP_SUCCESS; } return p_cdio; } %} pycdio-2.1.0/swig/device_const.swg0000664000175000017500000001625413530441774017463 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See for more extensive documentation. */ #include /**** ALL OF THESE ARE CONSTANTS *** */ %immutable; /* Drive types returned by cdio_get_drive_cap() */ %constant long int DRIVE_CAP_ERROR = CDIO_DRIVE_CAP_ERROR; %constant long int DRIVE_CAP_UNKNOWN = CDIO_DRIVE_CAP_UNKNOWN; %constant long int DRIVE_CAP_MISC_CLOSE_TRAY = CDIO_DRIVE_CAP_MISC_CLOSE_TRAY; %constant long int DRIVE_CAP_MISC_EJECT = CDIO_DRIVE_CAP_MISC_EJECT; %constant long int DRIVE_CAP_MISC_LOCK = CDIO_DRIVE_CAP_MISC_LOCK ; %constant long int DRIVE_CAP_MISC_SELECT_SPEED = CDIO_DRIVE_CAP_MISC_SELECT_SPEED; %constant long int DRIVE_CAP_MISC_SELECT_DISC = CDIO_DRIVE_CAP_MISC_SELECT_DISC; %constant long int DRIVE_CAP_MISC_MULTI_SESSION = CDIO_DRIVE_CAP_MISC_MULTI_SESSION; %constant long int DRIVE_CAP_MISC_MEDIA_CHANGED = CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED; %constant long int DRIVE_CAP_MISC_RESET = CDIO_DRIVE_CAP_MISC_RESET; %constant long int DRIVE_CAP_MISC_FILE = CDIO_DRIVE_CAP_MISC_FILE; /* Reading masks.. */ %constant long int DRIVE_CAP_READ_AUDIO = CDIO_DRIVE_CAP_READ_AUDIO; %constant long int DRIVE_CAP_READ_CD_DA = CDIO_DRIVE_CAP_READ_CD_DA; %constant long int DRIVE_CAP_READ_CD_G = CDIO_DRIVE_CAP_READ_CD_G; %constant long int DRIVE_CAP_READ_CD_R = CDIO_DRIVE_CAP_READ_CD_R; %constant long int DRIVE_CAP_READ_CD_RW = CDIO_DRIVE_CAP_READ_CD_RW; %constant long int DRIVE_CAP_READ_DVD_R = CDIO_DRIVE_CAP_READ_DVD_R; %constant long int DRIVE_CAP_READ_DVD_PR = CDIO_DRIVE_CAP_READ_DVD_PR; %constant long int DRIVE_CAP_READ_DVD_RAM = CDIO_DRIVE_CAP_READ_DVD_RAM; %constant long int DRIVE_CAP_READ_DVD_ROM = CDIO_DRIVE_CAP_READ_DVD_ROM; %constant long int DRIVE_CAP_READ_DVD_RW = CDIO_DRIVE_CAP_READ_DVD_RW; %constant long int DRIVE_CAP_READ_DVD_RPW = CDIO_DRIVE_CAP_READ_DVD_RPW; %constant long int DRIVE_CAP_READ_C2_ERRS = CDIO_DRIVE_CAP_READ_C2_ERRS; %constant long int DRIVE_CAP_READ_MODE2_FORM1 = CDIO_DRIVE_CAP_READ_MODE2_FORM1; %constant long int DRIVE_CAP_READ_MODE2_FORM2 = CDIO_DRIVE_CAP_READ_MODE2_FORM2; %constant long int DRIVE_CAP_READ_MCN = CDIO_DRIVE_CAP_READ_MCN; %constant long int DRIVE_CAP_READ_ISRC = CDIO_DRIVE_CAP_READ_ISRC; /* Writing masks.. */ %constant long int DRIVE_CAP_WRITE_CD_R = CDIO_DRIVE_CAP_WRITE_CD_R; %constant long int DRIVE_CAP_WRITE_CD_RW = CDIO_DRIVE_CAP_WRITE_CD_RW; %constant long int DRIVE_CAP_WRITE_DVD_R = CDIO_DRIVE_CAP_WRITE_DVD_R; %constant long int DRIVE_CAP_WRITE_DVD_PR = CDIO_DRIVE_CAP_WRITE_DVD_PR; %constant long int DRIVE_CAP_WRITE_DVD_RAM = CDIO_DRIVE_CAP_WRITE_DVD_RAM; %constant long int DRIVE_CAP_WRITE_DVD_RW = CDIO_DRIVE_CAP_WRITE_DVD_RW ; %constant long int DRIVE_CAP_WRITE_DVD_RPW = CDIO_DRIVE_CAP_WRITE_DVD_RPW; %constant long int DRIVE_CAP_WRITE_MT_RAINIER = CDIO_DRIVE_CAP_WRITE_MT_RAINIER; %constant long int DRIVE_CAP_WRITE_BURN_PROOF = CDIO_DRIVE_CAP_WRITE_BURN_PROOF; /*** Masks derived from above... ***/ /* Has some sort of CD writer ability. */ %constant long int DRIVE_CAP_WRITE_CD = CDIO_DRIVE_CAP_WRITE_CD; /* Has some sort of DVD writer ability */ %constant long int DRIVE_CAP_WRITE_DVD = CDIO_DRIVE_CAP_WRITE_DVD; %constant long int DRIVE_CAP_WRITE = CDIO_DRIVE_CAP_WRITE; /*! Size of fields returned by an INQUIRY command */ %constant long int MMC_HW_VENDOR_LEN = CDIO_MMC_HW_VENDOR_LEN; %constant long int MMC_HW_MODEL_LEN = CDIO_MMC_HW_MODEL_LEN; %constant long int MMC_HW_REVISION_LEN = CDIO_MMC_HW_REVISION_LEN; /**! Flags specifying the category of device to open or is opened. */ %constant long int SRC_IS_DISK_IMAGE_MASK = CDIO_SRC_IS_DISK_IMAGE_MASK; %constant long int SRC_IS_DEVICE_MASK = CDIO_SRC_IS_DEVICE_MASK; %constant long int SRC_IS_SCSI_MASK = CDIO_SRC_IS_SCSI_MASK; %constant long int SRC_IS_NATIVE_MASK = CDIO_SRC_IS_NATIVE_MASK; /* driver_id_t enums. */ %constant long int DRIVER_UNKNOWN = DRIVER_UNKNOWN; %constant long int DRIVER_AIX = DRIVER_AIX; %constant long int DRIVER_FREEBSD = DRIVER_FREEBSD; %constant long int DRIVER_LINUX = DRIVER_LINUX; %constant long int DRIVER_SOLARIS = DRIVER_SOLARIS; %constant long int DRIVER_OSX = DRIVER_OSX; #ifdef DRIVER_NETBSD %constant long int DRIVER_NETBSD = DRIVER_NETBSD; #else %constant long int DRIVER_NETBSD = 20; #endif %constant long int DRIVER_WIN32 = DRIVER_WIN32; %constant long int DRIVER_CDRDAO = DRIVER_CDRDAO; %constant long int DRIVER_BINCUE = DRIVER_BINCUE; %constant long int DRIVER_NRG = DRIVER_NRG; %constant long int DRIVER_DEVICE = DRIVER_DEVICE; %constant long int DRIVER_OP_SUCCESS = DRIVER_OP_SUCCESS; %constant long int DRIVER_OP_ERROR = DRIVER_OP_ERROR; %constant long int DRIVER_OP_UNSUPPORTED = DRIVER_OP_UNSUPPORTED; %constant long int DRIVER_OP_UNINIT = DRIVER_OP_UNINIT; %constant long int DRIVER_OP_NOT_PERMITTED = DRIVER_OP_NOT_PERMITTED; %constant long int DRIVER_OP_BAD_PARAMETER = DRIVER_OP_BAD_PARAMETER; %constant long int DRIVER_OP_BAD_POINTER = DRIVER_OP_BAD_POINTER; %constant long int DRIVER_OP_NO_DRIVER = DRIVER_OP_NO_DRIVER; %constant unsigned int FS_AUDIO = CDIO_FS_AUDIO; %constant unsigned int FS_HIGH_SIERRA = CDIO_FS_HIGH_SIERRA; %constant unsigned int FS_ISO_9660 = CDIO_FS_ISO_9660; %constant unsigned int FS_INTERACTIVE = CDIO_FS_INTERACTIVE; %constant unsigned int FS_HFS = CDIO_FS_HFS; %constant unsigned int FS_UFS = CDIO_FS_UFS; %constant unsigned int FS_EXT2 = CDIO_FS_EXT2; %constant unsigned int FS_ISO_HFS = CDIO_FS_ISO_HFS; %constant unsigned int FS_ISO_9660_INTERACTIVE = CDIO_FS_ISO_9660_INTERACTIVE; %constant unsigned int FS_3DO = CDIO_FS_3DO; %constant unsigned int FS_XISO = CDIO_FS_XISO; %constant unsigned int FS_UDFX = CDIO_FS_UDFX; %constant unsigned int FS_UDF = CDIO_FS_UDF; %constant unsigned int FS_ISO_UDF = CDIO_FS_ISO_UDF; %constant unsigned int FS_ANAL_XA = CDIO_FS_ANAL_XA; %constant unsigned int FS_ANAL_MULTISESSION = CDIO_FS_ANAL_MULTISESSION; %constant unsigned int FS_ANAL_PHOTO_CD = CDIO_FS_ANAL_PHOTO_CD; %constant unsigned int FS_ANAL_HIDDEN_TRACK = CDIO_FS_ANAL_HIDDEN_TRACK; %constant unsigned int FS_ANAL_CDTV = CDIO_FS_ANAL_CDTV; %constant unsigned int FS_ANAL_BOOTABLE = CDIO_FS_ANAL_BOOTABLE; %constant unsigned int FS_ANAL_VIDEOCD = CDIO_FS_ANAL_VIDEOCD; %constant unsigned int FS_ANAL_ROCKRIDGE = CDIO_FS_ANAL_ROCKRIDGE; %constant unsigned int FS_ANAL_JOLIET = CDIO_FS_ANAL_JOLIET; %constant unsigned int FS_ANAL_SVCD = CDIO_FS_ANAL_SVCD; %constant unsigned int FS_ANAL_CVD = CDIO_FS_ANAL_CVD; %constant unsigned int FS_ANAL_XISO = CDIO_FS_ANAL_XISO; %constant unsigned int FS_MATCH_ALL = CDIO_FS_MATCH_ALL; %constant unsigned int FS_UNKNOWN = CDIO_FS_UNKNOWN; %mutable; pycdio-2.1.0/swig/disc.swg0000664000175000017500000000631413530441774015734 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See for more extensive documentation. */ %constant long int DISC_MODE_CD_DA = CDIO_DISC_MODE_CD_DA; %constant long int DISC_MODE_CD_DATA = CDIO_DISC_MODE_CD_DATA; %constant long int DISC_MODE_CD_XA = CDIO_DISC_MODE_CD_XA; %constant long int DISC_MODE_CD_MIXED = CDIO_DISC_MODE_CD_MIXED; %constant long int DISC_MODE_DVD_ROM = CDIO_DISC_MODE_DVD_ROM; %constant long int DISC_MODE_DVD_RAM = CDIO_DISC_MODE_DVD_RAM; %constant long int DISC_MODE_DVD_R = CDIO_DISC_MODE_DVD_R; %constant long int DISC_MODE_DVD_RW = CDIO_DISC_MODE_DVD_RW; %constant long int DISC_MODE_DVD_PR = CDIO_DISC_MODE_DVD_PR; %constant long int DISC_MODE_DVD_PRW = CDIO_DISC_MODE_DVD_PRW; %constant long int DISC_MODE_DVD_OTHER = CDIO_DISC_MODE_DVD_OTHER; %constant long int DISC_MODE_NO_INFO = CDIO_DISC_MODE_NO_INFO; %constant long int DISC_MODE_ERROR = CDIO_DISC_MODE_ERROR; %constant long int DISC_MODE_CD_I = CDIO_DISC_MODE_CD_I; %rename cdio_get_disc_last_lsn get_disc_last_lsn; %feature("autodoc", "get_disc_last_lsn(cdio)->lsn Get the LSN of the end of the CD. pycdio.INVALID_LSN is returned on error."); lsn_t cdio_get_disc_last_lsn(const CdIo_t *p_cdio); %feature("autodoc", "get_disc_mode(p_cdio) -> str Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, ...) that we've got. The notion of 'CD' is extended a little to include DVD's."); %exception get_disc_mode { $action if (NULL == result) { PyErr_SetString(PyExc_IOError, "Error getting disc mode."); return NULL; } } const char *get_disc_mode (CdIo_t *p_cdio); %rename cdio_get_joliet_level get_joliet_level; %feature("autodoc", "get_joliet_level(cdio)->int Return the Joliet level recognized for cdio. This only makes sense for something that has an ISO-9660 filesystem."); int cdio_get_joliet_level(const CdIo_t *p_cdio); %newobject cdio_get_mcn; // free malloc'd return value %rename cdio_get_mcn get_mcn; %feature("autodoc", "get_mcn(cdio) -> str Get the media catalog number (MCN) from the CD."); char * cdio_get_mcn(CdIo_t *p_cdio); %rename cdio_get_num_tracks get_num_tracks; %feature("autodoc", "get_num_tracks(p_cdio)->int Return the number of tracks on the CD. On error pycdio.INVALID_TRACK is returned."); track_t cdio_get_num_tracks (const CdIo_t *p_cdio); /*========================INLINE======================================*/ %inline %{ const char * get_disc_mode (CdIo_t *p_cdio) { discmode_t discmode = cdio_get_discmode(p_cdio); if (CDIO_DISC_MODE_ERROR == discmode) return NULL; return discmode2str[discmode]; } %} pycdio-2.1.0/swig/pycdio.i0000664000175000017500000000550313530441774015730 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ %define DOCSTRING "This is a wrapper for The CD Input and Control library (libcdio) which encapsulates CD-ROM reading and control. Python programs wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library." %enddef %module(docstring=DOCSTRING) pycdio %{ /* Includes the header in the wrapper code */ #include #include #include %} %include "typemaps.i" %include "cstring.i" /* Various libcdio constants and typedefs */ %include "types.swg" %feature("autodoc", 1); %include "audio.swg" %include "read.swg" %include "track.swg" %include "cdtext.swg" /* In the presence of the exception handling, the order is important. The below use %exception. */ %include "device.swg" %include "disc.swg" /* Encapsulation is done in two parts. The lower-level python interface is called pycdio and is generated by SWIG. The more object-oriented module is cdio; it is a Python class that uses pycdio. Although pycdio is perfectly usable on its own, it is expected that cdio is what most people will use. As pycdio more closely models the C interface, it is conceivable (if unlikely) that diehard libcdio C users who are very familiar with that interface could prefer that. It is probably possible to change the SWIG in such a way to combine these pieces. However there are the problems. First, I'm not that much of a SWIG expert. Second it looks as though the resulting SWIG code would be more complex. Third the separation makes translation very straight forward to understand and maintain: first get what's in C into Python as a one-to-one translation. Then we implement some nice abstraction off of that. The abstraction can be modified without having to redo the underlying translation. (But the reverse is generally not true: usually changes to the C-to-python translation, pycdio, do result in small, but obvious and straightforward changes to the abstraction layer cdio.) */ #define INCLUDE_CLASS 0 #if INCLUDE_CLASS /* In spite of the above, if we were to do things as a one-step approach, this might be how it would be done. */ %pythoncode %{ %include "cdio.py" %} #endif pycdio-2.1.0/swig/pyiso9660.i0000664000175000017500000006536713530441774016147 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2010, 2016, 2018 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ %define DOCSTRING "This is a wrapper for The CD Input and Control library's ISO-9660 library See also the ISO-9660 specification. The freely available European equivalant standard is called ECMA-119." %enddef %module(docstring=DOCSTRING) pyiso9660 %{ /* Includes the header in the wrapper code */ #include #include #include %} /* Various libcdio constants and typedefs */ %include "types.swg" %include "typemaps.i" %include "cstring.i" %feature("autodoc", 1); typedef unsigned int iso_extension_mask_t; %constant long int ISO_BLOCKSIZE = CDIO_CD_FRAMESIZE; %constant long int PVD_SECTOR = ISO_PVD_SECTOR ; %constant long int EVD_SECTOR = ISO_EVD_SECTOR ; %constant long int LEN_ISONAME = LEN_ISONAME; %constant long int MAX_SYSTEM_ID = ISO_MAX_SYSTEM_ID ; %constant long int MAX_ISONAME = MAX_ISONAME; %constant long int MAX_PREPARER_ID = ISO_MAX_PREPARER_ID ; %constant long int MAX_ISOPATHNAME = MAX_ISOPATHNAME; %constant long int FILE = ISO_FILE; %constant long int EXISTENCE = ISO_EXISTENCE; %constant long int DIRECTORY = ISO_DIRECTORY; %constant long int ASSOCIATED = ISO_ASSOCIATED; %constant long int RECORD = ISO_RECORD; %constant long int PROTECTION = 16; %constant long int DRESERVED1 = ISO_DRESERVED1; %constant long int DRESERVED2 = ISO_DRESERVED2; %constant long int MULTIEXTENT = ISO_MULTIEXTENT; %constant long int VD_BOOT_RECORD = ISO_VD_BOOT_RECORD; %constant long int VD_PRIMARY = ISO_VD_PRIMARY; %constant long int VD_SUPPLEMENTARY = ISO_VD_SUPPLEMENTARY; %constant long int VD_PARITION = ISO_VD_PARITION; %constant long int VD_END = ISO_VD_END; %constant long int MAX_PUBLISHER_ID = ISO_MAX_PUBLISHER_ID; %constant long int MAX_APPLICATION_ID = ISO_MAX_APPLICATION_ID; %constant long int MAX_VOLUME_ID = ISO_MAX_VOLUME_ID; %constant long int MAX_VOLUMESET_ID = ISO_MAX_VOLUMESET_ID; %constant long int STANDARD_ID = ISO_STANDARD_ID; %constant long int NOCHECK = ISO9660_NOCHECK; %constant long int SEVEN_BIT = ISO9660_7BIT; %constant long int ACHARS = ISO9660_ACHARS; %constant long int DCHARS = ISO9660_DCHARS; %constant long int EXTENSION_JOLIET_LEVEL1 = ISO_EXTENSION_JOLIET_LEVEL1; %constant long int EXTENSION_JOLIET_LEVEL2 = ISO_EXTENSION_JOLIET_LEVEL2; %constant long int EXTENSION_JOLIET_LEVEL3 = ISO_EXTENSION_JOLIET_LEVEL3; %constant long int EXTENSION_ROCK_RIDGE = ISO_EXTENSION_ROCK_RIDGE; %constant long int EXTENSION_HIGH_SIERRA = ISO_EXTENSION_HIGH_SIERRA; %constant long int EXTENSION_ALL = ISO_EXTENSION_ALL; %constant long int EXTENSION_NONE = ISO_EXTENSION_NONE; %constant long int EXTENSION_JOLIET = ISO_EXTENSION_JOLIET; /* Set up to allow functions to return stat lists of type "stat *". We'll use a typedef so we can make sure to isolate this. */ %inline %{ typedef CdioList_t IsoStatList_t; typedef iso9660_stat_t IsoStat_t; %} typedef CdioList_t IsoStatList_t; typedef iso9660_stat_t IsoStat_t; %typemap(newfree) IsoStatList_t "_cdio_list_free($1, 1);"; %typemap(out) IsoStatList_t *{ CdioList_t *p_entlist = result; CdioListNode_t *p_entnode; if (result) { resultobj = PyList_New(0); _CDIO_LIST_FOREACH (p_entnode, p_entlist) { PyObject *py_list = PyList_New(5); iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); PyObject *o; o = PyString_FromString(p_statbuf->filename); PyList_SetItem(py_list, 0, o); o = SWIG_From_long((long)(p_statbuf->lsn)); PyList_SetItem(py_list, 1, o); o = SWIG_From_long((long)(p_statbuf->size)); PyList_SetItem(py_list, 2, o); o = SWIG_From_long((long)(p_statbuf->secsize)); PyList_SetItem(py_list, 3, o); o = SWIG_From_long((long)(p_statbuf->type)); PyList_SetItem(py_list, 4, o); PyList_Append(resultobj, py_list); } } else { resultobj = Py_None; } } %typemap(out) IsoStat_t *{ iso9660_stat_t *p_statbuf = result; if (result) { PyObject *o; resultobj = PyList_New(0); o = PyString_FromString(p_statbuf->filename); PyList_Append(resultobj, o); o = SWIG_From_long((long)(p_statbuf->lsn)); PyList_Append(resultobj, o); o = SWIG_From_long((long)(p_statbuf->size)); PyList_Append(resultobj, o); o = SWIG_From_long((long)(p_statbuf->secsize)); PyList_Append(resultobj, o); o = SWIG_From_long((long)(p_statbuf->type)); PyList_Append(resultobj, o); free (p_statbuf); } else { resultobj = Py_None; } } %typemap(out) struct tm *{ struct tm *p_tm = result; if (result) { PyObject *o; resultobj = PyList_New(9); o = SWIG_From_int(p_tm->tm_year+1900); PyList_SetItem(resultobj, 0, o); o = SWIG_From_int(p_tm->tm_mon+1); PyList_SetItem(resultobj, 1, o); o = SWIG_From_int(p_tm->tm_mday); PyList_SetItem(resultobj, 2, o); o = SWIG_From_int(p_tm->tm_hour); PyList_SetItem(resultobj, 3, o); o = SWIG_From_int(p_tm->tm_min); PyList_SetItem(resultobj, 4, o); o = SWIG_From_int(p_tm->tm_sec); PyList_SetItem(resultobj, 5, o); o = SWIG_From_int((p_tm->tm_wday-1)%7); PyList_SetItem(resultobj, 6, o); o = SWIG_From_int(p_tm->tm_yday+1); PyList_SetItem(resultobj, 7, o); o = SWIG_From_int(p_tm->tm_isdst); PyList_SetItem(resultobj, 8, o); free (p_tm); } } #ifdef FINISHED %typemap(out) IsoStatList_t *{ // $1 is of type IsoStatList_t CdioList_t *p_entlist = result; CdioListNode_t *p_entnode; unsigned int num = 0; if (!result) goto out; PPCODE: /* Figure out how many items in the array */ _CDIO_LIST_FOREACH (p_entnode, p_entlist) { num +=5; } /* For each element in the array of strings, create a new * mortalscalar, and stuff it into the above array. */ _CDIO_LIST_FOREACH (p_entnode, p_entlist) { iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); /* Have perl compute the length of the string using strlen() */ XPUSHs(sv_2mortal(newSVpv(p_statbuf->filename, 0))); XPUSHs(sv_2mortal(newSViv(p_statbuf->lsn))); XPUSHs(sv_2mortal(newSViv(p_statbuf->size))); XPUSHs(sv_2mortal(newSViv(p_statbuf->secsize))); XPUSHs(sv_2mortal(newSViv(p_statbuf->type))); } _cdio_list_free (p_entlist, true); argvi += num + 2; out: ; } #endif %feature("autodoc", "open_iso(path) Open an ISO 9660 image for reading. Maybe in the future we will have mode. None is returned on error. "); %rename iso9660_open open_iso; iso9660_t *iso9660_open (const char *psz_path /*flags, mode */); %feature("autodoc", "Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. None is returned on error."); %rename iso9660_open_ext open_ext; iso9660_t *iso9660_open_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask); %feature("autodoc", "Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. None is returned on error. see iso9660_open"); %rename iso9660_open_fuzzy open_fuzzy; iso9660_t *iso9660_open_fuzzy (const char *psz_path /*flags, mode */, uint16_t i_fuzz); %feature("autodoc", "Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. None is returned on error. see open_iso "); %rename iso9660_open_fuzzy open_fuzzy_ext; iso9660_t *iso9660_open_fuzzy_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz /*flags, mode */); %feature("autodoc", "Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. "); %rename iso9660_ifs_fuzzy_read_superblock ifs_fuzzy_read_superblock; bool iso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz); %feature("autodoc", "Close previously opened ISO 9660 image. True is unconditionally returned. If there was an error false would be returned."); %rename iso9660_close close; bool iso9660_close (iso9660_t * p_iso); %feature("autodoc", "Seek to a position and then read n bytes. (buffer, size) are returned."); %cstring_output_withsize(char *p_buf, ssize_t *pi_size); ssize_t seek_read (const iso9660_t *p_iso, lsn_t start, char *p_buf, ssize_t *pi_size); %inline %{ ssize_t seek_read (const iso9660_t *p_iso, lsn_t start, char *p_buf, ssize_t *pi_size) { *pi_size = iso9660_iso_seek_read(p_iso, p_buf, start, (*pi_size) / ISO_BLOCKSIZE); return *pi_size; } %} %feature("autodoc", "Read the Primary Volume Descriptor for a CD. None is returned if there was an error."); iso9660_pvd_t *fs_read_pvd ( const CdIo_t *p_cdio ); %inline %{ iso9660_pvd_t *fs_read_pvd ( const CdIo_t *p_cdio ) { static iso9660_pvd_t pvd; bool b_ok = iso9660_fs_read_pvd ( p_cdio, &pvd ); if (!b_ok) return NULL; return &pvd; } %} %feature("autodoc", "Read the Primary Volume Descriptor for an ISO 9660 image. None is returned if there was an error."); iso9660_pvd_t *ifs_read_pvd ( const iso9660_t *p_iso ); %inline %{ iso9660_pvd_t *ifs_read_pvd ( const iso9660_t *p_iso ) { static iso9660_pvd_t pvd; bool b_ok = iso9660_ifs_read_pvd ( p_iso, &pvd ); if (!b_ok) return NULL; return &pvd; } %} %feature("autodoc", "Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable."); %rename iso9660_fs_read_superblock fs_read_superblock; bool iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask); %feature("autodoc", "Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable."); %rename iso9660_ifs_read_superblock ifs_read_superblock; bool iso9660_ifs_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask); /*==================================================== Time conversion ====================================================*/ %feature("autodoc", "Set time in format used in ISO 9660 directory index record"); iso9660_dtime_t * set_dtime ( int year, int mon, int mday, int hour, int min, int sec); %inline %{ iso9660_dtime_t * set_dtime ( int year, int mon, int mday, int hour, int min, int sec) { struct tm tm = { sec, min, hour, mday, mon-1, year-1900, 0, 0, -1 }; static iso9660_dtime_t dtime; iso9660_set_dtime (&tm, &dtime); return &dtime; } %} %feature("autodoc", "Set 'long' time in format used in ISO 9660 primary volume descriptor"); iso9660_ltime_t * set_ltime ( int year, int mon, int mday, int hour, int min, int sec); %inline %{ iso9660_ltime_t * set_ltime ( int year, int mon, int mday, int hour, int min, int sec) { struct tm tm = { sec, min, hour, mday, mon-1, year-1900, 0, 0, -1 }; static iso9660_ltime_t ldate; iso9660_set_ltime (&tm, &ldate); return &ldate; } %} %feature("autodoc", "Get Unix time structure from format use in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in idr_date, they are calculated from the other fields. If tm is to reflect the localtime, set 'use_localtime' true, otherwise tm will reported in GMT."); struct tm *get_dtime (const iso9660_dtime_t *p_dtime, bool use_localtime); %inline %{ struct tm *get_dtime (const iso9660_dtime_t *p_dtime, bool use_localtime) { struct tm *p_tm = (struct tm *) calloc(1, sizeof(struct tm)); if (!iso9660_get_dtime (p_dtime, use_localtime, p_tm)) { free(p_tm); return NULL; } return p_tm; } %} %feature("autodoc", "Get 'long' time in format used in ISO 9660 primary volume descriptor from a Unix time structure."); struct tm *get_ltime (const iso9660_ltime_t *p_ltime); %inline %{ struct tm *get_ltime (const iso9660_ltime_t *p_ltime) { struct tm *p_tm = (struct tm *) calloc(1, sizeof(struct tm)); if (!iso9660_get_ltime (p_ltime, p_tm)) { free(p_tm); return NULL; } return p_tm; } %} /*======================================================== Characters used in file and directory and manipulation =======================================================*/ %feature("autodoc", " Return true if c is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore."); %rename iso9660_isdchar is_dchar; bool iso9660_isdchar (int c); %feature("autodoc", "Return true if c is an ACHAR - These are the DCHAR's plus some ASCII symbols including the space symbol."); %rename iso9660_isachar is_achar; bool iso9660_isachar (int c); %feature("autodoc", "Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @return length of the translated string is returned."); %newobject name_translate; char * name_translate(const char *psz_oldname); %inline %{ char * name_translate(const char *psz_oldname) { char *psz_newname=calloc(sizeof(char), strlen(psz_oldname)+1); iso9660_name_translate(psz_oldname, psz_newname); return psz_newname; } %} %feature("autodoc", "Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @param i_joliet_level 0 if not using Joliet Extension. Otherwise the Joliet level. @return length of the translated string is returned. It will be no greater than the length of psz_oldname."); %newobject name_translate_ext; char * name_translate_ext(const char *psz_oldname, uint8_t i_joliet_level); %inline %{ char * name_translate_ext(const char *psz_oldname, uint8_t i_joliet_level) { char *psz_newname=calloc(sizeof(char), strlen(psz_oldname)+1); iso9660_name_translate_ext(psz_oldname, psz_newname, i_joliet_level); return psz_newname; } %} %feature("autodoc", "Pad string src with spaces to size len and copy this to dst. If en is less than the length of src, dst will be truncated to the first len characters of src. src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check. In addition to getting changed, dst is the return value. Note: this string might not be NULL terminated."); %newobject strncpy_pad; // free malloc'd return value char *strncpy_pad(const char src[], size_t len, enum strncpy_pad_check _check); %inline %{ char * strncpy_pad(const char src[], size_t len, enum strncpy_pad_check _check) { char *dst = calloc(sizeof(char), len+1); return iso9660_strncpy_pad(dst, src, len, _check); } %} /*===================================================================== Files and Directory Names ======================================================================*/ %feature("autodoc", "Check that psz_path is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. True is returned if psz_path is valid."); %rename iso9660_dirname_valid_p dirname_valid_p; bool iso9660_dirname_valid_p (const char psz_path[]); %feature("autodoc", "Take psz_path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followed by ';' and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned."); %rename iso9660_pathname_isofy pathname_isofy; %newobject iso9660_pathname_isofy; // free malloc'd return value char *iso9660_pathname_isofy (const char psz_path[], uint16_t i_version=1); %feature("autodoc", "Check that psz_path is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. True is returned if psz_path is valid."); %rename iso9660_pathname_valid_p pathname_valid_p; bool iso9660_pathname_valid_p (const char psz_path[]); /* ... */ %feature("autodoc", "Given a directory pointer, find the filesystem entry that contains lsn and return information about it. Returns stat_t of entry if we found lsn, or None otherwise."); #if 0 %rename iso9660_find_fs_lsn fs_find_lsn; IsoStat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); %feature("autodoc", "Given a directory pointer, find the filesystem entry that contains lsn and return information about it. Returns stat_t of entry if we found lsn, or None otherwise."); %rename iso9660_find_ifs_lsn ifs_find_lsn; IsoStat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn); #endif %feature("autodoc", "Return file status for psz_path. None is returned on error."); %rename iso9660_fs_stat fs_stat; IsoStat_t *iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]); %feature("autodoc", "Return file status for path name psz_path. None is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased."); %rename iso9660_fs_stat_translate fs_stat_translate; IsoStat_t *iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]); %feature("autodoc", "Return file status for pathname. None is returned on error."); %rename iso9660_ifs_stat ifs_stat; IsoStat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]); %feature("autodoc", "Return file status for path name psz_path. undef is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased."); %rename iso9660_ifs_stat_translate ifs_stat_translate; IsoStat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[]); %feature("autodoc", "Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory."); IsoStatList_t *fs_readdir (CdIo_t *p_cdio, const char psz_path[]); %inline %{ IsoStatList_t *fs_readdir (CdIo_t *p_cdio, const char psz_path[]) { CdioList_t *p_statlist = iso9660_fs_readdir (p_cdio, psz_path); return p_statlist; } %} %feature("autodoc", "Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory."); IsoStatList_t *ifs_readdir (iso9660_t *p_iso, const char psz_path[]); %inline %{ IsoStatList_t *ifs_readdir (iso9660_t *p_iso, const char psz_path[]) { CdioList_t *p_statlist = iso9660_ifs_readdir (p_iso, psz_path); return p_statlist; } %} %feature("autodoc", "Return the PVD's application ID. None is returned if there is some problem in getting this."); %rename iso9660_get_application_id get_application_id; char * iso9660_get_application_id(iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the application ID. Return None if there is some problem in getting this."); %newobject get_application_id; // free malloc'd return value char *ifs_get_application_id(iso9660_t *p_iso); %inline %{ char * ifs_get_application_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_application_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} %feature("autodoc", "Return the Joliet level recognized for p_iso."); %rename iso9660_ifs_get_joliet_level get_joliet_level; uint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso); %rename iso9660_get_dir_len get_dir_len; uint8_t iso9660_get_dir_len(const iso9660_dir_t *p_idr); %feature("autodoc", "Return the directory name stored in the iso9660_dir_t."); %newobject iso9660_dir_to_name; // free malloc'd return value %rename iso9660_get_to_name get_to_name; char * iso9660_dir_to_name (const iso9660_dir_t *p_iso9660_dir); %feature("autodoc", "Returns a POSIX mode for a given p_iso_dirent."); %rename iso9660_get_posix_filemode get_posix_filemode; mode_t iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent); %feature("autodoc", "Return a string containing the preparer id with trailing blanks removed."); %rename iso9660_get_preparer_id get_preparer_id; char *iso9660_get_preparer_id(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the preparer ID. Return None if there is some problem in getting this."); %newobject ifs_get_preparer_id; // free malloc'd return value char *ifs_get_preparer_id(iso9660_t *p_iso); %inline %{ char * ifs_get_preparer_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_preparer_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} %feature("autodoc", "Return a string containing the PVD's publisher id with trailing blanks removed."); %rename iso9660_get_publisher_id get_publisher_id; char *iso9660_get_publisher_id(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the publisher ID. Return None if there is some problem in getting this."); %newobject ifs_get_publisher_id; // free malloc'd return value char *ifs_get_publisher_id(iso9660_t *p_iso); %inline %{ char * ifs_get_publisher_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_publisher_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} %rename iso9660_get_pvd_type get_pvd_type; uint8_t iso9660_get_pvd_type(const iso9660_pvd_t *p_pvd); %rename iso9660_get_pvd_id get_pvd_id; const char * iso9660_get_pvd_id(const iso9660_pvd_t *p_pvd); %rename iso9660_get_pvd_space_size get_pvd_space_size; int iso9660_get_pvd_space_size(const iso9660_pvd_t *p_pvd); %rename iso9660_get_pvd_block_size get_pvd_block_size; int iso9660_get_pvd_block_size(const iso9660_pvd_t *p_pvd) ; %feature("autodoc", "Return the primary volume id version number (of pvd). If there is an error 0 is returned."); %rename iso9660_get_pvd_version get_pvd_version; int iso9660_get_pvd_version(const iso9660_pvd_t *pvd) ; %feature("autodoc", "Return a string containing the PVD's system id with trailing blanks removed."); %rename iso9660_get_system_id get_system_id; char *iso9660_get_system_id(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the system ID. None is returned if there is some problem in getting this."); %newobject ifs_get_system_id; // free malloc'd return value char *ifs_get_system_id(iso9660_t *p_iso); %inline %{ char * ifs_get_system_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_system_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} %feature("autodoc", "Return the LSN of the root directory for pvd. If there is an error INVALID_LSN is returned. "); %rename iso9660_get_root_lsn get_root_lsn; lsn_t iso9660_get_root_lsn(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Return the PVD's volume ID."); %rename iso9660_get_volume_id get_volume_id; char *iso9660_get_volume_id(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the system ID. None is returned if there is some problem in getting this."); %newobject ifs_get_volume_id; // free malloc'd return value char *ifs_get_volume_id(iso9660_t *p_iso); %inline %{ char * ifs_get_volume_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_volume_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} %feature("autodoc", " Return the PVD's volumeset ID. None is returned if there is some problem in getting this. "); %rename iso9660_get_volumeset_id get_volumeset_id; char *iso9660_get_volumeset_id(const iso9660_pvd_t *p_pvd); %feature("autodoc", "Get the volumeset ID. None is returned if there is some problem in getting this."); %newobject ifs_get_volumeset_id; // free malloc'd return value char *ifs_get_volumeset_id(iso9660_t *p_iso); %inline %{ char * ifs_get_volumeset_id(iso9660_t *p_iso) { char *psz; bool ok = iso9660_ifs_get_volumeset_id(p_iso, &psz); if (!ok) return NULL; return psz; } %} /* ================= pathtable ================== */ %feature("autodoc", "Zero's out pathable. Do this first."); %rename iso9660_pathtable_init pathtable_init; void iso9660_pathtable_init (void *pt); %rename iso9660_pathtable_get_size pathtable_get_size; unsigned int iso9660_pathtable_get_size (const void *pt); %rename iso9660_pathtable_l_add_entry pathtable_l_add_entry; uint16_t iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent); %rename iso9660_pathtable_m_add_entry pathtable_m_add_entry; uint16_t iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent); /*====================================================================== Volume Descriptors ========================================================================*/ #ifdef FINSHED void iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[], const char publisher_id[], const char preparer_id[], uint32_t iso_size, const void *root_dir, uint32_t path_table_l_extent, uint32_t path_table_m_extent, uint32_t path_table_size, const time_t *pvd_time); #endif /*FINISHED*/ %rename iso9660_set_evd set_evd; void iso9660_set_evd (void *pd); %feature("autodoc", "Return true if ISO 9660 image has extended attrributes (XA)."); %rename iso9660_ifs_is_xa is_xa; bool iso9660_ifs_is_xa (const iso9660_t * p_iso); // %pythoncode %{ //%} pycdio-2.1.0/swig/read.swg0000664000175000017500000001135313530441774015724 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2010 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See for more extensive documentation. */ %constant long int READ_MODE_AUDIO = CDIO_READ_MODE_AUDIO; %constant long int READ_MODE_M1F1 = CDIO_READ_MODE_M1F1; %constant long int READ_MODE_M1F2 = CDIO_READ_MODE_M1F2; %constant long int READ_MODE_M2F1 = CDIO_READ_MODE_M2F1; %constant long int READ_MODE_M2F2 = CDIO_READ_MODE_M2F2; typedef int cdio_read_mode_t; %rename cdio_lseek lseek; %feature("autodoc", "lseek(cdio, offset, whence)->int Reposition read offset Similar to (if not the same as) libc's fseek() cdio is object to get adjested, offset is amount to seek and whence is like corresponding parameter in libc's lseek, e.g. it should be SEEK_SET or SEEK_END. the offset is returned or -1 on error."); off_t cdio_lseek(const CdIo_t *p_cdio, int offset, int whence=SEEK_SET); %feature("autodoc", "read_cd(cdio, size)->[size, data] Reads into buf the next size bytes. Similar to (if not the same as) libc's read() The number of reads read is returned. -1 is returned on error."); %cstring_output_withsize(char *p_buf, ssize_t *pi_size); ssize_t read_cd(const CdIo_t *p_cdio, char *p_buf, ssize_t *pi_size); %inline %{ ssize_t read_cd(const CdIo_t *p_cdio, char *p_buf, ssize_t *pi_size) { *pi_size = cdio_read(p_cdio, p_buf, *pi_size); return *pi_size; } %} %feature("autodoc", "read_sectors(bytes, lsn, read_mode)->[size, data] Reads a number of sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. If read_mode is pycdio.MODE_AUDIO, the return buffer size will be truncated to multiple of pycdio.CDIO_FRAMESIZE_RAW i_blocks bytes. If read_mode is pycdio.MODE_DATA, buffer will be truncated to a multiple of pycdio.ISO_BLOCKSIZE, pycdio.M1RAW_SECTOR_SIZE or pycdio.M2F2_SECTOR_SIZE bytes depending on what mode the data is in. If read_mode is pycdio.CDIO_MODE_M2F1, buffer will be truncated to a multiple of pycdio.M2RAW_SECTOR_SIZE bytes. If read_mode is CDIO_MODE_M2F2, the return buffer size will be truncated to a multiple of pycdio.CD_FRAMESIZE bytes. If size <= 0 an error has occurred."); %inline %{ ssize_t read_sectors(const CdIo_t *p_cdio, char *p_buf, ssize_t *pi_size, lsn_t i_lsn, cdio_read_mode_t read_mode) { driver_return_code_t drc; uint32_t i_blocks; uint16_t i_blocksize; switch (read_mode) { case CDIO_READ_MODE_AUDIO: i_blocksize = CDIO_CD_FRAMESIZE_RAW; break; case CDIO_READ_MODE_M1F1: i_blocksize = M2RAW_SECTOR_SIZE; break; case CDIO_READ_MODE_M1F2: i_blocksize = M2RAW_SECTOR_SIZE; break; case CDIO_READ_MODE_M2F1: i_blocksize = CDIO_CD_FRAMESIZE; break; case CDIO_READ_MODE_M2F2: i_blocksize = M2F2_SECTOR_SIZE; break; default: pi_size = NULL; return DRIVER_OP_BAD_PARAMETER; } i_blocks = *pi_size / i_blocksize; drc = cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, i_blocks); if (drc < 0) { pi_size = NULL; return drc; } return *pi_size; } %} %feature("autodoc", "read_data_bytes(lsn, bytes) Reads a number of data sectors (AKA blocks). lsn is sector to read, bytes is the number of bytes. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is pycdio.M2RAW_SECTOR_SIZE. If size <= 0 an error has occurred."); %inline %{ ssize_t read_data_bytes(const CdIo_t *p_cdio, char *p_buf, ssize_t *pi_size, lsn_t i_lsn, int16_t i_blocksize) { driver_return_code_t drc; uint32_t i_blocks = *pi_size / i_blocksize; switch (i_blocksize) { case CDIO_CD_FRAMESIZE: case CDIO_CD_FRAMESIZE_RAW: case M2F2_SECTOR_SIZE: case M2RAW_SECTOR_SIZE: break; default: /* Don't know about these block sizes */ pi_size = NULL; return DRIVER_OP_BAD_PARAMETER; } #if DEBUGGING printf("p_cdio: %x, i_size: %d, lsn: %d, blocksize %d, blocks %d\n", p_cdio, *pi_size, i_lsn, i_blocksize, i_blocks); #endif drc = cdio_read_data_sectors (p_cdio, p_buf, i_lsn, i_blocksize, i_blocks); #if DEBUGGING printf("drc: %d\n", drc); #endif if (drc < 0) { pi_size = NULL; return drc; } return *pi_size; } %} pycdio-2.1.0/swig/track.swg0000664000175000017500000001600713530441774016116 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2009 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* See For more extensive documentation */ %constant long int TRACK_FORMAT_AUDIO = TRACK_FORMAT_AUDIO; %constant long int TRACK_FORMAT_CDI = TRACK_FORMAT_CDI; %constant long int TRACK_FORMAT_XA = TRACK_FORMAT_XA; %constant long int TRACK_FORMAT_DATA = TRACK_FORMAT_DATA; %constant long int TRACK_FORMAT_PSX = TRACK_FORMAT_PSX; %constant long int CDIO_TRACK_FLAG_FALSE = CDIO_TRACK_FLAG_FALSE; %constant long int CDIO_TRACK_FLAG_TRUE = CDIO_TRACK_FLAG_TRUE; %constant long int CDIO_TRACK_FLAG_ERROR = CDIO_TRACK_FLAG_ERROR; %constant long int CDIO_TRACK_FLAG_UNKNOWN = CDIO_TRACK_FLAG_UNKNOWN; %constant long int CDIO_CDROM_LBA = CDIO_CDROM_LBA; %constant long int CDIO_CDROM_MSF = CDIO_CDROM_MSF; %constant long int CDIO_CDROM_DATA_TRACK = CDIO_CDROM_DATA_TRACK; %constant long int CDIO_CDROM_CDI_TRACK = CDIO_CDROM_CDI_TRACK; %constant long int CDIO_CDROM_XA_TRACK = CDIO_CDROM_XA_TRACK; %constant long int AUDIO = AUDIO; %constant long int MODE1 = MODE1; %constant long int MODE1_RAW = MODE1_RAW; %constant long int MODE2 = MODE2; %constant long int MODE2_FORM1 = MODE2_FORM1; %constant long int MODE2_FORM2 = MODE2_FORM2; %constant long int MODE2_FORM_MIX = MODE2_FORM_MIX; %constant long int MODE2_RAW = MODE2_RAW; %constant long int INVALID_TRACK = CDIO_INVALID_TRACK; %constant long int CDROM_LEADOUT_TRACK = 0xAA; typedef int track_flag_t; %rename cdio_get_first_track_num get_first_track_num; %feature("autodoc", "get_first_track_num(p_cdio) -> int Get the number of the first track. return the track number or pycdio.INVALID_TRACK if there was a problem."); track_t cdio_get_first_track_num(const CdIo_t *p_cdio); %rename cdio_get_last_track_num get_last_track_num ; %feature("autodoc", "get_last_track_num Return the last track number. pycdio.INVALID_TRACK is if there was a problem."); track_t cdio_get_last_track_num (const CdIo_t *p_cdio); %rename cdio_get_track get_track; %feature("autodoc", "cdio_get_track(lsn)->int Find the track which contains lsn. pycdio.INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track, 0 is returned. Otherwise we return the track that spans the lsn."); track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn); %rename cdio_get_track_channels get_track_channels; %feature("autodoc", "get_track_channels(cdio, track)->int Return number of channels in track: 2 or 4; -2 if implemented or -1 for error. Not meaningful if track is not an audio track."); int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_copy_permit get_track_copy_permit; %feature("autodoc", "get_copy_permit(cdio, track)->int Return copy protection status on a track. Is this meaningful not an audio track? "); track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio, track_t i_track); %feature("autodoc", "get_track_format(cdio, track)->format Get the format (audio, mode2, mode1) of track. "); const char *get_track_format(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_green is_track_green; %feature("autodoc", "is_track_green(cdio, track) -> bool Return True if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format?"); bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_last_lsn get_track_last_lsn; %feature("autodoc", "cdio_get_track_last_lsn(cdio, track)->lsn Return the ending LSN for track number track in cdio. CDIO_INVALID_LSN is returned on error."); lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_lba get_track_lba; %feature("autodoc", "cdio_get_track_lba Get the starting LBA for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @param p_cdio object to get information from @param i_track the track number we want the LSN for @return the starting LBA or CDIO_INVALID_LBA on error."); lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_lsn get_track_lsn; %feature("autodoc", "cdio_get_track_lsn (cdio, track)->int Return the starting LSN for track number. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track pycdio.CDROM_LEADOUT_TRACK or the total tracks+1. pycdio.INVALID_LSN is returned on error."); lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track); %feature("autodoc", "get_track_msf(cdio,track)->string Return the starting MSF (minutes/secs/frames) for track number track. Track numbers usually start at something greater than 0, usually 1. The 'leadout' track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @return string mm:ss:ff if all good, or string 'error' on error."); char *get_track_msf(const CdIo_t *p_cdio, track_t i_track); %inline %{ char *get_track_msf(const CdIo_t *p_cdio, track_t i_track) { msf_t msf; if (!cdio_get_track_msf( p_cdio, i_track, &msf )) { return NULL; } else { return cdio_msf_to_str( &msf ); } } %} %rename cdio_get_track_preemphasis get_track_preemphasis; %feature("autodoc", "cdio_get_track_preemphasis(cdio, track) Get linear preemphasis status on an audio track. This is not meaningful if not an audio track?"); track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio, track_t i_track); %rename cdio_get_track_sec_count get_track_sec_count; %feature("autodoc", "get_track_sec_count(cdio, track)->int Get the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. Track numbers usually start at something greater than 0, usually 1. 0 is returned if there is an error."); unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track); %inline %{ const char *get_track_format(const CdIo_t *p_cdio, track_t i_track) { track_format_t track_format = cdio_get_track_format(p_cdio, i_track); return track_format2str[track_format]; } %} pycdio-2.1.0/swig/types.swg0000664000175000017500000000326413530441774016157 0ustar rockyrocky00000000000000/* -*- c -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Various typedef's "constant"s/variables Many of these are documented more fully in libcdio's I'm not sure why, but including that directly will not allow SWIG to understand say that a lsn_t is an int. */ %include "inttypes.i" #ifdef NEED_LONG #define LONG long #else #define LONG #endif typedef unsigned int driver_id_t; typedef int lsn_t; typedef int lba_t; typedef unsigned int track_t; typedef long int driver_return_code_t; typedef long int ssize_t; %constant long int VERSION_NUM = LIBCDIO_VERSION_NUM; %constant long int INVALID_LBA = CDIO_INVALID_LBA; %constant long int INVALID_LSN = CDIO_INVALID_LSN; /* More documentation on the below is in cdio/sector.h */ %constant long int CD_FRAMESIZE = CDIO_CD_FRAMESIZE; %constant long int CD_FRAMESIZE_RAW = CDIO_CD_FRAMESIZE_RAW; %constant long int ISO_BLOCKSIZE = CDIO_CD_FRAMESIZE; %constant long int M2F2_SECTOR_SIZE = M2F2_SECTOR_SIZE; %constant long int M2RAW_SECTOR_SIZE = M2RAW_SECTOR_SIZE; pycdio-2.1.0/test/0000775000175000017500000000000013530476326014273 5ustar rockyrocky00000000000000pycdio-2.1.0/test/Makefile0000664000175000017500000000032313530441774015730 0ustar rockyrocky00000000000000#============================================================= # Whatever it is you want to do, it should be handled by the # by the main (parent) Makefile. So reissue make from there. all %: $(MAKE) -C .. $@ pycdio-2.1.0/test/cdda.bin0000664000175000017500000255324013530441774015672 0ustar rockyrocky00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   pycdio-2.1.0/test/cdda.cue0000664000175000017500000000026013530441774015661 0ustar rockyrocky00000000000000TITLE "Join us now we have the software" CATALOG 0000010271955 PERFORMER "Richard Stallman" FILE "BOING.BIN" BINARY TRACK 01 AUDIO FLAGS DCP INDEX 01 00:00:00 pycdio-2.1.0/test/cdda.toc0000664000175000017500000000045613530441774015701 0ustar rockyrocky00000000000000// // Language number should always start with 0 LANGUAGE 0 { // Required fields - at least all CD-TEXT CDs I've seen so far have them. TITLE "Join us now we have the software" PERFORMER "Richard Stallman" } CATALOG "0000010271955" CD_DA TRACK AUDIO COPY FILE "cdda.bin" 00:00:00 00:00:00 pycdio-2.1.0/test/cdtext.toc0000664000175000017500000000173613530441774016303 0ustar rockyrocky00000000000000CD_DA // global CD-TEXT data CD_TEXT { // Mapping from language number (0..7) used in 'LANGUAGE' statements // to language code. /// LANGUAGE_MAP { /// 0 : EN // 9 is the code for ENGLISH, /// // I don't know any other language code, yet /// } // Language number should always start with 0 LANGUAGE 0 { // Required fields - at least all CD-TEXT CDs I've seen so far have them. TITLE "CD Title" PERFORMER "Performer" DISC_ID "XY12345" UPC_EAN "" // usually empty // Further possible items, all of them are optional ARRANGER "" SONGWRITER "" MESSAGE "" GENRE "" // I'm not sure if this should be really ascii data } } TRACK AUDIO // track specific CD-TEXT data CD_TEXT { LANGUAGE 0 { // if an item is defined for one track it should be defined for all tracks TITLE "Track Title" PERFORMER "Performer" ISRC "US-XX1-98-01234" ARRANGER "" SONGWRITER "" MESSAGE "" } } SILENCE 1:0:0 pycdio-2.1.0/test/copying.iso0000664000175000017500000040000013530441774016450 0ustar rockyrocky00000000000000CD001LINUX CDROM @@ "j0  MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2006032706561400200603270656140000000000000000002006032706561400 CD001MKI Mon Mar 27 06:56:14 2006 mkisofs 1.15a40 .../isofs/"j0 "j0 ,HFFHj8 COPYING.;1 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pycdio-2.1.0/test/isofs-m1.bin0000664000175000017500000255324013530441774016435 0ustar rockyrocky00000000000000h+R5}&VA-.HDeCEC8kee¯C|6=v؅ugA5/evCgNu* ~TA(&`eCC+ z=Gh5=Ӹ&iA -9tD%evšCE(buN W]AgUTCeC$~ pG1+S}bV)[AT  &e5C ڇ!q\א2K?gA*~Au#͎e†CN[z Z}sA9~hje5_CD|S4J#d2VJbvަyA a3eC^|?:H/q d^AЈ{eCe0 BeByƋAn\ej¾CGSV=)Ȑdj1k$չ8A$Π2egCҡQ/X,t y` !@5A MI$eRCI$]Fo}ANcRey‹C"'}=CD001LINUX CDROM @@"g. MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2003042012291800200304201229180000000000000000002003042012291800 E)5_,HʼnZ\qօ$tY{Y{}b޶kJ}K2 Nq8=x/T ־MJZy]'=EtKK 3{/-?O91TThOahY\La:|GO$*qY*< ]Env9r*0M¡Bh` ~ԻBDfh1 3]l# MafCD001x բ U<[?m7Aw23KGqL-t$CwDxOv`"943MKI Sun Apr 20 12:29:18 2003 mkisofs 1.15a22 -R -o cdimage.raw /tmp/cdio-test dvrb~\ ,., " NJD4&66JBNF4\ZXBUFX;91?.'%"%!'#.-,!5vӯ#,0cYLEOLym e2an:([&+9O^uj3D et^\(C\ۺr<^iH,NuRDOC_xE67 <$Ar]f]leVNCZҡZrZ)w{W _OAG6xe\  <FhALi+[?r9KH}eCqj1p8HOu"j_b<yԾA[ 8e{CfBQʐe#g.SPRRPX$AATFg.g g.CEfg.RRPX$AATFg.g g.|HFFHf'5 COPYING.;1RRNM COPYINGPX$TFf'5g g pg 5DOCRRNMdocPX$AATFg 5g g 5ԡ [?hPs凈RC09J ɴMTj&f$~p;*iQk:QbrPh߸J%d7/$Cs&<&4i0;y&9n :`‡jvb_xϹ,(,Pl:\(?KzdhUJ!9j5~iƮe}X]&JV nкy2Ӵ3!4o9!6V_&>CM$fg 5RRPX$AATFg 5g g 5fg.RRPX$AATFg.g g.##g 5 README.TXT;1RRNMreadme.txtPX$TFg 5g g 5FU5kq> Q5'4qrCZ ɀlb,U&;BVLEgky8!Nn%窠),) !FS,bX"Riƛ4%R&Dᠩ۰sN}5 zcKg@E%vVlEo@Hp'3ڭ/UN4)}V,=p$´oo*.KM%&e>%ER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.47Q Ҙ5jKDɏMGi~v AN҂rĈiA K7+^{9>om}H4zz"2"Οv!4\"Jf71FI{Y̐2䖻2<_-y>aGpg&yN rI)e(]$ґC !i'GEwiOU)ʿX[K$gwMS_OO1P-; E 3M& GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for eacjxYu\k ~ %862L8Sn3IWpealqrX0-M  [CBWDdO01*mySU];o? #j2#>3&ÒMSIsPvt )Km3apO /5D`m81'y2VV@_ؐ>fG*K-E-a%çw% Q{995n;5Ҝ?Z`s_^9zE3T8jHQ3p@<'h author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuoua_xl3X8i$ ?8Lo^4c k)c\CƥxfQ\Y>x~S ̚D)]ΜP) ({o:ǧIz0k.*S loӐSv%ϨeDy`_'^IF{f8Q~L$$yX[H/mB~4jƃK',|NWm\r$$kNW\/jD ܩ 550"ڽaߋXyzaFZIP{tQ(sly and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute thJ?v77i֜:.sCȠ[ft)0^E {% `gu=;GU#g;aE5QQ9 cAT#6Ka%*AE&ƫ^ =qM6EWآq:wSKɁVO].Cڧܯ'4oq$%+v GvHU!F*NfpÑ7zP"G}թÓ߳8MHX B&)em as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executar|DL F$ J7lFK\kSۀx[Un(V cOJOu08WI^WCX^ܠ oHnJu(QxuC:/U b;ՊRƳJ0TifQL\cL\WݮX-nYWWBemҏʀĂ>zQ:M8शf<|qT"49dF|>>P0nPkjӮ!040mB0ble work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may n2 XQu҄.Fݱ 4 ;ڈ9v&b9W8:9h=Dfʫ=:mmR@t@Ua&]<}U;٪ +`y WA݀]W~cat+2[N.( yyFp݃Y!j!}I\A O\܉<3Ix0).'6*>E&J@m`32'c .^:`!o+V/j_4 )Q)QQ2LZ9t1+0K1ot impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents EM$W̖x 4  nUuπpx7;+,=ł(Ps;ӔKhn5/xYZd Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License alonvd> |1[i,QAtF5M ff$`iG []7 p&ո }8Lq3lڳPqZ .KWQ*ljf-/1/@9eZ5þrlbJ5O^XSr<(Q@nߘ+lOvY9(4j?"g~3f,&\jlj#7 ᕤ0 y*oO?k]}vn~^L:mZTƒuY4g with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. #.l$k e۫pK[x/W8,¢?`cai34D|VDLhK.'}i?w$DWĽgZ0hG*v) kI4Gb 0SN 2)aN3EWg{&忢MoM0[X7eRxJnKElqe;]WF8\4sAYMt뙘>&Ueu8+7'\5 5This library is to encapsulate CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependant properties of a CD-ROM can use this library. Some support for disk image types like BIN/CUE and NRG is available, so applications that use this library also have the ability to read disc images as though they were CD's. Immediate uses are VCDImager, a navigation-capable Video CD plugin and CD-DA plugin for the media player xine. A sample utility, cdinfo, is included which displayings CD info. If libcddb (http://libcddb.sourceforge.net) is available, the cdinfo program will display CDDB matches on CD-DA discs. @?8i?]T,՞Z1 XzkZ-,LAMN\MmdEu2Q^ṁܬQ4k*|G35OC a!U|AP^D?QyKk s4mIlO6MΔ6\G N1.>?]|nGV~OdxI; m[WX[~ϕ䍬AȨgW qʲu;npTm{2C=qf۱?ζD X;6$9zW.Aj|09"uaeC}]l1"E7:],mAKwa^OeeCKfIՐ18l|a صA-eµCzc{9`.Π+2A ;He$lCf{f3U@wD͙̼}#Ay\xe9eȨA4PpGdXseYCPNaΐgC1vSbA[)e2CjD:^/qDx> < oAH;eC9 MCEfy1AC UP+=eJC5˨5(F*&rb~jTLA1aqL;e¨Ce_^ZGDOz9=q.AjgϮ^e/qC}d0&$6H>[pB^h8|Af1pweCsȓU I>QBC|qA=h7pe C¦a[t RP.N`r 0E\ A0(+fe3UCRN$qmwQ=KcGzA=n*oeŒC꼀J1[KRn2J܇A]MeVCfaM~;Sb!1>MA%8e#CppT `m@AieCFQR|>BUzݜEfz3%A8'JeECj*vVs,dFt 2XA|e΃%e¹Cq9/;AeAWX:ُ,eAJHe@e `C7ˋ9Iѐ7X"Jf@DA)àWieC⪼MPyYg[/nȩq7{ζ^AA e CSNvkb1S`S@R' :AW^De"fC{|U%ax.X4]A9T!e¿C- JbsgOA^h? eGC-T?SF9c8kBH8!p{AӦۗsN{eC`x>sdS;I3M"vA<5e%C#װj~?Ae]6^FZ#lAseTCHsYwf1D/S "-bA[+RظeŠCj y7Cg_7AzE[be1SCw$vӐ4hQ&g ϱAؓ!xKeC‰+xiF4N\'5hA%f.e9C{*S`0PpY3%Av ('=yZe-wC/T1Jq^ F>/ AW朏>#?e®C[ w2arWyO\.wA#E.eHCl{YD̐fs$2*lV&~HdTA(~Zi eC 2X!h\.rt Xm-,6YAs;lJBe4Ch RuV@6_$%8rˏewT w0w P`#yӥ'\eewno:H wټ1vSeb[p)eew7j*:= w,T6t$eXPGdsevw uw7y=CU+=eCw]t(z= GwwN>ߜoH ;J\evwR Ou wOQ9.jkLCewp}r0ٌG wU*nr~TagL &e5we֡א 2w/>qB+^|2q +hpewh[ z w [ha,=f뒖je5_wUS d2 VwKcݧg10n*ew5*1[ w,.tr X\ +{ew$גwe w#qM]ejwZȐd w&2jJL1?MegwfMaX, twEza 駵sR-'6:sWYewh/|%g w"k<սmK{h%s{e{wJ`0xʐe w#);{MgRvئeTw܀SZ- ww$6^8zZFlWܧJeawGs4Y Ew%LSY;Mvvi< 5ehw/ w&&7EH[ew whvX w'ny: -+Ze w7  0w(40<\(hg3ewi*( w)Q&!F%xVe+}wԷ Tw0 >(=#"e3wH0[w w193.%" =GewI w22*V~Ud_Tz(E~Z etw2Xh? w35W1O"_Sjb[#eEwjl!D vw4o^XTޛ0Pmepwh9zx< Dw5P S&Y;?l*BegwRVt w6 $88Ur:aewGP:E w7rsi^^Rq}mew-{}Ր 1w8b Gc_գ-ew`^{ w9.͡E/}5h11VHe$lwI0IJrf3 Uw@vNa}.uxeg=!5C"/@eYwΐg wCgu=έ>ke2w#^/ qwDhx= <;-%eweEo CwEb &9n`eJw+ wF+ң}kV[$ O ;ew@8!\Z wG NBz`W=@Tg然^e/qwGɲ~p$ 6wHZZ5p_8j~hhwew|J wI?g@A~Wuا#/e w#7N RwP/`Eqd0^i :0fe3Uw0  wQYJ*~Ty(;aw3ew^?-ŧK wR#1$)8n2geVw 7/; wS{ yb1Š\ e#wV pwTo NWʁRew'@6=|> BwUhf"y3<5- IƴeEwEI] v wVr:duN2Gt.}%ewgȏA wW<H_D9x.yv@e `w֫4*ѐ 7wXF?A~+<Oiew*y wYfnd7C#}6  e wpA5b1 Sw`ħ@,QI ÕS6_FLDe"fw_X-  wa~7Y_nOٟ !ew6߮mJ wbJ K[eceGw̺cX}9 wc\jbB9!.j 8Vew}cBQ swdR2#Mwe%wOuhHo~? Awe97uFKY#rnܮ!wM-eTw!Cw wf!DRc" /BNlewZxgC wgUD-6媈oLbe1Sw:èCӐ 4wha"%fDD,49Kewv1 Kx wiN 2'y*~`.e9w^-g`0 PwpU'Gco"va;Ze-ww:@Vf wqb=0^GP/z`BdL&?ewTm0a wrV\n.!Fv6eHw]-)I̐f ws@3U'f:M8qewߍ¯\. rwt sX,,uf^¼t^мe4w-Z"v @wUoe@:7GQ qzRNraF]bee@٧)_!OHGQu|aiܦ,@!Mee@ry$=GQ+}2ViB Me@v6B\$GuQ߂9|9K.rjePe@C}z=GGQN\4K> nev@q=p6uGQI7Y nٗ- ,Ce@eY+GGQl,tXS3܅&e@5_ ^TbcאG2Q8S:Hm,pZR meNe@)@I>zGQ ]@6Zl{c-"je5@_;dѦ1d2GVQM_tkX=e@w*(iGQ(?xL8*P_oz{e@ȧLPEeGQMQG]jej@8;ȐdGQ7(Y8,xnPfV2y-:e@g~)|CX,GtQXp' :]EH5Čte@RWGFQRߊRaNG˒ey@]^wloGQ=k>0G zBl% []e@{YGQpu Gcgy8e@$iq |W"G3Q asC©B9e@KVGQJ +CTte:@N.pK.GWQ Bƺ[Q'VXkd$ jRB Ye@3ghgGQ"mbV<Ĭ.cEe{@xI9ʐeGQ#30 U f%6[e@TeH{Z-GwQ$081P`k6}ye@aBB/GEQ%uU=!=/ eh@k捤WGQ& pW`@@e@Χo+m<)XGQ'W:?!}*.$e @"D"D G0Q(-0wTnZ 0eJN:43e@3nGQ)W,eîunsFVe+@}FGTQ0H  c{xl"e@3j7lGQ1.aru\)G+Ge@g wIGQ24h\L'hЃ-{;2et@ECZ?GQ3 Q"I *Z|e@Et3dvGvQ4i "fDPPݚe@p0HxkvdeY@/ƉsΐgGQC^F W,jUe@24- ^/GqQD;x7M<IvV%e@]_GCQE;M%vKۘ(QeJ@ާJ3C&.'GQF-Fw- Z6s; A4;e@h:LnZGQGH#z+؀e=2 FRbB^e/@qlO4B$G6QHc\p48ƸaIfVwe@§ d QGQI9l Krш埰e @ 2fGRQP)s2`{V0Rd^|$fe3@U-(ƪ;GQQ`LW8ۮlԧ e@F4KGQRSh;٦37eV@;l;GQSBÜbƔX1%8Y]C"e@#g1GpQT1S<qcb([+{K 1le@j?ȴ@|>GBQU'ڡqfis3N_z %veE@ϧQll8#vGQVtd3|25"fC%e@ݱSAGQW3 "i 0k!@e @`HC 1+ѐG7QX~ kxLO!ie@ӧ4+yGQY`fn/-76Jsxp̸ e@ ,h5Zyb1GSQ`n)@g[{ RiΙrDe"@f@;uGGQaGLSbYf!e@p.Nv?JGQb N;@`G}]eG@ɧRRڿTO9GQcelއB!ء=K4e@.Y,cGsQdT,t?XXNGe@%WYUSx]~?GAQe1jFSپ#beSr 2eT@79YnqwGQf DȼQ"{#q#*Ue@0|kCGQg"fD%_8z퐂W<be1@SvӐG4QhXe/ yAjKe@qnI9yxGQiɋ{NF' /q^.e@9rAU`0GPQpʛdC+}4'_Ze-@wP"q}X.GQq[^b/tI3?e@L. aGQrPD{\%̍.͠T*eH@ا{RK̐fGQsy5_a"j<~e@r@3\.GrQt &Xj,L11c2`e@45gG@Q?O*_,zze6)$D0P4mp1SbK,[Ap_ Eee6)jJ֟|H4ށ ,~jUUee6)HƢ-=4O`3k",,ev6)P%؍u4И8%k,VeC6)3&z=G4*s~7T,^И2%ev6)-]'u4H#Xe/F,;bBCe6)O>BG4-SFwZ, 4&e56):nא24r9$KlrH,OaS}e6)k z4 \84۸u,nf:Vje5_6)d۶Qd2V4LW=ݘK,f% e6)JF4q);2{MVRvd,l$b{e6)(P+;e4‡[ %,R8YCr"ej6)٤g1Ȑd4S;-6,s37G5eg6)hÄX,t4qs& S, {% eR6) Ql0#ɍF46yZ܋<lc(,+K ley6)? 4ɺ3F"i,W ǂkå]e6)1ԇY4tY<| (貣,vة*C8e$6)/'׬"34n`.r-\6,sLxZe6)hP5,Z4~߂ a,xjO!te:N6)K+ƍW4 ǧLTSq,bS[j{LR,1iY|rYe6)@e;ʐg4"l<21,K]e{6)5̸^Ycʐe4#t  ; ,@4`}C]eT6)JReOZ-w4$1j8Sb,SNr2ea6)9ѵqȍE4%Td3",4Xeh6)PW=YS]4&ԡaY_,z#0ֵ<e6)r~X4'3D:UQf#,qUe 6)õ0E| 04(I30ۀU f,%y/pq,^3e6)eU4)eu/[, AkVe+}6)nyǍT40 pbe,IE3t"e36)7LP41J,ްt+X},t'3Ge6)"Jqk}.I425_"j%<,8׫#et6)̦?43hP {"Р,dTd*eE6)eRٍv44h%,c(dep6)p[pXx,r{e6)MiȬc4B|>KiG,cBZMeY6)6$ΐg4C:=N|Gatz,B,!e26)rb^/q4D\xO4L<Ӄ,յe>ne6)=r6ʍC4E__9Kr,PIeJ6)I4F,)t,X3,f7Y;e6) T͜Z4G}Izہ =,GƲ ,^e/q6)8e:+$64H]6p Z8l,Rcw-we6)Mdn4I8SH1p-, ߮Ne 6)\U@>ōR4P(`x807P,KBofe3U6)̜̯E4QM 9.,jt_ke6)}b*iK4R(8xsSP,Vˋ:eV6)_~|\;4S&7MbjY1Ln,]2ce#6)Mgۍp4TҾkRRa,NNH/G)e6)w|>B4UCUfp3],oEnteE6)::v4Vud 22,g%y~%e6)i| WA4Wauk0 ,l 9[@e `6)G{ѐ74X- 6C,~ie6)|b.Ky4YanC7 9,_N9 e 6)ܐb1S4`Ú@X y), RDe"f6) g4a# eFQ',ju,nJTFKe6)W.x4iNꃌn'G ,e:֠.e96)!`0P4paﳭA)=,!aZe-w6)γ4q?^A /~,Gx?e6)xjla4rQ\.}I,eH6)"tv̐f4s4 '\`L:h@,*{@2e6)W'CZ\.r4t GX&k,,$Pi x|e46)ҬIdˍ@4S :,aV5ee>KɓIs.i[r\Xhree>٘{1/eH؛pycdio-2.1.0/test/isofs-m1.cue0000664000175000017500000000011213530441774016420 0ustar rockyrocky00000000000000FILE "ISOFS-M1.BIN" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 pycdio-2.1.0/test/test-cdio.py0000775000175000017500000002405313530441774016546 0ustar rockyrocky00000000000000#!/usr/bin/env python # Copyright (C) 2015, 2018 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Unit test for cdio Note: for compatibility with old unittest 1.46 we won't use assertTrue or assertFalse.""" import unittest, sys, os import os.path as osp testdir = osp.realpath(osp.dirname(__file__)) libdir = osp.realpath(osp.join(testdir, '..')) if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio class CdioTests(unittest.TestCase): def test_ops(self): """Test running miscellaneous operations No assumption about the CD-ROM drives is made, so we're just going to run operations and see that they don't crash.""" self.device = cdio.Device() # FIXME: Broken on Darwin? # self.device.open() self.device.have_ATAPI() # FIXME: Broken on Darwin? # self.device.get_media_changed() self.assertEqual(True, True, "Test misc operations") return def test_device_default(self): """Test getting default device""" result1=cdio.get_default_device_driver(pycdio.DRIVER_DEVICE) result2=cdio.get_default_device_driver() self.assertEqual(result1, result2, "get_default_device with/out parameters") self.device = cdio.Device() result2=pycdio.get_device() if result1 is not None: self.assertEqual(result1[0], result2) # Now try getting device using driver that we got back try: device=cdio.Device(driver_id=result1[1]) result1 = device.get_device() self.assertEqual(result1, result2, "get_default_device using driver name") except: pass return def test_exceptions(self): """Test that various routines raise proper exceptions""" self.device = cdio.Device() # No CD or or CD image has been set yet. So these fail try: lsn = self.device.get_disc_last_lsn() except IOError: self.assertEqual(True, True, "get_last_lsn() IO Error") except cdio.DriverError: self.assertEqual(True, True, "get_last_lsn() DriverError") else: self.assertTrue(False, "get_last_lsn() should raise error") self.assertRaises(IOError, self.device.get_disc_mode) try: track = self.device.get_num_tracks() except IOError: self.assertEqual(True, True, "get_num_tracks() IO Error") except cdio.DriverError: self.assertEqual(True, True, "get_num_tracks() DriverError") except cdio.TrackError: self.assertEqual(True, True, "get_num_tracks() TrackError") else: self.assertTrue(False, "get_last_lsn() should raise error") self.assertRaises(IOError, self.device.get_driver_name) self.assertRaises(cdio.DriverUninitError, self.device.get_media_changed) self.assertRaises(IOError, self.device.open, "***Invalid device***") return def test_have_image_drivers(self): """Test that we have image drivers""" result = cdio.have_driver('CDRDAO') self.assertEqual(True, result, "Have cdrdrao driver via string") result = cdio.have_driver(pycdio.DRIVER_CDRDAO) self.assertEqual(True, result, "Have cdrdrao driver via driver_id") result = cdio.have_driver('NRG') self.assertEqual(True, result, "Have NRG driver via string") result = cdio.have_driver(pycdio.DRIVER_NRG) self.assertEqual(True, result, "Have NRG driver via driver_id") result = cdio.have_driver('BIN/CUE') self.assertEqual(True, result, "Have BIN/CUE driver via string") result = cdio.have_driver(pycdio.DRIVER_BINCUE) self.assertEqual(True, result, "Have BIN/CUE driver via driver_id") return def test_tocfile(self): """Test functioning of cdrdao image routines""" ## TOC reading needs to be done in the directory where the ## TOC/BIN files reside. olddir=os.getcwd() os.chdir(testdir) tocfile=os.path.join(testdir, "cdda.toc") device = cdio.Device(tocfile, pycdio.DRIVER_CDRDAO) ok, vendor, model, revision = device.get_hwinfo() self.assertEqual(True, ok, "get_hwinfo ok") self.assertEqual('libcdio', vendor, "get_hwinfo vendor") self.assertEqual('cdrdao', model, "get_hwinfo cdrdao") # Test known values of various access parameters: # access mode, driver name via string and via driver_id # and cue name result = device.get_arg("access-mode") self.assertEqual(result, 'image', 'get_arg("access_mode")',) result = device.get_driver_name() self.assertEqual(result, 'CDRDAO', 'get_driver_name') result = device.get_driver_id() self.assertEqual(result, pycdio.DRIVER_CDRDAO, 'get_driver_id') result = device.get_arg("source") self.assertEqual(result, tocfile, 'get_arg("source")') result = device.get_media_changed() self.assertEqual(False, result, "tocfile: get_media_changed") # Test getting is_tocfile result = cdio.is_tocfile(tocfile) self.assertEqual(True, result, "is_tocfile(tocfile)") result = cdio.is_nrg(tocfile) self.assertEqual(False, result, "is_nrgfile(tocfile)") result = cdio.is_device(tocfile) self.assertEqual(False, result, "is_device(tocfile)") self.assertRaises(cdio.DriverUnsupportedError, device.set_blocksize, 2048) self.assertRaises(cdio.DriverUnsupportedError, device.set_speed, 5) device.close() os.chdir(olddir) return def test_read(self): """Test functioning of read routines""" global testdir cuefile=os.path.join(testdir, "isofs-m1.cue") device = cdio.Device(source=cuefile) # Read the ISO Primary Volume descriptor blocks, data=device.read_sectors(16, pycdio.READ_MODE_M1F1) self.assertEqual(data[1:6], 'CD001') self.assertEqual(blocks, 1) blocks, data=device.read_data_blocks(26) self.assertEqual(data[6:32], 'GNU GENERAL PUBLIC LICENSE') return def test_bincue(self): """Test functioning of BIN/CUE image routines""" cuefile=os.path.join(testdir, "cdda.cue") device = cdio.Device(source=cuefile) # Test known values of various access parameters: # access mode, driver name via string and via driver_id # and cue name result = device.get_arg("access-mode") self.assertEqual(result, 'image', 'get_arg("access_mode")',) result = device.get_driver_name() self.assertEqual(result, 'BIN/CUE', 'get_driver_name') result = device.get_driver_id() self.assertEqual(result, pycdio.DRIVER_BINCUE, 'get_driver_id') result = device.get_arg("cue") self.assertEqual(result, cuefile, 'get_arg("cue")') # Test getting is_binfile and is_cuefile binfile = cdio.is_cuefile(cuefile) self.assertEqual(True, binfile != None, "is_cuefile(cuefile)") cuefile2 = cdio.is_binfile(binfile) # Could check that cuefile2 == cuefile, but some OS's may # change the case of files self.assertEqual(True, cuefile2 != None, "is_cuefile(binfile)") result = cdio.is_tocfile(cuefile) self.assertEqual(False, result, "is_tocfile(tocfile)") ok, vendor, model, revision = device.get_hwinfo() self.assertEqual(True, ok, "get_hwinfo ok") self.assertEqual('libcdio', vendor, "get_hwinfo vendor") self.assertEqual('CDRWIN', model, "get_hwinfo model") result = cdio.is_device(cuefile) self.assertEqual(False, result, "is_device(tocfile)") result = device.get_media_changed() self.assertEqual(False, result, "binfile: get_media_changed") # There's a bug in libcdio 0.76 that causes these to crash self.assertRaises(cdio.DriverUnsupportedError, device.set_blocksize, 2048) self.assertRaises(cdio.DriverUnsupportedError, device.set_speed, 5) device.close() return def test_cdda(self): """Test functioning CD-DA""" global testdir device = cdio.Device() cuefile=os.path.join(testdir, "cdda.cue") device.open(cuefile) result = device.get_disc_mode() self.assertEqual(result, 'CD-DA', 'get_disc_mode') self.assertEqual(device.get_mcn(), '0000010271955', 'get_mcn') self.assertRaises(cdio.DriverUnsupportedError, device.get_last_session) # self.assertRaises(IOError, device.get_joliet_level) result = device.get_num_tracks() self.assertEqual(result, 1, 'get_num_tracks') disc_last_lsn = device.get_disc_last_lsn() self.assertEqual(disc_last_lsn, 302, 'get_disc_last_lsn') t=device.get_last_track() self.assertEqual(t.track, 1, 'get_last_track') self.assertEqual(t.get_last_lsn(), 301, '(track) get_last_lsn') self.assertEqual(device.get_track_for_lsn(t.get_last_lsn()).track, t.track) t=device.get_first_track() self.assertEqual(t.track, 1, 'get_first_track') self.assertEqual(t.get_format(), 'audio', 'get_track_format') device.close() return if __name__ == "__main__": unittest.main() pycdio-2.1.0/test/test-cdtext.py0000664000175000017500000000530613530441774017120 0ustar rockyrocky00000000000000#!/usr/bin/env python # Copyright (C) 2015 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Unit test for cdtext.""" import unittest, sys, os libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import cdio class CDTextTests(unittest.TestCase): def test_keyword(self): """Test keywords""" if pycdio.VERSION_NUM > 83: self.assertEquals(pycdio.cdtext_field2str( pycdio.CDTEXT_FIELD_PERFORMER), "PERFORMER") else: self.assertEquals(pycdio.cdtext_field2str(pycdio.CDTEXT_PERFORMER), "PERFORMER") def test_get_set(self): """Test getting and setting CDText""" tocpath = os.path.join(os.path.dirname(__file__), "cdtext.toc") device = cdio.Device(tocpath, pycdio.DRIVER_CDRDAO) if pycdio.VERSION_NUM > 83: text = device.get_cdtext() self.assertEquals(text.get(pycdio.CDTEXT_FIELD_PERFORMER, 0), 'Performer') self.assertEquals(text.get(pycdio.CDTEXT_FIELD_TITLE, 0), 'CD Title') self.assertEquals(text.get(pycdio.CDTEXT_FIELD_DISCID, 0), 'XY12345') self.assertEquals(text.get(pycdio.CDTEXT_FIELD_PERFORMER, 1), 'Performer') self.assertEquals(text.get(pycdio.CDTEXT_FIELD_TITLE, 1), 'Track Title') else: disctext = device.get_track(0).get_cdtext() self.assertEquals(disctext.get(pycdio.CDTEXT_PERFORMER), 'Performer') self.assertEquals(disctext.get(pycdio.CDTEXT_TITLE), 'CD Title') self.assertEquals(disctext.get(pycdio.CDTEXT_DISCID), 'XY12345') track1text = device.get_track(1).get_cdtext() self.assertEquals(track1text.get(pycdio.CDTEXT_PERFORMER), 'Performer') self.assertEquals(track1text.get(pycdio.CDTEXT_TITLE), 'Track Title') track1text.set(pycdio.CDTEXT_PERFORMER, 'Someone') self.assertEquals(track1text.get(pycdio.CDTEXT_PERFORMER), 'Someone') if __name__ == "__main__": unittest.main() pycdio-2.1.0/test/test-iso.py0000775000175000017500000001457113530441774016426 0ustar rockyrocky00000000000000#!/usr/bin/env python # Copyright (C) 2015 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Unit test for iso9660 Test some low-level ISO9660 routines This is basically the same thing as libcdio's testiso9660.c""" import unittest, sys, os libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep testdir = os.path.dirname(__file__) sys.path.insert(0, libdir) import pyiso9660 import iso9660 def is_eq(a, b): if len(a) != len(b): return False for i in range(len(a)): if a[i] != b[i]: print("position %d: %d != %d\n" % (i, a[i], b[i])) return False return True achars = ('!', '"', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '?', '<', '=', '>') class ISO9660Tests(unittest.TestCase): def test_chars(self): """Test ACHAR and DCHAR""" bad = 0 c=ord('A') while c<=ord('Z'): if not pyiso9660.is_dchar(c): print("Failed iso9660_is_achar test on %c" % c) bad += 1 if not pyiso9660.is_achar(c): print("Failed iso9660_is_achar test on %c" % c) bad += 1 c += 1 self.assertEqual(True, bad==0, 'is_dchar & is_achar A..Z') bad=0 c=ord('0') while c<=ord('9'): if not pyiso9660.is_dchar(c): print("Failed iso9660_is_dchar test on %c" % c) bad += 1 if not pyiso9660.is_achar(c): print("Failed iso9660_is_achar test on %c" % c) bad += 1 c += 1 self.assertEqual(True, bad==0, 'is_dchar & is_achar 0..9') bad=0 i=0 while i<=13: c=ord(achars[i]) if pyiso9660.is_dchar(c): print("Should not pass is_dchar test on %c" % c) bad += 1 if not pyiso9660.is_achar(c): print("Failed is_achar test on symbol %c" % c) bad += 1 i += 1 self.assertEqual(True, bad==0, 'is_dchar & is_achar symbols') def test_strncpy_pad(self): """Test pyiso9660.strncpy_pad""" dst = pyiso9660.strncpy_pad("1_3", 5, pyiso9660.DCHARS) self.assertEqual(dst, "1_3 ", "strncpy_pad DCHARS") dst = pyiso9660.strncpy_pad("ABC!123", 2, pyiso9660.ACHARS) self.assertEqual(dst, "AB", "strncpy_pad ACHARS truncation") def test_dirname(self): """Test pyiso9660.dirname_valid_p""" self.assertEqual(False, pyiso9660.dirname_valid_p("/NOGOOD"), "dirname_valid_p - /NOGOOD is no good.") self.assertEqual(False, pyiso9660.dirname_valid_p("LONGDIRECTORY/NOGOOD"), "pyiso9660.dirname_valid_p - too long directory") self.assertEqual(True, pyiso9660.dirname_valid_p("OKAY/DIR"), "dirname_valid_p - OKAY/DIR should pass ") self.assertEqual(False, pyiso9660.dirname_valid_p("OKAY/FILE.EXT"), "pyiso9660.dirname_valid_p - OKAY/FILENAME.EXT") def test_image_info(self): """Test retrieving image information""" # The test ISO 9660 image image_fname=os.path.join(testdir, "copying.iso") iso = iso9660.ISO9660.IFS(source=image_fname) self.assertNotEqual(iso, None, "Opening %s" % image_fname) self.assertEqual(iso.get_application_id(), "MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING", "get_application_id()") self.assertEqual(iso.get_system_id(), "LINUX", "get_system_id() eq 'LINUX'") self.assertEqual(iso.get_volume_id(), "CDROM", "get_volume_id() eq 'CDROM'") file_stats = iso.readdir('/') okay_stats = [ ['.', 23, 2048, 1, 2], ['..', 23, 2048, 1, 2], ['COPYING.;1', 24, 17992, 9, 1] ] self.assertEqual(file_stats, okay_stats, "file stat info") def test_pathname_valid(self): """Test pyiso9660.pathname_valid_p""" self.assertEqual(True, pyiso9660.pathname_valid_p("OKAY/FILE.EXT"), "pyiso9660.dirname_valid_p - OKAY/FILE.EXT ") self.assertEqual(False, pyiso9660.pathname_valid_p("OKAY/FILENAMELONG.EXT"), 'invalid pathname, long basename') self.assertEqual(False, pyiso9660.pathname_valid_p("OKAY/FILE.LONGEXT"), "pathname_valid_p - long extension" ) dst = pyiso9660.pathname_isofy("this/file.ext", 1) self.assertNotEqual(dst, "this/file.ext1", "iso9660_pathname_isofy") def test_time(self): """Test time""" import time tm = time.localtime(0) dtime = pyiso9660.set_dtime(tm[0], tm[1], tm[2], tm[3], tm[4], tm[5]) new_tm = pyiso9660.get_dtime(dtime, True) ### FIXME Don't know why the discrepancy, but there is an hour ### difference, perhaps daylight savings time. ### Versions before 0.77 have other bugs. if new_tm is not None: # if pyiso9660.VERSION_NUM < 77: new_tm[3] = tm[3] new_tm[3] = tm[3] self.assertEqual(True, is_eq(new_tm, tm), 'get_dtime(set_dtime())') else: self.assertEqual(True, False, 'get_dtime is None') # if pyiso9660.VERSION_NUM >= 77: # tm = time.gmtime(0) # ltime = pyiso9660.set_ltime(tm[0], tm[1], tm[2], tm[3], tm[4], # tm[5]) # new_tm = pyiso9660.get_ltime(ltime) # self.assertEqual(True, is_eq(new_tm, tm), # 'get_ltime(set_ltime())') return if __name__ == "__main__": unittest.main() pycdio-2.1.0/test/test-isocopy.py0000775000175000017500000005032713530441774017320 0ustar rockyrocky00000000000000#!/usr/bin/env python # Copyright (C) 2015 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Unit test of iso9660 file extraction.""" import unittest, sys, os libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) import pycdio import iso9660 # Python has rounding (round) and truncation (int), but what about an # integer ceiling function? Until I learn what it is... def ceil(x): return int(round(x+0.5)) # The test CD image CD_IMAGE_PATH =os.path.join(libdir, 'data') cd_image_fname=os.path.join(CD_IMAGE_PATH, "isofs-m1.cue") class ISO9660Tests(unittest.TestCase): def test_fs(self): cd = iso9660.ISO9660.FS(source=cd_image_fname) self.assertEqual(True, cd is not None, "Open CD image %s" % cd_image_fname) statbuf = cd.stat (os.path.join('/copying')) if None == statbuf: statbuf = cd.stat('/COPYING') expected_fn = 'COPYING' else: expected_fn = 'COPYING.;1' pass good_stat = { 'LSN': 26, 'filename': expected_fn, 'is_dir': False, 'sec_size': 9, 'size' :17992 } self.assertEqual(good_stat, statbuf, 'CD 9660 file stats') # Get file buf_all =[] blocks = ceil(statbuf['size'] / pycdio.ISO_BLOCKSIZE) for i in range(blocks): lsn = statbuf['LSN'] + i size, buf = cd.read_data_blocks(lsn) self.assertEqual( True, size >= 0, "Error reading ISO 9660 file %d" % lsn ) buf_all.append(buf) length=statbuf['size']; test_file_contents=''.join(buf_all)[0:length-1] global file_contents self.assertEqual(test_file_contents, file_contents, 'File contents comparison') statbuf = cd.stat("/notthere") self.assertEqual(None, statbuf, 'stat() for non-existent file') cd.close() file_contents=""" GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.""" if __name__ == "__main__": unittest.main()