pyflakes corrections

This commit is contained in:
Julien Veyssier 2013-02-28 14:05:39 +01:00
commit e497d2ebaf
10 changed files with 6 additions and 41 deletions

View file

@ -18,17 +18,9 @@
# 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.base import NotAvailable
from weboob.tools.browser import BasePage
from weboob.tools.misc import get_bytes_size
__all__ = ['SubtitlesPage','SearchPage']

View file

@ -18,7 +18,6 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.test import BackendTest
from weboob.capabilities.base import NotLoaded
import urllib
from random import choice

View file

@ -24,7 +24,7 @@ from .browser import BtmonBrowser
from urllib import quote_plus
__all__ = ['KickassBackend']
__all__ = ['BtmonBackend']
class BtmonBackend(BaseBackend, ICapTorrent):

View file

@ -18,12 +18,6 @@
# 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
from weboob.capabilities.torrent import Torrent

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2012 Julien Veyssier
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
@ -18,17 +18,9 @@
# 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.base import NotAvailable
from weboob.tools.browser import BasePage
from weboob.tools.misc import get_bytes_size
__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' ?
#for line in self.parser.select(table,'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'):
yield self.get_subtitle_from_line(line)
def get_subtitle_from_line(self,line):
cells = self.parser.select(line,'td')
if len(cells) > 0:
first_cell = cells[0]
links = self.parser.select(line,'a')
a = links[0]
urldetail = a.attrib.get('href','')
@ -136,6 +127,7 @@ class SubtitlePage(BasePage):
""" Page which contains a single subtitle for a movie
"""
def get_subtitle(self):
desc = NotAvailable
father = self.parser.select(self.document.getroot(),'a#app_link',1).getparent()
a = self.parser.select(father,'a')[1]
id = a.attrib.get('href','').split('/')[-1]

View file

@ -18,7 +18,6 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.test import BackendTest
from weboob.capabilities.base import NotLoaded
import urllib
from random import choice

View file

@ -23,7 +23,7 @@ from weboob.tools.browser import BaseBrowser
from .pages import SeriePage, SearchPage, SeasonPage,HomePage
__all__ = ['OpensubtitlesBrowser']
__all__ = ['TvsubtitlesBrowser']
LANGUAGE_LIST = ['en','es','fr','de','br','ru','ua','it','gr',
'ar','hu','pl','tr','nl','pt','sv','da','fi',

View file

@ -18,17 +18,8 @@
# 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.base import NotAvailable
from weboob.tools.browser import BasePage
from weboob.tools.misc import get_bytes_size
__all__ = ['HomePage','SearchPage','SeriePage','SeasonPage']

View file

@ -18,7 +18,6 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.test import BackendTest
from weboob.capabilities.base import NotLoaded
import urllib
from random import choice

View file

@ -18,8 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, FloatField, \
DateField, IntField, UserError
from .base import IBaseCap, CapBaseObject, StringField, IntField, UserError
__all__ = ['Subtitle', 'ICapSubtitle']