class CabRequest: def __init__(self): self.area = '' self.location = LocVertex() def parsing(self,value): # print 'Request parsing' if 'area' in value: self.area = value['area'] if 'location' in value: self.location.parsing(value['location'])
class CabInfo: def __init__(self): self.odometre = 0 self.destination = CabRequest() self.locNow = LocVertex() self.locNext = LocVertex() def parsing(self,value): if 'odometer' in value: self.odometre = value['odometer'] if 'destination' in value: self.destination.parsing(value['destination']) if 'locNow' in value: self.locNow.parsing(value['locNow']) if 'locNext' in value: self.locNext.parsing(value['locNext'])
class CabInfo: def __init__(self): self.odometre = 0 self.destination = CabRequest() self.locNow = LocVertex() self.locNext = LocVertex() def parsing(self, value): if 'odometer' in value: self.odometre = value['odometer'] if 'destination' in value: self.destination.parsing(value['destination']) if 'locNow' in value: self.locNow.parsing(value['locNow']) if 'locNext' in value: self.locNext.parsing(value['locNext'])