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

Import _ from cubicweb

parent b3d5cdb9eff2
......@@ -15,11 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-seda adapter classes for generation of a profile generation as HTML"""
from cubicweb import _
from cubes.seda.entities.profile_generation import SEDA2ExportAdapter, content_types
from cubes.seda.entities.profile_generation import xselement_scheme_attribute
_ = unicode
def element_uml_cardinality(occ, card_entity):
"""Return UML like cardinality for the given pyxst Occurence. Cardinality may be
......
......@@ -21,6 +21,7 @@ import itertools
from yams import ValidationError
from yams.schema import role_name
from cubicweb import _
from cubicweb.predicates import is_instance, score_entity
from cubicweb.server import hook
......@@ -28,8 +29,6 @@ from cubes.seda.entities import rule_type_from_etype
from cubes.seda.entities.generated import CHOICE_RTYPE
_ = unicode
SEDA_PARENT_RTYPES = {}
CHOICE_RTYPE_ROLE = dict(itertools.chain(*CHOICE_RTYPE.values()))
CHOICE_RTYPES = set(CHOICE_RTYPE_ROLE)
......
......@@ -18,10 +18,10 @@
from yams.buildobjs import EntityType, RelationType, RelationDefinition
from yams.buildobjs import String
from cubicweb import _
from cubicweb.schema import ERQLExpression, RRQLExpression
from cubes.skos import schema as skos
_ = unicode
_('1')
_('0..1')
_('0..n')
......
......@@ -23,10 +23,10 @@
from yams.buildobjs import EntityType, RelationDefinition
from yams.buildobjs import String, Boolean
from cubicweb import _
from cubicweb.schema import RQLConstraint
from cubes.seda.schema import seda_profile_element
_ = unicode
@seda_profile_element()
class SEDAArchiveTransfer(EntityType):
......
......@@ -18,7 +18,7 @@ from copy import deepcopy
from yams import BASE_TYPES
from cubicweb import tags, neg_role
from cubicweb import tags, neg_role, _
from cubicweb.utils import UStringIO
from cubicweb.web import formwidgets as fw, formfields as ff
# XXX alias to avoid side effect: uicfg will become our uicfg submodule. Not necessary with 3.23?
......@@ -28,7 +28,6 @@ from cubes.seda.xsd import XSDM_MAPPING
from cubes.seda.xsd2uicfg import FIRST_LEVEL_ETYPES
from cubes.seda.views.widgets import SEDAMetaField
_ = unicode
pvs = cwuicfg.primaryview_section
afs = cwuicfg.autoform_section
......
......@@ -17,6 +17,7 @@
from logilab.common.decorators import monkeypatch
from cubicweb import _
from cubicweb.predicates import is_instance
from cubicweb.web import formwidgets as fw
from cubicweb.web.views import tabs, uicfg, reledit
......@@ -26,8 +27,6 @@ from cubes.seda.views import rtags_from_xsd_element, rtags_from_rtype_role_targe
from cubes.seda.views import viewlib, copy_rtag
from cubes.seda.views import uicfg as sedauicfg # noqa - ensure those rules are defined first
_ = unicode
at_ordered_fields = [
('seda_archival_agency', 'subject'),
('seda_transferring_agency', 'subject'),
......
......@@ -17,7 +17,7 @@
from logilab.common.registry import objectify_predicate, yes
from cubicweb import tags
from cubicweb import tags, _
from cubicweb.predicates import is_instance
from cubicweb.view import EntityView
from cubicweb.web.views import uicfg, baseviews, tabs
......@@ -31,7 +31,6 @@ from cubes.seda.views import (add_subobject_link, add_subobjects_button, dropdow
from cubes.seda.views import viewlib, widgets, archivetransfer
from cubes.seda.views import uicfg as sedauicfg # noqa - ensure those rules are defined first
_ = unicode
afs = uicfg.autoform_section
pvs = uicfg.primaryview_section
......
......@@ -18,6 +18,7 @@
from logilab.common.registry import objectify_predicate
from logilab.mtconverter import xml_escape
from cubicweb import _
from cubicweb.predicates import is_instance
from cubicweb.web.views import tabs, uicfg
......@@ -28,7 +29,6 @@ from cubes.seda.views import rtags_from_rtype_role_targets, rtags_from_xsd_eleme
from cubes.seda.views import viewlib, widgets
from cubes.seda.views import uicfg as sedauicfg # noqa - ensure those rules are defined first
_ = unicode
pvs = uicfg.primaryview_section
pvdc = uicfg.primaryview_display_ctrl
......
......@@ -19,7 +19,7 @@ import json
from logilab.mtconverter import xml_escape
from cubicweb import tags, view
from cubicweb import tags, view, _
from cubicweb.predicates import match_form_params, is_instance
from cubicweb.web.views import uicfg, tabs
......@@ -32,7 +32,6 @@ from cubes.seda.views import rtags_from_xsd_element, add_subobject_link
from cubes.seda.views import viewlib
from cubes.seda.views import uicfg as sedauicfg # noqa - ensure those rules are defined first
_ = unicode
pvs = uicfg.primaryview_section
pvdc = uicfg.primaryview_display_ctrl
......
......@@ -15,12 +15,11 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-saem-ref views related to XSD download"""
from cubicweb import _
from cubicweb.predicates import is_instance, one_line_rset
from cubicweb.web import httpcache, action
from cubicweb.web.views import idownloadable
_ = unicode
class SEDA2DownloadRNGAction(action.Action):
__regid__ = 'seda.seda2export.rng'
......
......@@ -15,11 +15,10 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-seda views for ArchiveUnit"""
from cubicweb import _
from cubicweb.predicates import adaptable
from cubicweb.web import component
_ = unicode
class SEDAArchiveUnitTree(component.EntityCtxComponent):
"""Display the whole archive unit tree."""
......
......@@ -15,11 +15,10 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""THIS FILE IS GENERATED FROM SEDA 2.0 XSD FILES, DO NOT EDIT"""
from cubicweb import _
from cubicweb.web import formwidgets as fw
from cubicweb.web.views import uicfg
_ = unicode
ives = uicfg.indexview_etype_section
ives['SEDAOriginatingAgency'] = 'subobject'
ives['SEDADataObjectVersion'] = 'subobject'
......
......@@ -15,7 +15,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""Library of views use there and there in the interface"""
from cubicweb import tags
from cubicweb import tags, _
from cubicweb.predicates import match_kwargs, is_instance
from cubicweb.view import EntityView
from cubicweb.web.views import tabs
......@@ -23,8 +23,6 @@ from cubicweb.web.views import tabs
from cubes.seda.xsd2uicfg import FIRST_LEVEL_ETYPES
from cubes.seda.views import add_subobjects_button
_ = unicode
class XSDMetaEntityView(EntityView):
__regid__ = 'seda.xsdmeta'
......
......@@ -89,9 +89,9 @@ class UICFGGenerator(CodeGenerator):
def _generate(self, mapping, stream):
self._processed = set()
stream.write('from cubicweb import _\n')
stream.write('from cubicweb.web import formwidgets as fw\n')
stream.write('from cubicweb.web.views import uicfg\n\n')
stream.write('_ = unicode\n\n')
# indexview_etype_section configuration
stream.write('ives = uicfg.indexview_etype_section\n')
all_etypes = set()
......
......@@ -414,10 +414,10 @@ class YamsSchemaGenerator(CodeGenerator):
def _generate(self, mapping, stream):
stream.write('''from yams.buildobjs import EntityType, RelationDefinition
from yams.buildobjs import String, Boolean
from cubicweb import _
from cubicweb.schema import RQLConstraint
from cubes.seda.schema import seda_profile_element
_ = unicode
''')
self._processed_complex_rdef = set()
......
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