devtools/devctl.py
changeset 4021 280c910c8710
parent 3998 94cc7cad3d2d
child 4252 6c4f109c2b03
equal deleted inserted replaced
4018:d4d4e7112ccf 4021:280c910c8710
   111     w(DEFAULT_POT_HEAD)
   111     w(DEFAULT_POT_HEAD)
   112     _generate_schema_pot(w, vreg, schema, libconfig=libconfig, cube=cube)
   112     _generate_schema_pot(w, vreg, schema, libconfig=libconfig, cube=cube)
   113 
   113 
   114 
   114 
   115 def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
   115 def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
   116     from cubicweb.common.i18n import add_msg
   116     from cubicweb.i18n import add_msg
   117     from cubicweb.web import uicfg
   117     from cubicweb.web import uicfg
   118     from cubicweb.schema import META_RTYPES, SYSTEM_RTYPES
   118     from cubicweb.schema import META_RTYPES, SYSTEM_RTYPES
   119     no_context_rtypes = META_RTYPES | SYSTEM_RTYPES
   119     no_context_rtypes = META_RTYPES | SYSTEM_RTYPES
   120     w('# schema pot file, generated on %s\n' % datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
   120     w('# schema pot file, generated on %s\n' % datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
   121     w('# \n')
   121     w('# \n')
   284         import shutil
   284         import shutil
   285         import tempfile
   285         import tempfile
   286         import yams
   286         import yams
   287         from logilab.common.fileutils import ensure_fs_mode
   287         from logilab.common.fileutils import ensure_fs_mode
   288         from logilab.common.shellutils import globfind, find, rm
   288         from logilab.common.shellutils import globfind, find, rm
   289         from cubicweb.common.i18n import extract_from_tal, execute
   289         from cubicweb.i18n import extract_from_tal, execute
   290         tempdir = tempfile.mkdtemp()
   290         tempdir = tempfile.mkdtemp()
   291         potfiles = [join(I18NDIR, 'static-messages.pot')]
   291         potfiles = [join(I18NDIR, 'static-messages.pot')]
   292         print '-> extract schema messages.'
   292         print '-> extract schema messages.'
   293         schemapot = join(tempdir, 'schema.pot')
   293         schemapot = join(tempdir, 'schema.pot')
   294         potfiles.append(schemapot)
   294         potfiles.append(schemapot)
   377 def update_cube_catalogs(cubedir):
   377 def update_cube_catalogs(cubedir):
   378     import shutil
   378     import shutil
   379     import tempfile
   379     import tempfile
   380     from logilab.common.fileutils import ensure_fs_mode
   380     from logilab.common.fileutils import ensure_fs_mode
   381     from logilab.common.shellutils import find, rm
   381     from logilab.common.shellutils import find, rm
   382     from cubicweb.common.i18n import extract_from_tal, execute
   382     from cubicweb.i18n import extract_from_tal, execute
   383     toedit = []
   383     toedit = []
   384     cube = basename(normpath(cubedir))
   384     cube = basename(normpath(cubedir))
   385     tempdir = tempfile.mkdtemp()
   385     tempdir = tempfile.mkdtemp()
   386     print underline_title('Updating i18n catalogs for cube %s' % cube)
   386     print underline_title('Updating i18n catalogs for cube %s' % cube)
   387     chdir(cubedir)
   387     chdir(cubedir)