Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from modoboa/fix/legend_translation
Browse files Browse the repository at this point in the history
Do not interpret string too early.
  • Loading branch information
tonioo authored Oct 16, 2018
2 parents cbc0c00 + a69eead commit a60929b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modoboa_stats/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, dsname, color, legend, cfunc="AVERAGE"):
"""
self.dsname = dsname
self.color = color
self.legend = legend.encode("utf-8")
self.legend = legend
self.cfunc = cfunc

def to_rrd_command_args(self, rrdfile):
Expand All @@ -47,7 +47,7 @@ def to_rrd_command_args(self, rrdfile):
'DEF:%s=%s:%s:%s' %
(self.dsname, rrdfile, self.dsname, self.cfunc),
'CDEF:%(ds)spm=%(ds)s,UN,0,%(ds)s,IF,60,*' % {"ds": self.dsname},
'XPORT:%spm:"%s"' % (self.dsname, self.legend.decode("utf-8"))
'XPORT:%spm:"%s"' % (self.dsname, self.legend)
]


Expand Down Expand Up @@ -103,7 +103,7 @@ def export(self, rrdfile, start, end):
cmdargs = []
for curve in self._curves:
result += [{
"name": smart_text(curve.legend),
"name": str(curve.legend),
"color": curve.color, "data": []
}]
cmdargs += curve.to_rrd_command_args(rrdfile)
Expand Down

0 comments on commit a60929b

Please sign in to comment.