devtools/devctl.py
branch3.5
changeset 3281 bea1bde00fbc
parent 3280 c1f5625f2fea
child 3285 fa3dc35b564f
equal deleted inserted replaced
3280:c1f5625f2fea 3281:bea1bde00fbc
    18 from logilab.common.modutils import get_module_files
    18 from logilab.common.modutils import get_module_files
    19 from logilab.common.textutils import splitstrip
    19 from logilab.common.textutils import splitstrip
    20 from logilab.common.shellutils import ASK
    20 from logilab.common.shellutils import ASK
    21 from logilab.common.clcommands import register_commands
    21 from logilab.common.clcommands import register_commands
    22 
    22 
    23 from cubicweb import CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage, underline_title
    23 from cubicweb import (CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage,
       
    24                       underline_title)
       
    25 from cubicweb.schema import META_RTYPES
    24 from cubicweb.__pkginfo__ import version as cubicwebversion
    26 from cubicweb.__pkginfo__ import version as cubicwebversion
    25 from cubicweb.toolsutils import Command, copy_skeleton
    27 from cubicweb.toolsutils import Command, copy_skeleton
    26 from cubicweb.web import uicfg
    28 from cubicweb.web import uicfg
    27 from cubicweb.web.webconfig import WebConfiguration
    29 from cubicweb.web.webconfig import WebConfiguration
    28 from cubicweb.server.serverconfig import ServerConfiguration
    30 from cubicweb.server.serverconfig import ServerConfiguration
   148         relations = [r for r in schema.relations() if not r in libschema]
   150         relations = [r for r in schema.relations() if not r in libschema]
   149     else:
   151     else:
   150         relations = schema.relations()
   152         relations = schema.relations()
   151     for rschema in sorted(set(relations)):
   153     for rschema in sorted(set(relations)):
   152         rtype = rschema.type
   154         rtype = rschema.type
   153         for subjschema in rschema.subjects():
   155         # bw compat, necessary until all translation of relation are done properly...
   154             add_msg(w, rtype, subjschema.type)
       
   155             # bw compat, necessary until all translation of relation are done properly...
       
   156         add_msg(w, rtype)
   156         add_msg(w, rtype)
       
   157         # add context information only for non-metadata rtypes
       
   158         if rschema not in META_RTYPES:
       
   159             for subjschema in rschema.subjects():
       
   160                 add_msg(w, rtype, subjschema.type)
   157         done.add(rtype)
   161         done.add(rtype)
   158         if not (schema.rschema(rtype).is_final() or rschema.symetric):
   162         if not (schema.rschema(rtype).is_final() or rschema.symetric):
   159             for objschema in rschema.objects():
   163             for objschema in rschema.objects():
   160                 add_msg(w, '%s_object' % rtype, objschema.type)
   164                 add_msg(w, '%s_object' % rtype, objschema.type)
   161             # bw compat, necessary until all translation of relation are done properly...
   165             # bw compat, necessary until all translation of relation are done properly...