diff bin/curvecalc @ 716:348b68723238

collapse mode. reload() hacks. rebuild key Ignore-this: 641f70b7b09a7e58e3bed66199ee8295
author Drew Perttula <drewp@bigasterisk.com>
date Tue, 12 Jun 2012 09:46:04 +0000
parents 9865cf5e07fd
children d8202a0a7fd5
line wrap: on
line diff
--- a/bin/curvecalc	Tue Jun 12 07:58:03 2012 +0000
+++ b/bin/curvecalc	Tue Jun 12 09:46:04 2012 +0000
@@ -15,7 +15,7 @@
 gtk2reactor.install()
 from twisted.internet import reactor
 
-import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache, signal
+import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache, signal, traceback
 import louie as dispatcher 
 from twisted.python.util import sibpath
 from rdflib import URIRef, Graph, Literal, RDF, RDFS
@@ -198,6 +198,11 @@
             try:
                 linecache.clearcache()
                 reload(curveview)
+
+                # old ones are not getting deleted right
+                if hasattr(self, 'curvesetView'):
+                    self.curvesetView.live = False
+
                 # mem problem somewhere; need to hold a ref to this
                 self.curvesetView = curveview.Curvesetview(
                     curvesVBox, zoomControlBox, self.curveset)
@@ -209,7 +214,8 @@
                 # ok. You'll just get some wasted redraws.
                 self.curvesetView.goLive()
             except Exception, e:
-                print "reload failed:", e
+                print "reload failed:"
+                traceback.print_exc()
         if self.opts.reload:
             reactor.callLater(1, self.refreshCurveView)
 
@@ -248,9 +254,6 @@
     curveset = Curveset(sliders=opts.sliders)
     subterms = []
 
-    # curvesetview must already exist, since this
-    # makes 'add_curve' signals for all the initial
-    # curves.
     curveset.load(basename=os.path.join(
         showconfig.curvesDir(),
         showconfig.songFilenameFromURI(song)),