• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python xmlconfig.string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中zope.configuration.xmlconfig.string函数的典型用法代码示例。如果您正苦于以下问题:Python string函数的具体用法?Python string怎么用?Python string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUpZope

    def setUpZope(self, app, configurationContext):
        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '</configure>',
            context=configurationContext)

        # Load ZCML
        import ftw.subsite
        xmlconfig.file('configure.zcml', ftw.subsite,
                       context=configurationContext)

        xmlconfig.file('overrides.zcml', ftw.subsite,
                       context=configurationContext)

        # import plone.app.portlets
        # xmlconfig.file('configure.zcml', plone.app.portlets,
        #                context=configurationContext)

        # import collective.MockMailHost
        # xmlconfig.file('configure.zcml', collective.MockMailHost,
        #                context=configurationContext)

        # installProduct() is *only* necessary for packages outside
        # the Products.* namespace which are also declared as Zope 2 products,
        # using <five:registerPackage /> in ZCML.
        z2.installProduct(app, 'plone.app.portlets')
        z2.installProduct(app, 'ftw.subsite')
        z2.installProduct(app, 'ftw.simplelayout')
        z2.installProduct(app, 'collective.MockMailHost')
开发者ID:ucdavis,项目名称:ftw.subsite,代码行数:32,代码来源:testing.py


示例2: setUpProducts

    def setUpProducts(self, app):
        super(ZopeLayer, self).setUpProducts(app)
        configurationContext = self['configurationContext']

        # Plone < 4.3
        import Products.GenericSetup
        xmlconfig.file('meta.zcml', Products.GenericSetup,
                       context=configurationContext)

        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        if IS_PLONE_5:
            xmlconfig.string('''
            <configure>
            <include package="plone.app.caching" />
            <include package="plonetheme.barceloneta" />
            </configure>''', context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        import Products.Five
        xmlconfig.file('meta.zcml', Products.Five,
                       context=configurationContext)

        import ftw.inflator
        xmlconfig.file('configure.zcml', ftw.inflator,
                       context=configurationContext)
        xmlconfig.file('overrides.zcml', ftw.inflator,
                       context=configurationContext)
        xmlconfig.file('configure.zcml', ftw.inflator.tests,
                       context=configurationContext)

        apply_patches()
开发者ID:4teamwork,项目名称:ftw.inflator,代码行数:35,代码来源:testing.py


示例3: setUpZope

    def setUpZope(self, app, configurationContext):
        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            "</configure>",
            context=configurationContext,
        )

        import Products.CMFPlacefulWorkflow

        xmlconfig.file("configure.zcml", Products.CMFPlacefulWorkflow, context=configurationContext)

        try:
            # Plone >= 4.3.x
            import Products.DataGridField

            xmlconfig.file("configure.zcml", Products.DataGridField, context=configurationContext)
        except:
            pass

        z2.installProduct(app, "ftw.file")
        z2.installProduct(app, "ftw.meeting")
        z2.installProduct(app, "ftw.mail")
        z2.installProduct(app, "ftw.workspace")
开发者ID:4teamwork,项目名称:ftw.mail,代码行数:26,代码来源:testing.py


示例4: setUpZope

    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        if IS_PLONE_APP_MULTILINGUAL_2:
            z2.installProduct(app, 'Products.DateRecurringIndex')

        import ftw.inflator
        xmlconfig.file('configure.zcml', ftw.inflator,
                       context=configurationContext)

        xmlconfig.file('configure.zcml', ftw.inflator.tests,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml', plone.app.multilingual,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml', plone.app.dexterity,
                       context=configurationContext)

        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '</configure>',
            context=configurationContext)

        setupCoreSessions(app)
开发者ID:4teamwork,项目名称:ftw.inflator,代码行数:34,代码来源:testing.py


示例5: test_configure

    def test_configure(self):
        _ = xmlconfig.string(r"""
        <configure xmlns="http://namespaces.zope.org/browser" i18n_domain="zope">
        <include package="zope.browsermenu" file="meta.zcml" />
        <menu
          id="zmi_views"
          title="Views"
          />

        <menu
          id="zmi_actions"
          title="Actions"
        />
        </configure>
        """)

        xmlconfig.string(r"""
        <configure xmlns="http://namespaces.zope.org/zope">
          <include package="zope.app.broken" />
        </configure>
        """)
        from zope import component
        from zope.interface import implementer

        from zope.publisher.interfaces.browser import IDefaultBrowserLayer
        @implementer(IDefaultBrowserLayer)
        class Layer(object):
            pass

        self.assertIsNotNone(component.getMultiAdapter(
            (Broken(), Layer()),
            name='index.html'))
开发者ID:zopefoundation,项目名称:zope.app.broken,代码行数:32,代码来源:tests.py


示例6: testRegisterDistributedTranslations

    def testRegisterDistributedTranslations(self):
        from zope.configuration import xmlconfig
        self.assert_(queryUtility(ITranslationDomain, 'zope-i18n') is None)
        xmlconfig.string(
            template % '''
            <configure package="zope.i18n.tests">
            <i18n:registerTranslations directory="locale" />
            </configure>
            ''', self.context)
        xmlconfig.string(
            template % '''
            <configure package="zope.i18n.tests">
            <i18n:registerTranslations directory="locale2" />
            </configure>
            ''', self.context)
        path1 = os.path.join(os.path.dirname(zope.i18n.tests.__file__),
                             'locale', 'en', 'LC_MESSAGES', 'zope-i18n.mo')
        path2 = os.path.join(os.path.dirname(zope.i18n.tests.__file__),
                             'locale2', 'en', 'LC_MESSAGES', 'zope-i18n.mo')
        util = getUtility(ITranslationDomain, 'zope-i18n')
        self.assertEquals(util._catalogs.get('test'), ['test', 'test'])
        self.assertEquals(util._catalogs.get('en'),
                          [unicode(path1), unicode(path2)])

        msg = util.translate(u'Additional message', target_language='en')
        self.assertEquals(msg, u'Additional message translated')

        msg = util.translate(u'New Domain', target_language='en')
        self.assertEquals(msg, u'New Domain translated')

        msg = util.translate(u'New Language', target_language='en')
        self.assertEquals(msg, u'New Language translated')
开发者ID:ejucovy,项目名称:zope_i18n_fork_r105273,代码行数:32,代码来源:test_zcml.py


示例7: setUpZope

    def setUpZope(self, app, configurationContext):
        # Load ZCML for this package

        # xmlconfig.file('configure.zcml', Products.DateRecurringIndex,
        #                context=configurationContext)
        # xmlconfig.file('configure.zcml', plone.app.event,
        #                context=configurationContext)

        z2.installProduct(app, 'Products.DateRecurringIndex')
        xmlconfig.file('configure.zcml', plone.app.contenttypes,
                       context=configurationContext)
        xmlconfig.file('configure.zcml', collective.tinymcetiles,
                       context=configurationContext)
        xmlconfig.file('configure.zcml', plone.app.contentlistingtile,
                       context=configurationContext)
        xmlconfig.string("""\
<configure package="collective.tinymcetiles"
           xmlns="http://namespaces.plone.org/plone">
    <tile
        name="dummy.tile"
        title="Dummy tile"
        description="dummy"
        add_permission="cmf.ModifyPortalContent"
        class=".testing.DummyTile"
        permission="zope2.View"
        for="*"
        />
</configure>
""", context=configurationContext)
开发者ID:collective,项目名称:collective.tinymcetiles,代码行数:29,代码来源:testing.py


示例8: setUpZope

    def setUpZope(self, app, configurationContext):
        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '  <include package="Products.CMFPlacefulWorkflow" />'
            '</configure>',
            context=configurationContext)

        # DatagridField doesn't define the auto-include entry point
        import Products.DataGridField
        xmlconfig.file('configure.zcml',
                       Products.DataGridField,
                       context=configurationContext)

        z2.installProduct(app, 'ftw.workspace')
        z2.installProduct(app, 'ftw.file')
        z2.installProduct(app, 'ftw.meeting')
        z2.installProduct(app, 'Products.DataGridField')
        z2.installProduct(app, 'egov.contactdirectory')
        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')
        # Dep. of egov.contactdirectory
        z2.installProduct(app, 'ftw.contentpage')
        z2.installProduct(app, 'simplelayout.types.common')
开发者ID:4teamwork,项目名称:ftw.workspace,代码行数:25,代码来源:testing.py


示例9: setUpZCML

    def setUpZCML(self):
        """Load the basic ZCML configuration from Five. Exposes a resource
        ``configurationContext`` which can be used to load further ZCML.
        """

        # Push a new global registry so that we can cleanly tear down all ZCML
        from plone.testing import zca
        zca.pushGlobalRegistry()

        # Load something akin to the default site.zcml without actually auto-
        # loading products

        self['configurationContext'] = context = zca.stackConfigurationContext(self.get('configurationContext'))

        from zope.configuration import xmlconfig
        xmlconfig.string("""\
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:meta="http://namespaces.zope.org/meta">

    <include package="Products.Five" />
    <meta:redefinePermission from="zope2.Public" to="zope.Public" />

    <securityPolicy component="Products.Five.security.FiveSecurityPolicy" />

</configure>
""", context=context)
开发者ID:adamcheasley,项目名称:plone.testing,代码行数:27,代码来源:z2.py


示例10: zcml

def zcml(s, execute=True):
    from zope.app.appsetup.appsetup import __config_context as context
    try:
        xmlconfig.string(s, context, execute=execute)
    except:
        context.end()
        raise
开发者ID:BGCX261,项目名称:zope-alchemist-svn-to-git,代码行数:7,代码来源:test_doc.py


示例11: setUpZope

    def setUpZope(self, app, configurationContext):
        # load ZCML
        import plone.app.blocks
        self.loadZCML(package=plone.app.blocks)

        # Register directory for testing
        xmlconfig.string("""\
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="plone"
    package="plone.app.blocks.tests">

    <plone:static
        type="sitelayout"
        name="testlayout1"
        directory="resources/sitelayout/testlayout1"
        />

    <plone:static
        type="sitelayout"
        name="testlayout2"
        directory="resources/sitelayout/testlayout2"
        />

</configure>
""", context=configurationContext)
        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
开发者ID:Vinsurya,项目名称:Plone,代码行数:33,代码来源:testing.py


示例12: initialize_1

def initialize_1(config_path=None):
    """First initialization step.

    * Zope component architecture
    * The configuration system
    * Run-time directories

    :param config_path: The path to the configuration file.
    :type config_path: string
    """
    zcml = resource_string('mailman.config', 'configure.zcml')
    xmlconfig.string(zcml)
    # By default, set the umask so that only owner and group can read and
    # write our files.  Specifically we must have g+rw and we probably want
    # o-rwx although I think in most cases it doesn't hurt if other can read
    # or write the files.
    os.umask(0o007)
    # Initialize configuration event subscribers.  This must be done before
    # setting up the configuration system.
    from mailman.app.events import initialize as initialize_events
    initialize_events()
    # config_path will be set if the command line argument -C is given.  That
    # case overrides all others.  When not given on the command line, the
    # configuration file is searched for in the file system.
    if config_path is None:
        config_path = search_for_configuration_file()
    elif config_path is INHIBIT_CONFIG_FILE:
        # For the test suite, force this back to not using a config file.
        config_path = None
    mailman.config.config.load(config_path)
开发者ID:trevor,项目名称:mailman3,代码行数:30,代码来源:initialize.py


示例13: setUpZope

    def setUpZope(self, app, configurationContext):
        # load ZCML
        import plone.app.blocks
        self.loadZCML(package=plone.app.blocks)
        
        # Register directory for testing
        xmlconfig.string("""\
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="plone"
    package="plone.app.blocks.tests">
    
    <plone:static
        type="sitelayout"
        name="testlayout1"
        directory="resources/sitelayout/testlayout1"
        />
    
    <plone:static
        type="sitelayout"
        name="testlayout2"
        directory="resources/sitelayout/testlayout2"
        />

</configure>
""", context=configurationContext)
开发者ID:lrowe,项目名称:plone.app.blocks,代码行数:27,代码来源:testing.py


示例14: apply_customization_ui

def apply_customization_ui():
    """Called from ui.app.on_wsgi_application_created_event -- must be called
    AFTER custom types have been catalysed.
    """
    # combine config string and execute it
    zcml = ZCML_SLUG.format(ui_zcml_decls="".join([ zd for zd in UI_ZC_DECLS ]))
    log.debug("Executing UI feature configuration:\n%s" % (zcml))
    xmlconfig.string(zcml)
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:8,代码来源:feature.py


示例15: setUpZope

 def setUpZope(self, app, configurationContext):
     xmlconfig.string(
         '<configure xmlns="http://namespaces.zope.org/zope">'
         '  <include package="z3c.autoinclude" file="meta.zcml" />'
         '  <includePlugins package="plone" />'
         '  <includePluginsOverrides package="plone" />'
         '</configure>',
         context=configurationContext)
开发者ID:4teamwork,项目名称:ftw.treeview,代码行数:8,代码来源:testing.py


示例16: setUp

def setUp(test):
    print "\n---------- SETUP ----------", test
    placelesssetup.setUp()
    xmlconfig.string(zcml_slug)
    metadata.create_all(checkfirst=True)
    # placelesssetup.tearDown() clears the registry
    print "\n---------- register_generic_workflow_adapters -------------", test
    adapters.register_generic_workflow_adapters()
开发者ID:gelie,项目名称:bungeni_src,代码行数:8,代码来源:test_doctests.py


示例17: setUpZope

    def setUpZope(self, app, configurationContext):
        path = os.path.normpath(os.path.join(
            os.path.dirname(__file__), os.path.pardir, 'resources'))
        xmlconfig.string("""\
<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:plone="http://namespaces.plone.org/plone">
  <plone:static directory="%s" />
</configure>
""" % path, context=configurationContext)
开发者ID:datakurre,项目名称:plonetheme.webpack,代码行数:9,代码来源:tests.py


示例18: test_zcml_import_settings_works

 def test_zcml_import_settings_works(self):
    context = xmlconfig.file('meta.zcml', collective.websocketclient)
    xmlconfig.string('''
       <configure xmlns:websocketclient="http://namespaces.plone.org/websocketclient">
           <websocketclient:connection name="test" host="127.0.0.1" port="9000"/>
       </configure>
    ''', context=context)
    cfg = queryUtility(IZCMLWebSocketConnectionConfig)
    self.assertEqual((cfg.name, cfg.host, cfg.port), ('test', '127.0.0.1',9000))
开发者ID:koodaamo,项目名称:collective.websocketclient,代码行数:9,代码来源:tests.py


示例19: _runSnippet

 def _runSnippet(self, snippet):
     from zope.configuration import xmlconfig
     template = """\
     <configure xmlns='http://namespaces.zope.org/zope'
                i18n_domain="zope">
        <include package="zope.component" file="meta.zcml" />
        %s
     </configure>""" % snippet
     xmlconfig.string(template)
开发者ID:zopefoundation,项目名称:zope.component,代码行数:9,代码来源:test_zcml.py


示例20: test_ZCMLconfigured_connection_creation

 def test_ZCMLconfigured_connection_creation(self):
    context = xmlconfig.file('meta.zcml', collective.websocketclient)
    xmlconfig.string('''
       <configure xmlns:websocketclient="http://namespaces.plone.org/websocketclient">
           <websocketclient:connection name="test" host="127.0.0.1" port="9000"/>
       </configure>
    ''', context=context)
    manager = queryUtility(IWebSocketConnectionManager)
    wsc_connection = manager.getConnection()
    self.assertEqual((wsc_connection.host, wsc_connection.port), ('127.0.0.1',9000))
开发者ID:koodaamo,项目名称:collective.websocketclient,代码行数:10,代码来源:tests.py



注:本文中的zope.configuration.xmlconfig.string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python xmlconfig.xmlconfig函数代码示例发布时间:2022-05-26
下一篇:
Python xmlconfig.registerCommonDirectives函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap