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

Python config.copy函数代码示例

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

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



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

示例1: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'resource_proxy'
        wsgiapp = middleware.make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        # create test resource
        create_test_data.CreateTestData.create()
开发者ID:1sha1,项目名称:ckan,代码行数:8,代码来源:test_proxy.py


示例2: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:6779660,项目名称:ckan,代码行数:8,代码来源:test_user.py


示例3: setup_class

    def setup_class(cls):
        cls.original_config = config.copy()

        cls._load_plugins()
        cls.app = _get_test_app()

        search.clear()
        helpers.reset_db()
        cls._create_test_data()
开发者ID:aalecs,项目名称:hdx-ckan-ci,代码行数:9,代码来源:hdx_test_base.py


示例4: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     config['ckan.auth.create_user_via_web'] = True
     new_authz.clear_auth_functions_cache()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:1sha1,项目名称:ckan,代码行数:10,代码来源:test_user.py


示例5: wrapper

        def wrapper(*args, **kwargs):
            _original_config = config.copy()
            config[key] = value

            return_value = func(*args, **kwargs)

            config.clear()
            config.update(_original_config)

            return return_value
开发者ID:AAEMCJALBERT,项目名称:ckan,代码行数:10,代码来源:helpers.py


示例6: setup_class

 def setup_class(cls):
     cls._original_config = config.copy()
     config['ckan.plugins'] = 'resource_proxy'
     wsgiapp = middleware.make_app(config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     create_test_data.CreateTestData.create()
     # Httpretty crashes with Solr on Python 2.6,
     # skip the tests
     if (sys.version_info[0] == 2 and sys.version_info[1] == 6):
         raise nose.SkipTest()
开发者ID:HatemAlSum,项目名称:ckan,代码行数:10,代码来源:test_proxy.py


示例7: setup_class

 def setup_class(cls):
     if not p.plugin_loaded('recline_view'):
         p.load('recline_view')
     if not p.plugin_loaded('datastore'):
         p.load('datastore')
     app_config = config.copy()
     app_config['ckan.legacy_templates'] = 'false'
     app_config['ckan.plugins'] = 'recline_view datastore'
     app_config['ckan.views.default_views'] = 'recline_view'
     wsgiapp = middleware.make_app(config['global_conf'], **app_config)
     cls.app = paste.fixture.TestApp(wsgiapp)
开发者ID:Hoedic,项目名称:ckan,代码行数:11,代码来源:test_view.py


示例8: wrapper

        def wrapper(*args, **kwargs):
            _original_config = config.copy()
            config[key] = value
            new_authz.clear_auth_functions_cache()

            return_value = func(*args, **kwargs)

            config.clear()
            config.update(_original_config)
            new_authz.clear_auth_functions_cache()

            return return_value
开发者ID:BigOpenData,项目名称:ckan,代码行数:12,代码来源:helpers.py


示例9: test_profiles_via_config_option

    def test_profiles_via_config_option(self):

        original_config = config.copy()

        config[RDF_PROFILES_CONFIG_OPTION] = 'profile_conf_1 profile_conf_2'
        try:
            RDFParser()
        except RDFProfileException as e:

            eq_(str(e), 'Unknown RDF profiles: profile_conf_1, profile_conf_2')

        config.clear()
        config.update(original_config)
开发者ID:AQUACROSS,项目名称:ckanext-dcat,代码行数:13,代码来源:test_base_parser.py


示例10: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        for key in config.keys():
            if key.startswith('ofs'):
                del config[key]
        config['ofs.impl'] = 'pairtree'
        config['ckan.storage.bucket'] = 'ckantest'
        config['ofs.storage_dir'] = '/tmp/ckan-test-ckanext-storage'

        create_pairtree_marker( config['ofs.storage_dir'] )
        wsgiapp = make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        CreateTestData.create_test_user()
开发者ID:Accela-Inc,项目名称:ckan,代码行数:14,代码来源:test_storage.py


示例11: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'resource_proxy'
        wsgiapp = middleware.make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        if not cls.serving:
            file_server.serve()
            cls.serving = True
            # gets shutdown when nose finishes all tests,
            # so don't restart ever

        # create test resource
        create_test_data.CreateTestData.create()
开发者ID:ArnY,项目名称:ckan,代码行数:14,代码来源:test_proxy.py


示例12: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config["ckan.plugins"] = "recline_preview"
        wsgiapp = make_app(config["global_conf"], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        cls.p = previewplugin.ReclinePreview()

        # create test resource
        CreateTestData.create()

        context = {"model": model, "session": model.Session, "user": model.User.get("testsysadmin").name}

        cls.package = model.Package.get("annakarenina")
        cls.resource = logic.get_action("resource_show")(context, {"id": cls.package.resources[1].id})
        cls.resource["url"] = pylons.config.get("ckan.site_url", "//localhost:5000")
        cls.resource["format"] = "csv"
        logic.action.update.resource_update(context, cls.resource)
开发者ID:agalino,项目名称:Aragon-Open-data-Website,代码行数:18,代码来源:test_preview.py


示例13: setup_class

    def setup_class(cls):
#        TestAuth.setup_class()
        CreateTestData.create_group_hierarchy_test_data()

        cls.apikeys = {}
        for user in model.Session.query(model.User):
            cls.apikeys[user.name] = str(user.apikey)

        cls._original_config = config.copy()

        config['ckan.auth.roles_that_cascade_to_sub_groups'] = 'admin'

        wsgiapp = ckan.config.middleware.make_app(
            config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        CreateTestData.create_arbitrary(
            package_dicts= [{'name': 'adataset',
                             'groups': ['national-health-service']}],
            extra_user_names=['john'])
开发者ID:EnxEng,项目名称:ckan,代码行数:20,代码来源:test_auth.py


示例14: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'json_preview'
        wsgiapp = make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        cls.p = previewplugin.JsonPreview()

        # create test resource
        CreateTestData.create()

        context = {
            'model': model,
            'session': model.Session,
            'user': model.User.get('testsysadmin').name
        }

        cls.package = model.Package.get('annakarenina')
        cls.resource = logic.get_action('resource_show')(context, {'id': cls.package.resources[1].id})
        cls.resource['url'] = pylons.config.get('ckan.site_url', '//localhost:5000')
        logic.action.update.resource_update(context, cls.resource)
开发者ID:31H0B1eV,项目名称:ckan,代码行数:21,代码来源:test_preview.py


示例15: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()

        # Disable the email notifications feature.
        config['ckan.activity_streams_email_notifications'] = False

        wsgiapp = ckan.config.middleware.make_app(config['global_conf'],
                **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        mock_mail_server.SmtpServerHarness.setup_class()
        pylons_controller.PylonsTestCase.setup_class()
        tests.CreateTestData.create()

        joeadmin = model.User.get('joeadmin')
        cls.joeadmin = {'id': joeadmin.id,
                'apikey': joeadmin.apikey,
                }
        testsysadmin = model.User.get('testsysadmin')
        cls.testsysadmin = {'id': testsysadmin.id,
                'apikey': testsysadmin.apikey,
                }
开发者ID:1sha1,项目名称:ckan,代码行数:22,代码来源:test_email_notifications.py


示例16: setup_class

    def setup_class(cls):
        if not tests.is_datastore_supported():
            raise nose.SkipTest("Datastore not supported")
        p.load('datastore')
        ctd.CreateTestData.create()
        cls.sysadmin_user = model.User.get('testsysadmin')
        cls.normal_user = model.User.get('annafan')
        resource = model.Package.get('annakarenina').resources[0]
        cls.data = {
            'resource_id': resource.id,
            'aliases': 'books',
            'fields': [{'id': u'b\xfck', 'type': 'text'},
                       {'id': 'author', 'type': 'text'},
                       {'id': 'published'},
                       {'id': u'characters', u'type': u'_text'}],
            'records': [{u'b\xfck': 'annakarenina',
                        'author': 'tolstoy',
                        'published': '2005-03-01',
                        'nested': ['b', {'moo': 'moo'}],
                        u'characters': [u'Princess Anna', u'Sergius']},
                        {u'b\xfck': 'warandpeace', 'author': 'tolstoy',
                        'nested': {'a': 'b'}}]
        }
        postparams = '%s=1' % json.dumps(cls.data)
        auth = {'Authorization': str(cls.sysadmin_user.apikey)}
        res = cls.app.post('/api/action/datastore_create', params=postparams,
                           extra_environ=auth)
        res_dict = json.loads(res.body)
        assert res_dict['success'] is True

        import pylons
        engine = db._get_engine(
            {'connection_url': pylons.config['ckan.datastore.write_url']})
        cls.Session = orm.scoped_session(orm.sessionmaker(bind=engine))

        cls._original_config = config.copy()
        config['ckan.plugins'] = 'datastore'
        wsgiapp = middleware.make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)
开发者ID:Hosting-Scripts,项目名称:ckan,代码行数:39,代码来源:test_dump.py


示例17: setup_class

 def setup_class(cls):
     cls.original_config = config.copy()
     plugins.load('example_idatasetform_v4')
开发者ID:6779660,项目名称:ckan,代码行数:3,代码来源:test_example_idatasetform.py


示例18: setup_class

 def setup_class(cls):
     cls._original_config = config.copy()
     config["ckan.plugins"] = "dga_stats"
     wsgiapp = make_app(config["global_conf"], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
开发者ID:DataShades,项目名称:ckanext-dsa-stats,代码行数:5,代码来源:__init__.py


示例19: setup_class

 def setup_class(cls):
     cls._original_config = config.copy()
     config['ckan.storage.directory'] = '/tmp'
     wsgiapp = make_app(config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     CreateTestData.create()
开发者ID:1sha1,项目名称:ckan,代码行数:6,代码来源:test_upload.py


示例20: setup_class

 def setup_class(cls):
     cls.base_csv_path = os.path.join(os.path.dirname(os.path.abspath( __file__ )), 'csv')
     cls._original_config = config.copy()
     config['ckan.plugins'] = 'iati_csv'
     wsgiapp = make_app(config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
开发者ID:dalepotter,项目名称:ckanext-iati,代码行数:6,代码来源:test_csv.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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