From Fedora Project Wiki
(Moved design docs here from parent)
Line 2: Line 2:


This page has information about the printing configuration tool used in Fedora, '''system-config-printer'''.  The tool is for configuring a CUPS server, and uses the Internet Printing Protocol (''IPP'') to do so.  For local servers this is delegated to PolicyKit when available.
This page has information about the printing configuration tool used in Fedora, '''system-config-printer'''.  The tool is for configuring a CUPS server, and uses the Internet Printing Protocol (''IPP'') to do so.  For local servers this is delegated to PolicyKit when available.
== Structure ==
The configuration tool is written in Python and uses GTK+.  The IPP handling is done using the [[#pycups|pycups]] Python extension.  Windows print share browsing is provided by the [[#pysmbc|pysmbc]] Python extension.
=== Main application ===
The main application provides a graphical interface for editing printer queues.
=== Applet ===
The printer applet displays an icon in the notification area when you have jobs queued to print.
=== pycups ===
In order to communicate with a CUPS server, '''system-config-printer''' uses the <code>libcups</code> library provided by CUPS.  This provides a fairly high-level API for performing several common operations such as adding and removing printers.  It also provides a lower-level API for constructing arbitrary IPP requests.
Another API provided by this library is one for inspecting and manipulating ''PPD files'', which define what format the printer requires data in, as well as any options and their choices and defaults.
Bindings for the high-level IPP API and for the PPD API are provided by pycups, currently shipped in the same source RPM as the configuration tool.
=== pysmbc ===
The <code>libsmbclient</code> library is used to discover and browse CIFS print shares.  Python bindings for a simple subset of this API are provided by pysmbc, currently shipped in the same source RPM as the configuration tool.


== PolicyKit configuration ==
== PolicyKit configuration ==

Revision as of 09:35, 19 March 2010

system-config-printer

This page has information about the printing configuration tool used in Fedora, system-config-printer. The tool is for configuring a CUPS server, and uses the Internet Printing Protocol (IPP) to do so. For local servers this is delegated to PolicyKit when available.

Structure

The configuration tool is written in Python and uses GTK+. The IPP handling is done using the pycups Python extension. Windows print share browsing is provided by the pysmbc Python extension.

Main application

The main application provides a graphical interface for editing printer queues.

Applet

The printer applet displays an icon in the notification area when you have jobs queued to print.

pycups

In order to communicate with a CUPS server, system-config-printer uses the libcups library provided by CUPS. This provides a fairly high-level API for performing several common operations such as adding and removing printers. It also provides a lower-level API for constructing arbitrary IPP requests.

Another API provided by this library is one for inspecting and manipulating PPD files, which define what format the printer requires data in, as well as any options and their choices and defaults.

Bindings for the high-level IPP API and for the PPD API are provided by pycups, currently shipped in the same source RPM as the configuration tool.

pysmbc

The libsmbclient library is used to discover and browse CIFS print shares. Python bindings for a simple subset of this API are provided by pysmbc, currently shipped in the same source RPM as the configuration tool.

PolicyKit configuration

The printing configuration tool uses PolicyKit when configuring CUPS on the local machine. For normal IPP operations the policy determining who gets to modify what is defined in the CUPS configuration file /etc/cups/cupsd.conf. Configuring CUPS using PolicyKit (cups-pk-helper) is an extra mechanism with its own policy.

The default cups-pk-helper policy requires administrative authentication for most actions. Here is how you can customize that in two steps.

  • Add yourself to the desktop_admin group. With the new user account dialog this is done by clicking the padlock labelled Click to make changes, then changing the Account type to Administrator.
  • Create a pklocalauthority file called /var/lib/polkit/localauthority/50-local.d/10-printer-config.pkla with this content:
[Desktop Administrator Permissions]
Identity=unix-group:desktop_admin_r
Action=org.opensuse.cupspkhelper.mechanism.*
ResultAny=no
ResultInactive=no
ResultActive=yes

Original design discussion for system-config-printer