[qcineoob] search and display torrent
This commit is contained in:
parent
6fe917417c
commit
c76db754e9
8 changed files with 597 additions and 106 deletions
|
|
@ -73,9 +73,7 @@ class TorrentPage(BasePage):
|
||||||
title = NotAvailable
|
title = NotAvailable
|
||||||
size = NotAvailable
|
size = NotAvailable
|
||||||
url = 'https://isohunt.com/download/%s/%s.torrent' % (id, id)
|
url = 'https://isohunt.com/download/%s/%s.torrent' % (id, id)
|
||||||
for a in self.document.getiterator('a'):
|
title = unicode(self.parser.select(self.document.getroot(),'head > meta[name=title]',1).attrib.get('content',''))
|
||||||
if 'Search more torrents of' in a.attrib.get('title', ''):
|
|
||||||
title = unicode(a.tail)
|
|
||||||
seed = NotAvailable
|
seed = NotAvailable
|
||||||
leech = NotAvailable
|
leech = NotAvailable
|
||||||
tip_id = "none"
|
tip_id = "none"
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
from PyQt4.QtCore import SIGNAL
|
from PyQt4.QtCore import SIGNAL
|
||||||
|
|
||||||
from weboob.capabilities.cinema import ICapCinema
|
from weboob.capabilities.cinema import ICapCinema
|
||||||
|
from weboob.capabilities.torrent import ICapTorrent
|
||||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||||
|
|
||||||
|
|
@ -28,8 +29,10 @@ from weboob.applications.qcineoob.ui.main_window_ui import Ui_MainWindow
|
||||||
|
|
||||||
from .minimovie import MiniMovie
|
from .minimovie import MiniMovie
|
||||||
from .miniperson import MiniPerson
|
from .miniperson import MiniPerson
|
||||||
|
from .minitorrent import MiniTorrent
|
||||||
from .movie import Movie
|
from .movie import Movie
|
||||||
from .person import Person
|
from .person import Person
|
||||||
|
from .torrent import Torrent
|
||||||
|
|
||||||
class MainWindow(QtMainWindow):
|
class MainWindow(QtMainWindow):
|
||||||
def __init__(self, config, weboob, parent=None):
|
def __init__(self, config, weboob, parent=None):
|
||||||
|
|
@ -39,10 +42,8 @@ class MainWindow(QtMainWindow):
|
||||||
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.weboob = weboob
|
self.weboob = weboob
|
||||||
self.minimovies = []
|
self.minis = []
|
||||||
self.minipersons = []
|
self.current_info_widget = None
|
||||||
self.current_movie_widget = None
|
|
||||||
self.current_person_widget = None
|
|
||||||
|
|
||||||
self.history = {'last_action':None,'action_list':[]}
|
self.history = {'last_action':None,'action_list':[]}
|
||||||
self.connect(self.ui.backButton, SIGNAL("clicked()"), self.doBack)
|
self.connect(self.ui.backButton, SIGNAL("clicked()"), self.doBack)
|
||||||
|
|
@ -59,7 +60,7 @@ class MainWindow(QtMainWindow):
|
||||||
self.backendsConfig()
|
self.backendsConfig()
|
||||||
|
|
||||||
def backendsConfig(self):
|
def backendsConfig(self):
|
||||||
bckndcfg = BackendCfg(self.weboob, (ICapCinema,), self)
|
bckndcfg = BackendCfg(self.weboob, (ICapCinema,ICapTorrent,), self)
|
||||||
if bckndcfg.run():
|
if bckndcfg.run():
|
||||||
self.loadBackendsList()
|
self.loadBackendsList()
|
||||||
|
|
||||||
|
|
@ -81,6 +82,7 @@ class MainWindow(QtMainWindow):
|
||||||
self.ui.currentActionLabel.setText(description)
|
self.ui.currentActionLabel.setText(description)
|
||||||
if self.history['last_action'] != None:
|
if self.history['last_action'] != None:
|
||||||
self.history['action_list'].append(self.history['last_action'])
|
self.history['action_list'].append(self.history['last_action'])
|
||||||
|
self.ui.backButton.setToolTip(self.history['last_action']['description'])
|
||||||
self.ui.backButton.setDisabled(False)
|
self.ui.backButton.setDisabled(False)
|
||||||
self.history['last_action'] = {'function':fun,'args':args,'description':description}
|
self.history['last_action'] = {'function':fun,'args':args,'description':description}
|
||||||
return fun(*args)
|
return fun(*args)
|
||||||
|
|
@ -92,37 +94,39 @@ class MainWindow(QtMainWindow):
|
||||||
self.history['last_action'] = todo
|
self.history['last_action'] = todo
|
||||||
if len(self.history['action_list']) == 0:
|
if len(self.history['action_list']) == 0:
|
||||||
self.ui.backButton.setDisabled(True)
|
self.ui.backButton.setDisabled(True)
|
||||||
|
else:
|
||||||
|
self.ui.backButton.setToolTip(self.history['action_list'][-1]['description'])
|
||||||
return todo['function'](*todo['args'])
|
return todo['function'](*todo['args'])
|
||||||
|
|
||||||
def castingAction(self, id, role):
|
def castingAction(self, id, role):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.person_list_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||||
for miniperson in self.minipersons:
|
for mini in self.minis:
|
||||||
self.ui.person_list_content.layout().removeWidget(miniperson)
|
self.ui.list_content.layout().removeWidget(mini)
|
||||||
miniperson.hide()
|
mini.hide()
|
||||||
miniperson.deleteLater()
|
mini.deleteLater()
|
||||||
|
|
||||||
self.minipersons = []
|
self.minis = []
|
||||||
self.ui.searchEdit.setEnabled(False)
|
self.ui.searchEdit.setEnabled(False)
|
||||||
|
|
||||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||||
|
|
||||||
self.process = QtDo(self.weboob, self.addPerson)
|
self.process = QtDo(self.weboob, self.addPerson)
|
||||||
self.process.do('iter_movie_persons', id, role, backends=backend_name)
|
self.process.do('iter_movie_persons', id, role, backends=backend_name, caps=ICapCinema)
|
||||||
|
|
||||||
def filmographyAction(self, id, role):
|
def filmographyAction(self, id, role):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.movie_list_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||||
for minimovie in self.minimovies:
|
for mini in self.minis:
|
||||||
self.ui.movie_list_content.layout().removeWidget(minimovie)
|
self.ui.list_content.layout().removeWidget(mini)
|
||||||
minimovie.hide()
|
mini.hide()
|
||||||
minimovie.deleteLater()
|
mini.deleteLater()
|
||||||
|
|
||||||
self.minimovies = []
|
self.minis = []
|
||||||
self.ui.searchEdit.setEnabled(False)
|
self.ui.searchEdit.setEnabled(False)
|
||||||
|
|
||||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||||
|
|
||||||
self.process = QtDo(self.weboob, self.addMovie)
|
self.process = QtDo(self.weboob, self.addMovie)
|
||||||
self.process.do('iter_person_movies', id, role, backends=backend_name)
|
self.process.do('iter_person_movies', id, role, backends=backend_name, caps=ICapCinema)
|
||||||
|
|
||||||
def search(self):
|
def search(self):
|
||||||
tosearch = self.ui.typeCombo.currentText()
|
tosearch = self.ui.typeCombo.currentText()
|
||||||
|
|
@ -130,6 +134,8 @@ class MainWindow(QtMainWindow):
|
||||||
self.searchPerson()
|
self.searchPerson()
|
||||||
elif tosearch == 'movie':
|
elif tosearch == 'movie':
|
||||||
self.searchMovie()
|
self.searchMovie()
|
||||||
|
elif tosearch == 'torrent':
|
||||||
|
self.searchTorrent()
|
||||||
|
|
||||||
def searchMovie(self):
|
def searchMovie(self):
|
||||||
pattern = unicode(self.ui.searchEdit.text())
|
pattern = unicode(self.ui.searchEdit.text())
|
||||||
|
|
@ -138,19 +144,19 @@ class MainWindow(QtMainWindow):
|
||||||
self.doAction(u'Search movie results for "%s"'%pattern,self.searchMovieAction,[pattern])
|
self.doAction(u'Search movie results for "%s"'%pattern,self.searchMovieAction,[pattern])
|
||||||
|
|
||||||
def searchMovieAction(self,pattern):
|
def searchMovieAction(self,pattern):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.movie_list_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||||
for minimovie in self.minimovies:
|
for mini in self.minis:
|
||||||
self.ui.movie_list_content.layout().removeWidget(minimovie)
|
self.ui.list_content.layout().removeWidget(mini)
|
||||||
minimovie.hide()
|
mini.hide()
|
||||||
minimovie.deleteLater()
|
mini.deleteLater()
|
||||||
|
|
||||||
self.minimovies = []
|
self.minis = []
|
||||||
self.ui.searchEdit.setEnabled(False)
|
self.ui.searchEdit.setEnabled(False)
|
||||||
|
|
||||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||||
|
|
||||||
self.process = QtDo(self.weboob, self.addMovie)
|
self.process = QtDo(self.weboob, self.addMovie)
|
||||||
self.process.do('iter_movies', pattern, backends=backend_name)
|
self.process.do('iter_movies', pattern, backends=backend_name, caps=ICapCinema)
|
||||||
|
|
||||||
def addMovie(self, backend, movie):
|
def addMovie(self, backend, movie):
|
||||||
if not backend:
|
if not backend:
|
||||||
|
|
@ -158,18 +164,18 @@ class MainWindow(QtMainWindow):
|
||||||
self.process = None
|
self.process = None
|
||||||
return
|
return
|
||||||
minimovie = MiniMovie(self.weboob, backend, movie, self)
|
minimovie = MiniMovie(self.weboob, backend, movie, self)
|
||||||
self.ui.movie_list_content.layout().addWidget(minimovie)
|
self.ui.list_content.layout().addWidget(minimovie)
|
||||||
self.minimovies.append(minimovie)
|
self.minis.append(minimovie)
|
||||||
|
|
||||||
def displayMovie(self, movie):
|
def displayMovie(self, movie):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.movie_info_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.info_page)
|
||||||
if self.current_movie_widget != None:
|
if self.current_info_widget != None:
|
||||||
self.ui.movie_info_content.layout().removeWidget(self.current_movie_widget)
|
self.ui.info_content.layout().removeWidget(self.current_info_widget)
|
||||||
self.current_movie_widget.hide()
|
self.current_info_widget.hide()
|
||||||
self.current_movie_widget.deleteLater()
|
self.current_info_widget.deleteLater()
|
||||||
wmovie = Movie(movie,self)
|
wmovie = Movie(movie,self)
|
||||||
self.ui.movie_info_content.layout().addWidget(wmovie)
|
self.ui.info_content.layout().addWidget(wmovie)
|
||||||
self.current_movie_widget = wmovie
|
self.current_info_widget = wmovie
|
||||||
|
|
||||||
def searchPerson(self):
|
def searchPerson(self):
|
||||||
pattern = unicode(self.ui.searchEdit.text())
|
pattern = unicode(self.ui.searchEdit.text())
|
||||||
|
|
@ -178,19 +184,19 @@ class MainWindow(QtMainWindow):
|
||||||
self.doAction(u'Search person results for "%s"'%pattern,self.searchPersonAction,[pattern])
|
self.doAction(u'Search person results for "%s"'%pattern,self.searchPersonAction,[pattern])
|
||||||
|
|
||||||
def searchPersonAction(self,pattern):
|
def searchPersonAction(self,pattern):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.person_list_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||||
for miniperson in self.minipersons:
|
for mini in self.minis:
|
||||||
self.ui.person_list_content.layout().removeWidget(miniperson)
|
self.ui.list_content.layout().removeWidget(mini)
|
||||||
miniperson.hide()
|
mini.hide()
|
||||||
miniperson.deleteLater()
|
mini.deleteLater()
|
||||||
|
|
||||||
self.minipersons = []
|
self.minis = []
|
||||||
self.ui.searchEdit.setEnabled(False)
|
self.ui.searchEdit.setEnabled(False)
|
||||||
|
|
||||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||||
|
|
||||||
self.process = QtDo(self.weboob, self.addPerson)
|
self.process = QtDo(self.weboob, self.addPerson)
|
||||||
self.process.do('iter_persons', pattern, backends=backend_name)
|
self.process.do('iter_persons', pattern, backends=backend_name, caps=ICapCinema)
|
||||||
|
|
||||||
def addPerson(self, backend, person):
|
def addPerson(self, backend, person):
|
||||||
if not backend:
|
if not backend:
|
||||||
|
|
@ -198,18 +204,58 @@ class MainWindow(QtMainWindow):
|
||||||
self.process = None
|
self.process = None
|
||||||
return
|
return
|
||||||
miniperson = MiniPerson(self.weboob, backend, person, self)
|
miniperson = MiniPerson(self.weboob, backend, person, self)
|
||||||
self.ui.person_list_content.layout().addWidget(miniperson)
|
self.ui.list_content.layout().addWidget(miniperson)
|
||||||
self.minipersons.append(miniperson)
|
self.minis.append(miniperson)
|
||||||
|
|
||||||
def displayPerson(self, person):
|
def displayPerson(self, person):
|
||||||
self.ui.stackedWidget.setCurrentWidget(self.ui.person_info_page)
|
self.ui.stackedWidget.setCurrentWidget(self.ui.info_page)
|
||||||
if self.current_person_widget != None:
|
if self.current_info_widget != None:
|
||||||
self.ui.person_info_content.layout().removeWidget(self.current_person_widget)
|
self.ui.info_content.layout().removeWidget(self.current_info_widget)
|
||||||
self.current_person_widget.hide()
|
self.current_info_widget.hide()
|
||||||
self.current_person_widget.deleteLater()
|
self.current_info_widget.deleteLater()
|
||||||
wperson = Person(person,self)
|
wperson = Person(person,self)
|
||||||
self.ui.person_info_content.layout().addWidget(wperson)
|
self.ui.info_content.layout().addWidget(wperson)
|
||||||
self.current_person_widget = wperson
|
self.current_info_widget = wperson
|
||||||
|
|
||||||
|
def searchTorrent(self):
|
||||||
|
pattern = unicode(self.ui.searchEdit.text())
|
||||||
|
if not pattern:
|
||||||
|
return
|
||||||
|
self.doAction(u'Search torrent for "%s"'%pattern,self.searchTorrentAction,[pattern])
|
||||||
|
|
||||||
|
def searchTorrentAction(self,pattern):
|
||||||
|
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||||
|
for mini in self.minis:
|
||||||
|
self.ui.list_content.layout().removeWidget(mini)
|
||||||
|
mini.hide()
|
||||||
|
mini.deleteLater()
|
||||||
|
|
||||||
|
self.mini = []
|
||||||
|
self.ui.searchEdit.setEnabled(False)
|
||||||
|
|
||||||
|
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||||
|
|
||||||
|
self.process = QtDo(self.weboob, self.addTorrent)
|
||||||
|
self.process.do('iter_torrents', pattern, backends=backend_name, caps=ICapTorrent)
|
||||||
|
|
||||||
|
def addTorrent(self, backend, torrent):
|
||||||
|
if not backend:
|
||||||
|
self.ui.searchEdit.setEnabled(True)
|
||||||
|
self.process = None
|
||||||
|
return
|
||||||
|
minitorrent = MiniTorrent(self.weboob, backend, torrent, self)
|
||||||
|
self.ui.list_content.layout().addWidget(minitorrent)
|
||||||
|
self.minis.append(minitorrent)
|
||||||
|
|
||||||
|
def displayTorrent(self, torrent):
|
||||||
|
self.ui.stackedWidget.setCurrentWidget(self.ui.info_page)
|
||||||
|
if self.current_info_widget != None:
|
||||||
|
self.ui.info_content.layout().removeWidget(self.current_info_widget)
|
||||||
|
self.current_info_widget.hide()
|
||||||
|
self.current_info_widget.deleteLater()
|
||||||
|
wtorrent = Torrent(torrent,self)
|
||||||
|
self.ui.info_content.layout().addWidget(wtorrent)
|
||||||
|
self.current_info_widget = wtorrent
|
||||||
|
|
||||||
def closeEvent(self, ev):
|
def closeEvent(self, ev):
|
||||||
self.config.set('settings', 'backend', str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString()))
|
self.config.set('settings', 'backend', str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString()))
|
||||||
|
|
|
||||||
56
weboob/applications/qcineoob/minitorrent.py
Normal file
56
weboob/applications/qcineoob/minitorrent.py
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright(C) 2010-2011 Romain Bignon
|
||||||
|
#
|
||||||
|
# This file is part of weboob.
|
||||||
|
#
|
||||||
|
# weboob is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# weboob is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
from PyQt4.QtGui import QFrame, QImage, QPixmap
|
||||||
|
|
||||||
|
from weboob.tools.application.qt import QtDo
|
||||||
|
from weboob.applications.qcineoob.ui.minitorrent_ui import Ui_MiniTorrent
|
||||||
|
from weboob.capabilities.base import NotAvailable, NotLoaded
|
||||||
|
|
||||||
|
class MiniTorrent(QFrame):
|
||||||
|
def __init__(self, weboob, backend, torrent, parent=None):
|
||||||
|
QFrame.__init__(self, parent)
|
||||||
|
self.parent = parent
|
||||||
|
self.ui = Ui_MiniTorrent()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
|
self.weboob = weboob
|
||||||
|
self.backend = backend
|
||||||
|
self.torrent = torrent
|
||||||
|
self.ui.nameLabel.setText(torrent.name)
|
||||||
|
if torrent.seeders != NotAvailable and torrent.leechers != NotAvailable:
|
||||||
|
self.ui.seedLeechLabel.setText('%s/%s'%(torrent.seeders,torrent.leechers))
|
||||||
|
self.ui.backendLabel.setText(backend.name)
|
||||||
|
|
||||||
|
def enterEvent(self, event):
|
||||||
|
self.setFrameShadow(self.Sunken)
|
||||||
|
QFrame.enterEvent(self, event)
|
||||||
|
|
||||||
|
def leaveEvent(self, event):
|
||||||
|
self.setFrameShadow(self.Raised)
|
||||||
|
QFrame.leaveEvent(self, event)
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
QFrame.mousePressEvent(self, event)
|
||||||
|
|
||||||
|
torrent = self.backend.get_torrent(self.torrent.id)
|
||||||
|
if torrent:
|
||||||
|
self.parent.doAction('Details of torrent "%s"'%torrent.name,self.parent.displayTorrent,[torrent])
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.capabilities.cinema import ICapCinema
|
from weboob.capabilities.cinema import ICapCinema
|
||||||
|
from weboob.capabilities.torrent import ICapTorrent
|
||||||
from weboob.tools.application.qt import QtApplication
|
from weboob.tools.application.qt import QtApplication
|
||||||
|
|
||||||
from .main_window import MainWindow
|
from .main_window import MainWindow
|
||||||
|
|
@ -30,7 +31,7 @@ class QCineoob(QtApplication):
|
||||||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
||||||
DESCRIPTION = "Qt application allowing to search movies etc..."
|
DESCRIPTION = "Qt application allowing to search movies etc..."
|
||||||
SHORT_DESCRIPTION = "search movies"
|
SHORT_DESCRIPTION = "search movies"
|
||||||
CAPS = ICapCinema
|
CAPS = ICapCinema,ICapTorrent
|
||||||
CONFIG = {'settings': {'nsfw': 1,
|
CONFIG = {'settings': {'nsfw': 1,
|
||||||
'sfw': 1,
|
'sfw': 1,
|
||||||
'sortby': 0,
|
'sortby': 0,
|
||||||
|
|
@ -38,7 +39,7 @@ class QCineoob(QtApplication):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
def main(self, argv):
|
def main(self, argv):
|
||||||
self.load_backends(ICapCinema)
|
self.load_backends([ICapCinema,ICapTorrent])
|
||||||
self.load_config()
|
self.load_config()
|
||||||
|
|
||||||
self.main_window = MainWindow(self.config, self.weboob)
|
self.main_window = MainWindow(self.config, self.weboob)
|
||||||
|
|
|
||||||
50
weboob/applications/qcineoob/torrent.py
Normal file
50
weboob/applications/qcineoob/torrent.py
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright(C) 2010-2011 Romain Bignon
|
||||||
|
#
|
||||||
|
# This file is part of weboob.
|
||||||
|
#
|
||||||
|
# weboob is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# weboob is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
from PyQt4.QtCore import QUrl,Qt,SIGNAL
|
||||||
|
from PyQt4.QtGui import QFrame, QImage, QPixmap
|
||||||
|
|
||||||
|
from weboob.applications.qcineoob.ui.torrent_ui import Ui_Torrent
|
||||||
|
from weboob.capabilities.base import NotAvailable, NotLoaded
|
||||||
|
|
||||||
|
class Torrent(QFrame):
|
||||||
|
def __init__(self, torrent, parent=None):
|
||||||
|
QFrame.__init__(self, parent)
|
||||||
|
self.parent = parent
|
||||||
|
self.ui = Ui_Torrent()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
|
#self.connect(self.ui.downloadButton, SIGNAL("clicked()"), self.download)
|
||||||
|
|
||||||
|
self.torrent = torrent
|
||||||
|
self.ui.nameLabel.setText(u'%s'%torrent.name)
|
||||||
|
|
||||||
|
self.ui.verticalLayout.setAlignment(Qt.AlignTop)
|
||||||
|
|
||||||
|
def download(self):
|
||||||
|
role = None
|
||||||
|
tosearch = self.ui.castingCombo.currentText()
|
||||||
|
role_desc = ''
|
||||||
|
if tosearch != 'all':
|
||||||
|
role = tosearch[:-1]
|
||||||
|
role_desc = ' as %s'%role
|
||||||
|
self.parent.doAction('Casting%s of movie "%s"'%(role_desc,self.movie.original_title),
|
||||||
|
self.parent.castingAction,[self.movie.id,role])
|
||||||
|
|
@ -52,6 +52,11 @@
|
||||||
<string>person</string>
|
<string>person</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>torrent</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
@ -91,14 +96,14 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<widget class="QWidget" name="movie_list_page">
|
<widget class="QWidget" name="list_page">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="movie_list_content">
|
<widget class="QWidget" name="list_content">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
|
@ -113,20 +118,20 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="movie_info_page">
|
<widget class="QWidget" name="info_page">
|
||||||
<layout class="QVBoxLayout" name="movieInfoLayout">
|
<layout class="QVBoxLayout" name="movieInfoLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea_2">
|
<widget class="QScrollArea" name="scrollArea_2">
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="movie_info_content">
|
<widget class="QWidget" name="info_content">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>96</width>
|
<width>660</width>
|
||||||
<height>26</height>
|
<height>292</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8"/>
|
<layout class="QVBoxLayout" name="verticalLayout_8"/>
|
||||||
|
|
@ -135,50 +140,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="person_list_page">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
|
||||||
<item>
|
|
||||||
<widget class="QScrollArea" name="scrollArea_4">
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="person_list_content">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>96</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5"/>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="person_info_page">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
|
||||||
<item>
|
|
||||||
<widget class="QScrollArea" name="scrollArea_5">
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="person_info_content">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>96</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4"/>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
129
weboob/applications/qcineoob/ui/minitorrent.ui
Normal file
129
weboob/applications/qcineoob/ui/minitorrent.ui
Normal file
|
|
@ -0,0 +1,129 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MiniTorrent</class>
|
||||||
|
<widget class="QFrame" name="MiniTorrent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>464</width>
|
||||||
|
<height>136</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="imageLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="nameLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<italic>true</italic>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Seed/leech:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="seedLeechLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Where</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="backendLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
250
weboob/applications/qcineoob/ui/torrent.ui
Normal file
250
weboob/applications/qcineoob/ui/torrent.ui
Normal file
|
|
@ -0,0 +1,250 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Torrent</class>
|
||||||
|
<widget class="QFrame" name="Torrent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>629</width>
|
||||||
|
<height>552</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>2000</width>
|
||||||
|
<height>600</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Frame</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_3">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>600</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="downloadButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Download</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_9">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="nameLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Seed/leech:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="seedLeechLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_6">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Size:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="sizeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_8">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Description:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="descriptionPlain"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_5">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Files:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="filesPlain"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_7">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Url:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="urlEdit"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue