improve ls command in handjoob

This commit is contained in:
Bezleputh 2013-08-20 18:03:14 +02:00
commit b4c93587b4
10 changed files with 54 additions and 71 deletions

View file

@ -19,7 +19,6 @@
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.capabilities.collection import ICapCollection, CollectionNotFound
from weboob.capabilities.job import ICapJob
from weboob.tools.value import Value
from weboob.tools.ordereddict import OrderedDict
@ -30,7 +29,7 @@ from .job import PopolemploiJobAdvert
__all__ = ['PopolemploiBackend']
class PopolemploiBackend(BaseBackend, ICapJob, ICapCollection):
class PopolemploiBackend(BaseBackend, ICapJob):
NAME = 'popolemploi'
DESCRIPTION = u'Pole Emploi website'
MAINTAINER = u'Bezleputh'
@ -205,18 +204,10 @@ class PopolemploiBackend(BaseBackend, ICapJob, ICapCollection):
with self.browser:
return self.browser.search_job(pattern=pattern)
def iter_resources(self, objs, split_path):
with self.browser:
collection = self.get_collection(objs, split_path)
if collection.path_level == 0:
return self.browser.advanced_search_job(metier=self.config['metier'].get(),
place=self.config['place'].get(),
contrat=self.config['contrat'].get())
def validate_collection(self, objs, collection):
if collection.path_level == 0:
return
raise CollectionNotFound(collection.split_path)
def advanced_search_job(self):
return self.browser.advanced_search_job(metier=self.config['metier'].get(),
place=self.config['place'].get(),
contrat=self.config['contrat'].get())
def get_job_advert(self, _id, advert=None):
with self.browser: