pycdio
Advanced tools
Sorry, the diff of this file is not supported yet
+674
| GNU GENERAL PUBLIC LICENSE | ||
| Version 3, 29 June 2007 | ||
| Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
| 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. | ||
| <one line to give the program's name and a brief idea of what it does.> | ||
| Copyright (C) <year> <name of author> | ||
| 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 <http://www.gnu.org/licenses/>. | ||
| 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: | ||
| <program> Copyright (C) <year> <name of author> | ||
| 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 | ||
| <http://www.gnu.org/licenses/>. | ||
| 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 | ||
| <http://www.gnu.org/philosophy/why-not-lgpl.html>. |
+50
| # 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 | ||
| all: build | ||
| #: Run all tests | ||
| check: build | ||
| nosetests | ||
| #: Remove OS- and platform-specific derived files. | ||
| clean: | ||
| $(PYTHON) ./setup.py clean --all | ||
| #: 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) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| # 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 .. $@ |
+2
| Benjamin Eltzner - Debian packaging | ||
| Adrian Reber - Fedora packaging |
+3
-4
@@ -1,2 +0,2 @@ | ||
| # Copyright (C) 2006, 2008, 2009 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2009, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -19,7 +19,6 @@ # This program is free software: you can redistribute it and/or modify | ||
| numversion = (0, 17) | ||
| version = '.'.join([str(num) for num in numversion]) | ||
| version = '0.19' | ||
| license = 'GPL' | ||
| copyright = '''Copyright (C) 2006, 2008, 2009, 2010 Rocky Bernstein <rocky@gnu.org>.''' | ||
| copyright = '''Copyright (C) 2006, 2008, 2009, 2010, 2013 Rocky Bernstein <rocky@gnu.org>.''' | ||
@@ -26,0 +25,0 @@ short_desc = 'Python OO interface to libcdio (CD Input and Control library)' |
+45
-24
@@ -1,2 +0,2 @@ | ||
| # Copyright (C) 2006, 2008, 2009 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008-2009, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -21,2 +21,3 @@ # This program is free software: you can redistribute it and/or modify | ||
| import pycdio | ||
| import _pycdio | ||
| import types | ||
@@ -37,2 +38,8 @@ | ||
| 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 | ||
@@ -63,3 +70,3 @@ # Note: the keys below match those the names returned by | ||
| for name in drivers.keys(): | ||
| for name in list(drivers.keys()): | ||
| drivers[name.lower()] = drivers[name] | ||
@@ -116,3 +123,3 @@ | ||
| if type(result) == type([1,2]): | ||
| return result | ||
| return result | ||
| return None | ||
@@ -127,3 +134,3 @@ | ||
| result = pycdio.get_devices(driver_id) | ||
| if type(result) == types.StringType: | ||
| if type(result) == bytes: | ||
| return [result] | ||
@@ -184,5 +191,5 @@ else: | ||
| """ | ||
| if type(driver_id)==types.IntType: | ||
| if type(driver_id)==int: | ||
| return pycdio.have_driver(driver_id) | ||
| elif type(driver_id)==types.StringType and driver_id in drivers: | ||
| elif type(driver_id)==bytes and driver_id in drivers: | ||
| ret = pycdio.have_driver(drivers[driver_id]) | ||
@@ -387,3 +394,3 @@ if ret == 0: return False | ||
| else: | ||
| print "***No object to close" | ||
| print("***No object to close") | ||
| self.cd=None | ||
@@ -413,2 +420,6 @@ | ||
| if pycdio.VERSION_NUM > 83: | ||
| def get_cdtext(self): | ||
| return CDText(pycdio.get_cdtext(self.cd)) | ||
| def get_device(self): | ||
@@ -733,3 +744,3 @@ """get_device(self)->str | ||
| if type(track_num) != types.IntType: | ||
| if type(track_num) != int: | ||
| raise TrackError('track number parameter is not an integer') | ||
@@ -740,3 +751,3 @@ self.track = track_num | ||
| # a device object. | ||
| if type(device) == types.StringType: | ||
| if type(device) == bytes: | ||
| self.device = Device(device) | ||
@@ -850,3 +861,3 @@ else: | ||
| else: | ||
| raise TrackError('Invalid return value %d' % d) | ||
| raise TrackError('Invalid return value %d' % rc) | ||
@@ -888,4 +899,5 @@ def get_track_sec_count(self): | ||
| def get_cdtext(self): | ||
| return CDText(pycdio.get_cdtext(self.device, self.track)) | ||
| if pycdio.VERSION_NUM <= 83: | ||
| def get_cdtext(self): | ||
| return CDText(pycdio.get_cdtext(self.device, self.track)) | ||
@@ -896,19 +908,28 @@ class CDText: | ||
| def get(self, key): | ||
| """ | ||
| get(self, key)->string | ||
| 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) | ||
| Get the value associatied with key. | ||
| """ | ||
| return pycdio.cdtext_get(key, self._cdtext) | ||
| def set(self, key, string): | ||
| """ | ||
| set(self, key, string)->None | ||
| def set(self, key, string): | ||
| """ | ||
| set(self, key, string)->None | ||
| Set the value associatied with key. | ||
| """ | ||
| return pycdio.cdtext_set(key, string, self._cdtext) | ||
| 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) | ||
| # | ||
@@ -915,0 +936,0 @@ # Local variables: |
+18
-13
@@ -6,3 +6,3 @@ #!/usr/bin/env python | ||
| # | ||
| # Copyright (C) 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2010, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -60,4 +60,4 @@ # This program is free software: you can redistribute it and/or modify | ||
| if opts.mode is None: | ||
| print "Mode option must given via --mode" + \ | ||
| "(and one of audio, m1f1, m1f2, m1f2 or m1f2)." | ||
| print("Mode option must given via --mode " + \ | ||
| "and one of: audio, m1f1, m1f2, m1f2 or m1f2.") | ||
| sys.exit(1) | ||
@@ -67,4 +67,4 @@ try: | ||
| except KeyError: | ||
| print "Need to use the --mode option with one of" + \ | ||
| "audio, m1f1, m1f2, m1f2 or m1f2" | ||
| print("Need to use the --mode option with one of" + \ | ||
| "audio, m1f1, m1f2, m1f2 or m1f2") | ||
| sys.exit(2) | ||
@@ -83,9 +83,11 @@ | ||
| i = 0 | ||
| s = '' | ||
| while i < len(buffer): | ||
| if (i % 16) == 0: | ||
| print ("0x%04x: " % i), | ||
| print "%02x%02x" % (ord(buffer[i]), ord(buffer[i+1])), | ||
| s += ("0x%04x: " % i) | ||
| pass | ||
| s += ("%02x%02x " % (ord(buffer[i]), ord(buffer[i+1]))) | ||
| if (i % 16) == 14: | ||
| if not just_hex: | ||
| s = " " | ||
| s += " " | ||
| for j in range(i-14, i+2): | ||
@@ -96,6 +98,9 @@ if isprint(buffer[j]): | ||
| s += '.' | ||
| print s, | ||
| pass | ||
| pass | ||
| print(s) | ||
| s = '' | ||
| i += 2 | ||
| pass | ||
| print('') | ||
| return | ||
@@ -111,3 +116,3 @@ | ||
| except IOError: | ||
| print "Problem opening CD-ROM: %s" % argv[0] | ||
| print("Problem opening CD-ROM: %s" % argv[0]) | ||
| sys.exit(1) | ||
@@ -118,3 +123,3 @@ else: | ||
| except IOError: | ||
| print "Problem finding a CD-ROM" | ||
| print("Problem finding a CD-ROM") | ||
| sys.exit(1) | ||
@@ -121,0 +126,0 @@ |
+38
-13
| #!/usr/bin/env python | ||
| """Program to show cdtext, similar to examples/cdtext.c""" | ||
| # | ||
| # Copyright (C) 2006, 2008, 2009 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2009, 2012 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -27,13 +27,33 @@ # This program is free software: you can redistribute it and/or modify | ||
| def print_cdtext_track_info(device, track, message): | ||
| print message | ||
| def print_cdtext_track_info_old(device, track, message): | ||
| print(message) | ||
| t = device.get_track(track) | ||
| cdt = t.get_cdtext() | ||
| for i in range(0, pycdio.MAX_CDTEXT_FIELDS): | ||
| 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) | ||
| 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:]: | ||
@@ -44,3 +64,3 @@ try: | ||
| except IOError: | ||
| print "Problem opening CD-ROM: %s" % drive_name | ||
| print("Problem opening CD-ROM: %s" % drive_name) | ||
| sys.exit(1) | ||
@@ -52,10 +72,15 @@ else: | ||
| except IOError: | ||
| print "Problem finding a CD-ROM" | ||
| print("Problem finding a CD-ROM") | ||
| sys.exit(1) | ||
| i_tracks = d.get_num_tracks() | ||
| i_first_track = pycdio.get_first_track_num(d.cd) | ||
| print_cdtext_track_info(d, 0, 'CD-Text for Disc:') | ||
| for i in range(i_first_track, i_tracks + i_first_track): | ||
| print_cdtext_track_info(d, i, 'CD-Text for Track %d:' % i) | ||
| 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 |
+11
-11
| #!/usr/bin/env python | ||
| """Program to show CD-ROM device information""" | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -30,3 +30,3 @@ # This program is free software: you can redistribute it and/or modify | ||
| There's probably an easier way to do this that I'm not aware of.""" | ||
| keys=dict.keys() | ||
| keys=list(dict.keys()) | ||
| keys.sort() | ||
@@ -40,3 +40,3 @@ return keys | ||
| except IOError: | ||
| print "Problem opening CD-ROM: %s" % drive_name | ||
| print("Problem opening CD-ROM: %s" % drive_name) | ||
| sys.exit(1) | ||
@@ -48,3 +48,3 @@ else: | ||
| except IOError: | ||
| print "Problem finding a CD-ROM" | ||
| print("Problem finding a CD-ROM") | ||
| sys.exit(1) | ||
@@ -55,13 +55,13 @@ | ||
| print "drive: %s, vendor: %s, model: %s, release: %s" \ | ||
| % (drive_name, vendor, model, release) | ||
| 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 | ||
| print("Drive Capabilities for %s..." % drive_name) | ||
| print "\t", | ||
| print "\n\t".join(cap for cap in sort_dict_keys(read_cap) + | ||
| 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..." | ||
| print("\nDriver Availability...") | ||
| seen = {} | ||
@@ -72,3 +72,3 @@ for driver_name in sort_dict_keys(cdio.drivers): | ||
| if cdio.have_driver(driver_name) and not driver_id in seen: | ||
| print "\tDriver %s (%d) is installed." % (driver_name, driver_id,) | ||
| print("\tDriver %s (%d) is installed." % (driver_name, driver_id,)) | ||
| seen[driver_id] = True | ||
@@ -75,0 +75,0 @@ except ValueError: |
| #!/usr/bin/python | ||
| # $Id: drives.py,v 1.2 2008/11/24 00:53:59 rocky Exp $ | ||
| """Program to read CD blocks. See read-cd from the libcdio distribution | ||
@@ -7,3 +6,3 @@ for a more complete program.""" | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2011, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -38,11 +37,11 @@ # This program is free software; you can redistribute it and/or modify | ||
| print "%s..." % msg | ||
| for d in drives: print "Drive %s" % d | ||
| print "-----" | ||
| 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("Drive %s" % drive) | ||
| print "-----" | ||
| print("-----") | ||
@@ -49,0 +48,0 @@ print_drive_class("All CD-ROM drives (again)", pycdio.FS_MATCH_ALL, False) |
+8
-8
| #!/usr/bin/env python | ||
| """Program to Eject and close CD-ROM drive""" | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -32,3 +32,3 @@ # This program is free software: you can redistribute it and/or modify | ||
| except IOError: | ||
| print "Problem opening CD-ROM: %s" % drive_name | ||
| print("Problem opening CD-ROM: %s" % drive_name) | ||
| sys.exit(1) | ||
@@ -40,3 +40,3 @@ else: | ||
| except IOError: | ||
| print "Problem finding a CD-ROM" | ||
| print("Problem finding a CD-ROM") | ||
| sys.exit(1) | ||
@@ -46,14 +46,14 @@ | ||
| print "Ejecting CD in drive %s" % drive_name | ||
| 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 | ||
| print("Closed tray of CD-ROM drive %s" % drive_name) | ||
| except cdio.DeviceException: | ||
| print "Closing tray of CD-ROM drive %s failed" % drive_name | ||
| print("Closing tray of CD-ROM drive %s failed" % drive_name) | ||
| except cdio.DriverUnsupportedError: | ||
| print "Eject not supported for %s" % drive_name | ||
| print("Eject not supported for %s" % drive_name) | ||
| except cdio.DeviceException: | ||
| print "Eject of CD-ROM drive %s failed" % drive_name | ||
| print("Eject of CD-ROM drive %s failed" % drive_name) | ||
@@ -60,0 +60,0 @@ |
+10
-10
@@ -10,3 +10,3 @@ #!/usr/bin/env python | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -45,3 +45,3 @@ # This program is free software: you can redistribute it and/or modify | ||
| if not iso.is_open(): | ||
| print "Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname | ||
| print("Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname) | ||
| sys.exit(1) | ||
@@ -54,18 +54,18 @@ | ||
| id = iso.get_application_id() | ||
| if id is not None: print "Application ID: %s" % 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| if id is not None: print("Volumeset ID: %s" % id) | ||
@@ -81,4 +81,4 @@ dir_tr=['-', 'd'] | ||
| is_dir = stat[4] == 2 | ||
| print "%s [LSN %6d] %8d %s%s" % (dir_tr[is_dir], LSN, size, path, | ||
| iso9660.name_translate(filename)) | ||
| print("%s [LSN %6d] %8d %s%s" % (dir_tr[is_dir], LSN, size, path, | ||
| iso9660.name_translate(filename))) | ||
| iso.close() | ||
@@ -85,0 +85,0 @@ sys.exit(0) |
+21
-15
@@ -10,3 +10,3 @@ #!/usr/bin/env python | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -34,2 +34,4 @@ # This program is free software: you can redistribute it and/or modify | ||
| PY3 = sys.version_info[0] == 3 | ||
| # Python has rounding (round) and trucation (int), but what about an integer | ||
@@ -46,3 +48,3 @@ # ceiling function? Until I learn what it is... | ||
| iso9660_path="/" | ||
| local_filename="COPYING" | ||
| local_filename="copying" | ||
@@ -54,6 +56,6 @@ if len(sys.argv) > 1: | ||
| if len(sys.argv) > 3: | ||
| print """ | ||
| print(""" | ||
| usage: %s [CD-ROM-or-image [filename]] | ||
| Extracts filename from CD-ROM-or-image. | ||
| """ % sys.argv[0] | ||
| """ % sys.argv[0]) | ||
| sys.exit(1) | ||
@@ -64,3 +66,3 @@ | ||
| except: | ||
| print "Sorry, couldn't open %s as a CD image." % cd_image_fname | ||
| print("Sorry, couldn't open %s as a CD image." % cd_image_fname) | ||
| sys.exit(1) | ||
@@ -71,4 +73,4 @@ | ||
| if statbuf is None: | ||
| print "Could not get ISO-9660 file information for file %s in %s" \ | ||
| % (local_filename, cd_image_fname) | ||
| print("Could not get ISO-9660 file information for file %s in %s" \ | ||
| % (local_filename, cd_image_fname)) | ||
| cd.close() | ||
@@ -78,5 +80,5 @@ sys.exit(2) | ||
| try: | ||
| OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0664) | ||
| OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0o664) | ||
| except: | ||
| print "Can't open %s for writing" % local_filename | ||
| print("Can't open %s for writing" % local_filename) | ||
@@ -90,8 +92,12 @@ # Copy the blocks from the ISO-9660 filesystem to the local filesystem. | ||
| if size < 0: | ||
| print "Error reading ISO 9660 file %s at LSN %d" % ( | ||
| local_filename, lsn) | ||
| print("Error reading ISO 9660 file %s at LSN %d" % ( | ||
| local_filename, lsn)) | ||
| sys.exit(4) | ||
| os.write(OUTPUT, buf) | ||
| pass | ||
| if PY3: | ||
| os.write(OUTPUT, bytes(buf, 'UTF-8')) | ||
| else: | ||
| os.write(OUTPUT, buf) | ||
| pass | ||
@@ -103,4 +109,4 @@ # Make sure the file size has the exact same byte size. Without the | ||
| print "Extraction of file '%s' from %s successful." % ( | ||
| local_filename, cd_image_fname) | ||
| print("Extraction of file '%s' from %s successful." % ( | ||
| local_filename, cd_image_fname)) | ||
@@ -107,0 +113,0 @@ os.close(OUTPUT) |
+19
-14
@@ -8,3 +8,3 @@ #!/usr/bin/env python | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -32,2 +32,4 @@ # This program is free software: you can redistribute it and/or modify | ||
| PY3 = sys.version_info[0] == 3 | ||
| # Python has rounding (round) and truncation (int), but what about an integer | ||
@@ -52,6 +54,6 @@ # ceiling function? Until I learn what it is... | ||
| if len(sys.argv) > 3: | ||
| print """ | ||
| print(""" | ||
| usage: %s [ISO9660-image.ISO [filename]] | ||
| Extracts filename from ISO9660-image.ISO. | ||
| """ % sys.argv[0] | ||
| """ % sys.argv[0]) | ||
| sys.exit(1) | ||
@@ -62,3 +64,3 @@ | ||
| if not iso.is_open(): | ||
| print "Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname | ||
| print("Sorry, couldn't open %s as an ISO-9660 image." % iso_image_fname) | ||
| sys.exit(1) | ||
@@ -70,4 +72,4 @@ | ||
| if statbuf is None: | ||
| print "Could not get ISO-9660 file information for file %s" \ | ||
| % local_filename | ||
| print("Could not get ISO-9660 file information for file %s" \ | ||
| % local_filename) | ||
| iso.close() | ||
@@ -77,5 +79,5 @@ sys.exit(2) | ||
| try: | ||
| OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0664) | ||
| OUTPUT=os.open(local_filename, os.O_CREAT|os.O_WRONLY, 0o664) | ||
| except: | ||
| print "Can't open %s for writing" % local_filename | ||
| print("Can't open %s for writing" % local_filename) | ||
@@ -89,9 +91,12 @@ # Copy the blocks from the ISO-9660 filesystem to the local filesystem. | ||
| if size <= 0: | ||
| print "Error reading ISO 9660 file %s at LSN %d" % ( | ||
| local_filename, lsn) | ||
| print("Error reading ISO 9660 file %s at LSN %d" % ( | ||
| local_filename, lsn)) | ||
| sys.exit(4) | ||
| os.write(OUTPUT, buf) | ||
| 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 | ||
@@ -102,4 +107,4 @@ # truncate below, the file will a multiple of ISO_BLOCKSIZE. | ||
| print "Extraction of file '%s' from %s successful." % ( | ||
| local_filename, iso_image_fname) | ||
| print("Extraction of file '%s' from %s successful." % ( | ||
| local_filename, iso_image_fname)) | ||
@@ -106,0 +111,0 @@ os.close(OUTPUT) |
+23
-14
| #!/usr/bin/env python | ||
| """A program to show CD information.""" | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # Copyright (C) 2006, 2008, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
@@ -31,3 +31,3 @@ # This program is free software: you can redistribute it and/or modify | ||
| except IOError: | ||
| print "Problem opening CD-ROM: %s" % sys.argv[1] | ||
| print("Problem opening CD-ROM: %s" % sys.argv[1]) | ||
| sys.exit(1) | ||
@@ -38,3 +38,3 @@ else: | ||
| except IOError: | ||
| print "Problem finding a CD-ROM" | ||
| print("Problem finding a CD-ROM") | ||
| sys.exit(1) | ||
@@ -44,3 +44,3 @@ | ||
| if t is None: | ||
| print "Problem getting first track" | ||
| print("Problem getting first track") | ||
| sys.exit(2) | ||
@@ -54,14 +54,14 @@ | ||
| 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) | ||
| 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("CD-ROM %s has %d track(s). " % (d.get_device(), d.get_num_tracks())) | ||
| print "Track format is %s." % d.get_disc_mode() | ||
| print("Track format is %s." % d.get_disc_mode()) | ||
| mcn = d.get_mcn() | ||
| if mcn: | ||
| print "Media Catalog Number: %s" % mcn | ||
| print("Media Catalog Number: %s" % mcn) | ||
| print "%3s: %-6s %s" % ("#", "LSN", "Format") | ||
| print("%3s: %-6s %s" % ("#", "LSN", "Format")) | ||
| i=first_track | ||
@@ -71,4 +71,4 @@ while (i <= last_track): | ||
| t = d.get_track(i) | ||
| print "%3d: %06lu %-6s %s" % (t.track, t.get_lsn(), | ||
| t.get_msf(), t.get_format()) | ||
| print("%3d: %06lu %-6s %s" % (t.track, t.get_lsn(), | ||
| t.get_msf(), t.get_format())) | ||
| except cdio.TrackError: | ||
@@ -78,4 +78,13 @@ pass | ||
| print "%3X: %06lu leadout" \ | ||
| % (pycdio.CDROM_LEADOUT_TRACK, d.get_disc_last_lsn()) | ||
| 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() |
+24
-18
@@ -1,5 +0,3 @@ | ||
| # $Id: iso9660.py,v 1.12 2008/05/01 16:55:03 karl Exp $ | ||
| # Copyright (C) 2006, 2008, 2010, 2013 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
| # Copyright (C) 2006, 2008 Rocky Bernstein <rocky@gnu.org> | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
@@ -18,2 +16,3 @@ # it under the terms of the GNU General Public License as published by | ||
| import pycdio | ||
| import pyiso9660 | ||
@@ -52,3 +51,3 @@ import cdio | ||
| symbol.""" | ||
| if type(achar) != types.IntType: | ||
| if type(achar) != int: | ||
| # Not integer. Should be a string of length one then. | ||
@@ -76,3 +75,3 @@ # We'll turn it into an integer. | ||
| if type(dchar) != types.IntType: | ||
| if type(dchar) != int: | ||
| # Not integer. Should be a string of length one then. | ||
@@ -134,3 +133,3 @@ # We'll turn it into an integer. | ||
| def stat_array_to_dict(filename, LSN, size, sec_size, is_dir): | ||
| """stat_array_to_href(filename, LSN, size, sec_size, is_dir)->stat | ||
| """stat_array_to_dict(filename, LSN, size, sec_size, is_dir)->stat | ||
@@ -161,4 +160,4 @@ Convert a ISO 9660 array to an hash reference of the values. | ||
| if check not in check_types: | ||
| print "*** A CHECK parameter must be one of %s\n" % \ | ||
| ', '.join(check_types.keys()) | ||
| print("*** A CHECK parameter must be one of %s\n" % \ | ||
| ', '.join(list(check_types.keys()))) | ||
| return None | ||
@@ -194,3 +193,3 @@ return pyiso9660.strncpy_pad(name, len, check_types[check]) | ||
| else: | ||
| print "***No object to close" | ||
| print("***No object to close") | ||
| self.iso9660 = None | ||
@@ -206,3 +205,3 @@ | ||
| if pycdio.VERSION_NUM <= 76: | ||
| print "*** Routine available only in libcdio versions >= 0.76" | ||
| print("*** Routine available only in libcdio versions >= 0.76") | ||
| return None | ||
@@ -212,3 +211,3 @@ | ||
| pyiso9660.ifs_find_lsn(self.iso9660, lsn) | ||
| return stat_array_to_href(filename, LSN, size, sec_size, is_dir) | ||
| return stat_array_to_dict(filename, LSN, size, sec_size, is_dir) | ||
@@ -317,4 +316,4 @@ | ||
| if type(fuzz) != types.IntType: | ||
| print "*** Expecting fuzz to be an integer; got 'fuzz'" | ||
| if type(fuzz) != int: | ||
| print("*** Expecting fuzz to be an integer; got 'fuzz'") | ||
| return False | ||
@@ -335,4 +334,4 @@ | ||
| if type(fuzz) != types.IntType: | ||
| print "*** Expecting fuzz to be an integer; got 'fuzz'" | ||
| if type(fuzz) != int: | ||
| print("*** Expecting fuzz to be an integer; got 'fuzz'") | ||
| return False | ||
@@ -443,3 +442,3 @@ | ||
| pyiso9660.fs_find_lsn(self.cd, lsn) | ||
| return stat_array_to_href(filename, LSN, size, sec_size, is_dir) | ||
| return stat_array_to_dict(filename, LSN, size, sec_size, is_dir) | ||
@@ -510,3 +509,10 @@ | ||
| values = pyiso9660.fs_stat(self.cd, path) | ||
| return stat_array_to_dict(values[0], values[1], values[2], | ||
| values[3], values[4]) | ||
| pass | ||
| if values: | ||
| return stat_array_to_dict(values[0], values[1], values[2], | ||
| values[3], values[4]) | ||
| else: | ||
| return None | ||
| pass | ||
| pass | ||
| pass |
+5
-0
@@ -0,1 +1,5 @@ | ||
| include COPYING | ||
| include ChangeLog | ||
| include Makefile | ||
| include THANKS | ||
| include __pkginfo__.py | ||
@@ -10,4 +14,5 @@ include data/copying.iso | ||
| include swig/*.swg | ||
| include swig/Makefile | ||
| include test/cdda.bin | ||
| include test/cdda.cue | ||
| include test/cdda.toc |
+31
-29
@@ -1,4 +0,4 @@ | ||
| Metadata-Version: 1.0 | ||
| Metadata-Version: 1.1 | ||
| Name: pycdio | ||
| Version: 0.17 | ||
| Version: 0.19 | ||
| Summary: Python OO interface to libcdio (CD Input and Control library) | ||
@@ -9,46 +9,48 @@ Home-page: http://www.gnu.org/software/libcdio | ||
| License: GPL | ||
| Description: pycdio is a Python interface to the CD Input and Control library | ||
| (libcdio). You can get the source at the same place as libcdio: | ||
| ftp://ftp.gnu.org:/pub/gnu/libcdio/pycdio-* | ||
| Description: | ||
| # Introduction | ||
| The pycdio (and libcdio) libraries encapsulate CD-ROM reading and | ||
| 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. | ||
| - - - | ||
| Requirements: | ||
| You'll need a C compiler so the extension can be compiled when it is | ||
| installed. | ||
| You'll also need libcdio | ||
| (http://www.gnu.org/software/libcdio) and it's header files installed. | ||
| # Requirements | ||
| You'll also need SWIG (http://www.swig.org). | ||
| * 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) | ||
| Finally you'll need pkg-config (http://pkg-config.freedesktop.org) | ||
| To build on Debian (e.g. Ubuntu): | ||
| 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 | ||
| apt-get install python-dev | ||
| apt-get install libcdio-dev | ||
| apt-get install libiso9660-dev | ||
| apt-get install swig pkg-config | ||
| - - - | ||
| libcdio is rather large and yet may still grow a bit. (UDF support in | ||
| libcdio may be on the horizon.) | ||
| # Completeness | ||
| What is in pycdio is incomplete; over time it may grow to completion | ||
| *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 | ||
| 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 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 | ||
| 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.) | ||
| libcdio have. | ||
@@ -58,5 +60,5 @@ The encapsulation by SWIG is done in two parts. The lower-level python | ||
| The more object-oriented module is cdio; it is a Python class that | ||
| 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 | ||
| expected that *cdio* is what most people will use. As *pycdio* more | ||
| closely models the C interface, it is conceivable (if unlikely) that | ||
@@ -63,0 +65,0 @@ diehard libcdio C users who are very familiar with that interface |
+31
-29
@@ -1,4 +0,4 @@ | ||
| Metadata-Version: 1.0 | ||
| Metadata-Version: 1.1 | ||
| Name: pycdio | ||
| Version: 0.17 | ||
| Version: 0.19 | ||
| Summary: Python OO interface to libcdio (CD Input and Control library) | ||
@@ -9,46 +9,48 @@ Home-page: http://www.gnu.org/software/libcdio | ||
| License: GPL | ||
| Description: pycdio is a Python interface to the CD Input and Control library | ||
| (libcdio). You can get the source at the same place as libcdio: | ||
| ftp://ftp.gnu.org:/pub/gnu/libcdio/pycdio-* | ||
| Description: | ||
| # Introduction | ||
| The pycdio (and libcdio) libraries encapsulate CD-ROM reading and | ||
| 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. | ||
| - - - | ||
| Requirements: | ||
| You'll need a C compiler so the extension can be compiled when it is | ||
| installed. | ||
| You'll also need libcdio | ||
| (http://www.gnu.org/software/libcdio) and it's header files installed. | ||
| # Requirements | ||
| You'll also need SWIG (http://www.swig.org). | ||
| * 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) | ||
| Finally you'll need pkg-config (http://pkg-config.freedesktop.org) | ||
| To build on Debian (e.g. Ubuntu): | ||
| 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 | ||
| apt-get install python-dev | ||
| apt-get install libcdio-dev | ||
| apt-get install libiso9660-dev | ||
| apt-get install swig pkg-config | ||
| - - - | ||
| libcdio is rather large and yet may still grow a bit. (UDF support in | ||
| libcdio may be on the horizon.) | ||
| # Completeness | ||
| What is in pycdio is incomplete; over time it may grow to completion | ||
| *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 | ||
| 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 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 | ||
| 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.) | ||
| libcdio have. | ||
@@ -58,5 +60,5 @@ The encapsulation by SWIG is done in two parts. The lower-level python | ||
| The more object-oriented module is cdio; it is a Python class that | ||
| 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 | ||
| expected that *cdio* is what most people will use. As *pycdio* more | ||
| closely models the C interface, it is conceivable (if unlikely) that | ||
@@ -63,0 +65,0 @@ diehard libcdio C users who are very familiar with that interface |
@@ -0,3 +1,7 @@ | ||
| COPYING | ||
| ChangeLog | ||
| MANIFEST.in | ||
| Makefile | ||
| README.txt | ||
| THANKS | ||
| __pkginfo__.py | ||
@@ -27,5 +31,7 @@ cdio.py | ||
| pycdio.egg-info/top_level.txt | ||
| swig/Makefile | ||
| swig/audio.swg | ||
| swig/cdtext.swg | ||
| swig/compat.swg | ||
| swig/cdtext_new.swg | ||
| swig/cdtext_old.swg | ||
| swig/device.swg | ||
@@ -32,0 +38,0 @@ swig/device_const.swg |
+238
-52
| # This file was automatically generated by SWIG (http://www.swig.org). | ||
| # Version 1.3.40 | ||
| # Version 2.0.4 | ||
| # | ||
| # Do not make changes to this file unless you know what you are doing--modify | ||
| # the SWIG interface file instead. | ||
| # This file is compatible with both classic and new-style classes. | ||
| """ | ||
@@ -15,2 +15,3 @@ This is a wrapper for The CD Input and Control library (libcdio) which | ||
| from sys import version_info | ||
@@ -50,3 +51,3 @@ if version_info >= (2,6,0): | ||
| if method: return method(self,value) | ||
| if (not static) or hasattr(self,name): | ||
| if (not static): | ||
| self.__dict__[name] = value | ||
@@ -78,15 +79,53 @@ else: | ||
| CDIO_READ_MODE_AUDIO = _pycdio.CDIO_READ_MODE_AUDIO | ||
| CDIO_READ_MODE_M1F1 = _pycdio.CDIO_READ_MODE_M1F1 | ||
| CDIO_READ_MODE_M1F2 = _pycdio.CDIO_READ_MODE_M1F2 | ||
| CDIO_READ_MODE_M2F1 = _pycdio.CDIO_READ_MODE_M2F1 | ||
| CDIO_READ_MODE_M2F2 = _pycdio.CDIO_READ_MODE_M2F2 | ||
| 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 | ||
| def cdio_read_sectors(*args): | ||
| return _pycdio.cdio_read_sectors(*args) | ||
| cdio_read_sectors = _pycdio.cdio_read_sectors | ||
| 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: 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 cdio_eject_media_drive(*args): | ||
| return _pycdio.cdio_eject_media_drive(*args) | ||
| cdio_eject_media_drive = _pycdio.cdio_eject_media_drive | ||
| def imaxabs(*args): | ||
| return _pycdio.imaxabs(*args) | ||
| imaxabs = _pycdio.imaxabs | ||
| def imaxdiv(*args): | ||
| return _pycdio.imaxdiv(*args) | ||
| imaxdiv = _pycdio.imaxdiv | ||
| def strtoimax(*args): | ||
| return _pycdio.strtoimax(*args) | ||
| strtoimax = _pycdio.strtoimax | ||
| def strtoumax(*args): | ||
| return _pycdio.strtoumax(*args) | ||
| strtoumax = _pycdio.strtoumax | ||
| def wcstoimax(*args): | ||
| return _pycdio.wcstoimax(*args) | ||
| wcstoimax = _pycdio.wcstoimax | ||
| def wcstoumax(*args): | ||
| return _pycdio.wcstoumax(*args) | ||
| wcstoumax = _pycdio.wcstoumax | ||
| VERSION_NUM = _pycdio.VERSION_NUM | ||
@@ -124,2 +163,9 @@ INVALID_LBA = _pycdio.INVALID_LBA | ||
| def audio_set_volume_levels(*args): | ||
| """ | ||
| audio_resume(cdio)->status | ||
| Resume playing an audio CD. | ||
| """ | ||
| return _pycdio.audio_set_volume_levels(*args) | ||
| def audio_stop(*args): | ||
@@ -224,10 +270,2 @@ """ | ||
| def get_cdtext(*args): | ||
| """ | ||
| cdio_get_cdtext(track)->cdtext | ||
| Get the CDText object for the given track number. | ||
| Use track 0 for the disc's CDText object. | ||
| """ | ||
| return _pycdio.get_cdtext(*args) | ||
| def get_first_track_num(*args): | ||
@@ -382,13 +420,142 @@ """ | ||
| CDTEXT_DISCID = _pycdio.CDTEXT_DISCID | ||
| CDTEXT_GENRE = _pycdio.CDTEXT_GENRE | ||
| CDTEXT_ISRC = _pycdio.CDTEXT_ISRC | ||
| CDTEXT_MESSAGE = _pycdio.CDTEXT_MESSAGE | ||
| CDTEXT_ISRC = _pycdio.CDTEXT_ISRC | ||
| CDTEXT_PERFORMER = _pycdio.CDTEXT_PERFORMER | ||
| CDTEXT_SIZE_INFO = _pycdio.CDTEXT_SIZE_INFO | ||
| CDTEXT_SONGWRITER = _pycdio.CDTEXT_SONGWRITER | ||
| CDTEXT_TITLE = _pycdio.CDTEXT_TITLE | ||
| CDTEXT_TOC_INFO = _pycdio.CDTEXT_TOC_INFO | ||
| CDTEXT_TOC_INFO2 = _pycdio.CDTEXT_TOC_INFO2 | ||
| CDTEXT_UPC_EAN = _pycdio.CDTEXT_UPC_EAN | ||
| CDTEXT_INVALID = _pycdio.CDTEXT_INVALID | ||
| 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 | ||
@@ -398,29 +565,51 @@ MAX_CDTEXT_FIELDS = _pycdio.MAX_CDTEXT_FIELDS | ||
| def cdtext_field2str(*args): | ||
| """ | ||
| cdtext_field2str(key)->string | ||
| Get the name of the key. | ||
| """ | ||
| """cdtext_field2str(cdtext_field_t i) -> char""" | ||
| return _pycdio.cdtext_field2str(*args) | ||
| def cdtext_lang2str(*args): | ||
| """cdtext_lang2str(cdtext_lang_t i) -> char""" | ||
| return _pycdio.cdtext_lang2str(*args) | ||
| def cdtext_genre2str(*args): | ||
| """cdtext_genre2str(cdtext_genre_t i) -> char""" | ||
| return _pycdio.cdtext_genre2str(*args) | ||
| def cdtext_init(): | ||
| """cdtext_init() -> cdtext_t""" | ||
| return _pycdio.cdtext_init() | ||
| def cdtext_destroy(*args): | ||
| """cdtext_destroy(cdtext_t p_cdtext)""" | ||
| return _pycdio.cdtext_destroy(*args) | ||
| def cdtext_get(*args): | ||
| """ | ||
| cdtext_get(key, p_cdtext)->string | ||
| Get the value associated with key. | ||
| """ | ||
| """cdtext_get(cdtext_t p_cdtext, cdtext_field_t key, track_t track) -> char""" | ||
| return _pycdio.cdtext_get(*args) | ||
| def cdtext_is_keyword(*args): | ||
| """ | ||
| cdtext_is_keyword(string)->int | ||
| Returns enum value of keyword if the key is a CD-Text keyword, | ||
| returns MAX_CDTEXT_FIELDS otherwise. | ||
| """ | ||
| return _pycdio.cdtext_is_keyword(*args) | ||
| def cdtext_get_const(*args): | ||
| """cdtext_get_const(cdtext_t p_cdtext, cdtext_field_t key, track_t track) -> char""" | ||
| return _pycdio.cdtext_get_const(*args) | ||
| def cdtext_get_language(*args): | ||
| """cdtext_get_language(cdtext_t p_cdtext) -> cdtext_lang_t""" | ||
| return _pycdio.cdtext_get_language(*args) | ||
| def cdtext_select_language(*args): | ||
| """cdtext_select_language(cdtext_t p_cdtext, cdtext_lang_t lang) -> bool""" | ||
| return _pycdio.cdtext_select_language(*args) | ||
| def cdtext_list_languages(*args): | ||
| """cdtext_list_languages(cdtext_t p_cdtext) -> cdtext_lang_t""" | ||
| return _pycdio.cdtext_list_languages(*args) | ||
| def cdtext_set(*args): | ||
| """ | ||
| cdtext_set(key, string, p_cdtext) | ||
| Set the value associated with key. | ||
| cdtext_set(cdtext_t p_cdtext, cdtext_field_t key, uint8_t value, | ||
| track_t track, char charset) | ||
| """ | ||
| return _pycdio.cdtext_set(*args) | ||
| def get_cdtext(*args): | ||
| """get_cdtext(CdIo_t p_cdio) -> cdtext_t""" | ||
| return _pycdio.get_cdtext(*args) | ||
| DRIVE_CAP_ERROR = _pycdio.DRIVE_CAP_ERROR | ||
@@ -485,6 +674,2 @@ DRIVE_CAP_UNKNOWN = _pycdio.DRIVE_CAP_UNKNOWN | ||
| DRIVER_DEVICE = _pycdio.DRIVER_DEVICE | ||
| MIN_DRIVER = _pycdio.MIN_DRIVER | ||
| MIN_DEVICE_DRIVER = _pycdio.MIN_DEVICE_DRIVER | ||
| MAX_DRIVER = _pycdio.MAX_DRIVER | ||
| MAX_DEVICE_DRIVER = _pycdio.MAX_DEVICE_DRIVER | ||
| DRIVER_OP_SUCCESS = _pycdio.DRIVER_OP_SUCCESS | ||
@@ -868,2 +1053,3 @@ DRIVER_OP_ERROR = _pycdio.DRIVER_OP_ERROR | ||
| INCLUDE_CLASS = _pycdio.INCLUDE_CLASS | ||
| # This file is compatible with both classic and new-style classes. | ||
@@ -870,0 +1056,0 @@ |
+51
-16
| # This file was automatically generated by SWIG (http://www.swig.org). | ||
| # Version 1.3.40 | ||
| # Version 2.0.4 | ||
| # | ||
| # Do not make changes to this file unless you know what you are doing--modify | ||
| # the SWIG interface file instead. | ||
| # This file is compatible with both classic and new-style classes. | ||
| """ | ||
@@ -14,2 +14,3 @@ This is a wrapper for The CD Input and Control library's ISO-9660 library | ||
| from sys import version_info | ||
@@ -49,3 +50,3 @@ if version_info >= (2,6,0): | ||
| if method: return method(self,value) | ||
| if (not static) or hasattr(self,name): | ||
| if (not static): | ||
| self.__dict__[name] = value | ||
@@ -77,2 +78,48 @@ else: | ||
| 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: 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(*args): | ||
| return _pyiso9660.imaxabs(*args) | ||
| imaxabs = _pyiso9660.imaxabs | ||
| def imaxdiv(*args): | ||
| return _pyiso9660.imaxdiv(*args) | ||
| imaxdiv = _pyiso9660.imaxdiv | ||
| def strtoimax(*args): | ||
| return _pyiso9660.strtoimax(*args) | ||
| strtoimax = _pyiso9660.strtoimax | ||
| def strtoumax(*args): | ||
| return _pyiso9660.strtoumax(*args) | ||
| strtoumax = _pyiso9660.strtoumax | ||
| def wcstoimax(*args): | ||
| return _pyiso9660.wcstoimax(*args) | ||
| wcstoimax = _pyiso9660.wcstoimax | ||
| def wcstoumax(*args): | ||
| return _pyiso9660.wcstoumax(*args) | ||
| wcstoumax = _pyiso9660.wcstoumax | ||
| VERSION_NUM = _pyiso9660.VERSION_NUM | ||
@@ -86,15 +133,2 @@ INVALID_LBA = _pyiso9660.INVALID_LBA | ||
| M2RAW_SECTOR_SIZE = _pyiso9660.M2RAW_SECTOR_SIZE | ||
| CDIO_READ_MODE_AUDIO = _pyiso9660.CDIO_READ_MODE_AUDIO | ||
| CDIO_READ_MODE_M1F1 = _pyiso9660.CDIO_READ_MODE_M1F1 | ||
| CDIO_READ_MODE_M1F2 = _pyiso9660.CDIO_READ_MODE_M1F2 | ||
| CDIO_READ_MODE_M2F1 = _pyiso9660.CDIO_READ_MODE_M2F1 | ||
| CDIO_READ_MODE_M2F2 = _pyiso9660.CDIO_READ_MODE_M2F2 | ||
| def cdio_read_sectors(*args): | ||
| return _pyiso9660.cdio_read_sectors(*args) | ||
| cdio_read_sectors = _pyiso9660.cdio_read_sectors | ||
| def cdio_eject_media_drive(*args): | ||
| return _pyiso9660.cdio_eject_media_drive(*args) | ||
| cdio_eject_media_drive = _pyiso9660.cdio_eject_media_drive | ||
| PVD_SECTOR = _pyiso9660.PVD_SECTOR | ||
@@ -559,3 +593,4 @@ EVD_SECTOR = _pyiso9660.EVD_SECTOR | ||
| return _pyiso9660.is_xa(*args) | ||
| # This file is compatible with both classic and new-style classes. | ||
+29
-27
@@ -1,45 +0,47 @@ | ||
| pycdio is a Python interface to the CD Input and Control library | ||
| (libcdio). You can get the source at the same place as libcdio: | ||
| ftp://ftp.gnu.org:/pub/gnu/libcdio/pycdio-* | ||
| The pycdio (and libcdio) libraries encapsulate CD-ROM reading and | ||
| # 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. | ||
| - - - | ||
| Requirements: | ||
| You'll need a C compiler so the extension can be compiled when it is | ||
| installed. | ||
| You'll also need libcdio | ||
| (http://www.gnu.org/software/libcdio) and it's header files installed. | ||
| # Requirements | ||
| You'll also need SWIG (http://www.swig.org). | ||
| * 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) | ||
| Finally you'll need pkg-config (http://pkg-config.freedesktop.org) | ||
| To build on Debian (e.g. Ubuntu): | ||
| 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 | ||
| apt-get install python-dev | ||
| apt-get install libcdio-dev | ||
| apt-get install libiso9660-dev | ||
| apt-get install swig pkg-config | ||
| - - - | ||
| libcdio is rather large and yet may still grow a bit. (UDF support in | ||
| libcdio may be on the horizon.) | ||
| # Completeness | ||
| What is in pycdio is incomplete; over time it may grow to completion | ||
| *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 | ||
| 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 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 | ||
| 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.) | ||
| libcdio have. | ||
@@ -49,5 +51,5 @@ The encapsulation by SWIG is done in two parts. The lower-level python | ||
| The more object-oriented module is cdio; it is a Python class that | ||
| 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 | ||
| expected that *cdio* is what most people will use. As *pycdio* more | ||
| closely models the C interface, it is conceivable (if unlikely) that | ||
@@ -54,0 +56,0 @@ diehard libcdio C users who are very familiar with that interface |
+6
-7
@@ -0,1 +1,7 @@ | ||
| [nosetests] | ||
| where = ./test | ||
| exe = on | ||
| verbosity = 2 | ||
| detailed-errors = 1 | ||
| [bdist_rpm] | ||
@@ -10,8 +16,1 @@ packager = Rocky Bernstein <rocky@gnu.org> | ||
| [nosetests] | ||
| cover-package = nose | ||
| verbosity = 2 | ||
| detailed-errors = 1 | ||
| exe = on | ||
| where = ./test | ||
+40
-11
@@ -13,9 +13,20 @@ #!/usr/bin/env python | ||
| from setuptools import setup | ||
| from distutils.core import Extension | ||
| from distutils.core import setup, Extension | ||
| from subprocess import * | ||
| import os | ||
| top_dir = os.path.dirname(__file__) | ||
| import shutil | ||
| top_dir = os.path.dirname(os.path.abspath(__file__)) | ||
| README = os.path.join(top_dir, 'README.txt') | ||
| 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. | ||
@@ -30,2 +41,19 @@ long_description = open(README).read() + '\n\n' | ||
| # Account for API change after 0.83 | ||
| ge_84 = call(['pkg-config','--atleast-version=0.84','libcdio']) | ||
| if ge_84 is 0: | ||
| print("libcdio version > 0.83") | ||
| shutil.copy('swig/cdtext_new.swg','swig/cdtext.swg') | ||
| else: | ||
| print("libcdio version <= 0.83") | ||
| shutil.copy('swig/cdtext_old.swg','swig/cdtext.swg') | ||
| print("Note: you should SWIG installed to build this package") | ||
| for filename in ('ctext.swg', 'pyiso9660.py', 'pycdio.py'): | ||
| rm_file(filename) | ||
| pass | ||
| for filename in ('pyiso9660_wrap.c', 'pycdio_wrap.c'): | ||
| rm_file('swig', filename) | ||
| pass | ||
| pass | ||
| # Find runtime library directories for libcdio and libiso9660 using | ||
@@ -42,4 +70,4 @@ # pkg-config. Then create the right Extension object lists which later | ||
| except: | ||
| print "** Error trying to run pkg-config. Is it installed?" | ||
| print "** If not, see http://pkg-config.freedesktop.org" | ||
| print("** Error trying to run pkg-config. Is it installed?") | ||
| print("** If not, see http://pkg-config.freedesktop.org") | ||
| raise | ||
@@ -50,8 +78,8 @@ pass | ||
| # Strip off blanks and initial '-L' | ||
| dirs = p.communicate()[0].split('-L')[1:] | ||
| dirs = p.communicate()[0].split(b'-L')[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 | ||
| 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 | ||
@@ -63,3 +91,3 @@ library_dirs = runtime_lib_dirs | ||
| # the others we want. | ||
| dirs = p.communicate()[0].split('-I')[1:] | ||
| dirs = p.communicate()[0].split(b'-I')[1:] | ||
| include_dirs = [d.strip() for d in dirs] | ||
@@ -70,4 +98,5 @@ p = Popen(['pkg-config', '--libs-only-l', lib_name], stdout=PIPE) | ||
| # the others we want. | ||
| dirs = p.communicate()[0].split('-l')[1:] | ||
| libraries = [d.strip() for d in dirs] | ||
| dirs = p.communicate()[0].split(b'-l')[1:] | ||
| libraries = [d.strip().decode("utf-8") for d in dirs] | ||
| pass | ||
| py_shortname = 'py' + short_libname | ||
@@ -74,0 +103,0 @@ modules.append(Extension('_' + py_shortname, |
+26
-17
@@ -17,10 +17,9 @@ #!/usr/bin/env python | ||
| """Test keywords""" | ||
| self.assertEquals(pycdio.cdtext_is_keyword('PERFORMER'), | ||
| pycdio.CDTEXT_PERFORMER) | ||
| self.assertEquals(pycdio.cdtext_is_keyword('IDONOTEXIST'), | ||
| pycdio.MAX_CDTEXT_FIELDS) | ||
| 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") | ||
| self.assertEquals(pycdio.cdtext_field2str(pycdio.CDTEXT_PERFORMER), | ||
| "PERFORMER") | ||
| def test_get_set(self): | ||
@@ -31,16 +30,26 @@ """Test getting and setting CDText""" | ||
| device = cdio.Device(tocpath, pycdio.DRIVER_CDRDAO) | ||
| 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') | ||
| 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') | ||
| track1text.set(pycdio.CDTEXT_PERFORMER, 'Someone') | ||
| self.assertEquals(track1text.get(pycdio.CDTEXT_PERFORMER), 'Someone') | ||
| 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() |
+7
-7
@@ -21,3 +21,3 @@ #!/usr/bin/env python | ||
| if a[i] != b[i]: | ||
| print "position %d: %d != %d\n" % (i, a[i], b[i]) | ||
| print("position %d: %d != %d\n" % (i, a[i], b[i])) | ||
| return False | ||
@@ -37,6 +37,6 @@ return True | ||
| if not pyiso9660.is_dchar(c): | ||
| print "Failed iso9660_is_achar test on %c" % 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 | ||
| print("Failed iso9660_is_achar test on %c" % c) | ||
| bad += 1 | ||
@@ -51,6 +51,6 @@ c += 1 | ||
| if not pyiso9660.is_dchar(c): | ||
| print "Failed iso9660_is_dchar test on %c" % 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 | ||
| print("Failed iso9660_is_achar test on %c" % c) | ||
| bad += 1 | ||
@@ -65,6 +65,6 @@ c += 1 | ||
| if pyiso9660.is_dchar(c): | ||
| print "Should not pass is_dchar test on %c" % 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 | ||
| print("Failed is_achar test on symbol %c" % c) | ||
| bad += 1 | ||
@@ -71,0 +71,0 @@ i += 1 |
@@ -20,5 +20,4 @@ #!/usr/bin/env python | ||
| # The test CD image | ||
| CD_IMAGE_PATH =os.path.join(libdir, "data") | ||
| CD_IMAGE_PATH =os.path.join(libdir, 'data') | ||
| cd_image_fname=os.path.join(CD_IMAGE_PATH, "isofs-m1.cue") | ||
| class ISO9660Tests(unittest.TestCase): | ||
@@ -31,3 +30,2 @@ | ||
| "Open CD image %s" % cd_image_fname) | ||
| statbuf = cd.stat (os.path.join('/copying')) | ||
@@ -46,3 +44,2 @@ | ||
| self.assertEqual(good_stat, statbuf, 'CD 9660 file stats') | ||
| # Get file | ||
@@ -64,2 +61,7 @@ buf_all =[] | ||
| file_contents, 'File contents comparison') | ||
| statbuf = cd.stat("/notthere") | ||
| self.assertEqual(None, statbuf, 'stat() for non-existent file') | ||
| cd.close() | ||
@@ -66,0 +68,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
1903062
5.23%51
13.33%4040
8.11%