From 40b3dabb9911b5c8e5f186b95476547166a0b65f Mon Sep 17 00:00:00 2001
From: j <0x006A@0x2620.org>
Date: Fri, 30 Sep 2011 19:52:13 +0200
Subject: [PATCH] include title in connections
---
ox/web/imdb.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/ox/web/imdb.py b/ox/web/imdb.py
index d908285..999c6ca 100644
--- a/ox/web/imdb.py
+++ b/ox/web/imdb.py
@@ -300,7 +300,18 @@ class Imdb(SiteParser):
if len(self['connections']) == 2 and isinstance(self['connections'][0], basestring):
self['connections'] = [self['connections']]
for rel, data in self['connections']:
- cc[unicode(rel)] = re.compile('').findall(data)
+ #cc[unicode(rel)] = re.compile('(.*?)').findall(data)
+ def get_conn(c):
+ title = c[1]
+ if title.startswith('"') and title.endswith('"'):
+ title = title[1:-1]
+ return {
+ 'id': c[0],
+ 'title': title
+ }
+ cc[unicode(rel)] = map(get_conn, re.compile('(.*?)').findall(data))
+
+
self['connections'] = cc
for key in ('countries', 'genres'):