Mercurial > code > home > repos > light9
changeset 1050:edf46615712a
don't write extra precision in curve data. keep curvecalc rows sorted
Ignore-this: 71794339abfd347ccd3c0d99be635457
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 29 May 2014 07:12:31 +0000 |
parents | 2930523b8bfe |
children | be016cd5e5c5 |
files | light9/curvecalc/curve.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/curvecalc/curve.py Thu May 29 06:59:44 2014 +0000 +++ b/light9/curvecalc/curve.py Thu May 29 07:12:31 2014 +0000 @@ -56,7 +56,12 @@ dispatcher.send("points changed",sender=self) def points_as_string(self): - return ' '.join("%s %r" % p for p in self.points) + def outVal(x): + if isinstance(x, basestring): # markers + return x + return "%.4g" % x + return ' '.join("%s %s" % (outVal(p[0]), outVal(p[1])) + for p in self.points) def save(self,filename): # this is just around for markers, now @@ -204,7 +209,7 @@ if self.currentSong is None: return - for uri in self.graph.objects(self.currentSong, L9['curve']): + for uri in sorted(self.graph.objects(self.currentSong, L9['curve'])): pts = self.graph.value(uri, L9['points']) c = Curve(uri, pointsStorage='file' if pts is None else 'graph') if pts is not None: