예제 #1
0
 def __init__(self, base=None):
     if base is None: base = DataBunch()
     self._base = base
     this = deepcopy(
         base
     )  # deepcopy is needed here to build configs - Feb 2016, T. MacDonald
     DataBunch.__init__(self, this)
예제 #2
0
class DiffedDataBunch(DataBunch):
    """ VyPy.data.DiffedDataBunch()
    """
    def __defaults__(self):
        self.tag = 'config'
        self._base = DataBunch()
        self._diff = DataBunch()

    def __init__(self, base=None):
        if base is None: base = DataBunch()
        self._base = base
        this = deepcopy(base)
        DataBunch.__init__(self, this)

    def store_diff(self):
        delta = diff(self, self._base)
        self._diff = delta

    def pull_base(self):
        try:
            self._base.pull_base()
        except AttributeError:
            pass
        self.update(self._base)
        self.update(self._diff)

    def __str__(self, indent=''):
        try:
            args = self._diff.__str__(indent)
            args += indent + '_base : ' + self._base.__repr__() + '\n'
            args += indent + '  tag : ' + self._base.tag + '\n'
            return args
        except AttributeError:
            return DataBunch.__str__(self, indent)
예제 #3
0
class DiffedDataBunch(DataBunch):
    """ DiffedDataBunch()
    """
    
    def __defaults__(self):
        self.tag    = 'config'
        self._base  = DataBunch()
        self._diff  = DataBunch()
        
    def __init__(self,base=None):
        if base is None: base = DataBunch()
        self._base = base
        this = deepcopy(base) # deepcopy is needed here to build configs - Feb 2016, T. MacDonald
        DataBunch.__init__(self,this)
        
    def store_diff(self):
        delta = diff(self,self._base)
        self._diff = delta
        
    def pull_base(self):
        try: self._base.pull_base()
        except AttributeError: pass
        self.update(self._base)
        self.update(self._diff)
    
    def __str__(self,indent=''):
        try: 
            args = self._diff.__str__(indent)
            args += indent + '_base : ' + self._base.__repr__() + '\n'
            args += indent + '  tag : ' + self._base.tag + '\n'
            return args
        except AttributeError: 
            return DataBunch.__str__(self,indent)
예제 #4
0
 def __str__(self, indent=''):
     try:
         args = self._diff.__str__(indent)
         args += indent + '_base : ' + self._base.__repr__() + '\n'
         args += indent + '  tag : ' + self._base.tag + '\n'
         return args
     except AttributeError:
         return DataBunch.__str__(self, indent)
예제 #5
0
 def __str__(self, indent=""):
     try:
         args = self._diff.__str__(indent)
         args += indent + "_base : " + self._base.__repr__() + "\n"
         args += indent + "  tag : " + self._base.tag + "\n"
         return args
     except AttributeError:
         return DataBunch.__str__(self, indent)
예제 #6
0
 def __str__(self,indent=''):
     try: 
         args = self._diff.__str__(indent)
         args += indent + '_base : ' + self._base.__repr__() + '\n'
         args += indent + '  tag : ' + self._base.tag + '\n'
         return args
     except AttributeError: 
         return DataBunch.__str__(self,indent)
예제 #7
0
class DiffedDataBunch(DataBunch):
    """ VyPy.data.DiffedDataBunch()
    """

    def __defaults__(self):
        self.tag = "config"
        self._base = DataBunch()
        self._diff = DataBunch()

    def __init__(self, base=None):
        if base is None:
            base = DataBunch()
        self._base = base
        this = deepcopy(base)
        DataBunch.__init__(self, this)

    def store_diff(self):
        delta = diff(self, self._base)
        self._diff = delta

    def pull_base(self):
        try:
            self._base.pull_base()
        except AttributeError:
            pass
        self.update(self._base)
        self.update(self._diff)

    def __str__(self, indent=""):
        try:
            args = self._diff.__str__(indent)
            args += indent + "_base : " + self._base.__repr__() + "\n"
            args += indent + "  tag : " + self._base.tag + "\n"
            return args
        except AttributeError:
            return DataBunch.__str__(self, indent)
예제 #8
0
 def __init__(self, base=None):
     if base is None: base = DataBunch()
     self._base = base
     this = deepcopy(base)
     DataBunch.__init__(self, this)
예제 #9
0
 def __defaults__(self):
     self.tag = 'config'
     self._base = DataBunch()
     self._diff = DataBunch()
예제 #10
0
 def __init__(self, base=None):
     if base is None:
         base = DataBunch()
     self._base = base
     this = deepcopy(base)
     DataBunch.__init__(self, this)
예제 #11
0
 def __defaults__(self):
     self.tag = "config"
     self._base = DataBunch()
     self._diff = DataBunch()
예제 #12
0
 def __init__(self,base=None):
     if base is None: base = DataBunch()
     self._base = base
     this = deepcopy(base) # deepcopy is needed here to build configs - Feb 2016, T. MacDonald
     DataBunch.__init__(self,this)