[2478] | 1 | <!-- $Id: filterpykota.sgml 1454 2005-03-06 16:52:43Z jerome $ --> |
---|
| 2 | |
---|
| 3 | <chapter> |
---|
| 4 | <title id="filter">PyKota's internals</title> |
---|
[3413] | 5 | |
---|
[2478] | 6 | <para>Last modified on $Date: 2005-03-06 17:52:43 +0100 (dim, 06 mar 2005) $</para> |
---|
[3413] | 7 | |
---|
[2478] | 8 | <para> |
---|
[3413] | 9 | To account for pages or eventually ink usage |
---|
[2478] | 10 | <footnote> |
---|
| 11 | <para> |
---|
| 12 | PyKota doesn't currently account for ink usage, it only accounts |
---|
| 13 | pages. To account for ink usage, you should use PrintBill instead for now. |
---|
[3413] | 14 | </para> |
---|
| 15 | </footnote> |
---|
[2478] | 16 | , you must plug your accounting |
---|
| 17 | system somewhere into the printing system you use. One way to do this without having |
---|
| 18 | to modify the printing system itself, is by using a <firstterm>filter</firstterm>. |
---|
| 19 | </para> |
---|
[3413] | 20 | |
---|
[2478] | 21 | <para> |
---|
| 22 | A filter is a computer program which takes data in one format as its input, and outputs the |
---|
| 23 | same data but transformed into another format. <application>CUPS</application> already |
---|
[3413] | 24 | contains many filters. For example there's one filter named <command>pstops</command> which accepts |
---|
[2478] | 25 | PostScript data as its input, and, as its name implies, outputs PostScript data too, but after having |
---|
| 26 | eventually rearranged the pages to fit several pages on a single sheet of paper, or other manipulations |
---|
| 27 | like that. |
---|
| 28 | </para> |
---|
[3413] | 29 | |
---|
[2478] | 30 | <para> |
---|
[2551] | 31 | The <command>pstops</command> filter described above is also in charge of doing basic page |
---|
[2478] | 32 | accounting, but <application>PyKota</application> currently doesn't use this facility since it may |
---|
| 33 | prove to be unreliable depending on the drivers used or if a paper jam occurs for example. |
---|
| 34 | </para> |
---|
[3413] | 35 | |
---|
[2478] | 36 | <para> |
---|
| 37 | So to do its own accounting, <application>PyKota</application> has its own filters, for <application>CUPS</application> |
---|
[2551] | 38 | it's named <command>cupspykota</command>, which is in fact a <application>CUPS</application> backends wrapper. |
---|
[3413] | 39 | The procedure to plug the correct filter into your printing system is described in the |
---|
[2478] | 40 | <xref linkend="installation" endterm="installation"> chapter. |
---|
| 41 | </para> |
---|
[3413] | 42 | |
---|
[2478] | 43 | <para> |
---|
[2835] | 44 | Currently with <application>CUPS</application>' internal accounting mechanism, the <command>pstops</command> |
---|
[2478] | 45 | filter can be bypassed. That's why <application>PyKota</application> uses its own backend. |
---|
[2551] | 46 | The <command>cupspykota</command> backend wrapper ensures that jobs can't bypass it, so you can use |
---|
[2478] | 47 | any printer with any driver and any command line option, and you can be sure that your |
---|
| 48 | print job will be correctly accounted for. |
---|
| 49 | </para> |
---|
[3413] | 50 | |
---|
[2478] | 51 | <para> |
---|
| 52 | When using the <literal>hardware</literal> accounting method, |
---|
| 53 | <application>PyKota</application> launches the script you specified to |
---|
| 54 | ask the printer for its internal page counter at the start and at the end of the print job, and |
---|
[3413] | 55 | computes the values' difference to know the job's size. |
---|
[2478] | 56 | </para> |
---|
[3413] | 57 | |
---|
[2478] | 58 | <para> |
---|
| 59 | When using the <literal>software</literal> accounting method, |
---|
[3413] | 60 | the command you specified is launched with the job's data on its |
---|
[2478] | 61 | standard input. Your command must print the job's size in number of |
---|
| 62 | pages on a single line on its standard output. This number is then |
---|
| 63 | read by <application>PyKota</application> and used to update the current user's quota information. |
---|
| 64 | </para> |
---|
[3413] | 65 | |
---|
[2478] | 66 | <para> |
---|
| 67 | If a problem occurs, it is logged either to the filter's standard error or to the system logger, depending on |
---|
| 68 | your preferences in <application>PyKota</application>'s configuration files. Also if a print quota is reached |
---|
| 69 | you may choose if the administrator, the user, both or no-one will receive an email message explaining |
---|
| 70 | the situation and proposing a solution. You can even configure another action instead of sending email |
---|
| 71 | messages if you want. |
---|
| 72 | </para> |
---|
[3413] | 73 | |
---|
[2478] | 74 | </chapter> |
---|
| 75 | |
---|