Changeset - 0ff5adb554ba
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-22 08:06:51
drewp@bigasterisk.com
modernize py lib name
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/effect/sequencer/sequencer.py
Show inline comments
 
'''
 
copies from effectloop.py, which this should replace
 
'''
 

	
 
import asyncio
 
import imp
 
import importlib
 
import logging
 
import time
 
import traceback
 
from typing import Callable, Coroutine, Dict, List, cast
 

	
 
from louie import All, dispatcher
 
from rdfdb.syncedgraph.syncedgraph import SyncedGraph
 
from rdflib import URIRef
 
from twisted.internet import reactor
 
from twisted.internet.inotify import INotify
 
from twisted.python.filepath import FilePath
 

	
 
@@ -38,25 +38,25 @@ class CodeWatcher:
 
        self.onChange = onChange
 

	
 
        self.notifier = INotify()
 
        self.notifier.startReading()
 
        self.notifier.watch(FilePath(effecteval.__file__.replace('.pyc',
 
                                                                 '.py')),
 
                            callbacks=[self.codeChange])
 

	
 
    def codeChange(self, watch, path, mask):
 

	
 
        def go():
 
            log.info("reload effecteval")
 
            imp.reload(effecteval)
 
            importlib.reload(effecteval)
 
            self.onChange()
 

	
 
        # in case we got an event at the start of the write
 
        reactor.callLater(.1, go) # type: ignore
 

	
 

	
 
class Sequencer:
 
    """Notes from the graph + current song playback -> sendToCollector"""
 
    def __init__(self,
 
                 graph: SyncedGraph,
 
                 sendToCollector: Callable[[DeviceSettings], Coroutine[None ,None,None]],
 
                 fps=40,
0 comments (0 inline, 0 general)