parent
46a56f5d87
commit
05b9bbdb2e
5 changed files with 30 additions and 14 deletions
|
|
@ -16,7 +16,7 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
import ClientForm
|
from weboob.tools.mech import ClientForm
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,8 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
try:
|
from weboob.tools.mech import ClientForm
|
||||||
from mechanize import ControlNotFoundError
|
ControlNotFoundError = ClientForm.ControlNotFoundError
|
||||||
except ImportError:
|
|
||||||
from ClientForm import ControlNotFoundError
|
|
||||||
import ClientForm
|
|
||||||
|
|
||||||
from .base import CragrBasePage
|
from .base import CragrBasePage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,8 @@
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
try:
|
from weboob.tools.mech import ClientForm
|
||||||
from mechanize import ControlNotFoundError
|
ControlNotFoundError = ClientForm.ControlNotFoundError
|
||||||
except ImportError:
|
|
||||||
from ClientForm import ControlNotFoundError
|
|
||||||
|
|
||||||
from mechanize import FormNotFoundError
|
from mechanize import FormNotFoundError
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,8 @@
|
||||||
import mechanize
|
import mechanize
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
try:
|
from weboob.tools.mech import ClientForm
|
||||||
from mechanize import ControlNotFoundError
|
ControlNotFoundError = ClientForm.ControlNotFoundError
|
||||||
except ImportError:
|
|
||||||
from ClientForm import ControlNotFoundError
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
from logging import warning, debug
|
from logging import warning, debug
|
||||||
|
|
|
||||||
23
weboob/tools/mech.py
Normal file
23
weboob/tools/mech.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright(C) 2010 Laurent Bachelier
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 3 of the License.
|
||||||
|
#
|
||||||
|
# This program 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 General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
import mechanize
|
||||||
|
if hasattr(mechanize, "FormParser"):
|
||||||
|
ClientForm = mechanize
|
||||||
|
else:
|
||||||
|
import ClientForm
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue