cmlenz@263: #!/usr/bin/env python cmlenz@263: # -*- coding: utf-8 -*- cmlenz@263: # cmlenz@263: # Copyright (C) 2007 Edgewall Software cmlenz@263: # All rights reserved. cmlenz@263: # cmlenz@263: # This software is licensed as described in the file COPYING, which cmlenz@263: # you should have received as part of this distribution. The terms cmlenz@263: # are also available at http://babel.edgewall.org/wiki/License. cmlenz@263: # cmlenz@263: # This software consists of voluntary contributions made by many cmlenz@263: # individuals. For the exact contribution history, see the revision cmlenz@263: # history and logs, available at http://babel.edgewall.org/log/. cmlenz@263: cmlenz@263: import os cmlenz@263: import pickle cmlenz@263: from pprint import pprint cmlenz@263: import sys cmlenz@263: cmlenz@263: import babel cmlenz@263: cmlenz@263: dirname = os.path.join(os.path.dirname(babel.__file__)) cmlenz@263: filename = os.path.join(dirname, 'global.dat') cmlenz@263: fileobj = open(filename, 'rb') cmlenz@263: try: cmlenz@263: data = pickle.load(fileobj) cmlenz@263: finally: cmlenz@263: fileobj.close() cmlenz@263: cmlenz@263: if len(sys.argv) > 1: cmlenz@263: pprint(data.get(sys.argv[1])) cmlenz@263: else: cmlenz@263: pprint(data)