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