[794] | 1 | #! /usr/bin/python |
---|
| 2 | |
---|
| 3 | # PyKota Print Quota Reports generator |
---|
| 4 | # |
---|
| 5 | # PyKota - Print Quotas for CUPS |
---|
| 6 | # |
---|
| 7 | # (c) 2003 Jerome Alet <alet@librelogiciel.com> |
---|
[873] | 8 | # This program is free software; you can redistribute it and/or modify |
---|
| 9 | # it under the terms of the GNU General Public License as published by |
---|
| 10 | # the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | # (at your option) any later version. |
---|
[794] | 12 | # |
---|
[873] | 13 | # This program is distributed in the hope that it will be useful, |
---|
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | # GNU General Public License for more details. |
---|
| 17 | # |
---|
| 18 | # You should have received a copy of the GNU General Public License |
---|
| 19 | # along with this program; if not, write to the Free Software |
---|
| 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
[794] | 21 | # |
---|
| 22 | # $Id$ |
---|
| 23 | # |
---|
| 24 | # $Log$ |
---|
[893] | 25 | # Revision 1.4 2003/04/08 21:20:25 jalet |
---|
| 26 | # CGI Script now displays a link to PyKota's website. |
---|
| 27 | # |
---|
[873] | 28 | # Revision 1.3 2003/03/29 13:45:27 jalet |
---|
| 29 | # GPL paragraphs were incorrectly (from memory) copied into the sources. |
---|
| 30 | # Two README files were added. |
---|
| 31 | # Upgrade script for PostgreSQL pre 1.01 schema was added. |
---|
| 32 | # |
---|
[799] | 33 | # Revision 1.2 2003/02/12 11:31:51 jalet |
---|
| 34 | # doesn't use the jaxml module anymore |
---|
| 35 | # |
---|
[794] | 36 | # Revision 1.1 2003/02/10 13:41:38 jalet |
---|
| 37 | # repykota cgi script added. |
---|
| 38 | # cleaner doc. |
---|
| 39 | # |
---|
| 40 | |
---|
| 41 | import sys |
---|
| 42 | import os |
---|
| 43 | import cgi |
---|
| 44 | |
---|
[799] | 45 | header = """Content-type: text/html |
---|
[794] | 46 | |
---|
[799] | 47 | <?xml version="1.0" encoding="iso-8859-1"?> |
---|
| 48 | <html> |
---|
| 49 | <head> |
---|
| 50 | <title>Print Quota Report</title> |
---|
| 51 | </head> |
---|
| 52 | <body> |
---|
| 53 | <h2>Print Quota Report</h2> |
---|
[893] | 54 | <p> |
---|
| 55 | <pre>""" |
---|
[794] | 56 | |
---|
[799] | 57 | footer = """ |
---|
[893] | 58 | </pre> |
---|
| 59 | </p> |
---|
| 60 | <p> |
---|
| 61 | Report generated with <a href="http://www.librelogiciel.com/software/">PyKota</a> |
---|
| 62 | </p> |
---|
[799] | 63 | </body> |
---|
| 64 | </html>""" |
---|
[794] | 65 | |
---|
[799] | 66 | print header |
---|
[794] | 67 | |
---|
| 68 | out = os.popen("repykota") |
---|
[799] | 69 | print out.read().strip() |
---|
[794] | 70 | out.close() |
---|
| 71 | |
---|
[799] | 72 | print footer |
---|