pep8 blank lines fixes
flake8 --select W391,E302,E301,E304 autopep8 can't fix W391 even though it claims it can. Fixed using a simple custom script.
This commit is contained in:
parent
be2c8bd789
commit
448c06d125
142 changed files with 249 additions and 25 deletions
|
|
@ -527,6 +527,7 @@ class _PagesBrowserMeta(type):
|
|||
new_class._urls.update(urls)
|
||||
return new_class
|
||||
|
||||
|
||||
class PagesBrowser(DomainBrowser):
|
||||
r"""
|
||||
A browser which works pages and keep state of navigation.
|
||||
|
|
@ -680,6 +681,7 @@ class LoginBrowser(PagesBrowser):
|
|||
"""
|
||||
A browser which supports login.
|
||||
"""
|
||||
|
||||
def __init__(self, username, password, *args, **kwargs):
|
||||
super(LoginBrowser, self).__init__(*args, **kwargs)
|
||||
self.username = username
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ def method(klass):
|
|||
"""
|
||||
Class-decorator to call it as a method.
|
||||
"""
|
||||
|
||||
def inner(self, *args, **kwargs):
|
||||
return klass(self)(*args, **kwargs)
|
||||
return inner
|
||||
|
|
@ -300,5 +301,3 @@ class TableElement(ListElement):
|
|||
|
||||
def get_colnum(self, name):
|
||||
return self._cols.get(name, None)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -131,4 +131,3 @@ class JSVar(Regexp):
|
|||
return super(JSVar, self).filter(txt)
|
||||
except RegexpError:
|
||||
raise ParseError('Variable %r not found' % self.var)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ from weboob.exceptions import ParseError
|
|||
from weboob.browser.url import URL
|
||||
from weboob.tools.log import getLogger, DEBUG_FILTERS
|
||||
|
||||
|
||||
class NoDefault(object):
|
||||
def __repr__(self):
|
||||
return 'NO_DEFAULT'
|
||||
|
|
@ -217,6 +218,7 @@ class Base(Filter):
|
|||
|
||||
>>> Base(Env('header'), CleanText('./h1')) # doctest: +SKIP
|
||||
"""
|
||||
|
||||
def __call__(self, item):
|
||||
base = self.select(self.base, item, obj=self._obj, key=self._key)
|
||||
return self.selector(base)
|
||||
|
|
@ -425,6 +427,7 @@ class Type(Filter):
|
|||
>>> Type(type=str, minlen=0, default='a').filter('')
|
||||
'a'
|
||||
"""
|
||||
|
||||
def __init__(self, selector=None, type=None, minlen=0, default=_NO_DEFAULT):
|
||||
super(Type, self).__init__(selector, default=default)
|
||||
self.type_func = type
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ class NextPage(Exception):
|
|||
|
||||
See :meth:`PagesBrowser.pagination` or decorator :func:`pagination`.
|
||||
"""
|
||||
|
||||
def __init__(self, request):
|
||||
super(NextPage, self).__init__()
|
||||
self.request = request
|
||||
|
|
@ -122,17 +123,20 @@ class Page(object):
|
|||
Event called when browser leaves this page.
|
||||
"""
|
||||
|
||||
|
||||
class FormNotFound(Exception):
|
||||
"""
|
||||
Raised when :meth:`HTMLPage.get_form` can't find a form.
|
||||
"""
|
||||
|
||||
|
||||
class FormSubmitWarning(UserWarning):
|
||||
"""
|
||||
A form has more than one submit element selected, and will likely
|
||||
generate an invalid request.
|
||||
"""
|
||||
|
||||
|
||||
class Form(OrderedDict):
|
||||
"""
|
||||
Represents a form of an HTML page.
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ class Wget(Profile):
|
|||
Some websites will give you a version with less JavaScript.
|
||||
Some others could ban you (after all, wget is not a real browser).
|
||||
"""
|
||||
|
||||
def __init__(self, version='1.11.4'):
|
||||
self.version = version
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ from requests.sessions import merge_setting
|
|||
from requests.structures import CaseInsensitiveDict
|
||||
from requests.utils import get_netrc_auth
|
||||
|
||||
|
||||
def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
|
||||
"""
|
||||
Properly merges both requests and session hooks.
|
||||
|
|
|
|||
|
|
@ -201,5 +201,3 @@ class URL(object):
|
|||
|
||||
return func(browser, id_or_url, *args, **kwargs)
|
||||
return inner
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue