(self, chip_dict)
Configure the chip from a dictionary.
Configure the chip from a dictionary.
Configure the chip from a dictionary .
def from_dict(self, chip_dict):
        """Configure the chip from a dictionary."""
        value = chip_dict.get('value')
        if not value:
            return
        date, before, after = value.split()
        self.unit = before[-1]
        self.date = date
        self.before = int(before[1:-1])
        self.after = int(after[1:-1])
def from_dict ( self , chip_dict ) : value = chip_dict . get ( 'value' ) if not value : return date , before , after = value . split ( ) self . unit = before [ - 1 ] self . date = date self . before = int ( before [ 1 : - 1 ] ) self . after = int ( after [ 1 : - 1 ] )