Possible to set printer devmode using samba3-python?

daniel.jarboe at custserv.com daniel.jarboe at custserv.com
Tue Nov 11 20:54:15 GMT 2003


Is it possible to retrieve/set a printer's devmode using the samba3
python
helpers?

I'm trying to automate printer driver installation on samba servers for
Our print admin.  I've no problem getting the driver files from a
windows
printer shared with rpcclient and smbclient, and access printerdata to
set
things like installed printer accessories...

But in order to have the printing preferences and defaults set I believe
I
need getprinter and setprinter.

Getprinter seems to work well, but when doing a python spoolss
setprinter
for info2, I get:
spoolss.werror: [31, 'DOS code 0x0000001f'] ...

And when doing a setprinter(info1) I get segmentation fault.
backtrace of core yields:
#0  0x40322688 in prs_uint32 ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#1  0x40372806 in spool_io_printer_info_level_1 ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#2  0x403732a0 in spool_io_printer_info_level ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#3  0x4037129e in spoolss_io_q_setprinter ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#4  0x4038c43e in cli_spoolss_setprinter ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#5  0x402bcbd4 in spoolss_hnd_setprinter ()
   from /usr/lib/python2.2/lib-dynload/samba/spoolss.so
#6  0x00490162 in PyCFunction_Call ()
#7  0x0046fe68 in PyObject_Call ()
#8  0x00439b7a in PyEval_GetFuncDesc ()

For setprinter(info3) I get:
spoolss.error: error converting to printer info 3 ... 
That is with info3=hnd.getprinter(level=3) ... I made no modifications
to
the format of the data.

Is samba3 python not ready for what I'm trying to do?  Any ideas how I
can
accomplish it by other means?  This is with 3.0.1pre2 on SLES8 s/390,
with
a w2k pc on the other end.

Thanks,
~ Daniel


-----------------------------------------------------------------------

This message is the property of Time Inc. or its affiliates. It may be
legally privileged and/or confidential and is intended only for the use
of the addressee(s). No addressee should forward, print, copy, or
otherwise reproduce this message in any manner that would allow it to be
viewed by any individual not originally listed as a recipient. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorized disclosure, dissemination, distribution,
copying or the taking of any action in reliance on the information
herein is strictly prohibited. If you have received this communication
in error, please immediately notify the sender and delete this message.
Thank you.




More information about the samba-technical mailing list