[qcineoob] role list imported from cineoob
[imdb] if birth date isn't complete => NotAvailable
This commit is contained in:
parent
5d70856014
commit
205ffd0251
6 changed files with 13 additions and 31 deletions
|
|
@ -158,12 +158,8 @@ class PersonPage(BasePage):
|
|||
times = self.parser.select(td_overview,'time[itemprop=birthDate]')
|
||||
if len(times) > 0:
|
||||
time = times[0].attrib.get('datetime','').split('-')
|
||||
if len(time) == 2:
|
||||
time.append('1')
|
||||
elif len(time) == 1:
|
||||
time.append('1')
|
||||
time.append('1')
|
||||
birth_date = datetime(int(time[0]),int(time[1]),int(time[2]))
|
||||
if len(time) == 3 and int(time[0]) >= 1900:
|
||||
birth_date = datetime(int(time[0]),int(time[1]),int(time[2]))
|
||||
dtimes = self.parser.select(td_overview,'time[itemprop=deathDate]')
|
||||
if len(dtimes) > 0:
|
||||
dtime = dtimes[0].attrib.get('datetime','').split('-')
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ from weboob.core import CallErrors
|
|||
|
||||
__all__ = ['Cineoob']
|
||||
|
||||
ROLE_LIST = ['actor','director','writer','composer','producer']
|
||||
COUNTRY_LIST = ['us','fr','de','jp']
|
||||
|
||||
class MovieInfoFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'original_title', 'release_date', 'other_titles', 'duration', 'pitch', 'note', 'roles', 'country')
|
||||
|
|
@ -202,13 +204,11 @@ class Cineoob(ReplApplication):
|
|||
'search_movie_subtitle': 'subtitle_list',
|
||||
'info_subtitle': 'subtitle_info'
|
||||
}
|
||||
ROLE_LIST = ['actor','director','writer','composer','producer']
|
||||
COUNTRY_LIST = ['us','fr','de','jp']
|
||||
|
||||
def complete_filmography(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
if len(args) == 3:
|
||||
return self.ROLE_LIST
|
||||
return ROLE_LIST
|
||||
|
||||
def complete_casting(self, text, line, *ignored):
|
||||
return self.complete_filmography(text,line,ignored)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright(C) 2013 Julien Veyssier
|
||||
# Copyright(C) 2010-2011 Romain Bignon
|
||||
#
|
||||
# This file is part of weboob.
|
||||
#
|
||||
|
|
@ -25,6 +25,7 @@ from PyQt4.QtGui import QFrame, QImage, QPixmap
|
|||
from weboob.applications.qcineoob.ui.movie_ui import Ui_Movie
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
class Movie(QFrame):
|
||||
def __init__(self, movie, backend, parent=None):
|
||||
|
|
@ -57,6 +58,8 @@ class Movie(QFrame):
|
|||
self.ui.pitchPlain.setPlainText('%s'%movie.pitch)
|
||||
self.ui.countryLabel.setText('%s'%movie.country)
|
||||
self.ui.noteLabel.setText('%s'%movie.note)
|
||||
for role in ROLE_LIST:
|
||||
self.ui.castingCombo.addItem('%ss'%role)
|
||||
|
||||
self.ui.verticalLayout.setAlignment(Qt.AlignTop)
|
||||
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright(C) 2013 Julien Veyssier
|
||||
# Copyright(C) 2010-2011 Romain Bignon
|
||||
#
|
||||
# This file is part of weboob.
|
||||
#
|
||||
|
|
@ -24,6 +24,7 @@ from PyQt4.QtGui import QFrame, QImage, QPixmap, QApplication
|
|||
|
||||
from weboob.applications.qcineoob.ui.person_ui import Ui_Person
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
class Person(QFrame):
|
||||
def __init__(self, person, backend, parent=None):
|
||||
|
|
@ -49,6 +50,8 @@ class Person(QFrame):
|
|||
else:
|
||||
self.ui.deathDateLabel.parent().hide()
|
||||
self.ui.shortBioPlain.setPlainText('%s'%person.short_biography)
|
||||
for role in ROLE_LIST:
|
||||
self.ui.filmographyCombo.addItem(role)
|
||||
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||
|
||||
def gotThumbnail(self):
|
||||
|
|
|
|||
|
|
@ -83,16 +83,6 @@
|
|||
<string>all</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>actors</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>directors</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
|
|
@ -67,16 +67,6 @@ filmography</string>
|
|||
<string>all</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>actor</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>director</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue