Mercurial > code > home > repos > light9
changeset 915:5054d49ed44e
rework some CC currentGraph optimizations
Ignore-this: f01851abc4f649b169a1753670a5fbe
author | drewp@bigasterisk.com |
---|---|
date | Mon, 10 Jun 2013 19:57:15 +0000 |
parents | 092c00f6ba25 |
children | 9ed01a562288 |
files | bin/curvecalc |
diffstat | 1 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/curvecalc Mon Jun 10 19:56:42 2013 +0000 +++ b/bin/curvecalc Mon Jun 10 19:57:15 2013 +0000 @@ -173,21 +173,19 @@ self.makeSubterm(newname, withCurve=wc) dialog.hide() - def currentSong(self, current=None): - def fin(current): + def currentSong(self): + + with self.graph.currentState( + tripleFilter=(self.session, L9['currentSong'], None) + ) as current: return current.value(self.session, L9['currentSong']) - if current is None: - with self.graph.currentState() as current: - return fin(current) - else: - return fin(current) - def songSubtermsContext(self, current=None): - return self.currentSong(current=current) + def songSubtermsContext(self): + return self.currentSong() def makeSubterm(self, newname, withCurve=False, expr=None, sub=None): with self.graph.currentState() as current: - song = self.currentSong(current=current) + song = self.currentSong() for i in range(1000): uri = song + "/subterm/%d" % i if (uri, None, None) not in current: