Changeset - e69661cca1cb
[Not reviewed]
default
0 4 0
drewp@bigasterisk.com - 20 months ago 2023-05-18 18:56:28
drewp@bigasterisk.com
cleanup
4 files changed with 9 insertions and 8 deletions:
0 comments (0 inline, 0 general)
light9/collector/collector.py
Show inline comments
 
import logging
 
import time
 
from typing import Dict, List, Set, Tuple, Type, TypeVar, cast
 
from typing import Dict, List, Set, Tuple, cast
 

	
 
from rdfdb.syncedgraph.syncedgraph import SyncedGraph
 
from rdflib import Literal, URIRef
 
from rdflib import Literal
 

	
 
from light9.collector.device import resolve, toOutputAttrs
 
from light9.collector.output import Output as OutputInstance
 
@@ -19,8 +19,6 @@ def makeDmxMessageIndex(base: DmxIndex, 
 
    return DmxMessageIndex(base + offset - 1)
 

	
 

	
 

	
 

	
 
def outputMap(graph: SyncedGraph, outputs: List[OutputInstance]) -> Dict[Tuple[DeviceUri, OutputAttr], Tuple[OutputInstance, DmxMessageIndex]]:
 
    """From rdf config graph, compute a map of
 
       (device, outputattr) : (output, index)
light9/fade/web/Light9FadeUi.ts
Show inline comments
 
@@ -5,7 +5,7 @@ import { customElement, property } from 
 
import { NamedNode } from "n3";
 
import { getTopGraph } from "../../web/RdfdbSyncedGraph";
 
import { SyncedGraph } from "../../web/SyncedGraph";
 
import { shortShow, showRoot } from "light9/web/show_specific";
 
import { shortShow, showRoot } from "../../web/show_specific";
 
export { EditChoice } from "../../web/EditChoice";
 

	
 
provideFASTDesignSystem().register(fastSlider(), fastSliderLabel());
 
@@ -60,6 +60,8 @@ export class Light9Fader extends LitElem
 
    css`
 
      :host {
 
        display: inline-block;
 
        border: 2px gray outset;
 
        background: #272727;
 
      }
 
      fast-slider {
 
        height: 256px;
light9/fade/web/index.html
Show inline comments
 
@@ -3,7 +3,7 @@
 
  <head>
 
    <title>fade</title>
 
    <meta charset="utf-8" />
 
    <link rel="stylesheet" href="./style.css">    
 
    <link rel="stylesheet" href="../style.css">    
 
    <script type="module" src="../fade/Light9FadeUi"></script>
 
  </head>
 
  <body>
light9/newtypes.py
Show inline comments
 
@@ -24,7 +24,7 @@ OutputRange = NewType('OutputRange', Tup
 
_ObjType = TypeVar('_ObjType')
 

	
 

	
 
def _isSubclass2(t1: Type, t2: type) -> bool:
 
def _isSubclass2(t1: Type, t2: Type) -> bool:
 
    """same as issubclass but t1 can be a NewType"""
 
    if hasattr(t1, '__supertype__'):
 
        t1 = t1.__superType__
 
@@ -32,7 +32,8 @@ def _isSubclass2(t1: Type, t2: type) -> 
 

	
 

	
 
def typedValue(objType: Type[_ObjType], graph, subj, pred) -> _ObjType:
 
    """graph.value(subj, pred) with a given return type. If objType is """
 
    """graph.value(subj, pred) with a given return type. 
 
    If objType is not an rdflib.Node, we toPython() the value."""
 
    obj = graph.value(subj, pred)
 
    if obj is None:
 
        raise ValueError()
0 comments (0 inline, 0 general)