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:
Laurent Bachelier 2014-10-10 23:04:08 +02:00
commit 448c06d125
142 changed files with 249 additions and 25 deletions

View file

@ -44,6 +44,7 @@ class CapAudioStream(CapAudio):
"""
Audio streams provider
"""
def search_audiostreams(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
"""
Search an audio stream

View file

@ -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.

View file

@ -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)

View file

@ -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)

View file

@ -236,6 +236,7 @@ class CapBugTracker(Capability):
"""
Bug trackers websites.
"""
def iter_issues(self, query):
"""
Iter issues with optionnal patterns.

View file

@ -57,6 +57,7 @@ class CapChat(Capability):
"""
Websites with a chat system.
"""
def iter_chat_messages(self, _id=None):
"""
Iter messages.

View file

@ -73,6 +73,7 @@ class CapCinema(Capability):
"""
Cinema databases.
"""
def iter_movies(self, pattern):
"""
Search movies and iterate on results.

View file

@ -39,6 +39,7 @@ class BaseCollection(BaseObject):
Inherit from this if you want to create an object that is *also* a Collection.
However, this probably will not work properly for now.
"""
def __init__(self, split_path):
BaseObject.__init__(self, None)
self.split_path = split_path

View file

@ -24,10 +24,12 @@ from weboob.capabilities.base import Field
__all__ = ['DateField', 'TimeField', 'DeltaField']
class DateField(Field):
"""
A field which accepts only :class:`datetime.date` and :class:`datetime.datetime` types.
"""
def __init__(self, doc, **kwargs):
Field.__init__(self, doc, datetime.date, datetime.datetime, **kwargs)
@ -46,6 +48,7 @@ class TimeField(Field):
"""
A field which accepts only :class:`datetime.time` and :class:`datetime.time` types.
"""
def __init__(self, doc, **kwargs):
Field.__init__(self, doc, datetime.time, datetime.datetime, **kwargs)
@ -54,5 +57,6 @@ class DeltaField(Field):
"""
A field which accepts only :class:`datetime.timedelta` type.
"""
def __init__(self, doc, **kwargs):
Field.__init__(self, doc, datetime.timedelta, **kwargs)

View file

@ -94,6 +94,7 @@ class CapDating(Capability):
"""
Capability for dating websites.
"""
def init_optimizations(self):
"""
Initialization of optimizations.
@ -155,4 +156,3 @@ class CapDating(Capability):
:rtype: iter[:class:`Contact`]
"""
raise NotImplementedError()

View file

@ -46,6 +46,7 @@ class CapGeolocIp(Capability):
"""
Access information about IP addresses database.
"""
def get_location(self, ipaddr):
"""
Get location of an IP address.

View file

@ -110,6 +110,7 @@ class CapHousing(Capability):
"""
Capability of websites to search housings.
"""
def search_housings(self, query):
"""
Search housings.

View file

@ -24,6 +24,7 @@ from .file import CapFile, BaseFile
__all__ = ['BaseImage', 'CapImage']
class _BaseImage(BaseFile):
"""
Fake class to allow the inclusion of a BaseImage property within
@ -31,6 +32,7 @@ class _BaseImage(BaseFile):
"""
pass
class BaseImage(_BaseImage):
"""
Represents an image file.
@ -61,6 +63,7 @@ class CapImage(CapFile):
"""
Image file provider
"""
def search_image(self, pattern, sortby=CapFile.SEARCH_RELEVANCE, nsfw=False):
"""
search for an image file
@ -83,4 +86,3 @@ class CapImage(CapFile):
:rtype: :class:`BaseImage`]
"""
return self.get_file(_id)

View file

@ -72,6 +72,7 @@ class CapJob(Capability):
"""
Capability of job annouce websites.
"""
def search_job(self, pattern=None):
"""
Iter results of a search on a pattern.

View file

@ -47,6 +47,7 @@ class CapBook(CapCollection):
"""
Library websites.
"""
def iter_resources(self, objs, split_path):
"""
Iter resources. It retuns :func:`iter_books`.

View file

@ -41,6 +41,7 @@ class CapLyrics(Capability):
"""
Lyrics websites.
"""
def iter_lyrics(self, criteria, pattern):
"""
Search lyrics by artist or by song

View file

@ -173,6 +173,7 @@ class CapMessages(Capability):
"""
Capability to read messages.
"""
def iter_threads(self):
"""
Iterates on threads, from newers to olders.
@ -217,6 +218,7 @@ class CapMessagesPost(Capability):
"""
This capability allow user to send a message.
"""
def post_message(self, message):
"""
Post a message.

View file

@ -62,5 +62,6 @@ class ParcelNotFound(UserError):
Raised when a parcell is not found.
It can be an user error, or an expired parcel
"""
def __init__(self, msg='Account not found'):
UserError.__init__(self, msg)

View file

@ -28,6 +28,7 @@ class PasteNotFound(UserError):
"""
Raised when a paste is not found.
"""
def __init__(self):
return super(PasteNotFound, self).__init__("Paste not found")

View file

@ -35,10 +35,12 @@ class Radio(BaseObject):
current = Field('Current emission', StreamInfo)
streams = Field('List of streams', list)
class CapRadio(Capability):
"""
Capability of radio websites.
"""
def iter_radios_search(self, pattern):
"""
Search a radio.

View file

@ -165,6 +165,7 @@ class CapRecipe(Capability):
"""
Recipe providers.
"""
def iter_recipes(self, pattern):
"""
Search recipes and iterate on results.

View file

@ -48,10 +48,12 @@ class Subtitle(BaseObject):
BaseObject.__init__(self, id)
self.name = name
class CapSubtitle(Capability):
"""
Subtitle providers.
"""
def iter_subtitles(self, pattern):
"""
Search subtitles and iterate on results.

View file

@ -29,6 +29,7 @@ class MagnetOnly(UserError):
"""
Raised when trying to get URL to torrent but only magnet is available.
"""
def __init__(self, magnet):
self.magnet = magnet
UserError.__init__(self, 'Only magnet URL is available')
@ -58,6 +59,7 @@ class CapTorrent(Capability):
"""
Torrent trackers.
"""
def iter_torrents(self, pattern):
"""
Search torrents and iterate on results.

View file

@ -99,6 +99,7 @@ class CapTravel(Capability):
"""
Travel websites.
"""
def iter_station_search(self, pattern):
"""
Iterates on search results of stations.

View file

@ -113,6 +113,7 @@ class CapWeather(Capability):
"""
Capability for weather websites.
"""
def iter_city_search(self, pattern):
"""
Look for a city.