pax_global_header 0000666 0000000 0000000 00000000064 13414430553 0014514 g ustar 00root root 0000000 0000000 52 comment=6e2147adbb0d685e8e740a246e0c7f31465f3511
woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/ 0000775 0000000 0000000 00000000000 13414430553 0023635 5 ustar 00root root 0000000 0000000 woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/modules/ 0000775 0000000 0000000 00000000000 13414430553 0025305 5 ustar 00root root 0000000 0000000 woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/modules/pixtoilelibre/ 0000775 0000000 0000000 00000000000 13414430553 0030160 5 ustar 00root root 0000000 0000000 __init__.py 0000664 0000000 0000000 00000001450 13414430553 0032212 0 ustar 00root root 0000000 0000000 woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/modules/pixtoilelibre # -*- coding: utf-8 -*-
# Copyright(C) 2014 Vincent A
#
# 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 .
from .module import PixtoilelibreModule
__all__ = ['PixtoilelibreModule']
woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/modules/pixtoilelibre/browser.py0000664 0000000 0000000 00000003410 13414430553 0032213 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2014 Vincent A
#
# 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 .
from base64 import b64encode
from io import BytesIO
from weboob.browser import PagesBrowser, URL
from weboob.tools.capabilities.paste import image_mime
from .pages import PageHome, PageImage, PageError
__all__ = ['PixtoilelibreBrowser']
class PixtoilelibreBrowser(PagesBrowser):
BASEURL = 'http://pix.toile-libre.org'
home = URL(r'/$', PageHome)
error = URL(r'/\?action=upload', PageError)
img = URL(r'/\?img=(?P.+)', PageImage)
def post_image(self, filename, contents, private=False, description=''):
self.location('/')
assert self.home.is_here()
mime = image_mime(b64encode(contents))
form = self.page.get_form(nr=0)
form['private'] = int(private)
form['description'] = description or ''
del form['img']
f = (filename, BytesIO(contents), mime)
self.location(form.url, data=form, files={'img': f})
assert self.img.is_here()
return self.page.get_info()
def get_contents(self, id):
return self.open('/upload/original/%s' % id).content
favicon.png 0000664 0000000 0000000 00000006517 13414430553 0032245 0 ustar 00root root 0000000 0000000 woob-6e2147adbb0d685e8e740a246e0c7f31465f3511-modules-pixtoilelibre/modules/pixtoilelibre PNG
IHDR @ @ iq bKGD pHYs @ @[ tIME1
?F IDATx}t?7I RP!T:<,]Zf@J7
30tbe=G9jOG=rBUhe]_Ӝn&2G"JTl5$yd0='$^wy_ș |(4Xx
@eX
T759Sv
<J99Oe%HVIY_Θq\ɓO݊.]Y(N,veu5X6XV4->%O~,־|#NYo"4⺮>q0@iU2
֧\ִ]bçD".@U-h.mxAH|Hઊxe>2:cu@1?|8+rI&"1=(d@Dΰ8B 93
@$}c'0qSr0gu /-%FeKQ}DD& ]o&>K\A>HRcpQ:s@$}p܆km~?6ܹ6rJq]c@߹>^;vT[[Drj طoՈȝ"f8 _zmf7o*Z[;7{O"ȏK<