12 |
""" |
""" |
13 |
#print buildProperties('countries', ['en', 'fr'], 'country-codes.txt') |
#print buildProperties('countries', ['en', 'fr'], 'country-codes.txt') |
14 |
|
|
15 |
|
from Globals import package_home |
16 |
|
import os |
17 |
|
|
18 |
def buildProperties(item, item_langs, keyfile): |
def buildProperties(item, item_langs, keyfile): |
19 |
|
|
20 |
codes = [] |
codes = [] |
21 |
# FIXME: heh...ummmm |
# FIXME: heh...ummmm |
22 |
for line in open('/home/tvon/Zope/lib/python/Products/CMFGeographics/data/%s' % keyfile): |
for line in open('%s/data/%s' % (os.path.split(__file__)[0].replace('Extensions', ''), keyfile)): |
23 |
codes.append(line.replace('\n', '')) |
codes.append(line.replace('\n', '')) |
24 |
|
|
25 |
|
|
26 |
countries = {} |
countries = {} |
27 |
for lang in item_langs: |
for lang in item_langs: |
28 |
countries[lang] = {} |
countries[lang] = {} |
29 |
for line in open('/home/tvon/Zope/lib/python/Products/CMFGeographics/data/%s-%s.txt' % (item, lang)): |
for line in open('%s/data/%s-%s.txt' % (os.path.split(__file__)[0].replace('Extensions', ''), item, lang)): |
30 |
(k, v) = line.replace('\n', '').split('|') |
(k, v) = line.replace('\n', '').split('|') |
31 |
countries[lang][k] = v |
countries[lang][k] = v |
32 |
|
|