本文整理汇总了Python中weboob.capabilities.housing.Query类的典型用法代码示例。如果您正苦于以下问题:Python Query类的具体用法?Python Query怎么用?Python Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_seloger_viager
def test_seloger_viager(self):
query = Query()
query.type = POSTS_TYPES.VIAGER
query.cities = []
for city in self.backend.search_city('85'):
city.backend = self.backend.name
query.cities.append(city)
self.check_against_query(query)
开发者ID:laurentb,项目名称:weboob,代码行数:8,代码来源:test.py
示例2: test_seloger_sale
def test_seloger_sale(self):
query = Query()
query.area_min = 20
query.type = POSTS_TYPES.SALE
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
self.check_against_query(query)
开发者ID:laurentb,项目名称:weboob,代码行数:9,代码来源:test.py
示例3: test_seloger_furnished_rent
def test_seloger_furnished_rent(self):
query = Query()
query.area_min = 20
query.cost_max = 1500
query.type = POSTS_TYPES.FURNISHED_RENT
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
self.check_against_query(query)
开发者ID:laurentb,项目名称:weboob,代码行数:10,代码来源:test.py
示例4: test_explorimmo_rent
def test_explorimmo_rent(self):
query = Query()
query.area_min = 20
query.cost_max = 1500
query.type = POSTS_TYPES.RENT
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
self.check_against_query(query)
开发者ID:P4ncake,项目名称:weboob,代码行数:10,代码来源:test.py
示例5: test_logicimmo_viager
def test_logicimmo_viager(self):
query = Query()
query.type = POSTS_TYPES.VIAGER
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
if len(query.cities) == 3:
break
self.check_against_query(query)
开发者ID:laurentb,项目名称:weboob,代码行数:10,代码来源:test.py
示例6: test_entreparticuliers_sale
def test_entreparticuliers_sale(self):
query = Query()
query.cities = []
for city in self.backend.search_city('lille'):
city.backend = self.backend.name
query.cities.append(city)
query.type = POSTS_TYPES.SALE
self.check_against_query(query)
开发者ID:P4ncake,项目名称:weboob,代码行数:10,代码来源:test.py
示例7: test_leboncoin_sale
def test_leboncoin_sale(self):
query = Query()
query.area_min = 20
query.type = POSTS_TYPES.SALE
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
if len(query.cities) == 3:
break
self.check_against_query(query)
开发者ID:P4ncake,项目名称:weboob,代码行数:11,代码来源:test.py
示例8: test_leboncoin
def test_leboncoin(self):
query = Query()
query.cities = []
query.type = Query.TYPE_SALE
for city in self.backend.search_city('lille'):
city.backend = self.backend.name
query.cities.append(city)
results = list(itertools.islice(self.backend.search_housings(query), 0, 20))
self.assertTrue(len(results) > 0)
obj = self.backend.fillobj(results[0])
self.assertTrue(obj.url is not None, 'Missing url for "%s"' % (obj.id))
开发者ID:dasimon,项目名称:weboob,代码行数:12,代码来源:test.py
示例9: test_seloger
def test_seloger(self):
query = Query()
query.area_min = 20
query.cost_max = 1000
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
results = list(self.backend.search_housings(query))
self.assertTrue(len(results) > 0)
self.backend.fillobj(results[0], 'phone')
开发者ID:Boussadia,项目名称:weboob,代码行数:13,代码来源:test.py
示例10: test_entreparticuliers
def test_entreparticuliers(self):
query = Query()
query.cities = []
for city in self.backend.search_city('lille'):
city.backend = self.backend.name
query.cities.append(city)
query.type = Query.TYPE_SALE
results = list(itertools.islice(self.backend.search_housings(query), 0, 20))
self.assertTrue(len(results) > 0)
obj = self.backend.fillobj(results[0])
self.assertTrue(obj.area is not None, 'Area for "%s"' % (obj.id))
开发者ID:nojhan,项目名称:weboob-devel,代码行数:13,代码来源:test.py
示例11: test_explorimmo
def test_explorimmo(self):
query = Query()
query.area_min = 20
query.cost_max = 900
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
results = list(itertools.islice(self.backend.search_housings(query), 0, 20))
self.assertTrue(len(results) > 0)
self.backend.fillobj(results[0], 'phone')
开发者ID:Konubinix,项目名称:weboob,代码行数:13,代码来源:test.py
示例12: test_seloger
def test_seloger(self):
query = Query()
query.area_min = 20
query.cost_max = 1000
query.type = Query.TYPE_RENT
query.cities = []
for city in self.backend.search_city(u'Ferté'):
city.backend = self.backend.name
query.cities.append(city)
results = list(itertools.islice(self.backend.search_housings(query), 0, 20))
self.assertTrue(len(results) > 0)
self.backend.fillobj(results[0], 'phone')
开发者ID:dasimon,项目名称:weboob,代码行数:14,代码来源:test.py
示例13: refreshHousingsList
def refreshHousingsList(self):
name = self.ui.queriesList.itemText(self.ui.queriesList.currentIndex())
q = self.config.get('queries', name)
if q is None:
return q
self.ui.housingsList.clear()
self.ui.queriesList.setEnabled(False)
self.ui.bookmarksButton.setEnabled(False)
query = Query()
query.type = int(q.get('type', 0))
query.cities = []
for c in q['cities']:
city = City(c['id'])
city.backend = c['backend']
city.name = c['name']
query.cities.append(city)
query.area_min = int(q['area_min']) or None
query.area_max = int(q['area_max']) or None
query.cost_min = int(q['cost_min']) or None
query.cost_max = int(q['cost_max']) or None
query.nb_rooms = int(q['nb_rooms']) or None
self.process = QtDo(self.weboob, self.addHousing, fb=self.addHousingEnd)
self.process.do(self.app._do_complete, 20, (), 'search_housings', query)
开发者ID:ffourcot,项目名称:weboob,代码行数:28,代码来源:main_window.py
示例14: test_entreparticuliers_rent
def test_entreparticuliers_rent(self):
query = Query()
query.cities = []
self.FIELDS_ANY_SINGLE_HOUSING = [
"photos", "phone", "rooms"
]
for city in self.backend.search_city('lille'):
city.backend = self.backend.name
query.cities.append(city)
query.type = POSTS_TYPES.RENT
self.check_against_query(query)
开发者ID:P4ncake,项目名称:weboob,代码行数:15,代码来源:test.py
示例15: test_pap_viager
def test_pap_viager(self):
query = Query()
query.type = POSTS_TYPES.VIAGER
query.cities = []
for city in self.backend.search_city('85'):
city.backend = self.backend.name
query.cities.append(city)
# Remove rooms from the tested fields as viager never have them
self.FIELDS_ANY_HOUSINGS_LIST = [
"photos",
"station",
"bedrooms"
]
self.FIELDS_ANY_SINGLE_HOUSING = [
"photos",
"bedrooms",
"station",
"DPE"
]
self.check_against_query(query)
开发者ID:P4ncake,项目名称:weboob,代码行数:20,代码来源:test.py
示例16: do_search
def do_search(self, line):
"""
search
Search for housing. Parameters are interactively asked.
"""
pattern = 'notempty'
query = Query()
query.cities = []
while pattern:
if len(query.cities) > 0:
print '\n%sSelected cities:%s %s' % (self.BOLD, self.NC, ', '.join([c.name for c in query.cities]))
pattern = self.ask('Enter a city pattern (or empty to stop)', default='')
if not pattern:
break
cities = []
for backend, city in self.weboob.do('search_city', pattern):
cities.append(city)
if len(cities) == 0:
print ' Not found!'
continue
if len(cities) == 1:
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
continue
r = 'notempty'
while r != '':
for i, city in enumerate(cities):
print ' %s%2d)%s [%s] %s' % (self.BOLD, i+1, self.NC, 'x' if city in query.cities else ' ', city.name)
r = self.ask(' Select cities (or empty to stop)', regexp='(\d+|)', default='')
if not r.isdigit():
continue
r = int(r)
if r <= 0 or r > len(cities):
continue
city = cities[r-1]
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
query.area_min = self.ask_int('Enter min area')
query.area_max = self.ask_int('Enter max area')
query.cost_min = self.ask_int('Enter min cost')
query.cost_max = self.ask_int('Enter max cost')
query.nb_rooms = self.ask_int('Enter number of rooms')
self.change_path([u'housings'])
self.start_format()
for backend, housing in self.do('search_housings', query):
self.cached_format(housing)
开发者ID:Boussadia,项目名称:weboob,代码行数:56,代码来源:flatboob.py
示例17: test_seloger_rent_personal
def test_seloger_rent_personal(self):
query = Query()
query.area_min = 20
query.cost_max = 1500
query.type = POSTS_TYPES.RENT
query.advert_types = [ADVERT_TYPES.PROFESSIONAL]
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
self.check_against_query(query)
开发者ID:laurentb,项目名称:weboob,代码行数:11,代码来源:test.py
示例18: test_logicimmo_personal
def test_logicimmo_personal(self):
query = Query()
query.area_min = 20
query.cost_max = 900
query.type = POSTS_TYPES.RENT
query.advert_types = [ADVERT_TYPES.PERSONAL]
query.cities = []
for city in self.backend.search_city('paris'):
city.backend = self.backend.name
query.cities.append(city)
results = list(self.backend.search_housings(query))
self.assertEqual(len(results), 0)
开发者ID:laurentb,项目名称:weboob,代码行数:13,代码来源:test.py
示例19: do_search
def do_search(self, line):
"""
search
Search for housing. Parameters are interactively asked.
"""
pattern = "notempty"
query = Query()
query.cities = []
while pattern:
if len(query.cities) > 0:
print "\n%sSelected cities:%s %s" % (self.BOLD, self.NC, ", ".join([c.name for c in query.cities]))
pattern = self.ask("Enter a city pattern (or empty to stop)", default="")
if not pattern:
break
cities = []
for backend, city in self.weboob.do("search_city", pattern):
cities.append(city)
if len(cities) == 0:
print " Not found!"
continue
if len(cities) == 1:
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
continue
r = "notempty"
while r != "":
for i, city in enumerate(cities):
print " %s%2d)%s [%s] %s" % (
self.BOLD,
i + 1,
self.NC,
"x" if city in query.cities else " ",
city.name,
)
r = self.ask(" Select cities (or empty to stop)", regexp="(\d+|)", default="")
if not r.isdigit():
continue
r = int(r)
if r <= 0 or r > len(cities):
continue
city = cities[r - 1]
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
query.area_min = self.ask_int("Enter min area")
query.area_max = self.ask_int("Enter max area")
query.cost_min = self.ask_int("Enter min cost")
query.cost_max = self.ask_int("Enter max cost")
query.nb_rooms = self.ask_int("Enter number of rooms")
self.change_path([u"housings"])
self.start_format()
for backend, housing in self.do("search_housings", query):
self.cached_format(housing)
开发者ID:hugues,项目名称:weboob,代码行数:62,代码来源:flatboob.py
示例20: do_search
def do_search(self, line):
"""
search
Search for housing. Parameters are interactively asked.
"""
pattern = 'notempty'
query = Query()
query.cities = []
while pattern:
if len(query.cities) > 0:
print('\n%sSelected cities:%s %s' % (self.BOLD, self.NC, ', '.join([c.name for c in query.cities])))
pattern = self.ask('Enter a city pattern (or empty to stop)', default='')
if not pattern:
break
cities = []
for city in self.weboob.do('search_city', pattern):
cities.append(city)
if len(cities) == 0:
print(' Not found!')
continue
if len(cities) == 1:
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
continue
r = 'notempty'
while r != '':
for i, city in enumerate(cities):
print(' %s%2d)%s [%s] %s (%s)' % (self.BOLD, i+1, self.NC, 'x' if city in query.cities else ' ', city.name, city.backend))
r = self.ask('Select cities (or empty to stop)', regexp='(\d+|)', default='')
if not r.isdigit():
continue
r = int(r)
if r <= 0 or r > len(cities):
continue
city = cities[r-1]
if city in query.cities:
query.cities.remove(city)
else:
query.cities.append(city)
r = 'notempty'
while r != '':
for i, good in enumerate(HOUSE_TYPES, 1):
print(' %s%2d)%s [%s] %s' % (self.BOLD,
i,
self.NC,
'x' if good in query.house_types else ' ', good))
r = self.ask('Select type of house (or empty to stop)', regexp='(\d+|)', default='')
if not r.isdigit():
continue
r = int(r)
if r <= 0 or r > len(HOUSE_TYPES):
continue
value = list(HOUSE_TYPES)[r - 1]
if value in query.house_types:
query.house_types.remove(value)
else:
query.house_types.append(value)
_type = None
posts_types = sorted(POSTS_TYPES, key=lambda e: e.value)
while _type not in range(len(posts_types)):
for i, t in enumerate(posts_types):
print(' %s%2d)%s %s' % (self.BOLD,
i,
self.NC,
t))
_type = self.ask_int('Type of query')
query.type = posts_types[_type]
r = 'notempty'
while r != '':
for i, good in enumerate(ADVERT_TYPES, 1):
print(' %s%2d)%s [%s] %s' % (self.BOLD,
i,
self.NC,
'x' if good in query.advert_types else ' ', good))
r = self.ask('Select type of posts (or empty to stop)', regexp='(\d+|)', default='')
if not r.isdigit():
continue
r = int(r)
if r <= 0 or r > len(ADVERT_TYPES):
continue
value = list(ADVERT_TYPES)[r - 1]
if value in query.advert_types:
query.advert_types.remove(value)
else:
query.advert_types.append(value)
query.area_min = self.ask_int('Enter min area')
query.area_max = self.ask_int('Enter max area')
query.cost_min = self.ask_int('Enter min cost')
query.cost_max = self.ask_int('Enter max cost')
#.........这里部分代码省略.........
开发者ID:P4ncake,项目名称:weboob,代码行数:101,代码来源:flatboob.py
注:本文中的weboob.capabilities.housing.Query类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论