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
56 changed files with 249 additions and 25 deletions
|
|
@ -105,6 +105,7 @@ class OfxFormatter(IFormatter):
|
|||
self.output(u'<DTASOF>%s</AVAILBAL>' % datetime.date.today().strftime('%Y%m%d'))
|
||||
self.output(u'</STMTRS></STMTTRNRS></BANKMSGSRSV1></OFX>')
|
||||
|
||||
|
||||
class QifFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'date', 'raw', 'amount')
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class HistoryFormatter(IFormatter):
|
|||
self.colored('%-17s' % (obj.location or ''), 'magenta'),
|
||||
self.colored(obj.activity or '', 'yellow'))
|
||||
|
||||
|
||||
class StatusFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id',)
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ class ContactThread(QWidget):
|
|||
return
|
||||
|
||||
self.ui.refreshButton.setEnabled(False)
|
||||
|
||||
def finished():
|
||||
#v = self.ui.scrollArea.verticalScrollBar()
|
||||
#print v.minimum(), v.value(), v.maximum(), v.sliderPosition()
|
||||
|
|
@ -572,6 +573,7 @@ class ContactsWidget(QWidget):
|
|||
def retrieveContact(self, url):
|
||||
backend_name = unicode(self.ui.backendsList.currentText())
|
||||
self.ui.urlButton.setEnabled(False)
|
||||
|
||||
def finished():
|
||||
self.url_process = None
|
||||
self.ui.urlButton.setEnabled(True)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class EventsWidget(QWidget):
|
|||
self.ui.typeBox.setEnabled(False)
|
||||
self.ui.typeBox.clear()
|
||||
self.ui.typeBox.addItem('All', None)
|
||||
|
||||
def finished():
|
||||
self.ui.refreshButton.setEnabled(True)
|
||||
self.ui.typeBox.setEnabled(True)
|
||||
|
|
|
|||
|
|
@ -56,12 +56,14 @@ class DeparturesFormatter(PrettyFormatter):
|
|||
|
||||
return s
|
||||
|
||||
|
||||
class StationsFormatter(PrettyFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'name')
|
||||
|
||||
def get_title(self, obj):
|
||||
return obj.name
|
||||
|
||||
|
||||
class Traveloob(ReplApplication):
|
||||
APPNAME = 'traveloob'
|
||||
VERSION = '1.0'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class CapAudioStream(CapAudio):
|
|||
"""
|
||||
Audio streams provider
|
||||
"""
|
||||
|
||||
def search_audiostreams(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
|
||||
"""
|
||||
Search an audio stream
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ class CapBank(CapCollection):
|
|||
"""
|
||||
Capability of bank websites to see accounts and transactions.
|
||||
"""
|
||||
|
||||
def iter_resources(self, objs, split_path):
|
||||
"""
|
||||
Iter resources.
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ def empty(value):
|
|||
return True
|
||||
return False
|
||||
|
||||
|
||||
def find_object(mylist, error=None, **kwargs):
|
||||
"""
|
||||
Very simple tools to return an object with the matching parameters in
|
||||
|
|
@ -63,6 +64,7 @@ def find_object(mylist, error=None, **kwargs):
|
|||
raise error()
|
||||
return None
|
||||
|
||||
|
||||
class UserError(Exception):
|
||||
"""
|
||||
Exception containing an error message for user.
|
||||
|
|
@ -78,6 +80,7 @@ class FieldNotFound(Exception):
|
|||
:param field: field not found
|
||||
:type field: :class:`Field`
|
||||
"""
|
||||
|
||||
def __init__(self, obj, field):
|
||||
Exception.__init__(self,
|
||||
u'Field "%s" not found for object %s' % (field, obj))
|
||||
|
|
@ -102,6 +105,7 @@ class NotAvailableType(object):
|
|||
"""
|
||||
NotAvailable is a constant to use on non available fields.
|
||||
"""
|
||||
|
||||
def __str__(self):
|
||||
return unicode(self).decode('utf-8')
|
||||
|
||||
|
|
@ -199,6 +203,7 @@ class IntField(Field):
|
|||
"""
|
||||
A field which accepts only :class:`int` and :class:`long` types.
|
||||
"""
|
||||
|
||||
def __init__(self, doc, **kwargs):
|
||||
Field.__init__(self, doc, int, long, **kwargs)
|
||||
|
||||
|
|
@ -210,6 +215,7 @@ class DecimalField(Field):
|
|||
"""
|
||||
A field which accepts only :class:`decimal` type.
|
||||
"""
|
||||
|
||||
def __init__(self, doc, **kwargs):
|
||||
Field.__init__(self, doc, Decimal, **kwargs)
|
||||
|
||||
|
|
@ -223,6 +229,7 @@ class FloatField(Field):
|
|||
"""
|
||||
A field which accepts only :class:`float` type.
|
||||
"""
|
||||
|
||||
def __init__(self, doc, **kwargs):
|
||||
Field.__init__(self, doc, float, **kwargs)
|
||||
|
||||
|
|
@ -234,6 +241,7 @@ class StringField(Field):
|
|||
"""
|
||||
A field which accepts only :class:`unicode` strings.
|
||||
"""
|
||||
|
||||
def __init__(self, doc, **kwargs):
|
||||
Field.__init__(self, doc, unicode, **kwargs)
|
||||
|
||||
|
|
@ -245,6 +253,7 @@ class BytesField(Field):
|
|||
"""
|
||||
A field which accepts only :class:`str` strings.
|
||||
"""
|
||||
|
||||
def __init__(self, doc, **kwargs):
|
||||
Field.__init__(self, doc, str, **kwargs)
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class SubscriptionNotFound(UserError):
|
|||
"""
|
||||
Raised when a subscription is not found.
|
||||
"""
|
||||
|
||||
def __init__(self, msg='Subscription not found'):
|
||||
UserError.__init__(self, msg)
|
||||
|
||||
|
|
@ -38,6 +39,7 @@ class BillNotFound(UserError):
|
|||
"""
|
||||
Raised when a bill is not found.
|
||||
"""
|
||||
|
||||
def __init__(self, msg='Bill not found'):
|
||||
UserError.__init__(self, msg)
|
||||
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ class CapBugTracker(Capability):
|
|||
"""
|
||||
Bug trackers websites.
|
||||
"""
|
||||
|
||||
def iter_issues(self, query):
|
||||
"""
|
||||
Iter issues with optionnal patterns.
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class CapChat(Capability):
|
|||
"""
|
||||
Websites with a chat system.
|
||||
"""
|
||||
|
||||
def iter_chat_messages(self, _id=None):
|
||||
"""
|
||||
Iter messages.
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class CapCinema(Capability):
|
|||
"""
|
||||
Cinema databases.
|
||||
"""
|
||||
|
||||
def iter_movies(self, pattern):
|
||||
"""
|
||||
Search movies and iterate on results.
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue