[F bw compat] warn if entities.pot exists but consider it anyway
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 29 Jul 2009 09:09:11 +0200
changeset 2551 91f579b7a1e1
parent 2550 4e009026a0f0
child 2560 fee7fb9832d8
[F bw compat] warn if entities.pot exists but consider it anyway
devtools/devctl.py
--- a/devtools/devctl.py	Wed Jul 29 09:08:26 2009 +0200
+++ b/devtools/devctl.py	Wed Jul 29 09:09:11 2009 +0200
@@ -12,7 +12,7 @@
 from datetime import datetime
 from os import mkdir, chdir
 from os.path import join, exists, abspath, basename, normpath, split, isdir
-
+from warnings import warn
 
 from logilab.common import STD_BLACKLIST
 from logilab.common.modutils import get_module_files
@@ -357,8 +357,14 @@
     tempdir = tempfile.mkdtemp()
     print underline_title('Updating i18n catalogs for cube %s' % cube)
     chdir(cubedir)
-    potfiles = [join('i18n', scfile) for scfile in ('static-messages.pot',)
-                if exists(join('i18n', scfile))]
+    if exists(join('i18n', 'entities.pot')):
+        warn('entities.pot is deprecated, rename file to static-messages.pot (%s)'
+             % join('i18n', 'entities.pot'), DeprecationWarning)
+        potfiles = [join('i18n', 'entities.pot')]
+    elif exists(join('i18n', 'static-messages.pot')):
+        potfiles = [join('i18n', 'static-messages.pot')]
+    else:
+        potfiles = []
     print '-> extract schema messages'
     schemapot = join(tempdir, 'schema.pot')
     potfiles.append(schemapot)