Parcourir la source

Do not trim if max length is set to 0

Alois Mahdal il y a 8 ans
Parent
révision
c3f4422a98
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1
    1
      include/sardine.py
  2. 1
    1
      sardine

+ 1
- 1
include/sardine.py Voir le fichier

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 Voir le fichier

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