10 |
10 |
11 import sys |
11 import sys |
12 from datetime import datetime |
12 from datetime import datetime |
13 from os import mkdir, chdir |
13 from os import mkdir, chdir |
14 from os.path import join, exists, abspath, basename, normpath, split, isdir |
14 from os.path import join, exists, abspath, basename, normpath, split, isdir |
15 |
15 from warnings import warn |
16 |
16 |
17 from logilab.common import STD_BLACKLIST |
17 from logilab.common import STD_BLACKLIST |
18 from logilab.common.modutils import get_module_files |
18 from logilab.common.modutils import get_module_files |
19 from logilab.common.textutils import get_csv |
19 from logilab.common.textutils import get_csv |
20 from logilab.common.clcommands import register_commands |
20 from logilab.common.clcommands import register_commands |
355 toedit = [] |
355 toedit = [] |
356 cube = basename(normpath(cubedir)) |
356 cube = basename(normpath(cubedir)) |
357 tempdir = tempfile.mkdtemp() |
357 tempdir = tempfile.mkdtemp() |
358 print underline_title('Updating i18n catalogs for cube %s' % cube) |
358 print underline_title('Updating i18n catalogs for cube %s' % cube) |
359 chdir(cubedir) |
359 chdir(cubedir) |
360 potfiles = [join('i18n', scfile) for scfile in ('static-messages.pot',) |
360 if exists(join('i18n', 'entities.pot')): |
361 if exists(join('i18n', scfile))] |
361 warn('entities.pot is deprecated, rename file to static-messages.pot (%s)' |
|
362 % join('i18n', 'entities.pot'), DeprecationWarning) |
|
363 potfiles = [join('i18n', 'entities.pot')] |
|
364 elif exists(join('i18n', 'static-messages.pot')): |
|
365 potfiles = [join('i18n', 'static-messages.pot')] |
|
366 else: |
|
367 potfiles = [] |
362 print '-> extract schema messages' |
368 print '-> extract schema messages' |
363 schemapot = join(tempdir, 'schema.pot') |
369 schemapot = join(tempdir, 'schema.pot') |
364 potfiles.append(schemapot) |
370 potfiles.append(schemapot) |
365 # explicit close necessary else the file may not be yet flushed when |
371 # explicit close necessary else the file may not be yet flushed when |
366 # we'll using it below |
372 # we'll using it below |