Always shorten the author if needed - stahg-gopher - Static Mercurial page generator for gopher
 (HTM) hg clone https://bitbucket.org/iamleot/stahg-gopher
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) changeset e6a57c6a75d1a3bcfda619301305129e76b219ce
 (DIR) parent 089eb93bff5da1a14b343c27614ea1a87283063d
 (HTM) Author: Leonardo Taccari <iamleot@gmail.com>
       Date:   Thu, 16 May 2019 00:25:17 
       
       Always shorten the author if needed
       
       Diffstat:
        stahg-gopher.py |  8 ++++----
        1 files changed, 4 insertions(+), 4 deletions(-)
       ---
       diff -r 089eb93bff5d -r e6a57c6a75d1 stahg-gopher.py
       --- a/stahg-gopher.py   Tue May 14 00:06:27 2019 +0200
       +++ b/stahg-gopher.py   Thu May 16 00:25:17 2019 +0200
       @@ -169,10 +169,10 @@
                            break
                        print('[1|{desc}|{path}|server|port]'.format(
                            desc=gph_escape_entry(
       -                        '{date:16}  {commit_message:40}  {author}'.format(
       +                        '{date:16}  {commit_message:40}  {author:20}'.format(
                                    date=e.date.strftime('%Y-%m-%d %H:%M'),
                                    commit_message=shorten(e.desc.decode(), 40),
       -                            author=author_name(e.author.decode()))),
       +                            author=shorten(author_name(e.author.decode()), 20))),
                            path='{base_path}/commit/{changeset}.gph'.format(
                                base_path=bp,
                                changeset=e.node.decode())), file=f)
       @@ -217,7 +217,7 @@
                            gph_escape_text('  {name:32}  {date:16}  {author:26}'.format(
                                name=shorten(name.decode(), 32),
                                date=self.client[changeset].date().strftime('%Y-%m-%d %H:%M'),
       -                        author=author_name(self.client[changeset].author().decode()))),
       +                        author=shorten(author_name(self.client[changeset].author().decode()), 26))),
                            file=f)
        
                    print(file=f)
       @@ -229,7 +229,7 @@
                            gph_escape_text('  {name:32}  {date:16}  {author:26}'.format(
                                name=shorten(name.decode(), 32),
                                date=self.client[changeset].date().strftime('%Y-%m-%d %H:%M'),
       -                        author=author_name(self.client[changeset].author().decode()))),
       +                        author=shorten(author_name(self.client[changeset].author().decode()), 26))),
                            file=f)