Commit b4bd73ae authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

move i18n / migration modules from cw.common to cw

parent d4d4e7112ccf
......@@ -926,11 +926,11 @@ the repository',
def migration_handler(self):
"""return a migration handler instance"""
from cubicweb.common.migration import MigrationHelper
from cubicweb.migration import MigrationHelper
return MigrationHelper(self, verbosity=self.verbosity)
def i18ncompile(self, langs=None):
from cubicweb.common import i18n
from cubicweb import i18n
if langs is None:
langs = self.available_languages()
i18ndir = join(self.apphome, 'i18n')
......
......@@ -311,7 +311,7 @@ repository and the web server.',
# handle i18n files structure
# in the first cube given
print '-> preparing i18n catalogs'
from cubicweb.common import i18n
from cubicweb import i18n
langs = [lang for lang, _ in i18n.available_catalogs(join(templdirs[0], 'i18n'))]
errors = config.i18ncompile(langs)
if errors:
......@@ -666,7 +666,7 @@ given, appropriate sources for migration will be automatically selected \
# * install new languages
# * recompile catalogs
# in the first componant given
from cubicweb.common import i18n
from cubicweb import i18n
templdir = cwcfg.cube_dir(config.cubes()[0])
langs = [lang for lang, _ in i18n.available_catalogs(join(templdir, 'i18n'))]
errors = config.i18ncompile(langs)
......
......@@ -113,7 +113,7 @@ def generate_schema_pot(w, cubedir=None):
def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
from cubicweb.common.i18n import add_msg
from cubicweb.i18n import add_msg
from cubicweb.web import uicfg
from cubicweb.schema import META_RTYPES, SYSTEM_RTYPES
no_context_rtypes = META_RTYPES | SYSTEM_RTYPES
......@@ -286,7 +286,7 @@ class UpdateCubicWebCatalogCommand(Command):
import yams
from logilab.common.fileutils import ensure_fs_mode
from logilab.common.shellutils import globfind, find, rm
from cubicweb.common.i18n import extract_from_tal, execute
from cubicweb.i18n import extract_from_tal, execute
tempdir = tempfile.mkdtemp()
potfiles = [join(I18NDIR, 'static-messages.pot')]
print '-> extract schema messages.'
......@@ -379,7 +379,7 @@ def update_cube_catalogs(cubedir):
import tempfile
from logilab.common.fileutils import ensure_fs_mode
from logilab.common.shellutils import find, rm
from cubicweb.common.i18n import extract_from_tal, execute
from cubicweb.i18n import extract_from_tal, execute
toedit = []
cube = basename(normpath(cubedir))
tempdir = tempfile.mkdtemp()
......
......@@ -59,6 +59,8 @@ COPY_CW_FILES = (
'cwconfig.py',
'entity.py',
'interfaces.py',
'i18n.py',
'migration.py',
'rqlrewrite.py',
'rset.py',
'schema.py',
......@@ -69,7 +71,6 @@ COPY_CW_FILES = (
'view.py',
'common/mail.py',
'common/migration.py',
'common/mixins.py',
'common/mttransforms.py',
'common/uilib.py',
......@@ -224,7 +225,7 @@ class NewGoogleAppCommand(Command):
join(packagesdir, include))
# generate sample config
from cubicweb.goa.goaconfig import GAEConfiguration
from cubicweb.common.migration import MigrationHelper
from cubicweb.migration import MigrationHelper
config = GAEConfiguration(appid, appldir)
if exists(config.main_config_file()):
mih = MigrationHelper(config)
......
......@@ -38,7 +38,7 @@ from cubicweb import AuthenticationError, ETYPE_NAME_MAP
from cubicweb.schema import (META_RTYPES, VIRTUAL_RTYPES,
CubicWebRelationSchema, order_eschemas)
from cubicweb.dbapi import get_repository, repo_connect
from cubicweb.common.migration import MigrationHelper, yes
from cubicweb.migration import MigrationHelper, yes
try:
from cubicweb.server import SOURCE_TYPES, schemaserial as ss
......
......@@ -510,7 +510,7 @@ def nfrdef2rql(rschema, subjtype, objtype, props):
def rdefrelations2rql(rschema, subjtype, objtype, props):
iterators = []
for constraint in props['constraints']:
for constraint in props.constraints:
iterators.append(constraint2rql(rschema, subjtype, objtype, constraint))
return chain(*iterators)
......
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