Changeset 3437 for pkipplib/trunk/README
- Timestamp:
- 10/06/08 00:24:42 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkipplib/trunk/README
r3380 r3437 1 pkipplib : IPP and CUPS support for Python1 ypkipplib : IPP and CUPS support for Python 2 2 3 3 $Id$ … … 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 29 29 and its instance methods. 30 30 31 Finally, a CUPS class can be leveraged to easily deal with CUPS 31 Finally, a CUPS class can be leveraged to easily deal with CUPS 32 32 print servers. 33 33 … … 42 42 43 43 1 - Grab the latest version of this library from : 44 44 45 45 http://www.pykota.com/software/pkipplib/ 46 47 2 - Extract the tarball : 48 46 47 2 - Extract the tarball : 48 49 49 $ tar -zxf pkipplib-x.yy.tar.gz 50 51 3 - Install the Python module : 52 50 51 3 - Install the Python module : 52 53 53 $ cd pkipplib-x.yy 54 54 $ python setup.py install … … 78 78 print request 79 79 80 # Access one of the job's attributes directly 80 # Access one of the job's attributes directly 81 81 print request.job["job-name"] 82 82 --- CUT --- … … 119 119 # Lower level API : 120 120 request = cups.newRequest(pkipplib.IPP_GET_PRINTER_ATTRIBUTES) 121 request.operation["printer-uri"] = ("uri", 121 request.operation["printer-uri"] = ("uri", 122 122 cups.identifierToURI("printers", "HP2100")) 123 for attribute in ("printer-uri-supported", 123 for attribute in ("printer-uri-supported", 124 124 "printer-type", 125 125 "member-uris") : 126 # IMPORTANT : here, despite the unusual syntax, we append to 126 # IMPORTANT : here, despite the unusual syntax, we append to 127 127 # the list of requested attributes : 128 128 request.operation["requested-attributes"] = ("nameWithoutLanguage", attribute) 129 130 # Sends this request to the CUPS server 129 130 # Sends this request to the CUPS server 131 131 answer = cups.doRequest(request) 132 132 … … 140 140 141 141 pkipplib currently includes the following command line tools : 142 142 143 143 * pksubscribe : can create or delete IPP subscriptions. 144 144 145 145 See pksubscribe --help for details. 146 146 147 147 examples : 148 148 149 149 $ pksubscribe --cups http://localhost:631 \ 150 150 --events printer-added,printer-deleted \ 151 151 --recipient mynotifier \ 152 152 --duration 0 153 154 $ pksubscribe --username root \ 153 154 $ pksubscribe --username root \ 155 155 --password HacKMe \ 156 156 --delete 34 58 98 157 157 158 158 * samplenotifier : can handle printer-added and printer-deleted 159 159 notifications and automatically create or remove printers 160 160 from PyKota's database (just adapt the code for other needs). 161 161 162 162 samplenotifier is present in the notifiers/ directory, but 163 163 won't be installed automatically. You must put it into … … 165 165 166 166 In the future more command line tools will be included. 167 167 168 168 ======================================================================= 169 169