Commit 487d9fce authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

[autopep8] E303 - Remove extra blank lines

parent 72e22e363e05
......@@ -91,7 +91,6 @@ class ExpenseLine(AnyEntity):
self._cw._(self.type), self.title,
self.amount, self.currency)
def dc_long_title(self):
expense = self.parent_expense
if expense:
......@@ -99,7 +98,6 @@ class ExpenseLine(AnyEntity):
else:
return self.dc_title()
def euro_amount(self):
if self.currency == 'EUR':
return self.amount
......
......@@ -47,7 +47,6 @@ class AbstractFlowGenerator:
if self.__class__ is AbstractFlowGenerator:
raise NotImplementedError()
def generate_flow(self, entity):
"""
Generates the flow content (a list of Flowable) for the entity.
......@@ -107,7 +106,6 @@ class AbstractFlowGenerator:
return flow_list
def get_metadata(self, entity):
"""
Gives the table that contains metadata about the entity (title,
......@@ -119,7 +117,6 @@ class AbstractFlowGenerator:
"""
raise NotImplementedError()
def get_person_name(self, entity):
"""
Gives the table that contains the name and address of the person
......@@ -131,7 +128,6 @@ class AbstractFlowGenerator:
"""
raise NotImplementedError()
def get_total(self, entity):
"""
Gives the table that contains the total.
......@@ -142,7 +138,6 @@ class AbstractFlowGenerator:
"""
raise NotImplementedError()
def get_total_relative_data(self, entity):
"""
Gives the table that contains useful data relative to the total
......@@ -154,7 +149,6 @@ class AbstractFlowGenerator:
"""
raise NotImplementedError()
def get_expenses_table(self, entity):
"""
Gives the main table of the document (that contains lines describing
......@@ -167,7 +161,6 @@ class AbstractFlowGenerator:
raise NotImplementedError()
class ExpenseFlowGenerator (AbstractFlowGenerator):
"""
Class building the specific contents for PDF flow content generation.
......@@ -181,7 +174,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
"""
AbstractFlowGenerator.__init__(self)
def get_metadata(self, entity):
"""
Gives the table that contains metadata about the entity (title,
......@@ -231,7 +223,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
return meta_table
def get_person_name(self, entity):
"""
Gives the table that contains the name and address of the person
......@@ -242,7 +233,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
"""
return Spacer(0, 0 * cm)
def get_total(self, entity):
"""
Gives the table that contains the total.
......@@ -290,7 +280,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
return tot_table
def get_total_relative_data(self, entity):
"""
Gives the table that contains useful data relative to the total
......@@ -332,7 +321,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
else:
return Spacer(0, 0 * cm)
def get_expenses_table(self, entity):
"""
Gives the main table of the document (that contains lines describing
......@@ -459,7 +447,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
return main_table
def _build_inner_tables(self, line1_data, line2_data):
"""
Builds inner tables that will be displayed into the main table (the
......@@ -525,7 +512,6 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
return both_lines_table
class RefundFlowGenerator (AbstractFlowGenerator):
"""
Class building the specific contents for PDF flow content generation.
......@@ -533,14 +519,12 @@ class RefundFlowGenerator (AbstractFlowGenerator):
Refund.
"""
def __init__(self):
"""
Initializes the flow content generator for Refund entities.
"""
AbstractFlowGenerator.__init__(self)
def get_metadata(self, entity):
"""
Gives the table that contains metadata about the entity (title,
......@@ -551,7 +535,6 @@ class RefundFlowGenerator (AbstractFlowGenerator):
"""
return Spacer(0, 0 * cm)
def get_person_name(self, entity):
"""
Gives the table that contains the name and address of the person
......@@ -607,7 +590,6 @@ class RefundFlowGenerator (AbstractFlowGenerator):
return addr_table
def get_total(self, entity):
"""
Gives the table that contains the total.
......@@ -643,7 +625,6 @@ class RefundFlowGenerator (AbstractFlowGenerator):
return tot_table
def get_total_relative_data(self, entity):
"""
Gives the table that contains useful data relative to the total
......@@ -687,7 +668,6 @@ class RefundFlowGenerator (AbstractFlowGenerator):
return payment_table
def get_expenses_table(self, entity):
"""
Gives the main table of the document (that contains lines describing
......
......@@ -50,7 +50,6 @@ class FreshPageTemplate(PageTemplate):
PageTemplate.__init__(self, id=template_id, frames=[main_f])
def beforeDrawPage(self, canvas, document):
"""
Overrides the method called before drawing on a new page of the PDF
......@@ -68,7 +67,6 @@ class FreshPageTemplate(PageTemplate):
# Puts back the canvas in its previous state
canvas.restoreState()
def draw_static_content(self, canvas, document):
"""
Draws on the PDF page the static content that is displayed on all
......@@ -146,7 +144,6 @@ class FreshPageTemplate(PageTemplate):
canvas.drawCentredString(14.2 * cm, 26.7 * cm,
_(u"All the amounts are displayed in Euros, except if specified"))
def draw_string_in_width(self, canvas, string, x, y, width):
"""
In a canvas, draws a string from the x,y position and within the
......@@ -176,7 +173,6 @@ class FreshPageTemplate(PageTemplate):
canvas.drawString(x, y, string)
class FreshDocTemplate(BaseDocTemplate):
"""
The Fresh document template is a class explaining how to create a PDF
......
......@@ -33,7 +33,6 @@ class PDFWriter(object):
# type of document to be generated
self._doc_type = None # string "expense" or "refund"
def __init_flow_generator(self, entity):
"""
Instanciates the flow generator that will create the PDF flow content
......@@ -55,7 +54,6 @@ class PDFWriter(object):
self._doc_type = None
self._flow_generator = None
def write(self, entity, output):
"""
Writes a PDF document representing the entity object.
......
......@@ -90,7 +90,6 @@ class ExpenseSummaryComponent(component.EntityCtxComponent):
title = _('Expense summary')
order = -1
def field(self, label, value, w):
w(u'<div class="entityfield">')
w(u'<span class="label">%s</span> ' % label)
......
......@@ -11,7 +11,6 @@ class HelpersTC(CubicWebTC):
cnx.execute('SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s' % rtype,
{'x': eidfrom, 'y': eidto})
def new_expense_line(self, cnx, paid_by_eid):
line = cnx.create_entity('ExpenseLine', title=u'aline', diem=date.today(),
type=u'food', amount=1., taxes=0.)
......
......@@ -51,7 +51,6 @@ class HooksTC(HelpersTC):
newcount = self.refund_lines_count(cnx, self.account1)
self.assertEqual(newcount, count + 1)
def test_expense_accepted_notification(self):
with self.admin_access.repo_cnx() as cnx:
expense = cnx.create_entity('Expense', title=u'expense 2')
......@@ -91,7 +90,6 @@ class HooksTC(HelpersTC):
self.assertCountEqual(email2.recipients, ['john@test.org'])
self.assertNotEqual(email2.message.get('Message-id'), email1.message.get('Message-id'))
def test_automatic_refund_with_existing_line(self):
with self.admin_access.repo_cnx() as cnx:
refund = cnx.create_entity('Refund')
......
......@@ -9,7 +9,6 @@ from _helpers import HelpersTC
class SecurityTC(HelpersTC):
def test_users_cannot_modify_accepted_expense(self):
with self.new_access('john').repo_cnx() as cnx:
rset = cnx.execute('Any E WHERE E is Expense, E has_lines EE, EE paid_by PA, '
......@@ -64,6 +63,5 @@ class SecurityTC(HelpersTC):
self.assertRaises(Unauthorized, cnx.commit)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment