Changeset - e13b62bfdaff
[Not reviewed]
default
0 4 0
drewp@bigasterisk.com - 20 months ago 2023-05-18 02:34:12
drewp@bigasterisk.com
fix some warnings
4 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/ascoltami/main.py
Show inline comments
 
@@ -10,13 +10,13 @@ from rdflib import URIRef
 
from twisted.internet import reactor
 
from twisted.internet.interfaces import IReactorCore
 

	
 
gi.require_version('Gst', '1.0')
 
gi.require_version('Gtk', '3.0')
 

	
 
from gi.repository import GObject, Gst
 
from gi.repository import Gst # type: ignore
 
from light9 import networking, showconfig
 
from light9.ascoltami.player import Player
 
from light9.ascoltami.playlist import NoSuchSong, Playlist
 
from light9.ascoltami.webapp import makeWebApp, songLocation, songUri
 

	
 
reactor = cast(IReactorCore, reactor)
light9/ascoltami/musictime_client.py
Show inline comments
 
@@ -27,12 +27,13 @@ class MusicTime(object):
 

	
 
        The choice of period doesn't need to be tied to framerate,
 
        it's more the size of the error you can tolerate (since we
 
        make up times between the samples, and we'll just run off the
 
        end of a song)
 
        """
 
        self.positionFetchTime = 0
 
        self.period = period
 
        self.hoverPeriod = .05
 
        self.onChange = onChange
 

	
 
        self.position: Dict[str, float] = {}
 
        # driven by our pollCurvecalcTime and also by Gui.incomingTime
light9/ascoltami/player.py
Show inline comments
 
#!/usr/bin/python
 
"""
 
alternate to the mpd music player, for ascoltami
 
"""
 

	
 
import time, logging, traceback
 
from gi.repository import Gst
 
from gi.repository import Gst # type: ignore
 
from twisted.internet import task
 
from light9.metrics import metrics
 
log = logging.getLogger()
 

	
 

	
 

	
light9/ascoltami/playlist.py
Show inline comments
 
@@ -8,12 +8,13 @@ class NoSuchSong(ValueError):
 

	
 

	
 
class Playlist(object):
 

	
 
    def __init__(self, graph, playlistUri):
 
        self.graph = graph
 
        self.playlistUri = playlistUri
 
        self.songs = list(graph.items(playlistUri))
 

	
 
    def nextSong(self, currentSong):
 
        """Returns the next song in the playlist or raises NoSuchSong if 
 
        we are at the end of the playlist."""
 
        try:
 
@@ -44,11 +45,11 @@ class Playlist(object):
 
    def songPath(self, uri):
 
        """filesystem path to a song"""
 
        raise NotImplementedError("see showconfig.songOnDisk")
 
        # maybe that function should be moved to this method
 

	
 
    @classmethod
 
    def fromShow(playlistClass, graph, show):
 
    def fromShow(cls, graph, show):
 
        playlistUri = graph.value(show, L9['playList'])
 
        if not playlistUri:
 
            raise ValueError("%r has no l9:playList" % show)
 
        return playlistClass(graph, playlistUri)
 
        return cls(graph, playlistUri)
0 comments (0 inline, 0 general)