#! /usr/bin/env python # -*- coding: ISO-8859-15 -*- # PyKota Print Quota Quote sender # # PyKota - Print Quotas for CUPS and LPRng # # (c) 2003-2004 Jerome Alet # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # # $Id$ # # $Log$ # Revision 1.7 2004/01/12 22:43:40 jalet # New formula to compute a job's price # # Revision 1.6 2004/01/08 14:10:32 jalet # Copyright year changed. # # Revision 1.5 2003/10/09 21:25:25 jalet # Multiple printer names or wildcards can be passed on the command line # separated with commas. # Beta phase. # # Revision 1.4 2003/10/07 09:07:27 jalet # Character encoding added to please latest version of Python # # Revision 1.3 2003/07/29 20:55:17 jalet # 1.14 is out ! # # Revision 1.2 2003/07/25 10:41:29 jalet # Better documentation. # pykotme now displays the current user's account balance. # Some test changed in ldap module. # # Revision 1.1 2003/07/03 09:44:01 jalet # Now includes the pykotme utility # # # import sys import os import pwd from pykota import version from pykota.tool import PyKotaTool, PyKotaToolError from pykota.config import PyKotaConfigError from pykota.storage import PyKotaStorageError __doc__ = """pykotme v%s (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres Gives print quotes to users. command line usage : pykotme [options] [files] options : -v | --version Prints pykotme's version number then exits. -h | --help Prints this message then exits. -P | --printer p Gives a quote for this printer only. Actually p can use wildcards characters to select only some printers. The default value is *, meaning all printers. You can specify several names or wildcards, by separating them with commas. examples : $ pykotme --printer apple file1.ps file2.ps This will give a print quote to the current user. The quote will show the price and size of a job consisting in file1.ps and file2.ps which would be sent to the apple printer. $ pykotme --printer apple,hplaser