Changeset - 87d9db21ba98
[Not reviewed]
default
0 1 0
Drew Perttula - 6 years ago 2019-05-28 08:42:14
drewp@bigasterisk.com
treq content() deferred api fix
Ignore-this: a2a3f8fa02cd7fe25a1ecb749ed8faf
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/vidref/musictime.py
Show inline comments
 
@@ -2,6 +2,7 @@ import time, json, logging
 
from typing import Dict
 

	
 
from twisted.internet import reactor
 
from twisted.internet.defer import inlineCallbacks
 
import treq
 

	
 
from light9 import networking
 
@@ -61,12 +62,13 @@ class MusicTime(object):
 

	
 
    def pollMusicTime(self):
 

	
 
        @inlineCallbacks
 
        def cb(response):
 

	
 
            if response.code != 200:
 
                raise ValueError("%s %s", response.code, response.body)
 
                raise ValueError("%s %s", response.code, (yield response.content()))
 

	
 
            position = json.loads(response.body)
 
            position = yield response.json()
 

	
 
            # this is meant to be the time when the server gave me its
 
            # report, and I don't know if that's closer to the
0 comments (0 inline, 0 general)