From 51a0c7dc4a29d52d7e65880f1f6a8adea2b0966b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 23 Jan 2010 10:03:14 +1100 Subject: [PATCH] only import BeautifulSoup if used in depricated functions --- oxweb/imdb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 62d9120..d46f6b8 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -6,7 +6,6 @@ import re import os import time -from BeautifulSoup import BeautifulSoup import chardet import oxlib from oxlib import stripTags, decodeHtml, findRe, findString @@ -284,6 +283,8 @@ def getMovieCredits(imdbId): return credits def getMovieTrailers(imdbId): + from BeautifulSoup import BeautifulSoup + url = "%strailers" % getUrlBase(imdbId) data = readUrlUnicode(url) soup = BeautifulSoup(data) @@ -583,6 +584,8 @@ class IMDb: return getMovieYear(self.imdb) def parse(self): + from BeautifulSoup import BeautifulSoup + data = self.getPage() IMDbDict ={} info = getMovieInfo(self.imdb)