当前位置: 首页>>代码示例>>Python>>正文


Python UserDict.__init__方法代码示例

本文整理汇总了Python中UserDict.UserDict.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python UserDict.__init__方法的具体用法?Python UserDict.__init__怎么用?Python UserDict.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserDict.UserDict的用法示例。


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

示例1: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, keyfile=None, certfile=None,
                 ssl_version='PROTOCOL_SSLv23', ca_certs=None,
                 do_handshake_on_connect=True, cert_reqs=CERT_NONE,
                 suppress_ragged_eofs=True, ciphers=None, **kwargs):
        """settings of SSL

        :param keyfile: SSL key file path usally end with ".key"
        :param certfile: SSL cert file path usally end with ".crt"
        """
        UserDict.__init__(self) 
        self.data.update( dict(keyfile = keyfile,
                                certfile = certfile,
                                server_side = True,
                                ssl_version = getattr(ssl, ssl_version, ssl.PROTOCOL_SSLv23),
                                ca_certs = ca_certs,
                                do_handshake_on_connect = do_handshake_on_connect,
                                cert_reqs=cert_reqs,
                                suppress_ragged_eofs = suppress_ragged_eofs,
                                ciphers = ciphers)) 
开发者ID:34nm,项目名称:gsmtpd,代码行数:21,代码来源:server.py

示例2: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, type, fetch=False, check=False,
                 parent=None, recursive=1, session=None, **kwargs):
        assert('fq_name' in kwargs or 'uuid' in kwargs or 'to' in kwargs)
        super(Resource, self).__init__(session=session)
        self.type = type

        UserDict.__init__(self, kwargs)
        self.from_dict(self.data)

        if parent:
            self.parent = parent

        if check:
            self.check()

        if fetch:
            self.fetch(recursive=recursive)

        self.properties = {prop.key: prop for prop in self.schema.properties}
        self.emit('created', self) 
开发者ID:eonpatapon,项目名称:contrail-api-cli,代码行数:22,代码来源:resource.py

示例3: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self,BASE=None,UNWANTED=[],**kw):
        data = {}
        if BASE:
            if isinstance(BASE,AttrMap):
                data = BASE.data                        #they used BASECLASS._attrMap
            else:
                if type(BASE) not in (type(()),type([])): BASE = (BASE,)
                for B in BASE:
                    if hasattr(B,'_attrMap'):
                        data.update(getattr(B._attrMap,'data',{}))
                    else:
                        raise ValueError, 'BASE=%s has wrong kind of value' % str(B)

        UserDict.__init__(self,data)
        self.remove(UNWANTED)
        self.data.update(kw) 
开发者ID:gltn,项目名称:stdm,代码行数:18,代码来源:attrmap.py

示例4: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, fieldMarker, fieldValue):
    """
    This method constructs a Field object as a tuple of a field
    marker and a field value.
    @param fieldMarker: a field's marker
    @type  fieldMarker: string
    @param fieldValue : a field's value (the actual data)
    @type  fieldValue : string
    """
    self._field = (fieldMarker, fieldValue) 
开发者ID:rafasashi,项目名称:razzy-spinner,代码行数:12,代码来源:utilities.py

示例5: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, *maps):
        '''Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        '''
        self.maps = list(maps) or [{}]          # always at least one map 
开发者ID:AtomLinter,项目名称:linter-pylama,代码行数:8,代码来源:singledispatch_helpers.py

示例6: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, object, method, name=None):
        if name is None:
            name = method.__name__
        self.object = object
        self.method = method
        self.name = name
        setattr(self.object, name, self) 
开发者ID:coin3d,项目名称:pivy,代码行数:9,代码来源:Environment.py

示例7: NoSubstitutionProxy

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def NoSubstitutionProxy(subject):
    class _NoSubstitutionProxy(Environment):
        def __init__(self, subject):
            self.__dict__['__subject'] = subject
        def __getattr__(self, name):
            return getattr(self.__dict__['__subject'], name)
        def __setattr__(self, name, value):
            return setattr(self.__dict__['__subject'], name, value)
        def raw_to_mode(self, dict):
            try:
                raw = dict['raw']
            except KeyError:
                pass
            else:
                del dict['raw']
                dict['mode'] = raw
        def subst(self, string, *args, **kwargs):
            return string
        def subst_kw(self, kw, *args, **kwargs):
            return kw
        def subst_list(self, string, *args, **kwargs):
            nargs = (string, self,) + args
            nkw = kwargs.copy()
            nkw['gvars'] = {}
            self.raw_to_mode(nkw)
            return SCons.Subst.scons_subst_list(*nargs, **nkw)
        def subst_target_source(self, string, *args, **kwargs):
            nargs = (string, self,) + args
            nkw = kwargs.copy()
            nkw['gvars'] = {}
            self.raw_to_mode(nkw)
            return SCons.Subst.scons_subst(*nargs, **nkw)
    return _NoSubstitutionProxy(subject)

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4: 
开发者ID:coin3d,项目名称:pivy,代码行数:41,代码来源:Environment.py

示例8: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, subject):
        """Wrap an object as a Proxy object"""
        self.__subject = subject 
开发者ID:coin3d,项目名称:pivy,代码行数:5,代码来源:Util.py

示例9: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, dict = None):
        self._keys = []
        UserDict.__init__(self, dict) 
开发者ID:mirskytech,项目名称:ansible-role-manager,代码行数:5,代码来源:odict.py

示例10: __init__

# 需要导入模块: from UserDict import UserDict [as 别名]
# 或者: from UserDict.UserDict import __init__ [as 别名]
def __init__(self, module=__name__):
        self.logger = logging.getLogger('%s-%s(%s)' %(module, self.__class__, _get_idstr(self))) 
开发者ID:donSchoe,项目名称:p2pool-n,代码行数:4,代码来源:Utility.py


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