Browse Source

Do not trim if max length is set to 0

Alois Mahdal 9 years ago
parent
commit
c3f4422a98
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      include/sardine.py
  2. 1
    1
      sardine

+ 1
- 1
include/sardine.py View File

129
         suffix = "…"
129
         suffix = "…"
130
         cooked = raw
130
         cooked = raw
131
         if self.plugindata.fmt == "plain":
131
         if self.plugindata.fmt == "plain":
132
-            if len(raw) > self.plugindata.maxlen:
132
+            if self.plugindata.maxlen and len(raw) > self.plugindata.maxlen:
133
                 newlen = self.plugindata.maxlen - len(suffix)
133
                 newlen = self.plugindata.maxlen - len(suffix)
134
                 cooked = raw[:newlen] + suffix
134
                 cooked = raw[:newlen] + suffix
135
         return cooked
135
         return cooked

+ 1
- 1
sardine View File

5
 usage: sardine [options] COMMAND [ARGS...]
5
 usage: sardine [options] COMMAND [ARGS...]
6
 
6
 
7
 Options:
7
 Options:
8
-    -c, --chars CHARS specify limit in characters
8
+    -c, --chars CHARS specify limit in characters; zero means no limit
9
     --format FMT    specify format: plain is a plain text, xgp
9
     --format FMT    specify format: plain is a plain text, xgp
10
                     is specific for xfce4-genmon-plugin
10
                     is specific for xfce4-genmon-plugin
11
     -p, --plain     same as --format=plain
11
     -p, --plain     same as --format=plain