Commit 5811b33f authored by's avatar
Browse files

fix some rtags pb on i18n catalog generation

branch : tls-sprint
parent b59b7c422a8a
......@@ -5,6 +5,7 @@
:contact: --
__docformat__ = "restructuredtext en"
_ = unicode
from logilab.common.decorators import cached, clear_cache
......@@ -12,8 +13,8 @@ from rql import RQLHelper
from cubicweb import Binary, UnknownProperty, UnknownEid
from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject
from cubicweb.rtags import RTAGS
_ = unicode
def use_interfaces(obj):
"""return interfaces used by the given object by searchinf for implements
......@@ -122,9 +123,10 @@ class CubicWebRegistry(VRegistry):
for appobjects in objects.itervalues():
for appobject in appobjects:
from cubicweb.rtags import RTAGS
# don't check rtags if we don't want to cleanup_interface_sobjects
for rtag in RTAGS:
def initialization_completed(self):
# clear etype cache if you don't want to run into deep weirdness
......@@ -77,6 +77,11 @@ def cleanup_sys_modules(config):
if mod.__file__.startswith(path):
del sys.modules[name]
# fresh rtags
from cubicweb import rtags
from cubicweb.web import uicfg
rtags.RTAGS[:] = []
def generate_schema_pot(w, cubedir=None):
"""generate a pot file with schema specific i18n messages
......@@ -52,14 +52,16 @@ class RelationTags(object):
keys.remove((rtype, tagged, stype, '*'))
return keys
def init(self, schema):
def init(self, schema, check=True):
# XXX check existing keys against schema
if check:
for (rtype, tagged, stype, otype), value in self._tagdefs.items():
for ertype in (stype, rtype, otype):
if ertype != '*' and not ertype in schema:
self.warning('removing rtag %s: %s, %s undefined in schema',
(stype, rtype, otype, tagged), value, ertype)
self.del_rtag(stype, rtype, otype, tagged)
if self._initfunc is not None:
for eschema in schema.entities():
for rschema, tschemas, role in eschema.relation_definitions(True):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment