pycups
This page is about the Python bindings for the CUPS API, known as pycups. It was written for use with system-config-printer, but can be put to other uses as well.
I work on this module as part of my job at Red Hat.
Download
Download tarball releases from:
http://cyberelk.net/tim/data/pycups/
or from the Python Package Index:
http://pypi.python.org/pypi/pycups
Source Code
Fetch the source like this:
git clone git://git.fedorahosted.org/git/pycups.git
or browse it using gitweb.
New releases are announced at freshmeat.
Documentation
Documentation is produced using epydoc and hosted at the pycups PyPI page.
Bug Reporting
Report bugs using the trac interface.
Discussion
Discussion of pycups is welcome on the system-config-printer mailing list.
can someone help me out?
http://forums.gentoo.org/viewtopic-t-931628.html
I can not figure out how to fix it.
[code]
building 'cups' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-pc-linux-gnu-gcc -pthread -march=core2 -mtune=generic -Os -pipe -msse3 -msse4 -mcx16 -msahf -mpopcnt -DVERSION="1.9.61" -fPIC -DVERSION="1.9.61" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o
cupsmodule.c: In function 'cups_ppdSetConformance':
cupsmodule.c:413:3: warning: 'ppdSetConformance' is deprecated (declared at /usr/include/cups/ppd.h:414) [-Wdeprecated-declarations]
cupsmodule.c: In function 'initcups':
cupsmodule.c:853:3: error: 'CUPS_SERVER_REMOTE_PRINTERS' undeclared (first use in this function)
cupsmodule.c:853:3: note: each undeclared identifier is reported only once for each function it appears in
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
[/code]
Which version of cups are you building it against?
net-print/cups-1.6.0 USE=”X acl dbus filters pam python ssl threads usb -avahi -debug -gnutls -java -kerberos (-selinux) -static-libs -systemd -xinetd -zeroconf”
There are some fixes since 1.9.61 for CUPS 1.6. I’ll make a new release soon.
thanks.
UPD:
I just updated CUPS from SVN and it did not help any.
[code]
emerge -v pycups
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N ] dev-python/pycups-1.9.61 USE="-doc -examples" 0 kB
Total: 1 package (1 new), Size of downloads: 0 kB
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-python/pycups-1.9.61
... [ ok ]
* pycups-1.9.61.tar.bz2 SHA256 SHA512 WHIRLPOOL size
>>> Unpacking source...
>>> Unpacking pycups-1.9.61.tar.bz2 to /var/tmp/portage/dev-python/pycups-1.9.61/work
>>> Source unpacked in /var/tmp/portage/dev-python/pycups-1.9.61/work
>>> Preparing source in /var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61 ...
python2.7 setup.py build
running build
running build_ext
building 'cups' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-pc-linux-gnu-gcc -pthread -march=core2 -mtune=generic -Os -pipe -msse3 -msse4 -mcx16 -msahf -mpopcnt -DVERSION="1.9.61" -fPIC -DVERSION="1.9.61" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o
cupsmodule.c: In function ‘cups_ppdSetConformance’:
cupsmodule.c:413:3: warning: ‘ppdSetConformance’ is deprecated (declared at /usr/include/cups/ppd.h:414) [-Wdeprecated-declarations]
cupsmodule.c: In function ‘initcups’:
cupsmodule.c:853:3: error: ‘CUPS_SERVER_REMOTE_PRINTERS’ undeclared (first use in this function)
cupsmodule.c:853:3: note: each undeclared identifier is reported only once for each function it appears in
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
* ERROR: dev-python/pycups-1.9.61 failed (compile phase):
* Building failed
*
* Call stack:
* ebuild.sh, line 85: Called src_compile
* environment, line 5288: Called distutils_src_compile
* environment, line 1296: Called die
* The specific snippet of code:
* "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed";
*
* If you need support, post the output of `emerge --info '=dev-python/pycups-1.9.61'`,
* the complete build log and the output of `emerge -pqv '=dev-python/pycups-1.9.61'`.
* The complete build log is located at '/var/tmp/portage/dev-python/pycups-1.9.61/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-python/pycups-1.9.61/temp/environment'.
* Working directory: '/var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61'
* S: '/var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61'
>>> Failed to emerge dev-python/pycups-1.9.61, Log file:
>>> '/var/tmp/portage/dev-python/pycups-1.9.61/temp/build.log'
* Messages for package dev-python/pycups-1.9.61:
* ERROR: dev-python/pycups-1.9.61 failed (compile phase):
* Building failed
*
* Call stack:
* ebuild.sh, line 85: Called src_compile
* environment, line 5288: Called distutils_src_compile
* environment, line 1296: Called die
* The specific snippet of code:
* "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed";
*
* If you need support, post the output of `emerge --info '=dev-python/pycups-1.9.61'`,
* the complete build log and the output of `emerge -pqv '=dev-python/pycups-1.9.61'`.
* The complete build log is located at '/var/tmp/portage/dev-python/pycups-1.9.61/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-python/pycups-1.9.61/temp/environment'.
* Working directory: '/var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61'
* S: '/var/tmp/portage/dev-python/pycups-1.9.61/work/pycups-1.9.61'
[/code]
You’ll need a newer version of pycups. I haven’t released one yet, but the git repository has the fixes.
pycups successfully compiled with cups-1.5.3