1 | #! /usr/bin/env python |
---|
2 | # -*- coding: ISO-8859-15 -*- |
---|
3 | # |
---|
4 | # pkpgcounter : a generic Page Description Language parser |
---|
5 | # |
---|
6 | # (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com> |
---|
7 | # This program is free software; you can redistribute it and/or modify |
---|
8 | # it under the terms of the GNU General Public License as published by |
---|
9 | # the Free Software Foundation; either version 2 of the License, or |
---|
10 | # (at your option) any later version. |
---|
11 | # |
---|
12 | # This program is distributed in the hope that it will be useful, |
---|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | # GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License |
---|
18 | # along with this program; if not, write to the Free Software |
---|
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
20 | # |
---|
21 | # $Id$ |
---|
22 | # |
---|
23 | # |
---|
24 | |
---|
25 | import sys |
---|
26 | from pkpgpdls.version import __version__, __author__, __authoremail__, \ |
---|
27 | __years__, __gplblurb__ |
---|
28 | from pkpgpdls import analyzer |
---|
29 | |
---|
30 | __doc__ = """pkpgcounter v%(__version__)s (c) %(__years__)s %(__author__)s |
---|
31 | |
---|
32 | pkpgcounter is a generic Page Description Language parser. |
---|
33 | |
---|
34 | pkpgcounter parses any number of input files and/or its standard input |
---|
35 | and outputs the number of pages needed to print these documents. |
---|
36 | |
---|
37 | pkpgcounter currently recognizes the following document formats : |
---|
38 | |
---|
39 | * PostScript (both DSC compliant and binary) |
---|
40 | * PDF |
---|
41 | * PCLXL (aka PCL6) |
---|
42 | * PCL3/4/5 (mostly) |
---|
43 | * DVI |
---|
44 | * TIFF |
---|
45 | * ESC/P2 |
---|
46 | * OpenOffice.org Writer |
---|
47 | * OpenOffice.org Impress |
---|
48 | |
---|
49 | command line usage : |
---|
50 | |
---|
51 | pkpgcounter [options] [files] |
---|
52 | |
---|
53 | options : |
---|
54 | |
---|
55 | -v | --version Prints pkpgcounter's version number then exits. |
---|
56 | -h | --help Prints this message then exits. |
---|
57 | |
---|
58 | -d | --debug Activate debug mode. |
---|
59 | |
---|
60 | examples : |
---|
61 | |
---|
62 | $ pkpgcounter file1.ps file2.escp2 file3.pclxl <file4.pcl345 |
---|
63 | |
---|
64 | Will launch pkpgcounter and will output the total number of pages |
---|
65 | needed to print all the documents specified. |
---|
66 | |
---|
67 | %(__gplblurb__)s |
---|
68 | |
---|
69 | Please e-mail bugs to: %(__authoremail__)s""" |
---|
70 | |
---|
71 | if __name__ == "__main__" : |
---|
72 | if (len(sys.argv) >= 2) and (sys.argv[1] in ("-h", "--help")) : |
---|
73 | print __doc__ % globals() |
---|
74 | elif (len(sys.argv) >= 2) and (sys.argv[1] in ("-v", "--version")) : |
---|
75 | print __version__ |
---|
76 | else : |
---|
77 | analyzer.main() |
---|