only import BeautifulSoup if used in depricated functions

This commit is contained in:
j 2010-01-23 10:03:14 +11:00
parent 746b355c50
commit 51a0c7dc4a

View file

@ -6,7 +6,6 @@ import re
import os import os
import time import time
from BeautifulSoup import BeautifulSoup
import chardet import chardet
import oxlib import oxlib
from oxlib import stripTags, decodeHtml, findRe, findString from oxlib import stripTags, decodeHtml, findRe, findString
@ -284,6 +283,8 @@ def getMovieCredits(imdbId):
return credits return credits
def getMovieTrailers(imdbId): def getMovieTrailers(imdbId):
from BeautifulSoup import BeautifulSoup
url = "%strailers" % getUrlBase(imdbId) url = "%strailers" % getUrlBase(imdbId)
data = readUrlUnicode(url) data = readUrlUnicode(url)
soup = BeautifulSoup(data) soup = BeautifulSoup(data)
@ -583,6 +584,8 @@ class IMDb:
return getMovieYear(self.imdb) return getMovieYear(self.imdb)
def parse(self): def parse(self):
from BeautifulSoup import BeautifulSoup
data = self.getPage() data = self.getPage()
IMDbDict ={} IMDbDict ={}
info = getMovieInfo(self.imdb) info = getMovieInfo(self.imdb)