예제 #1
0
    def __init__(self,
                 keyvalue,
                 keygroup=None,
                 keyformat=None,
                 attributes=None,
                 **argv):
        """
        コンストラクタ
        """
        self._keygroup = keygroup if keygroup else self.KEY_GROUP
        if self._keygroup is None:
            self._keygroup = self.__class__.__name__

        self._keyvalue = keyvalue
        self._keyformat = keyformat if keyformat else self.KEY_FORMAT
        self._kvsclass = create_kvs_class(argv.get('kvsclass', self.KVS_CLASS))
        self._argv = argv
        self._initvalues = {}

        if not attributes:
            attributes = self.ATTRIBUTES
        if attributes:
            # 属性名設定
            if isinstance(attributes, (list, tuple)):
                self._attributes = set(attributes)
            elif isinstance(attributes, dict):
                self._initvalues = attributes
                self._attributes = set(attributes.keys())
예제 #2
0
파일: generic.py 프로젝트: subc/anchovy
 def __init__(self, *args, **argv):
     self._max = argv.get('max', self.MAX)
     self._kvsclass = create_kvs_class(argv.get('kvsclass', self.KVS_CLASS))
     if 'keyname' not in argv:
         argv['keyname'] = self.KEY_NAME if self.KEY_NAME else self.__class__.__name__
     if 'keyformat' not in argv:
         argv['keyformat'] = self.KEY_FORMAT
     self._kvs = self._kvsclass(*args, **argv)
예제 #3
0
 def __init__(self, *args, **argv):
     self._max = argv.get('max', self.MAX)
     self._kvsclass = create_kvs_class(argv.get('kvsclass', self.KVS_CLASS))
     if 'keyname' not in argv:
         argv[
             'keyname'] = self.KEY_NAME if self.KEY_NAME else self.__class__.__name__
     if 'keyformat' not in argv:
         argv['keyformat'] = self.KEY_FORMAT
     self._kvs = self._kvsclass(*args, **argv)
예제 #4
0
파일: generic.py 프로젝트: subc/anchovy
    def __init__(self, *args, **argv):

        # argv['kvsclass'] > self.KVS_CLASS > self.KVS_TYPE の優先度で使用するクラスを決める
        default_class_name = self.KVS_CLASS if self.KVS_CLASS else get_kvs_class_name(type=self.KVS_TYPE)
        self._kvsclass = create_kvs_class(argv.get('kvsclass', default_class_name))

        if 'keyname' not in argv:
            argv['keyname'] = self.KEY_NAME if self.KEY_NAME else self.__class__.__name__
        if 'keyformat' not in argv:
            argv['keyformat'] = self.KEY_FORMAT
        if 'set_name' not in argv:
            argv['set_name'] = self.SET_NAME
        self._kvs = self._kvsclass(*args, **argv)
예제 #5
0
    def __init__(self, *args, **argv):

        # argv['kvsclass'] > self.KVS_CLASS > self.KVS_TYPE の優先度で使用するクラスを決める
        default_class_name = self.KVS_CLASS if self.KVS_CLASS else get_kvs_class_name(
            type=self.KVS_TYPE)
        self._kvsclass = create_kvs_class(
            argv.get('kvsclass', default_class_name))

        if 'keyname' not in argv:
            argv[
                'keyname'] = self.KEY_NAME if self.KEY_NAME else self.__class__.__name__
        if 'keyformat' not in argv:
            argv['keyformat'] = self.KEY_FORMAT
        if 'set_name' not in argv:
            argv['set_name'] = self.SET_NAME
        self._kvs = self._kvsclass(*args, **argv)
예제 #6
0
파일: generic.py 프로젝트: subc/anchovy
    def __init__(self, keyvalue, keygroup=None, keyformat=None, attributes=None, **argv):
        """
        コンストラクタ
        """
        self._keygroup = keygroup if keygroup else self.KEY_GROUP
        if self._keygroup is None:
            self._keygroup = self.__class__.__name__

        self._keyvalue = keyvalue
        self._keyformat = keyformat if keyformat else self.KEY_FORMAT
        self._kvsclass = create_kvs_class(argv.get('kvsclass', self.KVS_CLASS))
        self._argv = argv
        self._initvalues = {}

        if not attributes:
            attributes = self.ATTRIBUTES
        if attributes:
            # 属性名設定
            if isinstance(attributes, (list, tuple)):
                self._attributes = set(attributes)
            elif isinstance(attributes, dict):
                self._initvalues = attributes
                self._attributes = set(attributes.keys())