From 1145a42e5c66f5efbbc86f8eed7986e229abf5ab Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 30 Sep 2008 18:05:19 +0200 Subject: [PATCH] only last gross / budget, not sum --- oxweb/imdb.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 109b3a4..768867a 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -408,11 +408,13 @@ def getMovieBusinessSum(imdbId): business = getMovieBusiness(imdbId) b_ = {'budget': 0, 'gross': 0, 'profit': 0} if 'budget' in business: - b_['budget'] = sum([int(intValue(i.replace(',', ''))) for i in business['budget']]) + #b_['budget'] = sum([int(intValue(i.replace(',', ''))) for i in business['budget']]) + b_['budget'] = int(intValue(business['budget'][0].replace(',', ''))) if 'gross' in business: - b_['gross'] = sum([int(intValue(i.replace(',', ''))) for i in business['gross']]) - if 'weekend gross' in business: - b_['gross'] += sum([int(intValue(i.replace(',', ''))) for i in business['weekend gross']]) + b_['gross'] = int(intValue(business['gross'][0].replace(',', ''))) + #b_['gross'] = sum([int(intValue(i.replace(',', ''))) for i in business['gross']]) + #if 'weekend gross' in business: + # b_['gross'] += sum([int(intValue(i.replace(',', ''))) for i in business['weekend gross']]) if b_['budget'] and b_['gross']: b_['profit'] = b_['gross'] - b_['budget'] return b_