[suboob] language hashtable moved from opensubtitles backend to application
This commit is contained in:
parent
d4c231cf42
commit
e98008338a
6 changed files with 33 additions and 26 deletions
|
|
@ -18,10 +18,10 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.capabilities.subtitle import ICapSubtitle,LanguageNotSupported
|
from weboob.capabilities.subtitle import ICapSubtitle,LanguageNotSupported
|
||||||
|
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||||
from weboob.tools.backend import BaseBackend
|
from weboob.tools.backend import BaseBackend
|
||||||
|
|
||||||
from .browser import OpensubtitlesBrowser
|
from .browser import OpensubtitlesBrowser
|
||||||
from .pages import LANGUAGE_CONV
|
|
||||||
|
|
||||||
from urllib import quote_plus
|
from urllib import quote_plus
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,9 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser
|
from weboob.tools.browser import BaseBrowser
|
||||||
|
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||||
|
|
||||||
from .pages import SubtitlesPage, SearchPage, SubtitlePage, LANGUAGE_CONV
|
from .pages import SubtitlesPage, SearchPage, SubtitlePage
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['OpensubtitlesBrowser']
|
__all__ = ['OpensubtitlesBrowser']
|
||||||
|
|
|
||||||
|
|
@ -21,29 +21,12 @@
|
||||||
from weboob.capabilities.subtitle import Subtitle
|
from weboob.capabilities.subtitle import Subtitle
|
||||||
from weboob.capabilities.base import NotAvailable
|
from weboob.capabilities.base import NotAvailable
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['SubtitlesPage','SubtitlePage','SearchPage']
|
__all__ = ['SubtitlesPage','SubtitlePage','SearchPage']
|
||||||
|
|
||||||
|
|
||||||
LANGUAGE_CONV = {
|
|
||||||
'ar':'ara', 'eo':'epo', 'ga':'', 'ru':'rus',
|
|
||||||
'af':'' , 'et':'est', 'it':'ita', 'sr':'scc',
|
|
||||||
'sq':'alb', 'tl':'' , 'ja':'jpn', 'sk':'slo',
|
|
||||||
'hy':'arm', 'fi':'fin', 'kn':'', 'sl':'slv',
|
|
||||||
'az':'' , 'fr':'fre', 'ko':'kor', 'es':'spa',
|
|
||||||
'eu':'baq', 'gl':'glg', 'la':'', 'sw':'swa',
|
|
||||||
'be':'' , 'ka':'geo', 'lv':'lav', 'sv':'swe',
|
|
||||||
'bn':'ben', 'de':'ger', 'lt':'lit', 'ta':'',
|
|
||||||
'bg':'bul', 'gr':'ell', 'mk':'mac', 'te':'tel',
|
|
||||||
'ca':'cat', 'gu':'' , 'ms':'may', 'th':'tha',
|
|
||||||
'zh':'chi', 'ht':'' , 'mt':'', 'tr':'tur',
|
|
||||||
'hr':'hrv', 'iw':'heb', 'no':'nor', 'uk':'ukr',
|
|
||||||
'cz':'cze', 'hi':'hin', 'fa':'per', 'ur':'urd',
|
|
||||||
'da':'dan', 'hu':'hun', 'pl':'pol', 'vi':'vie',
|
|
||||||
'nl':'dut', 'is':'ice', 'pt':'por', 'cy':'',
|
|
||||||
'en':'eng', 'id':'ind', 'ro':'rum', 'yi':''}
|
|
||||||
|
|
||||||
class SearchPage(BasePage):
|
class SearchPage(BasePage):
|
||||||
""" Page which contains results as a list of movies
|
""" Page which contains results as a list of movies
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,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, NotLoaded
|
from weboob.capabilities.base import NotAvailable, NotLoaded
|
||||||
|
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||||
|
|
||||||
class Movie(QFrame):
|
class Movie(QFrame):
|
||||||
def __init__(self, movie, parent=None):
|
def __init__(self, movie, parent=None):
|
||||||
|
|
@ -31,6 +32,10 @@ class Movie(QFrame):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.ui = Ui_Movie()
|
self.ui = Ui_Movie()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
|
langs = LANGUAGE_CONV.keys()
|
||||||
|
langs.sort()
|
||||||
|
for lang in langs:
|
||||||
|
self.ui.langCombo.addItem(lang)
|
||||||
|
|
||||||
self.connect(self.ui.castingButton, SIGNAL("clicked()"), self.casting)
|
self.connect(self.ui.castingButton, SIGNAL("clicked()"), self.casting)
|
||||||
self.connect(self.ui.torrentButton, SIGNAL("clicked()"), self.searchTorrent)
|
self.connect(self.ui.torrentButton, SIGNAL("clicked()"), self.searchTorrent)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>700</width>
|
<width>748</width>
|
||||||
<height>463</height>
|
<height>463</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -108,8 +108,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>660</width>
|
<width>708</width>
|
||||||
<height>292</height>
|
<height>293</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
||||||
|
|
@ -130,8 +130,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>660</width>
|
<width>78</width>
|
||||||
<height>292</height>
|
<height>18</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8"/>
|
<layout class="QVBoxLayout" name="verticalLayout_8"/>
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>700</width>
|
<width>748</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,24 @@ from weboob.core import CallErrors
|
||||||
|
|
||||||
__all__ = ['Suboob']
|
__all__ = ['Suboob']
|
||||||
|
|
||||||
|
LANGUAGE_CONV = {
|
||||||
|
'ar':'ara', 'eo':'epo', 'ga':'', 'ru':'rus',
|
||||||
|
'af':'' , 'et':'est', 'it':'ita', 'sr':'scc',
|
||||||
|
'sq':'alb', 'tl':'' , 'ja':'jpn', 'sk':'slo',
|
||||||
|
'hy':'arm', 'fi':'fin', 'kn':'', 'sl':'slv',
|
||||||
|
'az':'' , 'fr':'fre', 'ko':'kor', 'es':'spa',
|
||||||
|
'eu':'baq', 'gl':'glg', 'la':'', 'sw':'swa',
|
||||||
|
'be':'' , 'ka':'geo', 'lv':'lav', 'sv':'swe',
|
||||||
|
'bn':'ben', 'de':'ger', 'lt':'lit', 'ta':'',
|
||||||
|
'bg':'bul', 'gr':'ell', 'mk':'mac', 'te':'tel',
|
||||||
|
'ca':'cat', 'gu':'' , 'ms':'may', 'th':'tha',
|
||||||
|
'zh':'chi', 'ht':'' , 'mt':'', 'tr':'tur',
|
||||||
|
'hr':'hrv', 'iw':'heb', 'no':'nor', 'uk':'ukr',
|
||||||
|
'cz':'cze', 'hi':'hin', 'fa':'per', 'ur':'urd',
|
||||||
|
'da':'dan', 'hu':'hun', 'pl':'pol', 'vi':'vie',
|
||||||
|
'nl':'dut', 'is':'ice', 'pt':'por', 'cy':'',
|
||||||
|
'en':'eng', 'id':'ind', 'ro':'rum', 'yi':''}
|
||||||
|
|
||||||
|
|
||||||
def sizeof_fmt(num):
|
def sizeof_fmt(num):
|
||||||
for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
|
for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue