Ejemplo n.º 1
0
    def save(self):
        raise NotImplementedError("obsolete?")
        if self.temporary:
            log.info("not saving temporary sub named %s",self.name)
            return

        graph = Graph()
        subUri = L9['sub/%s' % self.name]
        graph.add((subUri, RDFS.label, Literal(self.name)))
        for chan in self.levels.keys():
            try:
                chanUri = get_channel_uri(chan)
            except KeyError:
                log.error("saving dmx channels with no :Channel node "
                          "is not supported yet. Give channel %s a URI "
                          "for it to be saved. Omitting this channel "
                          "from the sub." % chan)
                continue
            lev = BNode()
            graph.add((subUri, L9['lightLevel'], lev))
            graph.add((lev, L9['channel'], chanUri))
            graph.add((lev, L9['level'],
                       Literal(self.levels[chan], datatype=XSD['decimal'])))

        graph.serialize(showconfig.subFile(self.name), format="nt")