Easy spacing fixes, trailing stuff
Remove useless trailing \ Remove trailing spaces Add missing empty lines autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 . Diff quickly checked.
This commit is contained in:
parent
c21d1f7925
commit
7094931c92
231 changed files with 474 additions and 67 deletions
|
|
@ -29,6 +29,7 @@ class AccountRegisterError(UserError):
|
|||
Raised when there is an error during registration.
|
||||
"""
|
||||
|
||||
|
||||
class Account(CapBaseObject):
|
||||
"""
|
||||
Describe an account and its properties.
|
||||
|
|
@ -40,6 +41,7 @@ class Account(CapBaseObject):
|
|||
def __init__(self, id=None):
|
||||
CapBaseObject.__init__(self, id)
|
||||
|
||||
|
||||
class StatusField(object):
|
||||
"""
|
||||
Field of an account status.
|
||||
|
|
|
|||
|
|
@ -36,11 +36,13 @@ class AccountNotFound(UserError):
|
|||
def __init__(self, msg='Account not found'):
|
||||
UserError.__init__(self, msg)
|
||||
|
||||
|
||||
class TransferError(UserError):
|
||||
"""
|
||||
A transfer has failed.
|
||||
"""
|
||||
|
||||
|
||||
class Currency(object):
|
||||
CUR_UNKNOWN = 0
|
||||
CUR_EUR = 1
|
||||
|
|
@ -92,6 +94,7 @@ class Recipient(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, 0)
|
||||
|
||||
|
||||
class Account(Recipient, Currency):
|
||||
"""
|
||||
Bank account.
|
||||
|
|
@ -144,6 +147,7 @@ class Transaction(CapBaseObject):
|
|||
return "<Transaction date='%s' label='%s' amount=%s>" % (self.date,
|
||||
label, self.amount)
|
||||
|
||||
|
||||
class Transfer(CapBaseObject):
|
||||
"""
|
||||
Transfer from an account to a recipient.
|
||||
|
|
@ -155,6 +159,7 @@ class Transfer(CapBaseObject):
|
|||
recipient = Field('Recipient', int, long, basestring)
|
||||
reason = StringField('Reason')
|
||||
|
||||
|
||||
class ICapBank(ICapCollection):
|
||||
"""
|
||||
Capability of bank websites to see accounts and transactions.
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class Detail(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, 0)
|
||||
|
||||
|
||||
class Bill(CapBaseObject):
|
||||
"""
|
||||
Bill.
|
||||
|
|
@ -65,6 +66,7 @@ class Bill(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, 0)
|
||||
|
||||
|
||||
class Subscription(CapBaseObject):
|
||||
"""
|
||||
Subscription to a service.
|
||||
|
|
@ -74,6 +76,7 @@ class Subscription(CapBaseObject):
|
|||
validity = DateField('End validity date of the subscription')
|
||||
renewdate = DateField('Reset date of consumption')
|
||||
|
||||
|
||||
class ICapBill(ICapCollection):
|
||||
def iter_resources(self, objs, split_path):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class IssueError(UserError):
|
|||
Raised when there is an error with an issue.
|
||||
"""
|
||||
|
||||
|
||||
class Project(CapBaseObject):
|
||||
"""
|
||||
Represents a project.
|
||||
|
|
@ -101,6 +102,7 @@ class Project(CapBaseObject):
|
|||
return None
|
||||
return None
|
||||
|
||||
|
||||
class User(CapBaseObject):
|
||||
"""
|
||||
User.
|
||||
|
|
@ -114,6 +116,7 @@ class User(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return '<User %r>' % self.name
|
||||
|
||||
|
||||
class Version(CapBaseObject):
|
||||
"""
|
||||
Version of a project.
|
||||
|
|
@ -127,6 +130,7 @@ class Version(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return '<Version %r>' % self.name
|
||||
|
||||
|
||||
class Status(CapBaseObject):
|
||||
"""
|
||||
Status of an issue.
|
||||
|
|
@ -150,6 +154,7 @@ class Status(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return '<Status %r>' % self.name
|
||||
|
||||
|
||||
class Attachment(CapBaseObject):
|
||||
"""
|
||||
Attachment of an issue.
|
||||
|
|
@ -160,6 +165,7 @@ class Attachment(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return '<Attachment %r>' % self.filename
|
||||
|
||||
|
||||
class Change(CapBaseObject):
|
||||
"""
|
||||
A change of an update.
|
||||
|
|
@ -168,6 +174,7 @@ class Change(CapBaseObject):
|
|||
last = StringField('Last value of field')
|
||||
new = StringField('New value of field')
|
||||
|
||||
|
||||
class Update(CapBaseObject):
|
||||
"""
|
||||
Represents an update of an issue.
|
||||
|
|
@ -182,6 +189,7 @@ class Update(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return '<Update %r>' % self.id
|
||||
|
||||
|
||||
class Issue(CapBaseObject):
|
||||
"""
|
||||
Represents an issue.
|
||||
|
|
@ -199,6 +207,7 @@ class Issue(CapBaseObject):
|
|||
version = Field('Target version of this issue', Version)
|
||||
status = Field('Status of this issue', Status)
|
||||
|
||||
|
||||
class Query(CapBaseObject):
|
||||
"""
|
||||
Query to find an issue.
|
||||
|
|
@ -214,6 +223,7 @@ class Query(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, '')
|
||||
|
||||
|
||||
class ICapBugTracker(IBaseCap):
|
||||
"""
|
||||
Bug trackers websites.
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class ChatMessage(CapBaseObject):
|
|||
if self.date is None:
|
||||
self.date = datetime.datetime.utcnow()
|
||||
|
||||
|
||||
class ICapChat(IBaseCap):
|
||||
"""
|
||||
Websites with a chat system.
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class Content(CapBaseObject):
|
|||
content = StringField('Body')
|
||||
revision = StringField('ID of revision')
|
||||
|
||||
|
||||
class Revision(CapBaseObject):
|
||||
"""
|
||||
Revision of a change on a content.
|
||||
|
|
@ -42,6 +43,7 @@ class Revision(CapBaseObject):
|
|||
timestamp = DateField('Date of revision')
|
||||
minor = Field('Is this change minor?', bool)
|
||||
|
||||
|
||||
class ICapContent(IBaseCap):
|
||||
def get_content(self, id, revision=None):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ class Event(CapBaseObject):
|
|||
type = StringField('Type of event')
|
||||
message = StringField('Message of the event')
|
||||
|
||||
|
||||
class ICapDating(IBaseCap):
|
||||
"""
|
||||
Capability for dating websites.
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class IpLocation(CapBaseObject):
|
|||
CapBaseObject.__init__(self, ipaddr)
|
||||
self.ipaddr = ipaddr
|
||||
|
||||
|
||||
class ICapGeolocIp(IBaseCap):
|
||||
"""
|
||||
Access information about IP addresses database.
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class HousingPhoto(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return u'<HousingPhoto "%s" data=%do>' % (self.id, len(self.data) if self.data else 0)
|
||||
|
||||
|
||||
class Housing(CapBaseObject):
|
||||
"""
|
||||
Content of a housing.
|
||||
|
|
@ -61,6 +62,7 @@ class Housing(CapBaseObject):
|
|||
photos = Field('List of photos', list)
|
||||
details = Field('Key/values of details', dict)
|
||||
|
||||
|
||||
class Query(CapBaseObject):
|
||||
"""
|
||||
Query to find housings.
|
||||
|
|
@ -79,12 +81,14 @@ class Query(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, '')
|
||||
|
||||
|
||||
class City(CapBaseObject):
|
||||
"""
|
||||
City.
|
||||
"""
|
||||
name = StringField('Name of city')
|
||||
|
||||
|
||||
class ICapHousing(IBaseCap):
|
||||
"""
|
||||
Capability of websites to search housings.
|
||||
|
|
|
|||
|
|
@ -34,12 +34,14 @@ class Book(CapBaseObject):
|
|||
date = DateField('The due date')
|
||||
late = Field('Are you late?', bool)
|
||||
|
||||
|
||||
class Renew(CapBaseObject):
|
||||
"""
|
||||
A renew message.
|
||||
"""
|
||||
message = StringField('Message')
|
||||
|
||||
|
||||
class ICapBook(ICapCollection):
|
||||
"""
|
||||
Library websites.
|
||||
|
|
|
|||
|
|
@ -34,10 +34,12 @@ class _Message(CapBaseObject):
|
|||
""" Base message. """
|
||||
pass
|
||||
|
||||
|
||||
class _Thread(CapBaseObject):
|
||||
""" Base Thread. """
|
||||
pass
|
||||
|
||||
|
||||
class Message(_Message):
|
||||
"""
|
||||
Represents a message read or to send.
|
||||
|
|
@ -131,6 +133,7 @@ class Message(_Message):
|
|||
return '<Message id=%r title=%r date=%r from=%r>' % (
|
||||
self.full_id, self.title, self.date, self.sender)
|
||||
|
||||
|
||||
class Thread(_Thread):
|
||||
"""
|
||||
Thread containing messages.
|
||||
|
|
@ -199,11 +202,13 @@ class ICapMessages(IBaseCap):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class CantSendMessage(UserError):
|
||||
"""
|
||||
Raised when a message can't be send.
|
||||
"""
|
||||
|
||||
|
||||
class ICapMessagesPost(IBaseCap):
|
||||
"""
|
||||
This capability allow user to send a message.
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class PasteNotFound(UserError):
|
|||
Raised when a paste is not found.
|
||||
"""
|
||||
|
||||
|
||||
class BasePaste(CapBaseObject):
|
||||
"""
|
||||
Represents a pasted text.
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class Product(CapBaseObject):
|
|||
"""
|
||||
name = StringField('Name of product')
|
||||
|
||||
|
||||
class Shop(CapBaseObject):
|
||||
"""
|
||||
A shop where the price is.
|
||||
|
|
@ -39,6 +40,7 @@ class Shop(CapBaseObject):
|
|||
location = StringField('Location of the shop')
|
||||
info = StringField('Information about the shop')
|
||||
|
||||
|
||||
class Price(CapBaseObject):
|
||||
"""
|
||||
Price.
|
||||
|
|
@ -50,6 +52,7 @@ class Price(CapBaseObject):
|
|||
shop = Field('Shop information', Shop)
|
||||
product = Field('Product', Product)
|
||||
|
||||
|
||||
class ICapPriceComparison(IBaseCap):
|
||||
"""
|
||||
Capability for price comparison websites.
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class Emission(CapBaseObject):
|
|||
else:
|
||||
return self.title
|
||||
|
||||
|
||||
class Stream(CapBaseObject):
|
||||
"""
|
||||
Stream of a radio.
|
||||
|
|
@ -54,6 +55,7 @@ class Stream(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return self.__unicode__()
|
||||
|
||||
|
||||
class Radio(CapBaseObject):
|
||||
"""
|
||||
Radio object.
|
||||
|
|
@ -63,6 +65,7 @@ class Radio(CapBaseObject):
|
|||
current = Field('Current emission', Emission)
|
||||
streams = Field('List of streams', list)
|
||||
|
||||
|
||||
class ICapRadio(IBaseCap):
|
||||
"""
|
||||
Capability of radio websites.
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class Station(CapBaseObject):
|
|||
def __repr__(self):
|
||||
return "<Station id=%r name=%r>" % (self.id, self.name)
|
||||
|
||||
|
||||
class Departure(CapBaseObject):
|
||||
"""
|
||||
Describes a departure.
|
||||
|
|
@ -62,6 +63,7 @@ class Departure(CapBaseObject):
|
|||
return u"<Departure id=%r type=%r time=%r departure=%r arrival=%r>" % (
|
||||
self.id, self.type, self.time.strftime('%H:%M'), self.departure_station, self.arrival_station)
|
||||
|
||||
|
||||
class RoadStep(CapBaseObject):
|
||||
"""
|
||||
A step on a roadmap.
|
||||
|
|
@ -73,11 +75,13 @@ class RoadStep(CapBaseObject):
|
|||
arrival = StringField('Arrival station')
|
||||
duration = DeltaField('Duration of this step')
|
||||
|
||||
|
||||
class RoadmapError(UserError):
|
||||
"""
|
||||
Raised when the roadmap is unable to be calculated.
|
||||
"""
|
||||
|
||||
|
||||
class RoadmapFilters(CapBaseObject):
|
||||
"""
|
||||
Filters to get a roadmap.
|
||||
|
|
@ -88,6 +92,7 @@ class RoadmapFilters(CapBaseObject):
|
|||
def __init__(self):
|
||||
CapBaseObject.__init__(self, '')
|
||||
|
||||
|
||||
class ICapTravel(IBaseCap):
|
||||
"""
|
||||
Travel websites.
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ class Forecast(CapBaseObject):
|
|||
self.high = Temperature(high, unit)
|
||||
self.text = text
|
||||
|
||||
|
||||
class Current(CapBaseObject):
|
||||
"""
|
||||
Current weather.
|
||||
|
|
@ -85,6 +86,7 @@ class Current(CapBaseObject):
|
|||
self.text = text
|
||||
self.temp = Temperature(temp, unit)
|
||||
|
||||
|
||||
class City(CapBaseObject):
|
||||
"""
|
||||
City where to find weather.
|
||||
|
|
@ -95,11 +97,13 @@ class City(CapBaseObject):
|
|||
CapBaseObject.__init__(self, id)
|
||||
self.name = name
|
||||
|
||||
|
||||
class CityNotFound(UserError):
|
||||
"""
|
||||
Raised when a city is not found.
|
||||
"""
|
||||
|
||||
|
||||
class ICapWeather(IBaseCap):
|
||||
"""
|
||||
Capability for weather websites.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue