more explicit error messages during common import errors
This commit is contained in:
parent
32e965d338
commit
535d6efc47
8 changed files with 42 additions and 8 deletions
|
|
@ -20,7 +20,11 @@
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import sys
|
import sys
|
||||||
import Image
|
|
||||||
|
try:
|
||||||
|
import Image
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-imaging')
|
||||||
|
|
||||||
class CaptchaError(Exception): pass
|
class CaptchaError(Exception): pass
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import Image
|
|
||||||
|
try:
|
||||||
|
import Image
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-imaging')
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
|
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import Image
|
|
||||||
|
try:
|
||||||
|
import Image
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-imaging')
|
||||||
|
|
||||||
|
|
||||||
class TileError(Exception):
|
class TileError(Exception):
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,12 @@
|
||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
|
try:
|
||||||
|
import gdata.youtube.service
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Please install python-gdata")
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import gdata.youtube.service
|
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,12 @@ from __future__ import with_statement
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from httplib import BadStatusLine
|
from httplib import BadStatusLine
|
||||||
from logging import warning
|
from logging import warning
|
||||||
import mechanize
|
|
||||||
|
try:
|
||||||
|
import mechanize
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-mechanize')
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
|
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import Image
|
|
||||||
|
try:
|
||||||
|
import Image
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-imaging')
|
||||||
|
|
||||||
|
|
||||||
class VirtKeyboardError(Exception):
|
class VirtKeyboardError(Exception):
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,11 @@
|
||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
from dateutil import tz
|
try:
|
||||||
|
from dateutil import tz
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-dateutil')
|
||||||
|
|
||||||
from logging import warning
|
from logging import warning
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
from tempfile import gettempdir
|
from tempfile import gettempdir
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,12 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import feedparser
|
|
||||||
|
try:
|
||||||
|
import feedparser
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError('Please install python-feedparser')
|
||||||
|
|
||||||
if feedparser.__version__ >= '5.0':
|
if feedparser.__version__ >= '5.0':
|
||||||
# feedparser >= 5.0 replaces this regexp on sgmllib and mechanize < 2.0
|
# feedparser >= 5.0 replaces this regexp on sgmllib and mechanize < 2.0
|
||||||
# fails with malformated webpages.
|
# fails with malformated webpages.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue