[cups.development] Python API For Converting Model Name intothe Location of the PPD file

Michael R Sweet msweet at apple.com
Mon Mar 23 15:08:41 PDT 2009


If the printer supports the Port Monitor MIB, then you can find the  
device ID OID (ppmPrinterIEEE1284DeviceId) at . 
1.3.6.1.4.1.2699.1.2.1.2.1.1.3.  If not, use snmpwalk to find the OID  
corresponding to the device ID...

On Mar 23, 2009, at 1:48 PM, Bin Li wrote:

> Thank you very much for your response. Yes, your suggestion sounds  
> good. It's better to use IEEE 1284 Device ID. If I do the SNMP  
> query, can I get the Device ID from the printer?
>
>> This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
>> --------------enig297CE9BCA0BBD51DDE39F302
>> Content-Type: text/plain; charset=UTF-8; format=flowed
>> Content-Transfer-Encoding: quoted-printable
>>
>> Bin Li wrote:
>>> Is there a python API or C API to convert the human-readable model  
>>> name=
>> into the location of the PPD file in CUPS? For instance, it takes  
>> 'HP La=
>> serJet 2410' as an input and converts it into '/usr/share/cups/ 
>> model/foom=
>> atic-db-ppds/HP_LaserJet_2410.ppd.gz'
>>
>> Often when I've been asked questions like this it has turned out to  
>> be=20
>> the wrong question.  What exactly are you trying to do -- what's  
>> the=20
>> problem you're trying to solve?
>>
>> For instance, is it that you are trying to find a PPD for a  
>> particular=20
>> printer that has been plugged in?  If so, it would be better to use  
>> the=20
>> IEEE 1284 Device ID to match against, in which case you really want  
>> to=20
>> try to match the ID first.
>>
>> The basic method of matching is to use a CUPS-Get-PPDs IPP request,  
>> and=20
>> there is a C API for this in libcups (and a Python API in pycups).=20
>> However, depending on your requirements you may have to filter  
>> through=20
>> the resulting list of PPDs to find the "best" one for your needs.   
>> There =
>>
>> may be several PPDs that match a particular printer model,  
>> corresponding =
>>
>> to different drivers that are able to drive it.
>>
>> Tim.
>> */
>>
>>
>> --------------enig297CE9BCA0BBD51DDE39F302
>> Content-Type: application/pgp-signature; name="signature.asc"
>> Content-Description: OpenPGP digital signature
>> Content-Disposition: attachment; filename="signature.asc"
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>>
>> iD8DBQFJw23kaSWRox63mSMRAnSJAJsHkTYD1t7TUlraFtDN/QJSWtWGWwCaA2e4
>> t2nSD4XEBUk+h9PE02ncR5A=
>> =PuHe
>> -----END PGP SIGNATURE-----
>>
>> --------------enig297CE9BCA0BBD51DDE39F302--
>>
>
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev

____________________________________
Michael R Sweet, Senior Printing System Engineer







More information about the cups-devel mailing list