pyflakes corrections
This commit is contained in:
parent
130d304a03
commit
e497d2ebaf
10 changed files with 6 additions and 41 deletions
|
|
@ -18,17 +18,9 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from urlparse import parse_qs
|
|
||||||
except ImportError:
|
|
||||||
from cgi import parse_qs # NOQA
|
|
||||||
|
|
||||||
from urlparse import urlsplit
|
|
||||||
|
|
||||||
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.tools.misc import get_bytes_size
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['SubtitlesPage','SearchPage']
|
__all__ = ['SubtitlesPage','SearchPage']
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.tools.test import BackendTest
|
from weboob.tools.test import BackendTest
|
||||||
from weboob.capabilities.base import NotLoaded
|
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ from .browser import BtmonBrowser
|
||||||
|
|
||||||
from urllib import quote_plus
|
from urllib import quote_plus
|
||||||
|
|
||||||
__all__ = ['KickassBackend']
|
__all__ = ['BtmonBackend']
|
||||||
|
|
||||||
|
|
||||||
class BtmonBackend(BaseBackend, ICapTorrent):
|
class BtmonBackend(BaseBackend, ICapTorrent):
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,6 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from urlparse import parse_qs
|
|
||||||
except ImportError:
|
|
||||||
from cgi import parse_qs # NOQA
|
|
||||||
|
|
||||||
from urlparse import urlsplit
|
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from weboob.capabilities.torrent import Torrent
|
from weboob.capabilities.torrent import Torrent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2010-2012 Julien Veyssier
|
# Copyright(C) 2013 Julien Veyssier
|
||||||
#
|
#
|
||||||
# This file is part of weboob.
|
# This file is part of weboob.
|
||||||
#
|
#
|
||||||
|
|
@ -18,17 +18,9 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from urlparse import parse_qs
|
|
||||||
except ImportError:
|
|
||||||
from cgi import parse_qs # NOQA
|
|
||||||
|
|
||||||
from urlparse import urlsplit
|
|
||||||
|
|
||||||
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.tools.misc import get_bytes_size
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['SubtitlesPage','SubtitlePage','SearchPage']
|
__all__ = ['SubtitlesPage','SubtitlePage','SearchPage']
|
||||||
|
|
@ -84,14 +76,13 @@ class SubtitlesPage(BasePage):
|
||||||
# why following line doesn't work all the time (for example 'search fr sopranos guy walks' ?
|
# why following line doesn't work all the time (for example 'search fr sopranos guy walks' ?
|
||||||
#for line in self.parser.select(table,'tr'):
|
#for line in self.parser.select(table,'tr'):
|
||||||
for line in table.getiterator('tr'):
|
for line in table.getiterator('tr'):
|
||||||
# some lines are useless, specially ads
|
# some tr are useless, specially ads
|
||||||
if line.attrib.get('id','').startswith('name'):
|
if line.attrib.get('id','').startswith('name'):
|
||||||
yield self.get_subtitle_from_line(line)
|
yield self.get_subtitle_from_line(line)
|
||||||
|
|
||||||
def get_subtitle_from_line(self,line):
|
def get_subtitle_from_line(self,line):
|
||||||
cells = self.parser.select(line,'td')
|
cells = self.parser.select(line,'td')
|
||||||
if len(cells) > 0:
|
if len(cells) > 0:
|
||||||
first_cell = cells[0]
|
|
||||||
links = self.parser.select(line,'a')
|
links = self.parser.select(line,'a')
|
||||||
a = links[0]
|
a = links[0]
|
||||||
urldetail = a.attrib.get('href','')
|
urldetail = a.attrib.get('href','')
|
||||||
|
|
@ -136,6 +127,7 @@ class SubtitlePage(BasePage):
|
||||||
""" Page which contains a single subtitle for a movie
|
""" Page which contains a single subtitle for a movie
|
||||||
"""
|
"""
|
||||||
def get_subtitle(self):
|
def get_subtitle(self):
|
||||||
|
desc = NotAvailable
|
||||||
father = self.parser.select(self.document.getroot(),'a#app_link',1).getparent()
|
father = self.parser.select(self.document.getroot(),'a#app_link',1).getparent()
|
||||||
a = self.parser.select(father,'a')[1]
|
a = self.parser.select(father,'a')[1]
|
||||||
id = a.attrib.get('href','').split('/')[-1]
|
id = a.attrib.get('href','').split('/')[-1]
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.tools.test import BackendTest
|
from weboob.tools.test import BackendTest
|
||||||
from weboob.capabilities.base import NotLoaded
|
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ from weboob.tools.browser import BaseBrowser
|
||||||
from .pages import SeriePage, SearchPage, SeasonPage,HomePage
|
from .pages import SeriePage, SearchPage, SeasonPage,HomePage
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['OpensubtitlesBrowser']
|
__all__ = ['TvsubtitlesBrowser']
|
||||||
|
|
||||||
LANGUAGE_LIST = ['en','es','fr','de','br','ru','ua','it','gr',
|
LANGUAGE_LIST = ['en','es','fr','de','br','ru','ua','it','gr',
|
||||||
'ar','hu','pl','tr','nl','pt','sv','da','fi',
|
'ar','hu','pl','tr','nl','pt','sv','da','fi',
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,8 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from urlparse import parse_qs
|
|
||||||
except ImportError:
|
|
||||||
from cgi import parse_qs # NOQA
|
|
||||||
|
|
||||||
from urlparse import urlsplit
|
|
||||||
|
|
||||||
from weboob.capabilities.subtitle import Subtitle
|
from weboob.capabilities.subtitle import Subtitle
|
||||||
from weboob.capabilities.base import NotAvailable
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
from weboob.tools.misc import get_bytes_size
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['HomePage','SearchPage','SeriePage','SeasonPage']
|
__all__ = ['HomePage','SearchPage','SeriePage','SeasonPage']
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.tools.test import BackendTest
|
from weboob.tools.test import BackendTest
|
||||||
from weboob.capabilities.base import NotLoaded
|
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
from .base import IBaseCap, CapBaseObject, Field, StringField, FloatField, \
|
from .base import IBaseCap, CapBaseObject, StringField, IntField, UserError
|
||||||
DateField, IntField, UserError
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Subtitle', 'ICapSubtitle']
|
__all__ = ['Subtitle', 'ICapSubtitle']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue