module.py 1.7 KB
Newer Older
1 2 3 4
# -*- coding: utf-8 -*-

# Copyright(C) 2013      Bezleputh
#
5
# This file is part of a weboob module.
6
#
7
# This weboob module is free software: you can redistribute it and/or modify
8 9 10 11
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
12
# This weboob module is distributed in the hope that it will be useful,
13 14 15 16 17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
18
# along with this weboob module. If not, see <http://www.gnu.org/licenses/>.
19 20


21
from weboob.tools.backend import Module, BackendConfig
22
from weboob.capabilities.job import CapJob, BaseJobAdvert
Bezleputh's avatar
Bezleputh committed
23
from weboob.tools.value import Value
24 25 26 27

from .browser import CciBrowser


Florent Fourcot's avatar
Florent Fourcot committed
28
__all__ = ['CciModule']
29 30


31
class CciModule(Module, CapJob):
32 33 34 35 36
    NAME = 'cci'
    DESCRIPTION = u'cci website'
    MAINTAINER = u'Bezleputh'
    EMAIL = 'carton_ben@yahoo.fr'
    LICENSE = 'AGPLv3+'
Romain Bignon's avatar
Romain Bignon committed
37
    VERSION = '1.6'
38 39 40

    BROWSER = CciBrowser

Bezleputh's avatar
Bezleputh committed
41 42
    CONFIG = BackendConfig(Value('metier', label='Job name', masked=False, default=''))

43
    def search_job(self, pattern=None):
Bezleputh's avatar
Bezleputh committed
44
        return self.browser.search_job(pattern)
45 46

    def advanced_search_job(self):
Bezleputh's avatar
Bezleputh committed
47
        return self.browser.search_job(pattern=self.config['metier'].get())
48 49

    def get_job_advert(self, _id, advert=None):
Bezleputh's avatar
Bezleputh committed
50
        return self.browser.get_job_advert(_id, advert)
51 52

    def fill_obj(self, advert, fields):
Bezleputh's avatar
Bezleputh committed
53
        return self.get_job_advert(advert.id, advert)
54 55

    OBJECTS = {BaseJobAdvert: fill_obj}