[leboncoin] remove commented code

This commit is contained in:
Bezleputh 2014-10-08 09:07:49 +02:00
commit 6414d65d5d

View file

@ -39,13 +39,7 @@ class LeboncoinModule(Module, CapHousing):
CONFIG = BackendConfig(Value('advert_type', label='Advert type',
choices={'c': 'Agency', 'p': 'Owner', 'a': 'All'}, default='a'))
"""
RET = {Query.HOUSE_TYPES.HOUSE: '1',
Query.HOUSE_TYPES.APART: '2',
Query.HOUSE_TYPES.LAND: '3',
Query.HOUSE_TYPES.PARKING: '4',
Query.HOUSE_TYPES.OTHER: '5'}
"""
def get_housing(self, _id):
return self.browser.get_housing(_id)
@ -61,37 +55,6 @@ class LeboncoinModule(Module, CapHousing):
return self.browser.get_cities(pattern)
def search_housings(self, query):
"""
cities = []
for c in query.cities:
cities.append('%s %s' % (c.id, c.name))
if len(cities) == 0:
return list()
ret = []
for g in query.house_types:
if g in self.RET:
ret.append(self.RET.get(g))
if len(ret) == 0:
return list()
_type = 'ventes_immobilieres'
if query.type == Query.TYPE_RENT:
_type = 'locations'
nb_rooms = '' if not query.nb_rooms else query.nb_rooms
area_min = '' if not query.area_min else query.area_min
area_max = '' if not query.area_max else query.area_max
cost_min = '' if not query.cost_min else query.cost_min
cost_max = '' if not query.cost_max else query.cost_max
return self.browser.search_housings(_type, ','.join(cities), nb_rooms,
area_min, area_max,
cost_min, cost_max, '&ret='.join(ret),
self.config['advert_type'].get())
"""
return self.browser.search_housings(query, self.config['advert_type'].get())
OBJECTS = {Housing: fill_housing, HousingPhoto: fill_photo}