This commit is contained in:
parent
650aef9794
commit
ef850140e0
2 changed files with 14 additions and 1 deletions
|
@ -47,7 +47,16 @@ class Product:
|
|||
price = f'{self.price:.2f}'
|
||||
description = f'"{self.description}"'
|
||||
metadata = ' '.join(sorted(f'#{k}' if v is None else f'#{k}={v}' for (k, v) in self.metadata.items()))
|
||||
return f'{aliases:<30} {price:<6} {description:<60} {metadata}'
|
||||
|
||||
accum = ''
|
||||
for col, txt in [
|
||||
(30, aliases),
|
||||
(37, price),
|
||||
(98, description),
|
||||
(0, metadata),
|
||||
]:
|
||||
accum += txt + ' ' + ' '*max(0, col-len(accum)-len(txt))
|
||||
return accum.rstrip()
|
||||
|
||||
|
||||
class NoAutoUpdate(Exception):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue