Debian Codegraph @

scripts/dump_global.py

raw
1 #!/usr/bin/env python
2 #
3 # Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team
4 # All rights reserved.
5 #
6 # This software is licensed as described in the file LICENSE, which
7 # you should have received as part of this distribution. The terms
8 # are also available at https://github.com/python-babel/babel/blob/master/LICENSE.
9 #
10 # This software consists of voluntary contributions made by many
11 # individuals. For the exact contribution history, see the revision
12 # history and logs, available at https://github.com/python-babel/babel/commits/master/.
13
14 import os
15 import pickle
16 import sys
17 from pprint import pprint
18
19 import babel
20
21 dirname = os.path.join(os.path.dirname(babel.__file__))
22 filename = os.path.join(dirname, 'global.dat')
23 with open(filename, 'rb') as fileobj:
24 data = pickle.load(fileobj)
25
26 if len(sys.argv) > 1:
27 pprint(data.get(sys.argv[1]))
28 else:
29 pprint(data)