• Re: name of the package (or style) (Posting On Python-List Prohibited)

    From HenHanna@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 13:25:20 2024
    XPost: comp.lang.python

    On 8/21/2024 12:20 AM, Lawrence D'Oliveiro wrote:
    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)
    ),
    )

    i think this look better like this:

    odf.text.Span
    ( text ="$%s" % format_common.my_format_amount(job_charge) ), )

    OR just one line.


    _______________________

    Giving [Close Parenthesis] (or END or curly-bracket) its own line
    ----------- if this is discussed anywhere, pls let me know!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to HenHanna on Thu Aug 22 00:01:32 2024
    XPost: comp.lang.python

    On Wed, 21 Aug 2024 13:25:20 -0700, HenHanna wrote:

    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.

    Except that call was inside a construct that was already indented four
    steps deep. So it was wrapped to reduce the line length.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)