Python UserDict.UserDict 模块,__init__() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用UserDict.UserDict.__init__()

项目:charm-plumgrid-gateway    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-plumgrid-gateway    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-plumgrid-gateway    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:code    作者:ActiveState    | 项目源码 | 文件源码
def __init__(self, **kwargs):
        "initialize board"
        d = {"ROWS":8,"COLS":8,"BOMBS":10}
        d.update(kwargs)
        UserDict.__init__(self,d)
        self.reset()
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kw):
        super(Config, self).__init__(*args, **kw)
        self.implicit_save = True
        self._prev_dict = None
        self.path = os.path.join(charm_dir(), Config.CONFIG_FILE_NAME)
        if os.path.exists(self.path):
            self.load_previous()
        atexit(self._implicit_save)
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def __init__(self, config_save=None):
        super(Hooks, self).__init__()
        self._hooks = {}

        # For unknown reasons, we allow the Hooks constructor to override
        # config().implicit_save.
        if config_save is not None:
            config().implicit_save = config_save
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
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
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __init__(self, data):
        UserDict.__init__(self)
        self.data = data
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
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
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __init__(self, data):
        UserDict.__init__(self)
        self.data = data
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
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
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, module=__name__):
        self.logger = logging.getLogger('%s-%s(%s)' %(module, self.__class__, _get_idstr(self)))
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, response):
        self.status = response.status
        self.reason = response.reason
        self.headers = response.msg
        self.body = response.read() or None
        response.close()
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, host, port=None, timeout=20):
        HTTPConnection.__init__(self, host, port)
        self.timeout = timeout
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, host, port=None, timeout=20, **kwargs):
        HTTPSConnection.__init__(self, str(host), port, **kwargs)
        self.timeout = timeout
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, sw):
        '''Constructor, May be extended, do not override.
            sw -- soapWriter instance
        '''
        self.sw = None
        if not isinstance(sw, weakref.ReferenceType) and sw is not None:
            self.sw = weakref.ref(sw)
        else:
            self.sw = sw
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, parent, key=None):
        UserDict.__init__(self)
        self.parent = weakref.ref(parent)
        self.list = []
        self._func = key or self.default
项目:vspheretools    作者:devopshq    | 项目源码 | 文件源码
def __init__(self, parent, key=None):
        UserDict.__init__(self)
        self.parent = weakref.ref(parent)
        self.targetNamespace = None
        self.list = []
        self._func = key or self.default
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, module=__name__):
        self.logger = logging.getLogger('%s-%s(%s)' %(module, self.__class__, _get_idstr(self)))
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, response):
        self.status = response.status
        self.reason = response.reason
        self.headers = response.msg
        self.body = response.read() or None
        response.close()
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, host, port=None, timeout=20):
        HTTPConnection.__init__(self, host, port)
        self.timeout = timeout
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, host, port=None, timeout=20, **kwargs):
        HTTPSConnection.__init__(self, str(host), port, **kwargs)
        self.timeout = timeout
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, sw):
        '''Constructor, May be extended, do not override.
            sw -- soapWriter instance
        '''
        self.sw = None
        if type(sw) != weakref.ReferenceType and sw is not None:
            self.sw = weakref.ref(sw)
        else:
            self.sw = sw
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, parent, key=None):
        UserDict.__init__(self)
        self.parent = weakref.ref(parent)
        self.list = []
        self._func = key or self.default
项目:p2pool-bch    作者:amarian12    | 项目源码 | 文件源码
def __init__(self, parent, key=None):
        UserDict.__init__(self)
        self.parent = weakref.ref(parent)
        self.targetNamespace = None
        self.list = []
        self._func = key or self.default
项目:charm-nova-compute    作者:openstack    | 项目源码 | 文件源码
def __init__(self, obj):
        # wrap the object
        UserDict.__init__(self)
        self.data = obj