def emptyResponse(self, key): if key == DriverData.NO: if self.no is None: self.no = '...' # if key== DriverData.NO_MOTOR: # if self.noMotor is None: # self.noMotor='...' if key == DriverData.NAMA: if self.nama is None: self.nama = '...' if key == DriverData.DESC: if self.desc is None: self.desc = '..' if key == DriverData.OJEK: if self.ojek is None: self.ojek = 'motor' if key == DriverData.LOKASI: if self.location is None: location = Location(126.951420, -5.708185) venue = Venue(location, '', 'alamat blm diset, silahkan perbarui dulu', None) self.location = toJson.toJson(venue) if key == DriverData.NAMA: if self.nama is None: self.nama = '.'
def setDari(self, dari): if (isinstance(dari, Venue)): print('TJOSON') self.dari = toJson.toJson(dari) else: print('NOTJOSON') self.dari = dari
def emptyResponse(self, key): if key == UserData.NO: if self.no is None: self.no = UserData.DEF_NO if key == UserData.DARI: if self.dari is None: location = Location(112.240727, -4.953413) venue = Venue(location, 'lokasi', UserData.DEF_DARI, None) self.dari = toJson.toJson(venue) if key == UserData.KE: if self.ke is None: location = Location(112.240727, -4.953413) venue = Venue(location, 'lokasi', UserData.DEF_KE, None) self.ke = toJson.toJson(venue) if key == UserData.HARGA: if self.harga is None: self.harga = UserData.DEF_HRG if key == UserData.OJEK: if self.ojek is None: self.ojek = UserData.DEF_OJK if key == UserData.NAMA: if self.nama is None: self.nama = UserData.DEF_NAME
def setLocation(self, venue): if (isinstance(venue, Venue)): self.location = toJson.toJson(venue) else: self.location = venue
def setKe(self, ke): if (isinstance(ke, Venue)): self.ke = toJson.toJson(ke) else: self.ke = ke