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