pax_global_header 0000666 0000000 0000000 00000000064 14575653726 0014536 g ustar 00root root 0000000 0000000 52 comment=5f3d558793b537a74480241ac6981479f5938cd3
woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-wordreference/ 0000775 0000000 0000000 00000000000 14575653726 0024674 5 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-wordreference/modules/ 0000775 0000000 0000000 00000000000 14575653726 0026344 5 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-wordreference/modules/wordreference/ 0000775 0000000 0000000 00000000000 14575653726 0031176 5 ustar 00root root 0000000 0000000 __init__.py 0000664 0000000 0000000 00000001550 14575653726 0033231 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-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']
browser.py 0000664 0000000 0000000 00000002613 14575653726 0033156 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-wordreference/modules/wordreference # -*- 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 14575653726 0033246 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-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~&