Changeset - 63952949106b
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 21 months ago 2023-05-31 08:19:57
drewp@bigasterisk.com
move decimalLiteral
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/effect/settings_test.py
Show inline comments
 
@@ -4,17 +4,13 @@ from typing import cast
 
from rdfdb.patch import Patch
 
from rdflib import Literal
 

	
 
from light9.effect.settings import DeviceSettings
 
from light9.localsyncedgraph import LocalSyncedGraph
 
from light9.namespaces import DEV, L9
 
from light9.newtypes import DeviceAttr, DeviceUri, HexColor, VTUnion
 

	
 

	
 
def decimalLiteral(value):
 
    return Literal(value, datatype='http://www.w3.org/2001/XMLSchema#decimal')
 
from light9.newtypes import DeviceAttr, DeviceUri, HexColor, VTUnion, decimalLiteral
 

	
 

	
 
class TestDeviceSettings(unittest.TestCase):
 

	
 
    def setUp(self):
 
        self.graph = LocalSyncedGraph(files=['test/cam/lightConfig.n3', 'test/cam/bg.n3'])
light9/newtypes.py
Show inline comments
 
from typing import NewType, Tuple, TypeVar, Union
 

	
 
from rdflib import URIRef
 
from rdflib import Literal, URIRef
 

	
 
ClientType = NewType('ClientType', str)
 
ClientSessionType = NewType('ClientSessionType', str)
 
Curve = NewType('Curve', URIRef)
 
OutputUri = NewType('OutputUri', URIRef)  # e.g. dmxA
 
DeviceUri = NewType('DeviceUri', URIRef)  # e.g. :aura2
 
@@ -34,6 +34,10 @@ OutputRange = NewType('OutputRange', Tup
 

	
 
def uriTail(u: URIRef) -> str:
 
    tail = u.rstrip('/').rsplit('/', 1)[1]
 
    if not tail:
 
        tail = str(u)
 
    return tail
 

	
 

	
 
def decimalLiteral(value):
 
    return Literal(value, datatype='http://www.w3.org/2001/XMLSchema#decimal')
0 comments (0 inline, 0 general)