Changeset - 4556eebe5d73
[Not reviewed]
default
! ! !
drewp@bigasterisk.com - 8 months ago 2024-05-13 02:02:10
drewp@bigasterisk.com
topdir reorgs; let pdm have its src/ dir; separate vite area from light9/
273 files changed with 7 insertions and 9 deletions:
web/patch.ts
rename
web/style.css
rename
0 comments (0 inline, 0 general)
.pdm.toml
Show inline comments
 
deleted file
bin/attic/bcf_puppet_demo
Show inline comments
 
file renamed from bin/bcf_puppet_demo to bin/attic/bcf_puppet_demo
bin/attic/bumppad
Show inline comments
 
file renamed from bin/bumppad to bin/attic/bumppad
bin/attic/captureDevice
Show inline comments
 
file renamed from bin/captureDevice to bin/attic/captureDevice
bin/attic/curvecalc
Show inline comments
 
file renamed from bin/curvecalc to bin/attic/curvecalc
bin/attic/curvecalc_all_subterms
Show inline comments
 
file renamed from bin/curvecalc_all_subterms to bin/attic/curvecalc_all_subterms
bin/attic/dmx_color_test.py
Show inline comments
 
file renamed from bin/dmx_color_test.py to bin/attic/dmx_color_test.py
bin/attic/dmxserver
Show inline comments
 
file renamed from bin/dmxserver to bin/attic/dmxserver
bin/attic/effectListing
Show inline comments
 
file renamed from bin/effectListing to bin/attic/effectListing
bin/attic/effectSequencer
Show inline comments
 
file renamed from bin/effectSequencer to bin/attic/effectSequencer
 
#!/bin/sh
 
#!/bin/zsh
 
pnpm exec vite -c light9/effect/sequencer/web/vite.config.ts &
 
pdm run uvicorn light9.effect.sequencer.service:app --host 0.0.0.0 --port 8213 --no-access-log 
 
wait
 

	
bin/attic/effecteval
Show inline comments
 
file renamed from bin/effecteval to bin/attic/effecteval
bin/attic/fade
Show inline comments
 
file renamed from bin/fade to bin/attic/fade
bin/attic/gobutton
Show inline comments
 
file renamed from bin/gobutton to bin/attic/gobutton
bin/attic/gtk_dnd_demo.py
Show inline comments
 
file renamed from bin/gtk_dnd_demo.py to bin/attic/gtk_dnd_demo.py
bin/attic/inputdemo
Show inline comments
 
file renamed from bin/inputdemo to bin/attic/inputdemo
bin/attic/inputquneo
Show inline comments
 
file renamed from bin/inputquneo to bin/attic/inputquneo
bin/attic/kcclient
Show inline comments
 
file renamed from bin/kcclient to bin/attic/kcclient
bin/attic/keyboardcomposer
Show inline comments
 
file renamed from bin/keyboardcomposer to bin/attic/keyboardcomposer
bin/attic/lightsim
Show inline comments
 
file renamed from bin/lightsim to bin/attic/lightsim
bin/attic/listsongs
Show inline comments
 
file renamed from bin/listsongs to bin/attic/listsongs
bin/attic/live
Show inline comments
 
file renamed from bin/live to bin/attic/live
bin/attic/load_test_rdfdb
Show inline comments
 
file renamed from bin/load_test_rdfdb to bin/attic/load_test_rdfdb
bin/attic/midifade
Show inline comments
 
file renamed from bin/midifade to bin/attic/midifade
bin/attic/movesinks
Show inline comments
 
file renamed from bin/movesinks to bin/attic/movesinks
bin/attic/mpd_timing_test
Show inline comments
 
file renamed from bin/mpd_timing_test to bin/attic/mpd_timing_test
bin/attic/musictime
Show inline comments
 
file renamed from bin/musictime to bin/attic/musictime
bin/attic/paintserver
Show inline comments
 
file renamed from bin/paintserver to bin/attic/paintserver
bin/attic/patchserver
Show inline comments
 
file renamed from bin/patchserver to bin/attic/patchserver
bin/attic/picamserve
Show inline comments
 
file renamed from bin/picamserve to bin/attic/picamserve
bin/attic/pytest
Show inline comments
 
file renamed from bin/pytest to bin/attic/pytest
bin/attic/python
Show inline comments
 
file renamed from bin/python to bin/attic/python
bin/attic/run_local.py
Show inline comments
 
file renamed from bin/run_local.py to bin/attic/run_local.py
bin/attic/staticclient
Show inline comments
 
file renamed from bin/staticclient to bin/attic/staticclient
bin/attic/subcomposer
Show inline comments
 
file renamed from bin/subcomposer to bin/attic/subcomposer
bin/attic/subserver
Show inline comments
 
file renamed from bin/subserver to bin/attic/subserver
bin/attic/timeline
Show inline comments
 
file renamed from bin/timeline to bin/attic/timeline
bin/attic/tkdnd_minimal_drop.py
Show inline comments
 
file renamed from bin/tkdnd_minimal_drop.py to bin/attic/tkdnd_minimal_drop.py
bin/attic/tracker
Show inline comments
 
file renamed from bin/tracker to bin/attic/tracker
bin/attic/vidref
Show inline comments
 
file renamed from bin/vidref to bin/attic/vidref
bin/attic/vidrefsetup
Show inline comments
 
file renamed from bin/vidrefsetup to bin/attic/vidrefsetup
bin/attic/wavecurve
Show inline comments
 
file renamed from bin/wavecurve to bin/attic/wavecurve
bin/attic/webcontrol
Show inline comments
 
file renamed from bin/webcontrol to bin/attic/webcontrol
bin/debug/clientdemo
Show inline comments
 
file renamed from bin/clientdemo to bin/debug/clientdemo
bin/debug/collector_loadtest.py
Show inline comments
 
file renamed from bin/collector_loadtest.py to bin/debug/collector_loadtest.py
src/light9/Effects.py
Show inline comments
 
file renamed from light9/Effects.py to src/light9/Effects.py
src/light9/Fadable.py
Show inline comments
 
file renamed from light9/Fadable.py to src/light9/Fadable.py
src/light9/FlyingFader.py
Show inline comments
 
file renamed from light9/FlyingFader.py to src/light9/FlyingFader.py
src/light9/Patch.py
Show inline comments
 
file renamed from light9/Patch.py to src/light9/Patch.py
src/light9/Submaster.py
Show inline comments
 
file renamed from light9/Submaster.py to src/light9/Submaster.py
src/light9/TLUtility.py
Show inline comments
 
file renamed from light9/TLUtility.py to src/light9/TLUtility.py
src/light9/__init__.py
Show inline comments
 
file renamed from light9/__init__.py to src/light9/__init__.py
src/light9/ascoltami/__init__.py
Show inline comments
 
file renamed from light9/ascoltami/__init__.py to src/light9/ascoltami/__init__.py
src/light9/ascoltami/main.py
Show inline comments
 
file renamed from light9/ascoltami/main.py to src/light9/ascoltami/main.py
src/light9/ascoltami/main_test.py
Show inline comments
 
file renamed from light9/ascoltami/main_test.py to src/light9/ascoltami/main_test.py
src/light9/ascoltami/musictime_client.py
Show inline comments
 
file renamed from light9/ascoltami/musictime_client.py to src/light9/ascoltami/musictime_client.py
src/light9/ascoltami/player.py
Show inline comments
 
file renamed from light9/ascoltami/player.py to src/light9/ascoltami/player.py
src/light9/ascoltami/playlist.py
Show inline comments
 
file renamed from light9/ascoltami/playlist.py to src/light9/ascoltami/playlist.py
src/light9/ascoltami/webapp.py
Show inline comments
 
file renamed from light9/ascoltami/webapp.py to src/light9/ascoltami/webapp.py
src/light9/ascoltami/webapp_test.py
Show inline comments
 
file renamed from light9/ascoltami/webapp_test.py to src/light9/ascoltami/webapp_test.py
src/light9/chase.py
Show inline comments
 
file renamed from light9/chase.py to src/light9/chase.py
src/light9/clientsession.py
Show inline comments
 
file renamed from light9/clientsession.py to src/light9/clientsession.py
src/light9/coffee.py
Show inline comments
 
file renamed from light9/coffee.py to src/light9/coffee.py
src/light9/collector/__init__.py
Show inline comments
 
file renamed from light9/collector/__init__.py to src/light9/collector/__init__.py
src/light9/collector/collector.py
Show inline comments
 
file renamed from light9/collector/collector.py to src/light9/collector/collector.py
src/light9/collector/collector_client.py
Show inline comments
 
file renamed from light9/collector/collector_client.py to src/light9/collector/collector_client.py
src/light9/collector/collector_client_asyncio.py
Show inline comments
 
file renamed from light9/collector/collector_client_asyncio.py to src/light9/collector/collector_client_asyncio.py
src/light9/collector/collector_test.py
Show inline comments
 
file renamed from light9/collector/collector_test.py to src/light9/collector/collector_test.py
src/light9/collector/device.py
Show inline comments
 
file renamed from light9/collector/device.py to src/light9/collector/device.py
src/light9/collector/device_test.py
Show inline comments
 
file renamed from light9/collector/device_test.py to src/light9/collector/device_test.py
src/light9/collector/dmx_controller_output.py
Show inline comments
 
file renamed from light9/collector/dmx_controller_output.py to src/light9/collector/dmx_controller_output.py
src/light9/collector/output.py
Show inline comments
 
file renamed from light9/collector/output.py to src/light9/collector/output.py
src/light9/collector/output_test.py
Show inline comments
 
file renamed from light9/collector/output_test.py to src/light9/collector/output_test.py
src/light9/collector/service.py
Show inline comments
 
file renamed from light9/collector/service.py to src/light9/collector/service.py
 
@@ -63,99 +63,99 @@ class Updates(WebSocketEndpoint, UiListe
 

	
 

	
 
async def PutAttrs(collector: Collector, request):
 
    try:
 
        body = await request.body()
 
    except ClientDisconnect:
 
        log.warning("PUT /attrs request disconnected- ignoring")
 
        return Response('', status_code=400)
 
    client, clientSession, settings, sendTime = parseJsonMessage(collector.graph, body)
 
    collector.setAttrs(client, clientSession, settings, sendTime)
 
    return Response('', status_code=202)
 

	
 

	
 
async def zmqListener(collector):
 
    try:
 
        ctx = zmq.asyncio.Context()
 
        sock = ctx.socket(zmq.SUB)
 
        sock.bind('tcp://127.0.0.1:9203')
 
        sock.subscribe(b'setAttr')
 
        while True:
 
            [topic, msg] = await sock.recv_multipart()
 
            if topic != b'setAttr':
 
                raise ValueError(topic)
 
            # log.info(f'zmq recv {len(msg)}')
 
            client, clientSession, settings, sendTime = parseJsonMessage(collector.graph, msg)
 
            collector.setAttrs(client, clientSession, settings, sendTime)
 
    except:
 
        traceback.print_exc()
 
        raise
 

	
 
def findDevice():
 
    for line in subprocess.check_output("lsusb").decode('utf8').splitlines():
 
        if '16c0:05dc' in line:
 
            words = line.split(':')[0].split()
 
            dev = f'/dev/bus/usb/{words[1]}/{words[3]}'
 
            log.info(f'device will be {dev}')
 
            return dev ,int(words[3])
 
    raise ValueError("no matching uDMX found")
 

	
 
def main():
 
    logging.getLogger('autodepgraphapi').setLevel(logging.INFO)
 
    logging.getLogger('syncedgraph').setLevel(logging.INFO)
 
    logging.getLogger('output.allDmx').setLevel(logging.WARNING)
 
    logging.getLogger().setLevel(logging.DEBUG)
 
    logging.getLogger('collector').setLevel(logging.DEBUG)
 

	
 
    graph = SyncedGraph(networking.rdfdb.url, "collector")
 

	
 
    devPath, usbAddress = findDevice()
 
    #devPath, usbAddress = findDevice()
 
            # if user doesn't have r/w, fail now
 
    try:
 
        # todo: drive outputs with config files
 
        outputs: List[Output] = [
 
            # ArtnetDmx(L9['output/dmxA/'],
 
            #           host='127.0.0.1',
 
            #           port=6445,
 
            #           rate=rate),
 
            #sudo chmod a+rw /dev/bus/usb/003/021
 
            Udmx(L9['output/dmxA/'], bus=1, address=usbAddress, lastDmxChannel=200, rate=RATE),
 
#            Udmx(L9['output/dmxA/'], bus=1, address=usbAddress, lastDmxChannel=200, rate=RATE),
 
        ]
 
    except Exception:
 
        log.error("setting up outputs:")
 
        traceback.print_exc()
 
        raise
 
    listeners = WebListeners()
 
    c = Collector(graph, outputs, listeners)
 
    zl = asyncio.create_task(zmqListener(c))
 
    app = Starlette(
 
        debug=True,
 
        routes=[
 
            # Route('/recentRequests', lambda req: get_recentRequests(req, db)),
 
            WebSocketRoute('/updates', endpoint=functools.partial(Updates, listeners)),
 
            Route('/attrs', functools.partial(PutAttrs, c), methods=['PUT']),
 
        ],
 
    )
 
    app.add_middleware(PrometheusMiddleware)
 
    app.add_route("/metrics", handle_metrics)
 

	
 
    # loadtest = os.environ.get('LOADTEST', False)  # call myself with some synthetic load then exit
 
    # if loadtest:
 
    #     # in a subprocess since we don't want this client to be
 
    #     # cooperating with the main event loop and only sending
 
    #     # requests when there's free time
 
    #     def afterWarmup():
 
    #         log.info('running collector_loadtest')
 
    #         d = utils.getProcessValue('bin/python', ['bin/collector_loadtest.py'])
 

	
 
    #         def done(*a):
 
    #             log.info('loadtest done')
 
    #             reactor.stop()
 

	
 
    #         d.addCallback(done)
 

	
 
    #     reactor.callLater(2, afterWarmup)
 

	
 
    return app
 

	
 

	
 
app = main()
src/light9/collector/weblisteners.py
Show inline comments
 
file renamed from light9/collector/weblisteners.py to src/light9/collector/weblisteners.py
src/light9/cursor1.xbm
Show inline comments
 
file renamed from light9/cursor1.xbm to src/light9/cursor1.xbm
src/light9/curvecalc/__init__.py
Show inline comments
 
file renamed from light9/curvecalc/__init__.py to src/light9/curvecalc/__init__.py
src/light9/curvecalc/client.py
Show inline comments
 
file renamed from light9/curvecalc/client.py to src/light9/curvecalc/client.py
src/light9/curvecalc/cursors.py
Show inline comments
 
file renamed from light9/curvecalc/cursors.py to src/light9/curvecalc/cursors.py
src/light9/curvecalc/curve.py
Show inline comments
 
file renamed from light9/curvecalc/curve.py to src/light9/curvecalc/curve.py
src/light9/curvecalc/curvecalc.glade
Show inline comments
 
file renamed from light9/curvecalc/curvecalc.glade to src/light9/curvecalc/curvecalc.glade
src/light9/curvecalc/curveedit.py
Show inline comments
 
file renamed from light9/curvecalc/curveedit.py to src/light9/curvecalc/curveedit.py
src/light9/curvecalc/curveview.py
Show inline comments
 
file renamed from light9/curvecalc/curveview.py to src/light9/curvecalc/curveview.py
src/light9/curvecalc/musicaccess.py
Show inline comments
 
file renamed from light9/curvecalc/musicaccess.py to src/light9/curvecalc/musicaccess.py
src/light9/curvecalc/output.py
Show inline comments
 
file renamed from light9/curvecalc/output.py to src/light9/curvecalc/output.py
src/light9/curvecalc/subterm.py
Show inline comments
 
file renamed from light9/curvecalc/subterm.py to src/light9/curvecalc/subterm.py
src/light9/curvecalc/subtermview.py
Show inline comments
 
file renamed from light9/curvecalc/subtermview.py to src/light9/curvecalc/subtermview.py
src/light9/curvecalc/zoomcontrol.py
Show inline comments
 
file renamed from light9/curvecalc/zoomcontrol.py to src/light9/curvecalc/zoomcontrol.py
src/light9/dmxchanedit.py
Show inline comments
 
file renamed from light9/dmxchanedit.py to src/light9/dmxchanedit.py
src/light9/dmxclient.py
Show inline comments
 
file renamed from light9/dmxclient.py to src/light9/dmxclient.py
src/light9/editchoice.py
Show inline comments
 
file renamed from light9/editchoice.py to src/light9/editchoice.py
src/light9/editchoicegtk.py
Show inline comments
 
file renamed from light9/editchoicegtk.py to src/light9/editchoicegtk.py
src/light9/effect/__init__.py
Show inline comments
 
file renamed from light9/effect/__init__.py to src/light9/effect/__init__.py
src/light9/effect/edit.py
Show inline comments
 
file renamed from light9/effect/edit.py to src/light9/effect/edit.py
src/light9/effect/effect_function_library.py
Show inline comments
 
file renamed from light9/effect/effect_function_library.py to src/light9/effect/effect_function_library.py
src/light9/effect/effect_function_library_test.py
Show inline comments
 
file renamed from light9/effect/effect_function_library_test.py to src/light9/effect/effect_function_library_test.py
src/light9/effect/effect_functions.py
Show inline comments
 
file renamed from light9/effect/effect_functions.py to src/light9/effect/effect_functions.py
src/light9/effect/effecteval.py
Show inline comments
 
file renamed from light9/effect/effecteval.py to src/light9/effect/effecteval.py
src/light9/effect/effecteval2.py
Show inline comments
 
file renamed from light9/effect/effecteval2.py to src/light9/effect/effecteval2.py
src/light9/effect/effecteval_test.py
Show inline comments
 
file renamed from light9/effect/effecteval_test.py to src/light9/effect/effecteval_test.py
src/light9/effect/scale.py
Show inline comments
 
file renamed from light9/effect/scale.py to src/light9/effect/scale.py
src/light9/effect/sequencer/__init__.py
Show inline comments
 
file renamed from light9/effect/sequencer/__init__.py to src/light9/effect/sequencer/__init__.py
src/light9/effect/sequencer/eval_faders.py
Show inline comments
 
file renamed from light9/effect/sequencer/eval_faders.py to src/light9/effect/sequencer/eval_faders.py
src/light9/effect/sequencer/eval_faders_test.py
Show inline comments
 
file renamed from light9/effect/sequencer/eval_faders_test.py to src/light9/effect/sequencer/eval_faders_test.py
src/light9/effect/sequencer/note.py
Show inline comments
 
file renamed from light9/effect/sequencer/note.py to src/light9/effect/sequencer/note.py
src/light9/effect/sequencer/note_test.py
Show inline comments
 
file renamed from light9/effect/sequencer/note_test.py to src/light9/effect/sequencer/note_test.py
src/light9/effect/sequencer/sequencer.py
Show inline comments
 
file renamed from light9/effect/sequencer/sequencer.py to src/light9/effect/sequencer/sequencer.py
src/light9/effect/sequencer/service.py
Show inline comments
 
file renamed from light9/effect/sequencer/service.py to src/light9/effect/sequencer/service.py
src/light9/effect/sequencer/service_test.py
Show inline comments
 
file renamed from light9/effect/sequencer/service_test.py to src/light9/effect/sequencer/service_test.py
src/light9/effect/sequencer/web/Light9SequencerUi.ts
Show inline comments
 
file renamed from light9/effect/sequencer/web/Light9SequencerUi.ts to src/light9/effect/sequencer/web/Light9SequencerUi.ts
src/light9/effect/sequencer/web/index.html
Show inline comments
 
file renamed from light9/effect/sequencer/web/index.html to src/light9/effect/sequencer/web/index.html
src/light9/effect/sequencer/web/vite.config.ts
Show inline comments
 
file renamed from light9/effect/sequencer/web/vite.config.ts to src/light9/effect/sequencer/web/vite.config.ts
src/light9/effect/settings.py
Show inline comments
 
file renamed from light9/effect/settings.py to src/light9/effect/settings.py
src/light9/effect/settings_test.py
Show inline comments
 
file renamed from light9/effect/settings_test.py to src/light9/effect/settings_test.py
src/light9/effecteval/__init__.py
Show inline comments
 
file renamed from light9/effecteval/__init__.py to src/light9/effecteval/__init__.py
src/light9/effecteval/effect-components.html
Show inline comments
 
file renamed from light9/effecteval/effect-components.html to src/light9/effecteval/effect-components.html
src/light9/effecteval/effect.coffee
Show inline comments
 
file renamed from light9/effecteval/effect.coffee to src/light9/effecteval/effect.coffee
src/light9/effecteval/effect.html
Show inline comments
 
file renamed from light9/effecteval/effect.html to src/light9/effecteval/effect.html
src/light9/effecteval/effect.py
Show inline comments
 
file renamed from light9/effecteval/effect.py to src/light9/effecteval/effect.py
src/light9/effecteval/effectloop.py
Show inline comments
 
file renamed from light9/effecteval/effectloop.py to src/light9/effecteval/effectloop.py
src/light9/effecteval/index.html
Show inline comments
 
file renamed from light9/effecteval/index.html to src/light9/effecteval/index.html
src/light9/effecteval/test_effect.py
Show inline comments
 
file renamed from light9/effecteval/test_effect.py to src/light9/effecteval/test_effect.py
src/light9/gtkpyconsole.py
Show inline comments
 
file renamed from light9/gtkpyconsole.py to src/light9/gtkpyconsole.py
src/light9/homepage/write_config.py
Show inline comments
 
file renamed from light9/homepage/write_config.py to src/light9/homepage/write_config.py
src/light9/homepage/write_config_test.py
Show inline comments
 
file renamed from light9/homepage/write_config_test.py to src/light9/homepage/write_config_test.py
src/light9/io/Makefile
Show inline comments
 
file renamed from light9/io/Makefile to src/light9/io/Makefile
src/light9/io/__init__.py
Show inline comments
 
file renamed from light9/io/__init__.py to src/light9/io/__init__.py
src/light9/io/motordrive
Show inline comments
 
file renamed from light9/io/motordrive to src/light9/io/motordrive
src/light9/io/parport.c
Show inline comments
 
file renamed from light9/io/parport.c to src/light9/io/parport.c
src/light9/io/parport.i
Show inline comments
 
file renamed from light9/io/parport.i to src/light9/io/parport.i
src/light9/io/serport.i
Show inline comments
 
file renamed from light9/io/serport.i to src/light9/io/serport.i
src/light9/io/udmx.py
Show inline comments
 
file renamed from light9/io/udmx.py to src/light9/io/udmx.py
src/light9/localsyncedgraph.py
Show inline comments
 
file renamed from light9/localsyncedgraph.py to src/light9/localsyncedgraph.py
src/light9/metrics.py
Show inline comments
 
file renamed from light9/metrics.py to src/light9/metrics.py
src/light9/midifade/midifade.py
Show inline comments
 
file renamed from light9/midifade/midifade.py to src/light9/midifade/midifade.py
src/light9/midifade/midifade_test.py
Show inline comments
 
file renamed from light9/midifade/midifade_test.py to src/light9/midifade/midifade_test.py
src/light9/mock_syncedgraph.py
Show inline comments
 
file renamed from light9/mock_syncedgraph.py to src/light9/mock_syncedgraph.py
src/light9/namespaces.py
Show inline comments
 
file renamed from light9/namespaces.py to src/light9/namespaces.py
src/light9/networking.py
Show inline comments
 
file renamed from light9/networking.py to src/light9/networking.py
src/light9/newtypes.py
Show inline comments
 
file renamed from light9/newtypes.py to src/light9/newtypes.py
src/light9/observable.py
Show inline comments
 
file renamed from light9/observable.py to src/light9/observable.py
src/light9/paint/__init__.py
Show inline comments
 
file renamed from light9/paint/__init__.py to src/light9/paint/__init__.py
src/light9/paint/capture.py
Show inline comments
 
file renamed from light9/paint/capture.py to src/light9/paint/capture.py
src/light9/paint/solve.py
Show inline comments
 
file renamed from light9/paint/solve.py to src/light9/paint/solve.py
src/light9/paint/solve_test.py
Show inline comments
 
file renamed from light9/paint/solve_test.py to src/light9/paint/solve_test.py
src/light9/prof.py
Show inline comments
 
file renamed from light9/prof.py to src/light9/prof.py
src/light9/rdfdb/service.py
Show inline comments
 
file renamed from light9/rdfdb/service.py to src/light9/rdfdb/service.py
src/light9/rdfdb/service_test.py
Show inline comments
 
file renamed from light9/rdfdb/service_test.py to src/light9/rdfdb/service_test.py
src/light9/recentfps.py
Show inline comments
 
file renamed from light9/recentfps.py to src/light9/recentfps.py
src/light9/run_local.py
Show inline comments
 
file renamed from light9/run_local.py to src/light9/run_local.py
 
@@ -7,57 +7,57 @@ import socket
 
import sys
 
from colorsys import hsv_to_rgb
 

	
 
import coloredlogs
 

	
 
try:
 
    import faulthandler
 
    faulthandler.enable()
 
except ImportError:
 
    pass
 

	
 
if 0:
 
    from IPython.core import ultratb
 
    sys.excepthook = ultratb.FormattedTB(mode='Verbose', color_scheme='Linux', call_pdb=1)
 

	
 
progName = sys.argv[0].split('/')[-1]
 
log = logging.getLogger()  # this has to get the root logger
 
log.name = progName  # but we can rename it for clarity
 

	
 
coloredlogs.install(
 
    level='DEBUG',
 
    milliseconds=True,
 
    datefmt='t=%H:%M:%S',
 
    fmt='%(asctime)s.%(msecs)03d %(levelname)1.1s [%(filename)s:%(lineno)s] %(name)s %(message)s',
 
    # try `pdm run humanfriendly --demo`
 
    field_styles=dict(
 
        asctime=dict(color=30),
 
        levelname=dict(color=247),
 
        name=dict(color='blue'),
 
    ),
 
    level_styles={
 
        'debug': dict(color=115),
 
        'info': dict(color=250),
 
        'warning': dict(color=208),
 
        'error': dict(color=161),
 
        'critical': dict(color=196),
 
    },
 
)
 

	
 

	
 
def setTerminalTitle(s):
 
    if os.environ.get('TERM', '') in ['xterm', 'rxvt', 'rxvt-unicode-256color']:
 
        m = re.search(r'(light9\..*):', s)
 
        if m is not None:
 
            s = m.group(1)
 
        s = s.replace('/home/drewp/own/proj/','')
 
        print("\033]0;%s\007" % s)  # not escaped/protected correctly
 
        hue = (hash(progName) % 255) / 255
 
        r, g, b = [int(x * 255) for x in hsv_to_rgb(hue, s=.2, v=.1)]
 
        r, g, b = [int(x * 255) for x in hsv_to_rgb(hue, s=.4, v=.1)]
 
        print(f"\033]11;#{r:02x}{g:02x}{b:02x}\007")
 

	
 

	
 
if 'listsongs' not in sys.argv[0] and 'homepageConfig' not in sys.argv[0]:
 
    setTerminalTitle('[%s] %s' % (socket.gethostname(), ' '.join(sys.argv).replace('bin/', '')))
 

	
 
# see http://www.youtube.com/watch?v=3cIOT9kM--g for commands that make
 
# profiles and set background images
src/light9/showconfig.py
Show inline comments
 
file renamed from light9/showconfig.py to src/light9/showconfig.py
src/light9/subclient.py
Show inline comments
 
file renamed from light9/subclient.py to src/light9/subclient.py
src/light9/subcomposer/__init__.py
Show inline comments
 
file renamed from light9/subcomposer/__init__.py to src/light9/subcomposer/__init__.py
src/light9/subcomposer/index.html
Show inline comments
 
file renamed from light9/subcomposer/index.html to src/light9/subcomposer/index.html
src/light9/subcomposer/subcomposerweb.py
Show inline comments
 
file renamed from light9/subcomposer/subcomposerweb.py to src/light9/subcomposer/subcomposerweb.py
src/light9/tkdnd.py
Show inline comments
 
file renamed from light9/tkdnd.py to src/light9/tkdnd.py
src/light9/typedgraph.py
Show inline comments
 
file renamed from light9/typedgraph.py to src/light9/typedgraph.py
src/light9/typedgraph_test.py
Show inline comments
 
file renamed from light9/typedgraph_test.py to src/light9/typedgraph_test.py
src/light9/uihelpers.py
Show inline comments
 
file renamed from light9/uihelpers.py to src/light9/uihelpers.py
src/light9/updatefreq.py
Show inline comments
 
file renamed from light9/updatefreq.py to src/light9/updatefreq.py
src/light9/vidref/__init__.py
Show inline comments
 
file renamed from light9/vidref/__init__.py to src/light9/vidref/__init__.py
src/light9/vidref/gui.js
Show inline comments
 
file renamed from light9/vidref/gui.js to src/light9/vidref/gui.js
src/light9/vidref/index.html
Show inline comments
 
file renamed from light9/vidref/index.html to src/light9/vidref/index.html
src/light9/vidref/main.py
Show inline comments
 
file renamed from light9/vidref/main.py to src/light9/vidref/main.py
src/light9/vidref/moviestore.py
Show inline comments
 
file renamed from light9/vidref/moviestore.py to src/light9/vidref/moviestore.py
src/light9/vidref/remotepivideo.py
Show inline comments
 
file renamed from light9/vidref/remotepivideo.py to src/light9/vidref/remotepivideo.py
src/light9/vidref/setup.html
Show inline comments
 
file renamed from light9/vidref/setup.html to src/light9/vidref/setup.html
src/light9/vidref/videorecorder.py
Show inline comments
 
file renamed from light9/vidref/videorecorder.py to src/light9/vidref/videorecorder.py
src/light9/vidref/vidref.glade
Show inline comments
 
file renamed from light9/vidref/vidref.glade to src/light9/vidref/vidref.glade
src/light9/vidref/vidref.html
Show inline comments
 
file renamed from light9/vidref/vidref.html to src/light9/vidref/vidref.html
src/light9/vidref/vidref.ui
Show inline comments
 
file renamed from light9/vidref/vidref.ui to src/light9/vidref/vidref.ui
src/light9/wavelength.py
Show inline comments
 
file renamed from light9/wavelength.py to src/light9/wavelength.py
src/light9/wavepoints.py
Show inline comments
 
file renamed from light9/wavepoints.py to src/light9/wavepoints.py
src/light9/webcontrol.html
Show inline comments
 
file renamed from light9/webcontrol.html to src/light9/webcontrol.html
src/light9/zmqtransport.py
Show inline comments
 
file renamed from light9/zmqtransport.py to src/light9/zmqtransport.py
web/AutoDependencies.ts
Show inline comments
 
file renamed from light9/web/AutoDependencies.ts to web/AutoDependencies.ts
web/EditChoice.ts
Show inline comments
 
file renamed from light9/web/EditChoice.ts to web/EditChoice.ts
web/Light9CursorCanvas.ts
Show inline comments
 
file renamed from light9/web/Light9CursorCanvas.ts to web/Light9CursorCanvas.ts
web/RdfDbChannel.ts
Show inline comments
 
file renamed from light9/web/RdfDbChannel.ts to web/RdfDbChannel.ts
web/RdfdbSyncedGraph.ts
Show inline comments
 
file renamed from light9/web/RdfdbSyncedGraph.ts to web/RdfdbSyncedGraph.ts
web/ResourceDisplay.ts
Show inline comments
 
file renamed from light9/web/ResourceDisplay.ts to web/ResourceDisplay.ts
web/SyncedGraph.ts
Show inline comments
 
file renamed from light9/web/SyncedGraph.ts to web/SyncedGraph.ts
web/TiledHome.ts
Show inline comments
 
file renamed from light9/web/TiledHome.ts to web/TiledHome.ts
web/ascoltami/Light9AscoltamiUi.ts
Show inline comments
 
file renamed from light9/web/ascoltami/Light9AscoltamiUi.ts to web/ascoltami/Light9AscoltamiUi.ts
web/ascoltami/index.html
Show inline comments
 
file renamed from light9/web/ascoltami/index.html to web/ascoltami/index.html
web/ascoltami/main.ts
Show inline comments
 
file renamed from light9/web/ascoltami/main.ts to web/ascoltami/main.ts
web/collector/Light9CollectorDevice.ts
Show inline comments
 
file renamed from light9/web/collector/Light9CollectorDevice.ts to web/collector/Light9CollectorDevice.ts
web/collector/Light9CollectorUi.ts
Show inline comments
 
file renamed from light9/web/collector/Light9CollectorUi.ts to web/collector/Light9CollectorUi.ts
 
import debug from "debug";
 
import { html, LitElement } from "lit";
 
import { customElement, property } from "lit/decorators.js";
 
import { NamedNode } from "n3";
 
import ReconnectingWebSocket from "reconnectingwebsocket";
 
import { sortBy, uniq } from "underscore";
 
import { Patch } from "../patch";
 
import { getTopGraph } from "../RdfdbSyncedGraph";
 
import { SyncedGraph } from "../SyncedGraph";
 
import { Light9CollectorDevice } from "./Light9CollectorDevice";
 
export { RdfdbSyncedGraph } from "../RdfdbSyncedGraph";
 
export { Light9CollectorDevice };
 

	
 
debug.enable("*");
 
const log = debug("collector");
 

	
 
@customElement("light9-collector-ui")
 
export class Light9CollectorUi extends LitElement {
 
  graph!: SyncedGraph;
 
  render() {
 
    return html`<rdfdb-synced-graph></rdfdb-synced-graph>
 
      <h1>Collector <a href="metrics">[metrics]</a></h1>
 
      <h1>Collector</h1>
 

	
 
      <h2>Devices</h2>
 
      <div style="column-width: 11em">${this.devices.map((d) => html`<light9-collector-device .uri=${d}></light9-collector-device>`)}</div> `;
 
  }
 

	
 
  @property() devices: NamedNode[] = [];
 

	
 
  constructor() {
 
    super();
 
    getTopGraph().then((g) => {
 
      this.graph = g;
 
      this.graph.runHandler(this.findDevices.bind(this), "findDevices");
 
    });
 

	
 
    const ws = new ReconnectingWebSocket(location.href.replace("http", "ws") + "../service/collector/updates");
 
    ws.addEventListener("message", (ev: any) => {
 
      const outputAttrsSet = JSON.parse(ev.data).outputAttrsSet;
 
      if (outputAttrsSet) {
 
        this.updateDev(outputAttrsSet.dev, outputAttrsSet.attrs);
 
      }
 
    });
 
  }
 

	
 
  findDevices(patch?: Patch) {
 
    const U = this.graph.U();
 

	
 
    this.devices = [];
 
    this.clearDeviceChildElementCache();
 
    let classes = this.graph.subjects(U("rdf:type"), U(":DeviceClass"));
 
    uniq(sortBy(classes, "value"), true).forEach((dc) => {
 
      sortBy(this.graph.subjects(U("rdf:type"), dc), "value").forEach((dev) => {
 
        this.devices.push(dev as NamedNode);
 
      });
 
    });
 
  }
 

	
 
  deviceElements: Map<string, Light9CollectorDevice> = new Map();
 

	
 
  clearDeviceChildElementCache() {
 
    this.deviceElements = new Map();
 
  }
 

	
 
  findDeviceChildElement(uri: string): Light9CollectorDevice | undefined {
 
    const known = this.deviceElements.get(uri);
 
    if (known) {
 
      return known;
 
    }
 

	
web/collector/index.html
Show inline comments
 
file renamed from light9/web/collector/index.html to web/collector/index.html
web/colorpick_crosshair_large.svg
Show inline comments
 
file renamed from light9/web/colorpick_crosshair_large.svg to web/colorpick_crosshair_large.svg
web/colorpick_crosshair_small.svg
Show inline comments
 
file renamed from light9/web/colorpick_crosshair_small.svg to web/colorpick_crosshair_small.svg
web/colorpick_rainbow_large.png
Show inline comments
 
file renamed from light9/web/colorpick_rainbow_large.png to web/colorpick_rainbow_large.png
Show images
web/colorpick_rainbow_small.png
Show inline comments
 
file renamed from light9/web/colorpick_rainbow_small.png to web/colorpick_rainbow_small.png
Show images
web/drawing.ts
Show inline comments
 
file renamed from light9/web/drawing.ts to web/drawing.ts
web/edit-choice-demo.html
Show inline comments
 
file renamed from light9/web/edit-choice-demo.html to web/edit-choice-demo.html
web/edit-choice.coffee
Show inline comments
 
file renamed from light9/web/edit-choice.coffee to web/edit-choice.coffee
web/edit-choice_test.html
Show inline comments
 
file renamed from light9/web/edit-choice_test.html to web/edit-choice_test.html
web/effects/Light9EffectListing.ts
Show inline comments
 
file renamed from light9/web/effects/Light9EffectListing.ts to web/effects/Light9EffectListing.ts
web/effects/index.html
Show inline comments
 
file renamed from light9/web/effects/index.html to web/effects/index.html
web/fade/Light9EffectFader.ts
Show inline comments
 
file renamed from light9/web/fade/Light9EffectFader.ts to web/fade/Light9EffectFader.ts
web/fade/Light9FadeUi.ts
Show inline comments
 
file renamed from light9/web/fade/Light9FadeUi.ts to web/fade/Light9FadeUi.ts
web/fade/Light9Fader.ts
Show inline comments
 
file renamed from light9/web/fade/Light9Fader.ts to web/fade/Light9Fader.ts
web/fade/index.html
Show inline comments
 
file renamed from light9/web/fade/index.html to web/fade/index.html
web/floating_color_picker.ts
Show inline comments
 
file renamed from light9/web/floating_color_picker.ts to web/floating_color_picker.ts
web/graph_test.coffee
Show inline comments
 
file renamed from light9/web/graph_test.coffee to web/graph_test.coffee
web/index.html
Show inline comments
 
file renamed from light9/web/index.html to web/index.html
web/lib/.bowerrc
Show inline comments
 
file renamed from light9/web/lib/.bowerrc to web/lib/.bowerrc
web/lib/bower.json
Show inline comments
 
file renamed from light9/web/lib/bower.json to web/lib/bower.json
web/lib/onecolor.d.ts
Show inline comments
 
file renamed from light9/web/lib/onecolor.d.ts to web/lib/onecolor.d.ts
web/lib/parse-prometheus-text-format.d.ts
Show inline comments
 
file renamed from light9/web/lib/parse-prometheus-text-format.d.ts to web/lib/parse-prometheus-text-format.d.ts
web/lib/sylvester.d.ts
Show inline comments
 
file renamed from light9/web/lib/sylvester.d.ts to web/lib/sylvester.d.ts
web/lib/tapmodo-Jcrop-1902fbc/MIT-LICENSE.txt
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/MIT-LICENSE.txt to web/lib/tapmodo-Jcrop-1902fbc/MIT-LICENSE.txt
web/lib/tapmodo-Jcrop-1902fbc/README.md
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/README.md to web/lib/tapmodo-Jcrop-1902fbc/README.md
web/lib/tapmodo-Jcrop-1902fbc/css/Jcrop.gif
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/css/Jcrop.gif to web/lib/tapmodo-Jcrop-1902fbc/css/Jcrop.gif
Show images
web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.css
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.css to web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.css
web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.min.css
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.min.css to web/lib/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.min.css
web/lib/tapmodo-Jcrop-1902fbc/index.html
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/index.html to web/lib/tapmodo-Jcrop-1902fbc/index.html
web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.js
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.js to web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.js
web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.min.js
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.min.js to web/lib/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.min.js
web/lib/tapmodo-Jcrop-1902fbc/js/jquery.color.js
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/js/jquery.color.js to web/lib/tapmodo-Jcrop-1902fbc/js/jquery.color.js
web/lib/tapmodo-Jcrop-1902fbc/js/jquery.min.js
Show inline comments
 
file renamed from light9/web/lib/tapmodo-Jcrop-1902fbc/js/jquery.min.js to web/lib/tapmodo-Jcrop-1902fbc/js/jquery.min.js
web/light9-collector-client.html
Show inline comments
 
file renamed from light9/web/light9-collector-client.html to web/light9-collector-client.html
web/light9-color-picker.ts
Show inline comments
 
file renamed from light9/web/light9-color-picker.ts to web/light9-color-picker.ts
web/light9-color-picker_test.html
Show inline comments
 
file renamed from light9/web/light9-color-picker_test.html to web/light9-color-picker_test.html
web/light9-music.coffee
Show inline comments
 
file renamed from light9/web/light9-music.coffee to web/light9-music.coffee
web/light9-music.html
Show inline comments
 
file renamed from light9/web/light9-music.html to web/light9-music.html
web/light9-timeline-audio.ts
Show inline comments
 
file renamed from light9/web/light9-timeline-audio.ts to web/light9-timeline-audio.ts
web/light9-vidref-live.js
Show inline comments
 
file renamed from light9/web/light9-vidref-live.js to web/light9-vidref-live.js
web/light9-vidref-replay-stack.js
Show inline comments
 
file renamed from light9/web/light9-vidref-replay-stack.js to web/light9-vidref-replay-stack.js
web/light9-vidref-replay.js
Show inline comments
 
file renamed from light9/web/light9-vidref-replay.js to web/light9-vidref-replay.js
web/live/Effect.ts
Show inline comments
 
file renamed from light9/web/live/Effect.ts to web/live/Effect.ts
web/live/Light9AttrControl.ts
Show inline comments
 
file renamed from light9/web/live/Light9AttrControl.ts to web/live/Light9AttrControl.ts
web/live/Light9DeviceControl.ts
Show inline comments
 
file renamed from light9/web/live/Light9DeviceControl.ts to web/live/Light9DeviceControl.ts
web/live/Light9DeviceSettings.ts
Show inline comments
 
file renamed from light9/web/live/Light9DeviceSettings.ts to web/live/Light9DeviceSettings.ts
web/live/Light9Listbox.ts
Show inline comments
 
file renamed from light9/web/live/Light9Listbox.ts to web/live/Light9Listbox.ts
web/live/README.md
Show inline comments
 
file renamed from light9/web/live/README.md to web/live/README.md
web/live/index.html
Show inline comments
 
file renamed from light9/web/live/index.html to web/live/index.html
web/metrics/ServiceButtonRow.ts
Show inline comments
 
file renamed from light9/web/metrics/ServiceButtonRow.ts to web/metrics/ServiceButtonRow.ts
web/metrics/StatsLine.ts
Show inline comments
 
file renamed from light9/web/metrics/StatsLine.ts to web/metrics/StatsLine.ts
web/metrics/StatsProcess.ts
Show inline comments
 
file renamed from light9/web/metrics/StatsProcess.ts to web/metrics/StatsProcess.ts
web/metrics/index.html
Show inline comments
 
file renamed from light9/web/metrics/index.html to web/metrics/index.html
web/mime.types
Show inline comments
 
file renamed from light9/web/mime.types to web/mime.types
web/paint/bg1.jpg
Show inline comments
 
file renamed from light9/web/paint/bg1.jpg to web/paint/bg1.jpg
Show images
web/paint/bg2.jpg
Show inline comments
 
file renamed from light9/web/paint/bg2.jpg to web/paint/bg2.jpg
Show images
web/paint/bg3.jpg
Show inline comments
 
file renamed from light9/web/paint/bg3.jpg to web/paint/bg3.jpg
Show images
web/paint/index.html
Show inline comments
 
file renamed from light9/web/paint/index.html to web/paint/index.html
web/paint/paint-elements.coffee
Show inline comments
 
file renamed from light9/web/paint/paint-elements.coffee to web/paint/paint-elements.coffee
web/paint/paint-elements.html
Show inline comments
 
file renamed from light9/web/paint/paint-elements.html to web/paint/paint-elements.html
web/paint/paint-report-elements.html
Show inline comments
 
file renamed from light9/web/paint/paint-report-elements.html to web/paint/paint-report-elements.html
web/patch.test.ts
Show inline comments
 
file renamed from light9/web/patch.test.ts to web/patch.test.ts
web/patch.ts
Show inline comments
 
file renamed from light9/web/patch.ts to web/patch.ts
web/rdfdb-synced-graph_test.html
Show inline comments
 
file renamed from light9/web/rdfdb-synced-graph_test.html to web/rdfdb-synced-graph_test.html
web/rdfdbclient.ts
Show inline comments
 
file renamed from light9/web/rdfdbclient.ts to web/rdfdbclient.ts
web/resource-display_test.html
Show inline comments
 
file renamed from light9/web/resource-display_test.html to web/resource-display_test.html
web/show_specific.ts
Show inline comments
 
file renamed from light9/web/show_specific.ts to web/show_specific.ts
web/style.css
Show inline comments
 
file renamed from light9/web/style.css to web/style.css
web/timeline/Note.coffee
Show inline comments
 
file renamed from light9/web/timeline/Note.coffee to web/timeline/Note.coffee
web/timeline/Project.coffee
Show inline comments
 
file renamed from light9/web/timeline/Project.coffee to web/timeline/Project.coffee
web/timeline/TimeAxis.coffee
Show inline comments
 
file renamed from light9/web/timeline/TimeAxis.coffee to web/timeline/TimeAxis.coffee
web/timeline/TimeZoomed.coffee
Show inline comments
 
file renamed from light9/web/timeline/TimeZoomed.coffee to web/timeline/TimeZoomed.coffee
web/timeline/TimelineEditor.coffee
Show inline comments
 
file renamed from light9/web/timeline/TimelineEditor.coffee to web/timeline/TimelineEditor.coffee
web/timeline/adjustable.ts
Show inline comments
 
file renamed from light9/web/timeline/adjustable.ts to web/timeline/adjustable.ts
web/timeline/adjusters.ts
Show inline comments
 
file renamed from light9/web/timeline/adjusters.ts to web/timeline/adjusters.ts
web/timeline/brick_layout.ts
Show inline comments
 
file renamed from light9/web/timeline/brick_layout.ts to web/timeline/brick_layout.ts
web/timeline/index.html
Show inline comments
 
file renamed from light9/web/timeline/index.html to web/timeline/index.html
web/timeline/inline-attrs.coffee
Show inline comments
 
file renamed from light9/web/timeline/inline-attrs.coffee to web/timeline/inline-attrs.coffee
web/timeline/inline-attrs.html
Show inline comments
 
file renamed from light9/web/timeline/inline-attrs.html to web/timeline/inline-attrs.html
web/timeline/timeline-elements.ts
Show inline comments
 
file renamed from light9/web/timeline/timeline-elements.ts to web/timeline/timeline-elements.ts
web/timeline/viewstate.ts
Show inline comments
 
file renamed from light9/web/timeline/viewstate.ts to web/timeline/viewstate.ts
web/timeline/vite.config.ts
Show inline comments
 
file renamed from light9/web/timeline/vite.config.ts to web/timeline/vite.config.ts
web/timeline2/index.html
Show inline comments
 
file renamed from light9/web/timeline2/index.html to web/timeline2/index.html
web/timeline2/package.json
Show inline comments
 
file renamed from light9/web/timeline2/package.json to web/timeline2/package.json
web/vite.config.ts
Show inline comments
 
file renamed from light9/web/vite.config.ts to web/vite.config.ts
 
import { defineConfig } from "vite";
 

	
 
export default defineConfig({
 
  base: "/",
 
  root: "./light9/web",
 
  publicDir: "../../node_modules",
 
  root: "./web",
 
  publicDir: "../node_modules",
 
  server: {
 
    host: "0.0.0.0",
 
    strictPort: true,
 
    port: 8300,
 
    hmr: {
 
      port: 8301,
 
    },
 
  },
 
  clearScreen: false,
 
  define: {
 
    global: {},
 
  },
 
});
web/websocket.js
Show inline comments
 
file renamed from light9/web/websocket.js to web/websocket.js
0 comments (0 inline, 0 general)