annotate scripts/dump_global.py @ 250:6c06570af1b9 trunk

Soften dependency on setuptools. Extraction methods can now be referenced using a special section in the mapping configuration, mapping short names to fully-qualified function references.
author cmlenz
date Mon, 13 Aug 2007 22:29:03 +0000
parents da97a3138239
children ca203b2af83c
rev   line source
233
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
1 #!/usr/bin/env python
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
2 # -*- coding: utf-8 -*-
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
3 #
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
4 # Copyright (C) 2007 Edgewall Software
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
5 # All rights reserved.
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
6 #
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
7 # This software is licensed as described in the file COPYING, which
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
8 # you should have received as part of this distribution. The terms
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
9 # are also available at http://babel.edgewall.org/wiki/License.
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
10 #
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
11 # This software consists of voluntary contributions made by many
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
12 # individuals. For the exact contribution history, see the revision
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
13 # history and logs, available at http://babel.edgewall.org/log/.
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
14
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
15 import os
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
16 import pickle
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
17 from pprint import pprint
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
18 import sys
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
19
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
20 import babel
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
21
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
22 dirname = os.path.join(os.path.dirname(babel.__file__))
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
23 filename = os.path.join(dirname, 'global.dat')
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
24 fileobj = open(filename, 'rb')
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
25 try:
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
26 data = pickle.load(fileobj)
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
27 finally:
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
28 fileobj.close()
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
29
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
30 if len(sys.argv) > 1:
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
31 pprint(data.get(sys.argv[1]))
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
32 else:
da97a3138239 Upgraded to CLDR 1.5 and improved timezone formatting.
cmlenz
parents:
diff changeset
33 pprint(data)
Copyright (C) 2012-2017 Edgewall Software