changeset 636:54c863b2553e

CC don't run musicPlayer.path as often Ignore-this: f7185b8741062f7c14d9fe0793a8138d
author Drew Perttula <drewp@bigasterisk.com>
date Thu, 16 Jun 2011 07:10:56 +0000
parents 0818825c629f
children af5539fe35a7
files bin/curvecalc
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Thu Jun 16 07:10:33 2011 +0000
+++ b/bin/curvecalc	Thu Jun 16 07:10:56 2011 +0000
@@ -10,7 +10,7 @@
 
 """
 from __future__ import division
-import time,textwrap,math,random,os,optparse
+import time,textwrap,math,random,os,optparse, urllib2
 import Tix as tk
 try:
     from dispatch import dispatcher
@@ -77,10 +77,12 @@
         self.recenttime=0
         self.player = Agent(reactor)
         dispatcher.connect(self.seekplay_or_pause,"music seek")
+        self.timePath = networking.musicPlayer.path("time")
         
     def current_time(self):
-        """return deferred which gets called with the current time"""
-        d = self.player.request("GET", networking.musicPlayer.path("time"))
+        """return deferred which gets called with the current
+        time. This gets called really often"""
+        d = self.player.request("GET", self.timePath)
         d.addCallback(self._timeReturned)
         return d