summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElisa Sohier <elisa.sohier@art-software.fr>2019-08-01 16:52:23 +0200
committerElisa Sohier <elisa.sohier@art-software.fr>2019-08-01 16:52:23 +0200
commit7bf0d5fdcdf3eab5d75526ab15f761180ef65687 (patch)
tree365d27d337c40b73a45dc29e9e9526f017b876c3
parentf7f049127505a88e53678147e160ed0483ef308e (diff)
Fixed error in tabname targets listing
-rw-r--r--autosync/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/autosync/__init__.py b/autosync/__init__.py
index df899c7..0ef4705 100644
--- a/autosync/__init__.py
+++ b/autosync/__init__.py
@@ -93,11 +93,11 @@ def run():
if firstArg.startswith("@@"): # list available entries for tabfile
elts = list(sorted(getTab(name=firstArg.lstrip("@"))))
- maxLenName = max(len(line[0]) for line in elts)
- maxLenSrc = max(len(line[1]) for line in elts)
- maxLenDst = max(len(line[1]) for line in elts)
-
msg("Available entries for tabfile {}:".format((lambda i: ["default", i][len(i)>0])(firstArg.lstrip("@"))))
+ maxLenName = max(len(line[0]) for line in elts+["Name"])
+ maxLenSrc = max(len(line[1]) for line in elts+["Source"])
+ maxLenDst = max(len(line[2]) for line in elts+["Target"])
+
print("\n\033[1;37m%-*s %-*s %-*s\033[0m" % (maxLenName, "Name", maxLenSrc, "Source", maxLenDst, "Target"))
for ename, esrc, edst in elts:
print("%-*s %-*s %-*s" % (maxLenName, ename, maxLenSrc, esrc, maxLenDst, edst))