Commit 1913fc14 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

[autopep8] E127 - Fix visual indentation

parent 77ddccc75450
......@@ -60,18 +60,18 @@ class AbstractFlowGenerator:
# top table containing on the left the metadata and on the right the
# name of the person concerned by the document
top_table = Table([[self.get_metadata(entity),
u"",
self.get_person_name(entity)],
u"",
self.get_person_name(entity)],
],
[11.5 * cm, 0.5 * cm, 7 * cm]
[11.5 * cm, 0.5 * cm, 7 * cm]
)
top_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
])
)
......@@ -87,18 +87,18 @@ class AbstractFlowGenerator:
# bottom table containing on the right the total table and on the left
# other useful data (payment, subtotals)
bottom_table = Table([[self.get_total_relative_data(entity),
u" ",
self.get_total(entity)],
u" ",
self.get_total(entity)],
],
[12.5 * cm, 0.5 * cm, 6 * cm]
[12.5 * cm, 0.5 * cm, 6 * cm]
)
bottom_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
])
)
......@@ -208,16 +208,16 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
meta_table = Table([[col_data],
],
[11.5 * cm]
[11.5 * cm]
)
meta_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
])
)
......@@ -264,17 +264,17 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
tab_data.append(lin_data)
tot_table = Table(tab_data,
[3.25 * cm, 2.75 * cm]
[3.25 * cm, 2.75 * cm]
)
tot_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('INNERGRID', (0, 0), (-1, -1), 0.02 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('INNERGRID', (0, 0), (-1, -1), 0.02 * cm, black),
])
)
......@@ -303,16 +303,16 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
if col_data != []:
rel_table = Table([[col_data],
],
[12.5 * cm]
[12.5 * cm]
)
rel_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
])
)
......@@ -429,7 +429,7 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
# Builds the main table that will be returned
main_table = Table(tab_data,
[19 * cm]
[19 * cm]
)
main_table.repeatRows = 1
main_table.setStyle(
......@@ -461,51 +461,51 @@ class ExpenseFlowGenerator (AbstractFlowGenerator):
# Builds table for the first line
line1_table = Table([line1_data
],
[2.25 * cm, 14 * cm, 2.75 * cm]
[2.25 * cm, 14 * cm, 2.75 * cm]
)
line1_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, 0), 'LEFT'),
('VALIGN', (0, 0), (-1, 0), 'TOP'),
('LEFTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, 0), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, 0), 0.1 * cm),
('INNERGRID', (0, 0), (-1, 0), 0.02 * cm, black),
('VALIGN', (0, 0), (-1, 0), 'TOP'),
('LEFTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, 0), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, 0), 0.1 * cm),
('INNERGRID', (0, 0), (-1, 0), 0.02 * cm, black),
])
)
# Builds table for the second line
line2_table = Table([line2_data
],
[4.25 * cm, 4.5 * cm, 2.25 * cm, 1.25 * cm, 1.75 * cm, 2.75 * cm,
2.25 * cm]
[4.25 * cm, 4.5 * cm, 2.25 * cm, 1.25 * cm, 1.75 * cm, 2.75 * cm,
2.25 * cm]
)
line2_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, 0), 'LEFT'),
('VALIGN', (0, 0), (-1, 0), 'TOP'),
('LEFTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, 0), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, 0), 0.1 * cm),
('INNERGRID', (0, 0), (-1, 0), 0.02 * cm, black),
('LINEABOVE', (0, 0), (-1, 0), 0.02 * cm, black),
('VALIGN', (0, 0), (-1, 0), 'TOP'),
('LEFTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, 0), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, 0), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, 0), 0.1 * cm),
('INNERGRID', (0, 0), (-1, 0), 0.02 * cm, black),
('LINEABOVE', (0, 0), (-1, 0), 0.02 * cm, black),
])
)
# Builds the table that contains the two lines describing the expense
both_lines_table = Table([[line1_table],
[line2_table]
[line2_table]
],
[19 * cm]
[19 * cm]
)
both_lines_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
('BOX', (0, 0), (-1, -1), 0.02 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0 * cm),
('BOX', (0, 0), (-1, -1), 0.02 * cm, black),
])
)
......@@ -575,16 +575,16 @@ class RefundFlowGenerator (AbstractFlowGenerator):
# Builds address table
addr_table = Table([[col_data],
],
[7 * cm]
[7 * cm]
)
addr_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
])
)
......@@ -609,17 +609,17 @@ class RefundFlowGenerator (AbstractFlowGenerator):
# Builds the total table
tot_table = Table([lin_data
],
[3.25 * cm, 2.75 * cm]
[3.25 * cm, 2.75 * cm]
)
tot_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('INNERGRID', (0, 0), (-1, -1), 0.02 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('INNERGRID', (0, 0), (-1, -1), 0.02 * cm, black),
])
)
......@@ -653,16 +653,16 @@ class RefundFlowGenerator (AbstractFlowGenerator):
# Builds payment table
payment_table = Table([[col_data],
],
[12.5 * cm]
[12.5 * cm]
)
payment_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.2 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.2 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
])
)
......@@ -743,25 +743,25 @@ class RefundFlowGenerator (AbstractFlowGenerator):
# Builds the main table containing the expenses lines
main_table = Table(tab_data,
[2.25 * cm, 7 * cm, 1.75 * cm, 2.25 * cm, 1.25 * cm, 1.75 * cm,
2.75 * cm]
[2.25 * cm, 7 * cm, 1.75 * cm, 2.25 * cm, 1.25 * cm, 1.75 * cm,
2.75 * cm]
)
main_table.repeatRows = 1
main_table.setStyle(
TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.1 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('LINEAFTER', (0, 0), (0, -1), 0.02 * cm, black),
('LINEAFTER', (1, 0), (1, -1), 0.02 * cm, black),
('LINEAFTER', (2, 0), (2, -1), 0.05 * cm, black),
('LINEAFTER', (3, 0), (3, -1), 0.02 * cm, black),
('LINEAFTER', (4, 0), (4, -1), 0.02 * cm, black),
('LINEAFTER', (5, 0), (5, -1), 0.05 * cm, black),
('LINEBELOW', (0, 0), (-1, 0), 0.05 * cm, black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (0, 0), (-1, -1), 0.1 * cm),
('RIGHTPADDING', (0, 0), (-1, -1), 0.1 * cm),
('TOPPADDING', (0, 0), (-1, -1), 0.1 * cm),
('BOTTOMPADDING', (0, 0), (-1, -1), 0.1 * cm),
('BOX', (0, 0), (-1, -1), 0.05 * cm, black),
('LINEAFTER', (0, 0), (0, -1), 0.02 * cm, black),
('LINEAFTER', (1, 0), (1, -1), 0.02 * cm, black),
('LINEAFTER', (2, 0), (2, -1), 0.05 * cm, black),
('LINEAFTER', (3, 0), (3, -1), 0.02 * cm, black),
('LINEAFTER', (4, 0), (4, -1), 0.02 * cm, black),
('LINEAFTER', (5, 0), (5, -1), 0.05 * cm, black),
('LINEBELOW', (0, 0), (-1, 0), 0.05 * cm, black),
])
)
......
......@@ -193,7 +193,7 @@ class FreshDocTemplate(BaseDocTemplate):
"""
# Initializes the document template with the correct page templates
templates = [FreshPageTemplate(doc_type, company_data,
template_id="Pages", _=_)]
template_id="Pages", _=_)]
BaseDocTemplate.__init__(self, output, pageTemplates=templates,
allowSplitting=1)
......
......@@ -12,7 +12,7 @@ class EntitiesTC(HelpersTC):
self.add_expense_line(cnx, expense, self.account2)
self.add_expense_line(cnx, expense, self.account1)
paid_by = dict((euser.eid, value)
for euser, value in expense.totals_paid_by().items())
for euser, value in expense.totals_paid_by().items())
self.assertEqual(paid_by, {self.user1: 2, self.user2: 1})
......
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