On Tue, 20 Aug 2024 21:55:20 -0700, HenHanna wrote:
What's the name of the package (or style) that uses
lots of extra lines in Python programming?
Lawrence’s style:
def write_invoice_entry_total(self, total_elapsed, hourly_rate, job_charge) :
if self.first_hours_entry != None :
self.item_para.addElement \
(
odf.text.Span
(
text =
"Total %s hour%s on %s @$%s"
%
(
format_common.my_format_elapsed(total_elapsed),
("", "s")[self.first_hours_entry["time_worked"] > 3600],
format_common.my_format_date
(
self.first_hours_entry["when_worked"]
),
format_common.my_format_amount(hourly_rate),
)
)
)
else :
add_elements \
(
self.item_para,
odf.text.LineBreak(),
odf.text.Span
(
text =
"Total %s hour%s @$%s"
%
(
format_common.my_format_elapsed(total_elapsed),
("", "s")[total_elapsed > 3600],
format_common.my_format_amount(hourly_rate),
)
),
)
#end if
add_elements \
(
self.item_para,
odf.text.Tab(),
odf.text.Span
(
text ="$%s" % format_common.my_format_amount(job_charge)
),
)
self.doc.text.addElement(self.item_para)
self.item_para = None
#end write_invoice_entry_total
odf.text.Span
(
text ="$%s" % format_common.my_format_amount(job_charge)
),
)
odf.text.Span
( text ="$%s" % format_common.my_format_amount(job_charge) ), )
On 8/21/2024 12:20 AM, Lawrence D'Oliveiro wrote:
odf.text.Span
(
text ="$%s" % format_common.my_format_amount(job_charge)
),
)
i think this look better like this:
odf.text.Span
( text ="$%s" % format_common.my_format_amount(job_charge) ), )
OR just one line.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 403 |
Nodes: | 16 (2 / 14) |
Uptime: | 43:32:41 |
Calls: | 8,407 |
Calls today: | 2 |
Files: | 13,171 |
Messages: | 5,905,025 |