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