Commit b6a4c0d4 authored by François Revol's avatar François Revol

Add linuxjobs.fr module boilerplate

parent 06ed5ed6
# -*- coding: utf-8 -*-
# Copyright(C) 2016 François Revol
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# 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.
#
# weboob is distributed in the hope that it will be useful,
# 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
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .module import LinuxJobsModule
__all__ = ['LinuxJobsModule']
# -*- coding: utf-8 -*-
# Copyright(C) 2016 François Revol
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# 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.
#
# weboob is distributed in the hope that it will be useful,
# 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
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.browser import PagesBrowser, URL
from .pages import Page1, Page2
class LinuxJobsBrowser(PagesBrowser):
BASEURL = 'http://www.linuxjobs.com'
page1 = URL('/page1\?id=(?P<id>.+)', Page1)
page2 = URL('/page2', Page2)
def get_stuff(self, _id):
self.page1.go(id=_id)
assert self.page1.is_here()
self.page.do_stuff(_id)
assert self.page2.is_here()
return self.page.do_more_stuff()
# -*- coding: utf-8 -*-
# Copyright(C) 2016 François Revol
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# 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.
#
# weboob is distributed in the hope that it will be useful,
# 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
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.backend import Module
from weboob.capabilities.job import CapJob
from .browser import LinuxJobsBrowser
__all__ = ['LinuxJobsModule']
class LinuxJobsModule(Module, CapJob):
NAME = 'linuxjobs'
DESCRIPTION = u'linuxjobs website'
MAINTAINER = u'François Revol'
EMAIL = 'revol@free.fr'
LICENSE = 'AGPLv3+'
VERSION = '1.2'
BROWSER = LinuxJobsBrowser
def advanced_search_job(self):
"""
Iter results of an advanced search
:rtype: iter[:class:`BaseJobAdvert`]
"""
raise NotImplementedError()
def get_job_advert(self, _id, advert=None):
"""
Get an announce from an ID.
:param _id: id of the advert
:type _id: str
:param advert: the advert
:type advert: BaseJobAdvert
:rtype: :class:`BaseJobAdvert` or None if not found.
"""
raise NotImplementedError()
def search_job(self, pattern=None):
"""
Iter results of a search on a pattern.
:param pattern: pattern to search on
:type pattern: str
:rtype: iter[:class:`BaseJobAdvert`]
"""
raise NotImplementedError()
# -*- coding: utf-8 -*-
# Copyright(C) 2016 François Revol
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# 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.
#
# weboob is distributed in the hope that it will be useful,
# 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
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.browser.pages import HTMLPage
class Page1(HTMLPage):
def do_stuff(self, _id):
raise NotImplementedError()
class Page2(HTMLPage):
def do_more_stuff(self):
raise NotImplementedError()
# -*- coding: utf-8 -*-
# Copyright(C) 2016 François Revol
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# 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.
#
# weboob is distributed in the hope that it will be useful,
# 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
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.test import BackendTest
class LinuxJobsTest(BackendTest):
MODULE = 'linuxjobs'
def test_linuxjobs(self):
raise NotImplementedError()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment