pax_global_header 0000666 0000000 0000000 00000000064 14042356110 0014506 g ustar 00root root 0000000 0000000 52 comment=18d41565f955028f9fcd2f6cc437f5f1cb717401
woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/ 0000775 0000000 0000000 00000000000 14042356110 0023631 5 ustar 00root root 0000000 0000000 woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/modules/ 0000775 0000000 0000000 00000000000 14042356110 0025301 5 ustar 00root root 0000000 0000000 woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/modules/wordreference/ 0000775 0000000 0000000 00000000000 14042356110 0030133 5 ustar 00root root 0000000 0000000 __init__.py 0000664 0000000 0000000 00000001550 14042356110 0032166 0 ustar 00root root 0000000 0000000 woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/modules/wordreference "WordReferenceModule init"
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Lucien Loiseau
#
# This file is part of a woob module.
#
# This woob module 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.
#
# This woob module 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 this woob module. If not, see .
from .module import WordReferenceModule
__all__ = ['WordReferenceModule']
woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/modules/wordreference/browser.py0000664 0000000 0000000 00000002613 14042356110 0032172 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2012 Lucien Loiseau
#
# This file is part of a woob module.
#
# This woob module 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.
#
# This woob module 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 this woob module. If not, see .
from woob.browser import PagesBrowser, URL
from .pages import TranslatePage
__all__ = ['WordReferenceBrowser']
class WordReferenceBrowser(PagesBrowser):
BASEURL = 'https://www.wordreference.com/'
translation_page = URL('(?P[a-z]{2})(?P[a-z]{2})/(?P.*)', TranslatePage)
def translate(self, source, to, text):
"""
translate 'text' from 'source' language to 'to' language
"""
return self.translation_page.go(sl=source.encode('utf-8'),
tl=to.encode('utf-8'),
pattern=text.encode('utf-8')).get_translation()
favicon.png 0000664 0000000 0000000 00000004110 14042356110 0032203 0 ustar 00root root 0000000 0000000 woob-18d41565f955028f9fcd2f6cc437f5f1cb717401-modules-wordreference/modules/wordreference PNG
IHDR @ @ iq sRGB bKGD pHYs
B(x tIME
sC2 iTXtComment Created with GIMPd.e IDATx}e?Wr'H̕@m(-&-`btmD
!cTL'PC`k(PǦԥmlI]yIx rEԡwr=gannyk$_y>gC:)s_(
[r ?fwO Q~&