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

Python interface.moduleProvides函数代码示例

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

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



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

示例1: import

    IObjectRemovedEvent,
    IContainerModifiedEvent)
from zope.container.contained import (
    ObjectAddedEvent,
    ObjectMovedEvent,
    ObjectRemovedEvent,
    ContainerModifiedEvent)

from grok.events import ApplicationInitializedEvent
from grok.components import Application
from grok.components import View, Form, AddForm, EditForm, DisplayForm
from grok.components import XMLRPC, REST, JSON
from grok.components import Traverser
from grok.components import Indexes
from grok.components import Role
from grok.interfaces import IRESTSkinType, IRESTLayer
from grok.interfaces import IApplicationInitializedEvent

from grok.directive import (
    permissions, site, restskin, traversable)

# BBB These two functions are meant for test fixtures and should be
# imported from grok.testing, not from grok.
from grok.testing import grok, grok_component

# Our __init__ provides the grok API directly so using 'import grok' is enough.
from grok.interfaces import IGrokAPI
from zope.interface import moduleProvides
moduleProvides(IGrokAPI)
__all__ = list(IGrokAPI)
开发者ID:grodniewicz,项目名称:oship,代码行数:30,代码来源:__init__.py


示例2: moduleProvides

try:
    from _LFBTree import LFBucket
    from _LFBTree import LFSet
    from _LFBTree import LFBTree
    from _LFBTree import LFTreeSet
    from _LFBTree import difference
    from _LFBTree import union
    from _LFBTree import intersection
    from _LFBTree import multiunion
    from _OIBTree import weightedUnion
    from _OIBTree import weightedIntersection
except ImportError: #pragma NO COVER
    LFBucket = LFBucketPy
    LFSet = LFSetPy
    LFBTree = LFBTreePy
    LFTreeSet = LFTreeSetPy
    difference = differencePy
    union = unionPy
    intersection = intersectionPy
    multiunion = multiunionPy
    weightedUnion = weightedUnionPy
    weightedIntersection = weightedIntersectionPy

Bucket = LFBucket
Set = LFSet
BTree = LFBTree
TreeSet = LFTreeSet

moduleProvides(IIntegerFloatBTreeModule)
开发者ID:goschtl,项目名称:zope,代码行数:29,代码来源:LFBTree.py


示例3: moduleProvides

from guillotina.component._api import subscribers
from guillotina.component._declaration import adaptedBy
from guillotina.component._declaration import adapter
from guillotina.component._declaration import adapts
from guillotina.component.globalregistry import get_global_components
from guillotina.component.globalregistry import provide_adapter
from guillotina.component.globalregistry import provide_handler
from guillotina.component.globalregistry import provide_subscription_adapter
from guillotina.component.globalregistry import provide_utility
from guillotina.component.interfaces import ComponentLookupError
from guillotina.component.interfaces import IComponentArchitecture
from guillotina.component.interfaces import IComponentLookup
from guillotina.component.interfaces import IComponentRegistrationConvenience
from guillotina.component.interfaces import IFactory
from zope.interface import moduleProvides


# b/w compat imports. Will be removed in 3.0
getMultiAdapter = get_multi_adapter
queryMultiAdapter = query_multi_adapter
getAdapter = get_adapter
queryAdapter = query_adapter
getUtility = get_utility
queryUtility = query_utility
getUtilitiesFor = get_utilities_for
getAdapters = get_adapters


moduleProvides(IComponentArchitecture, IComponentRegistrationConvenience)
__all__ = tuple(IComponentArchitecture)  # type: ignore
开发者ID:nazrulworld,项目名称:guillotina,代码行数:30,代码来源:__init__.py


示例4: Footer

class Footer(ViewletManager):
    context(Interface)
    request(IHTTPRequest)


class AboveBody(ViewletManager):
    context(Interface)
    request(IHTTPRequest)


class BelowBody(ViewletManager):
    context(Interface)
    request(IHTTPRequest)


class Master(Layout):
    context(Interface)
    request(IHTTPRequest)

    template = get_template('master.pt')

    def render(self, view=None, *args, **kwargs):
        if view is not None:
            resources = Resources(self.context, self.request, view)
            resources()
        return Layout.render(self, view=view, *args, **kwargs)


moduleProvides(API.IGlobalUI)
__all__ = list(API.IGlobalUI)
开发者ID:trollfot,项目名称:dolmen.app.layout,代码行数:30,代码来源:master.py


示例5: import

from zope.interface import moduleProvides

# Twisted imports
from twisted.python.compat import nativeString
from twisted.python.runtime import platform
from twisted.python.filepath import FilePath
from twisted.internet import error, defer, interfaces, protocol
from twisted.python import log, failure
from twisted.names import (
    dns, common, resolve, cache, root, hosts as hostsModule)
from twisted.internet.abstract import isIPv6Address



moduleProvides(interfaces.IResolver)



class Resolver(common.ResolverBase):
    """
    @ivar _waiting: A C{dict} mapping tuple keys of query name/type/class to
        Deferreds which will be called back with the result of those queries.
        This is used to avoid issuing the same query more than once in
        parallel.  This is more efficient on the network and helps avoid a
        "birthday paradox" attack by keeping the number of outstanding requests
        for a particular query fixed at one instead of allowing the attacker to
        raise it to an arbitrary number.

    @ivar _reactor: A provider of L{IReactorTCP}, L{IReactorUDP}, and
        L{IReactorTime} which will be used to set up network resources and
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:30,代码来源:client.py


示例6: moduleProvides

from ConfigParser import SafeConfigParser
import json
import os

from zope.interface import moduleProvides

from carapace.config import Config, Configurator, main, ssh
from carapace.sdk import interfaces

from prakasha import meta


moduleProvides(interfaces.IConfig)


# Main
main.config.datadir = os.path.expanduser("~/.%s" % meta.library_name)
main.config.localfile = "config.ini"
main.config.installedfile = os.path.join(main.config.datadir, main.config.localfile)

# Internal SSH Server
ssh.servicename = "SSH Server"
ssh.port = 6622
ssh.keydir = ".prakasha-ssh"
ssh.banner = """:
: Welcome to
:
:    .;@@
:      [email protected]@@
:        @@@                                 +'
:        '@@;                                [email protected]@`
开发者ID:oubiwann,项目名称:bot-prakasha-ke,代码行数:31,代码来源:config.py


示例7: BTree

from BTrees.Interfaces import IIntegerIntegerBTreeModule as IBTreeInterface
import BTrees.IIBTree as TreeModule
from zope.interface import moduleProvides

max_internal_size = 2850
max_leaf_size = 1425


class BTree(TreeModule.BTree):
    max_internal_size = max_internal_size
    max_leaf_size = max_leaf_size


class TreeSet(TreeModule.TreeSet):
    max_internal_size = max_internal_size
    max_leaf_size = max_leaf_size


Set = TreeModule.Set
Bucket = TreeModule.Bucket
difference = TreeModule.difference
union = TreeModule.union
intersection = TreeModule.intersection
multiunion = TreeModule.multiunion
weightedUnion = TreeModule.weightedUnion
weightedIntersection = TreeModule.weightedIntersection

moduleProvides(IBTreeInterface)
开发者ID:felixonmars,项目名称:zerodb,代码行数:28,代码来源:IIBTree.py


示例8: packer

    if '_outerWidget' in child.__dict__:
        # print 'parenting', parent, child,
        if '_innerWidget' in parent.__dict__:
            if child._outerWidget.parent is not None:
                raise ValueError, 'child %r is already parented to a %r' % \
                      (child, child._outerWidget.parent)
            # print 'concreted'
            try:
                packer = parent._innerWidget.pack_start
            except AttributeError:
                # maybe it's a Window?
                parent._innerWidget.add(child._outerWidget)
                parent._innerWidget.set_border_width(child.border)
            else:
                packer(child._outerWidget, child.expand, child.fill,
                       child.border)
        else:
            if parent.parent is None:
                # print 'postponed'
                try:
                    parent._childrenToParent.append (child)
                except AttributeError:
                    parent._childrenToParent = [child]
            else:
                # print 'forwarded to', parent.parent
                # logger.warning('using old forwarding; please update %r or %r' \
                #                % (parent, child))
                parent.parent._concreteParenter (child)

moduleProvides(ISkin)
开发者ID:BackupTheBerlios,项目名称:luca-erp-svn,代码行数:30,代码来源:__init__.py


示例9: _set_operation

multiunionPy = _set_operation(_multiunion, LOSetPy)

try:
    from ._LOBTree import LOBucket
except ImportError: #pragma NO COVER w/ C extensions
    LOBucket = LOBucketPy
    LOSet = LOSetPy
    LOBTree = LOBTreePy
    LOTreeSet = LOTreeSetPy
    LOTreeIterator = LOTreeIteratorPy
    difference = differencePy
    union = unionPy
    intersection = intersectionPy
    multiunion = multiunionPy
else: #pragma NO COVER w/o C extensions
    from ._LOBTree import LOSet
    from ._LOBTree import LOBTree
    from ._LOBTree import LOTreeSet
    from ._LOBTree import LOTreeIterator
    from ._LOBTree import difference
    from ._LOBTree import union
    from ._LOBTree import intersection
    from ._LOBTree import multiunion

Bucket = LOBucket
Set = LOSet
BTree = LOBTree
TreeSet = LOTreeSet

moduleProvides(IIntegerObjectBTreeModule)
开发者ID:B-Rich,项目名称:BTrees,代码行数:30,代码来源:LOBTree.py


示例10: Copyright

##############################################################################
#
# Copyright (c) 2006-2009 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Grokcore.annotation
"""

from grokcore.component import *

from grokcore.annotation.components import Annotation, Model

# BBB These two functions are meant for test fixtures and should be
# imported from grok.testing, not from grok.
from grokcore.annotation.testing import grok

# Our __init__ provides the grok API directly so using 'import grok' is enough.
from grokcore.annotation.interfaces import IGrokcoreAnnotationAPI
from zope.interface import moduleProvides
moduleProvides(IGrokcoreAnnotationAPI)
__all__ = list(IGrokcoreAnnotationAPI)
开发者ID:grodniewicz,项目名称:oship,代码行数:29,代码来源:__init__.py


示例11: Copyright

##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test module that declares an interface

$Id: m1.py 70826 2006-10-20 03:41:16Z baijum $
"""
from zope.interface import Interface, moduleProvides

class I1(Interface): pass
class I2(Interface): pass

moduleProvides(I1, I2)
开发者ID:ConduitTeam,项目名称:hue,代码行数:23,代码来源:m1.py


示例12: moduleProvides

# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Convenience functions for traversing the object tree.
"""
from zope.interface import moduleProvides
from zope.location.interfaces import ILocationInfo, IRoot, LocationError
from zope.traversing.interfaces import ITraversalAPI, ITraverser


moduleProvides(ITraversalAPI)
__all__ = tuple(ITraversalAPI)

_marker = object()

def joinPath(path, *args):
    """Join the given relative paths to the given path.

    Returns a unicode path.

    The path should be well-formed, and not end in a '/' unless it is
    the root path. It can be either a string (ascii only) or unicode.
    The positional arguments are relative paths to be added to the
    path as new path segments.  The path may be absolute or relative.

    A segment may not start with a '/' because that would be confused
开发者ID:Andyvs,项目名称:TrackMonthlyExpenses,代码行数:31,代码来源:api.py


示例13: _fix_pickle

    IBSet = IBSetPy
    IBBTree = IBBTreePy
    IBTreeSet = IBTreeSetPy
    IBTreeIterator = IBTreeIteratorPy
    difference = differencePy
    union = unionPy
    intersection = intersectionPy
    multiunion = multiunionPy
    weightedUnion = weightedUnionPy
    weightedIntersection = weightedIntersectionPy
else: #pragma NO COVER w/o C extensions
    from ._IBBTree import IBSet
    from ._IBBTree import IBBTree
    from ._IBBTree import IBTreeSet
    from ._IBBTree import IBTreeIterator
    from ._IBBTree import difference
    from ._IBBTree import union
    from ._IBBTree import intersection
    from ._IBBTree import multiunion
    from ._IBBTree import weightedUnion
    from ._IBBTree import weightedIntersection

Bucket = IBBucket
Set = IBSet
BTree = IBBTree
TreeSet = IBTreeSet

_fix_pickle(globals(), __name__)

moduleProvides(IIntegerByteBTreeModule)
开发者ID:SpamExperts,项目名称:BTrees,代码行数:30,代码来源:IBBTree.py


示例14: removeAllProxies

         return obj.__subject__
     else:
         return obj

def removeAllProxies(obj):
    return getProxiedObject(obj)


def sameProxiedObjects(obj1,obj2):
    if getProxiedObject(obj1) == getProxiedObject(obj2):
        return True
    else:
        return False    
        
        
    
    
    
    
moduleProvides(IProxyIntrospection)
__all__ = tuple(IProxyIntrospection)

def ProxyIterator(p):
    yield p
    while isProxy(p):
        p = getProxiedObject(p)
        yield p

def non_overridable(func):
    return property(lambda self: func.__get__(self))
开发者ID:logonod,项目名称:bfg-pages,代码行数:30,代码来源:zope.proxy.__init__.py


示例15: search

    def search(term, *args, **kwargs):
        """Searches elements matching the given term.
        """


class ICatalogSearcher(ISearcher):
    """Defines a specialized searcher using a catalog.
    """
    catalog = Object(
        title = u"Catalog in which the search has to occur.",
        schema = ICatalog,
        required = True
        )

    def search(term, index, permission="zope.View"):
        """Searches a catalog for elements matching the term.
        The searcher can check a given permission on the objects
        of the result set.
        """


class ISearchAPI(Interface):
    """The public Search API.
    """
    ISearcher = Attribute("A component dedicated to search")
    ICatalogSearcher = Attribute("A specialized ISearcher querying a catalog")


moduleProvides(ISearchAPI)
__all__ = list(ISearchAPI)
开发者ID:trollfot,项目名称:dolmen.app.search,代码行数:30,代码来源:interfaces.py


示例16: loadFile

    _model = loadFile(filename, policy=policy, _frame=_frame + 1)
    return _model.schemata[schema]


def loadFile(filename, reload=False, policy=u"", _frame=2):
    global _model_cache
    path = utils.relativeToCallingPackage(filename, _frame)
    if reload or path not in _model_cache:
        parsed_model = parser.parse(path, policy=policy)
        for schema in parsed_model.schemata.values():
            schema.setTaggedValue(FILENAME_KEY, path)
        _model_cache[path] = parsed_model
    return _model_cache[path]


def loadString(model, policy=u""):
    return parser.parse(StringIO(model), policy=policy)


def serializeSchema(schema, name=u""):
    return serializeModel(model.Model({name: schema}))


def serializeModel(model):
    return serializer.serialize(model)


moduleProvides(IXMLToSchema)

__all__ = ('xmlSchema', 'loadFile', 'loadString', 'serializeSchema', 'serializeModel')
开发者ID:seanupton,项目名称:plone.supermodel,代码行数:30,代码来源:__init__.py


示例17: Copyright

#
# Copyright (c) 2006-2007 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Grok
"""
from grokcore.component import *
from grokcore.security import *
from grokcore.view import *

from grokcore.viewlet.components import Viewlet, ViewletManager
from grokcore.viewlet.directive import view, viewletmanager, order

# Import this module so that it's available as soon as you import the
# 'grokcore.view' package.  Useful for tests and interpreter examples.
import grokcore.viewlet.testing

# Our __init__ provides the grok API directly so using 'import grok' is enough.
from grokcore.viewlet.interfaces import IGrokcoreViewletAPI
from zope.interface import moduleProvides
moduleProvides(IGrokcoreViewletAPI)
__all__ = list(IGrokcoreViewletAPI)
开发者ID:grodniewicz,项目名称:oship,代码行数:30,代码来源:__init__.py


示例18: Copyright

##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" Dummy Module
"""
from zope.interface import moduleProvides
from zope.interface.tests.idummy import IDummyModule

moduleProvides(IDummyModule)

def bar(baz):
    # Note:  no 'self', because the module provides the interface directly.
    raise NotImplementedError()
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:23,代码来源:dummy.py


示例19: _set_operation

differencePy = _set_operation(_difference, OOSetPy)
unionPy = _set_operation(_union, OOSetPy)
intersectionPy = _set_operation(_intersection, OOSetPy)

try:
    from ._OOBTree import OOBucket
except ImportError as e:  # pragma NO COVER w/ C extensions
    OOBucket = OOBucketPy
    OOSet = OOSetPy
    OOBTree = OOBTreePy
    OOTreeSet = OOTreeSetPy
    OOTreeIterator = OOTreeIteratorPy
    difference = differencePy
    union = unionPy
    intersection = intersectionPy
else:  # pragma NO COVER w/o C extensions
    from ._OOBTree import OOSet
    from ._OOBTree import OOBTree
    from ._OOBTree import OOTreeSet
    from ._OOBTree import OOTreeIterator
    from ._OOBTree import difference
    from ._OOBTree import union
    from ._OOBTree import intersection

Bucket = OOBucket
Set = OOSet
BTree = OOBTree
TreeSet = OOTreeSet

moduleProvides(IObjectObjectBTreeModule)
开发者ID:kislovm,项目名称:findburo,代码行数:30,代码来源:OOBTree.py


示例20: _set_operation

    pass


# Can't declare forward refs, so fix up afterwards:

IIBucketPy._mapping_type = IIBucketPy._bucket_type = IIBucketPy
IIBucketPy._set_type = IISetPy

IISetPy._mapping_type = IIBucketPy
IISetPy._set_type = IISetPy._bucket_type = IISetPy

IIBTreePy._mapping_type = IIBTreePy._bucket_type = IIBucketPy
IIBTreePy._set_type = IISetPy

IITreeSetPy._mapping_type = IIBucketPy
IITreeSetPy._set_type = IITreeSetPy._bucket_type = IISetPy


differencePy = _set_operation(_difference, IISetPy)
unionPy = _set_operation(_union, IISetPy)
intersectionPy = _set_operation(_intersection, IISetPy)
multiunionPy = _set_operation(_multiunion, IISetPy)
weightedUnionPy = _set_operation(_weightedUnion, IISetPy)
weightedIntersectionPy = _set_operation(_weightedIntersection, IISetPy)

import_c_extension(globals())

_fix_pickle(globals(), __name__)

moduleProvides(IIntegerIntegerBTreeModule)
开发者ID:zopefoundation,项目名称:BTrees,代码行数:30,代码来源:IIBTree.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python interface.noLongerProvides函数代码示例发布时间:2022-05-26
下一篇:
Python interface.implementer函数代码示例发布时间: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