devtools/devctl.py
changeset 2650 18aec79ec3a3
parent 2633 bc9386c3b2c9
child 2657 de974465d381
equal deleted inserted replaced
2649:5d4a943695d1 2650:18aec79ec3a3
    88     """generate a pot file with schema specific i18n messages
    88     """generate a pot file with schema specific i18n messages
    89 
    89 
    90     notice that relation definitions description and static vocabulary
    90     notice that relation definitions description and static vocabulary
    91     should be marked using '_' and extracted using xgettext
    91     should be marked using '_' and extracted using xgettext
    92     """
    92     """
    93     from cubicweb.cwvreg import CubicWebRegistry
    93     from cubicweb.cwvreg import CubicWebVRegistry
    94     cube = cubedir and split(cubedir)[-1]
    94     cube = cubedir and split(cubedir)[-1]
    95     libconfig = DevDepConfiguration(cube)
    95     libconfig = DevDepConfiguration(cube)
    96     libconfig.cleanup_interface_sobjects = False
    96     libconfig.cleanup_interface_sobjects = False
    97     cleanup_sys_modules(libconfig)
    97     cleanup_sys_modules(libconfig)
    98     if cubedir:
    98     if cubedir:
   100         config.cleanup_interface_sobjects = False
   100         config.cleanup_interface_sobjects = False
   101     else:
   101     else:
   102         config = libconfig
   102         config = libconfig
   103         libconfig = None
   103         libconfig = None
   104     schema = config.load_schema(remove_unused_rtypes=False)
   104     schema = config.load_schema(remove_unused_rtypes=False)
   105     vreg = CubicWebRegistry(config)
   105     vreg = CubicWebVRegistry(config)
   106     # set_schema triggers objects registrations
   106     # set_schema triggers objects registrations
   107     vreg.set_schema(schema)
   107     vreg.set_schema(schema)
   108     w(DEFAULT_POT_HEAD)
   108     w(DEFAULT_POT_HEAD)
   109     _generate_schema_pot(w, vreg, schema, libconfig=libconfig, cube=cube)
   109     _generate_schema_pot(w, vreg, schema, libconfig=libconfig, cube=cube)
   110 
   110 
   185                         add_msg(w, label)
   185                         add_msg(w, label)
   186                         add_msg(w, label2)
   186                         add_msg(w, label2)
   187     #cube = (cube and 'cubes.%s.' % cube or 'cubicweb.')
   187     #cube = (cube and 'cubes.%s.' % cube or 'cubicweb.')
   188     done = set()
   188     done = set()
   189     if libconfig is not None:
   189     if libconfig is not None:
   190         from cubicweb.cwvreg import CubicWebRegistry
   190         from cubicweb.cwvreg import CubicWebVRegistry
   191         libvreg = CubicWebRegistry(libconfig)
   191         libvreg = CubicWebVRegistry(libconfig)
   192         libvreg.set_schema(libschema) # trigger objects registration
   192         libvreg.set_schema(libschema) # trigger objects registration
   193         # prefill done set
   193         # prefill done set
   194         list(_iter_vreg_objids(libvreg, done))
   194         list(_iter_vreg_objids(libvreg, done))
   195     for objid in _iter_vreg_objids(vreg, done):
   195     for objid in _iter_vreg_objids(vreg, done):
   196         add_msg(w, '%s_description' % objid)
   196         add_msg(w, '%s_description' % objid)