Beispiel #1
0
    def as_partition(self, **kwargs):
        '''Return a PartitionName based on this name'''

        from .partition import name_class_from_format_name

        format = kwargs.get('format','db')

        nc = name_class_from_format_name(format)

        return nc(**dict(self.dict.items() + kwargs.items()))
Beispiel #2
0
    def new_subclass(cls, name, object_number):

        from partition import identity_class_from_format_name, name_class_from_format_name

        nc = name_class_from_format_name(name.format)
        ic = identity_class_from_format_name(name.format)

        nname = nc(**name.dict)

        return ic(nname, object_number)
Beispiel #3
0
    def promote(self, name):
        '''Promote to a PartitionName by combining with 
        a bundle Name'''
        from partition import name_class_from_format_name


        cls = name_class_from_format_name(self.format)


        return cls(**dict(name.dict.items() +
                                    self.dict.items() ))