[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,11 +158,7 @@ class PersonPage(BasePage):
|
||||||
times = self.parser.select(td_overview,'time[itemprop=birthDate]')
|
times = self.parser.select(td_overview,'time[itemprop=birthDate]')
|
||||||
if len(times) > 0:
|
if len(times) > 0:
|
||||||
time = times[0].attrib.get('datetime','').split('-')
|
time = times[0].attrib.get('datetime','').split('-')
|
||||||
if len(time) == 2:
|
if len(time) == 3 and int(time[0]) >= 1900:
|
||||||
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]))
|
birth_date = datetime(int(time[0]),int(time[1]),int(time[2]))
|
||||||
dtimes = self.parser.select(td_overview,'time[itemprop=deathDate]')
|
dtimes = self.parser.select(td_overview,'time[itemprop=deathDate]')
|
||||||
if len(dtimes) > 0:
|
if len(dtimes) > 0:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ from weboob.core import CallErrors
|
||||||
|
|
||||||
__all__ = ['Cineoob']
|
__all__ = ['Cineoob']
|
||||||
|
|
||||||
|
ROLE_LIST = ['actor','director','writer','composer','producer']
|
||||||
|
COUNTRY_LIST = ['us','fr','de','jp']
|
||||||
|
|
||||||
class MovieInfoFormatter(IFormatter):
|
class MovieInfoFormatter(IFormatter):
|
||||||
MANDATORY_FIELDS = ('id', 'original_title', 'release_date', 'other_titles', 'duration', 'pitch', 'note', 'roles', 'country')
|
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',
|
'search_movie_subtitle': 'subtitle_list',
|
||||||
'info_subtitle': 'subtitle_info'
|
'info_subtitle': 'subtitle_info'
|
||||||
}
|
}
|
||||||
ROLE_LIST = ['actor','director','writer','composer','producer']
|
|
||||||
COUNTRY_LIST = ['us','fr','de','jp']
|
|
||||||
|
|
||||||
def complete_filmography(self, text, line, *ignored):
|
def complete_filmography(self, text, line, *ignored):
|
||||||
args = line.split(' ')
|
args = line.split(' ')
|
||||||
if len(args) == 3:
|
if len(args) == 3:
|
||||||
return self.ROLE_LIST
|
return ROLE_LIST
|
||||||
|
|
||||||
def complete_casting(self, text, line, *ignored):
|
def complete_casting(self, text, line, *ignored):
|
||||||
return self.complete_filmography(text,line,ignored)
|
return self.complete_filmography(text,line,ignored)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2013 Julien Veyssier
|
# Copyright(C) 2010-2011 Romain Bignon
|
||||||
#
|
#
|
||||||
# This file is part of weboob.
|
# 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.applications.qcineoob.ui.movie_ui import Ui_Movie
|
||||||
from weboob.capabilities.base import NotAvailable
|
from weboob.capabilities.base import NotAvailable
|
||||||
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||||
|
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||||
|
|
||||||
class Movie(QFrame):
|
class Movie(QFrame):
|
||||||
def __init__(self, movie, backend, parent=None):
|
def __init__(self, movie, backend, parent=None):
|
||||||
|
|
@ -57,6 +58,8 @@ class Movie(QFrame):
|
||||||
self.ui.pitchPlain.setPlainText('%s'%movie.pitch)
|
self.ui.pitchPlain.setPlainText('%s'%movie.pitch)
|
||||||
self.ui.countryLabel.setText('%s'%movie.country)
|
self.ui.countryLabel.setText('%s'%movie.country)
|
||||||
self.ui.noteLabel.setText('%s'%movie.note)
|
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.setAlignment(Qt.AlignTop)
|
||||||
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2013 Julien Veyssier
|
# Copyright(C) 2010-2011 Romain Bignon
|
||||||
#
|
#
|
||||||
# This file is part of weboob.
|
# 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.applications.qcineoob.ui.person_ui import Ui_Person
|
||||||
from weboob.capabilities.base import NotAvailable
|
from weboob.capabilities.base import NotAvailable
|
||||||
|
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||||
|
|
||||||
class Person(QFrame):
|
class Person(QFrame):
|
||||||
def __init__(self, person, backend, parent=None):
|
def __init__(self, person, backend, parent=None):
|
||||||
|
|
@ -49,6 +50,8 @@ class Person(QFrame):
|
||||||
else:
|
else:
|
||||||
self.ui.deathDateLabel.parent().hide()
|
self.ui.deathDateLabel.parent().hide()
|
||||||
self.ui.shortBioPlain.setPlainText('%s'%person.short_biography)
|
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)
|
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||||
|
|
||||||
def gotThumbnail(self):
|
def gotThumbnail(self):
|
||||||
|
|
|
||||||
|
|
@ -83,16 +83,6 @@
|
||||||
<string>all</string>
|
<string>all</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>actors</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>directors</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -67,16 +67,6 @@ filmography</string>
|
||||||
<string>all</string>
|
<string>all</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>actor</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>director</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue