[or-cvs] r23353: {arm} fix: minor formatting improvements when the log panel title (in arm/trunk/src: interface util)

Damian Johnson atagar1 at gmail.com
Thu Sep 30 15:58:15 UTC 2010


Author: atagar
Date: 2010-09-30 15:58:15 +0000 (Thu, 30 Sep 2010)
New Revision: 23353

Modified:
   arm/trunk/src/interface/logPanel.py
   arm/trunk/src/util/uiTools.py
Log:
fix: minor formatting improvements when the log panel title doesn't have much room
fix: missing a character when hyphenating strings



Modified: arm/trunk/src/interface/logPanel.py
===================================================================
--- arm/trunk/src/interface/logPanel.py	2010-09-30 15:19:25 UTC (rev 23352)
+++ arm/trunk/src/interface/logPanel.py	2010-09-30 15:58:15 UTC (rev 23353)
@@ -913,8 +913,9 @@
       # truncates to use an ellipsis if too long, for instance:
       attrLabel = ", ".join(eventsList)
       if currentPattern: attrLabel += " - filter: %s" % currentPattern
-      attrLabel = uiTools.cropStr(attrLabel, width - 10, -1)
-      panelLabel = "Events (%s):" % attrLabel
+      attrLabel = uiTools.cropStr(attrLabel, width - 10, 1)
+      if attrLabel: attrLabel = " (%s)" % attrLabel
+      panelLabel = "Events%s:" % attrLabel
     
     # cache results and return
     self._titleCache = panelLabel

Modified: arm/trunk/src/util/uiTools.py
===================================================================
--- arm/trunk/src/util/uiTools.py	2010-09-30 15:19:25 UTC (rev 23352)
+++ arm/trunk/src/util/uiTools.py	2010-09-30 15:58:15 UTC (rev 23353)
@@ -116,7 +116,9 @@
   
   if includeCrop:
     returnMsg, remainder = msg[:size], msg[size:]
-    if endType == END_WITH_HYPHEN: returnMsg = returnMsg[:-1] + "-"
+    if endType == END_WITH_HYPHEN:
+      remainder = returnMsg[-1] + remainder
+      returnMsg = returnMsg[:-1] + "-"
   else: returnMsg, remainder = msg[:lastWordbreak], msg[lastWordbreak:]
   
   # if this is ending with a comma or period then strip it off



More information about the tor-commits mailing list