1#!/usr/bin/env python
2# -*- Mode: python -*-
3
4#    Copyright (C) 2001 Artifex Software Inc.
5#    All Rights Reserved.
6#
7# This software is provided AS-IS with no warranty, either express or
8# implied.
9#
10# This software is distributed under license and may not be copied, modified
11# or distributed except as expressly authorized under the terms of that
12# license.  Refer to licensing information at http://www.artifex.com/
13# or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
14# San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
15
16# $Id: dump_testdb,v 1.7 2004/07/14 18:21:24 ray Exp $
17
18#
19# dump_baseline_plus.py [<dbfile> [name]]
20#
21# dumps (prints out) the contents of the baselinedb
22
23import sys, anydbm, gsconf, os
24
25args=sys.argv
26myself=args.pop(0)
27
28if len(args) > 0:
29    name=args.pop(0)
30else:
31    print "no database name"
32    sys.exit(1)
33
34if not os.path.exists(name):
35    print "cannot open",name
36    sys.exit(1)
37
38db = anydbm.open(name)
39
40base=os.path.basename(name)
41
42keys=db.keys()
43keys.sort()
44for k in keys:
45    print "%50s %15s %s" % (k, base, db[k])
46
47