[schema categorization] new NO_I18NCONTEXT set usable to somewhat control c-c i18n
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 13 Oct 2010 16:47:22 +0200
changeset 6481 103774c8c215
parent 6480 2e3dabe00987
child 6482 80ddc3973819
[schema categorization] new NO_I18NCONTEXT set usable to somewhat control c-c i18n
devtools/devctl.py
schema.py
--- a/devtools/devctl.py	Wed Oct 13 16:46:54 2010 +0200
+++ b/devtools/devctl.py	Wed Oct 13 16:47:22 2010 +0200
@@ -122,8 +122,7 @@
     from copy import deepcopy
     from cubicweb.i18n import add_msg
     from cubicweb.web import uicfg
-    from cubicweb.schema import META_RTYPES, WORKFLOW_RTYPES, CONSTRAINTS
-    no_context_rtypes = META_RTYPES | WORKFLOW_RTYPES
+    from cubicweb.schema import NO_I18NCONTEXT, CONSTRAINTS
     w('# schema pot file, generated on %s\n'
       % datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
     w('# \n')
@@ -212,13 +211,13 @@
         else:
             librschema = libschema.rschema(rtype)
         # add context information only for non-metadata rtypes
-        if rschema not in no_context_rtypes:
+        if rschema not in NO_I18NCONTEXT:
             libsubjects = librschema and librschema.subjects() or ()
             for subjschema in rschema.subjects():
                 if not subjschema in libsubjects:
                     add_msg(w, rtype, subjschema.type)
         if not (schema.rschema(rtype).final or rschema.symmetric):
-            if rschema not in no_context_rtypes:
+            if rschema not in NO_I18NCONTEXT:
                 libobjects = librschema and librschema.objects() or ()
                 for objschema in rschema.objects():
                     if not objschema in libobjects:
--- a/schema.py	Wed Oct 13 16:46:54 2010 +0200
+++ b/schema.py	Wed Oct 13 16:47:22 2010 +0200
@@ -62,6 +62,8 @@
                      # cwproperty
                      'for_user',
                      )) | WORKFLOW_RTYPES
+NO_I18NCONTEXT = META_RTYPES | WORKFLOW_RTYPES
+NO_I18NCONTEXT.add('require_permission')
 
 # set of entity and relation types used to build the schema
 SCHEMA_TYPES = set((