Mercurial > code > home > repos > light9
annotate bin/captureDevice @ 1866:3c523c71da29
pyflakes cleanups and some refactors
Ignore-this: f7372e678699175feb4e628eee3d768c
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 25 May 2019 12:10:51 +0000 |
parents | 40cc863d2b63 |
children | 1a7e5b07bf17 |
rev | line source |
---|---|
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
1 #!bin/python |
1859
f066d6e874db
2to3 with these fixers: all idioms set_literal
drewp@bigasterisk.com
parents:
1858
diff
changeset
|
2 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
3 from rdflib import URIRef |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
4 from twisted.internet import reactor |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
5 from twisted.internet.defer import inlineCallbacks, Deferred |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
6 |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
7 import logging |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
8 import optparse |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
9 import os |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
10 import time |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
11 import treq |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
12 import cyclone.web, cyclone.websocket, cyclone.httpclient |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
13 from greplin import scales |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
14 |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
15 from run_local import log |
1861 | 16 from cycloneerr import PrettyErrorHandler |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
17 |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
18 from light9.namespaces import L9, RDF |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
19 from light9 import networking, showconfig |
1692 | 20 from rdfdb.syncedgraph import SyncedGraph |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
21 from light9.paint.capture import writeCaptureDescription |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
22 from light9.greplin_cyclone import StatsForCyclone |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
23 from light9.effect.settings import DeviceSettings |
1830 | 24 from light9.collector.collector_client import sendToCollector |
1692 | 25 from rdfdb.patch import Patch |
1866
3c523c71da29
pyflakes cleanups and some refactors
Drew Perttula <drewp@bigasterisk.com>
parents:
1861
diff
changeset
|
26 from light9.zmqtransport import parseJsonMessage |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
27 |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
28 stats = scales.collection('/webServer', scales.PmfStat('setAttr')) |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
29 |
1858 | 30 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
31 class Camera(object): |
1858 | 32 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
33 def __init__(self, imageUrl): |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
34 self.imageUrl = imageUrl |
1858 | 35 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
36 def takePic(self, uri, writePath): |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
37 log.info('takePic %s', uri) |
1858 | 38 return treq.get( |
39 self.imageUrl).addCallbacks(lambda r: self._done(writePath, r), | |
40 log.error) | |
41 | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
42 @inlineCallbacks |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
43 def _done(self, writePath, response): |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
44 jpg = yield response.content() |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
45 try: |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
46 os.makedirs(os.path.dirname(writePath)) |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
47 except OSError: |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
48 pass |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
49 with open(writePath, 'w') as out: |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
50 out.write(jpg) |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
51 log.info('wrote %s', writePath) |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
52 |
1858 | 53 |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
54 def deferSleep(sec): |
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
55 d = Deferred() |
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
56 reactor.callLater(sec, d.callback, None) |
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
57 return d |
1858 | 58 |
59 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
60 class Capture(object): |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
61 firstMoveTime = 3 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
62 settleTime = .5 |
1858 | 63 |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
64 def __init__(self, graph, dev): |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
65 self.graph = graph |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
66 self.dev = dev |
1858 | 67 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
68 def steps(a, b, n): |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
69 return [round(a + (b - a) * i / n, 5) for i in range(n)] |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
70 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
71 startTime = time.time() |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
72 self.captureId = 'cap%s' % (int(startTime) - 1495170000) |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
73 self.toGather = [] |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
74 |
1625 | 75 #quantum |
76 rxSteps = steps(.06, .952, 10) | |
77 rySteps = steps(0.1, .77, 5) | |
78 zoomSteps = steps(.12, .85, 3) | |
79 # aura | |
80 rxSteps = steps(0.15, .95, 10) | |
81 rySteps = steps(0, .9, 5) | |
1858 | 82 zoomSteps = steps(.6, .9, 3) |
83 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
84 row = 0 |
1625 | 85 for ry in rySteps: |
86 xSteps = rxSteps[:] | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
87 if row % 2: |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
88 xSteps.reverse() |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
89 row += 1 |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
90 for rx in xSteps: |
1625 | 91 for zoom in zoomSteps: |
1858 | 92 self.toGather.append( |
93 DeviceSettings( | |
94 graph, | |
95 [ | |
96 (dev, L9['rx'], rx), | |
97 (dev, L9['ry'], ry), | |
98 (dev, L9['color'], '#ffffff'), | |
99 (dev, L9['zoom'], zoom), | |
100 #(dev, L9['focus'], 0.13), | |
101 ])) | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
102 |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
103 self.devTail = dev.rsplit('/')[-1] |
1858 | 104 self.session = URIRef('/'.join( |
105 [showconfig.showUri(), 'capture', self.devTail, self.captureId])) | |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
106 self.ctx = URIRef(self.session + '/index') |
1858 | 107 |
108 self.graph.patch( | |
109 Patch(addQuads=[ | |
110 (self.session, RDF.type, L9['CaptureSession'], self.ctx), | |
111 ])) | |
112 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
113 self.numPics = 0 |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
114 self.settingsCache = set() |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
115 self.step().addErrback(log.error) |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
116 |
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
117 def off(self): |
1858 | 118 return sendToCollector(client='captureDevice', |
119 session='main', | |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
120 settings=DeviceSettings(self.graph, [])) |
1858 | 121 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
122 @inlineCallbacks |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
123 def step(self): |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
124 if not self.toGather: |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
125 yield self.off() |
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
126 yield deferSleep(1) |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
127 reactor.stop() |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
128 return |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
129 settings = self.toGather.pop() |
1858 | 130 |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
131 log.info('[%s left] move to %r', len(self.toGather), settings) |
1858 | 132 yield sendToCollector(client='captureDevice', |
133 session='main', | |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
134 settings=settings) |
1858 | 135 |
136 yield deferSleep(self.firstMoveTime if self.numPics == | |
137 0 else self.settleTime) | |
138 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
139 picId = 'pic%s' % self.numPics |
1858 | 140 path = '/'.join(['capture', self.devTail, self.captureId, picId |
141 ]) + '.jpg' | |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
142 uri = URIRef(self.session + '/' + picId) |
1858 | 143 |
1584
2239d5648932
captureDevice saves all pics
Drew Perttula <drewp@bigasterisk.com>
parents:
1553
diff
changeset
|
144 yield camera.takePic(uri, os.path.join(showconfig.root(), path)) |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
145 self.numPics += 1 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
146 |
1585
17da56a3c8df
group device captures into sessions, limit solver to specific ones
Drew Perttula <drewp@bigasterisk.com>
parents:
1584
diff
changeset
|
147 writeCaptureDescription(self.graph, self.ctx, self.session, uri, |
1858 | 148 self.dev, path, self.settingsCache, settings) |
149 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
150 reactor.callLater(0, self.step) |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
151 |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
152 |
1858 | 153 camera = Camera( |
154 'http://plus:8200/picamserve/pic?res=1080&resize=800&iso=800&redgain=1.6&bluegain=1.6&shutter=60000&x=0&w=1&y=0&h=.952' | |
155 ) | |
156 | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
157 |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
158 class Attrs(PrettyErrorHandler, cyclone.web.RequestHandler): |
1858 | 159 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
160 def put(self): |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
161 with stats.setAttr.time(): |
1858 | 162 client, clientSession, settings, sendTime = parseJsonMessage( |
163 self.request.body) | |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
164 self.set_status(202) |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
165 |
1858 | 166 |
1552
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
167 def launch(graph): |
0aad247a1168
refactor and fix captureDevice
Drew Perttula <drewp@bigasterisk.com>
parents:
1544
diff
changeset
|
168 |
1625 | 169 cap = Capture(graph, dev=L9['device/aura5']) |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
170 reactor.listenTCP(networking.captureDevice.port, |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
171 cyclone.web.Application(handlers=[ |
1858 | 172 (r'/()', cyclone.web.StaticFileHandler, { |
173 "path": "light9/web", | |
174 "default_filename": "captureDevice.html" | |
175 }), | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
176 (r'/stats', StatsForCyclone), |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
177 ]), |
1866
3c523c71da29
pyflakes cleanups and some refactors
Drew Perttula <drewp@bigasterisk.com>
parents:
1861
diff
changeset
|
178 interface='::', |
3c523c71da29
pyflakes cleanups and some refactors
Drew Perttula <drewp@bigasterisk.com>
parents:
1861
diff
changeset
|
179 cap=cap) |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
180 log.info('serving http on %s', networking.captureDevice.port) |
1858 | 181 |
182 | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
183 def main(): |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
184 parser = optparse.OptionParser() |
1858 | 185 parser.add_option("-v", |
186 "--verbose", | |
187 action="store_true", | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
188 help="logging.DEBUG") |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
189 (options, args) = parser.parse_args() |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
190 log.setLevel(logging.DEBUG if options.verbose else logging.INFO) |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
191 |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
192 graph = SyncedGraph(networking.rdfdb.url, "captureDevice") |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
193 |
1858 | 194 graph.initiallySynced.addCallback(lambda _: launch(graph)).addErrback( |
195 log.error) | |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
196 reactor.run() |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
197 |
1858 | 198 |
1544
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
199 if __name__ == '__main__': |
fc5675f5b756
captureDevice tool for sweeping through light settings and grabbing pics
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
200 main() |