Mercurial > code > home > repos > homeauto
diff service/store/store.py @ 1261:1431cd58803d
change port, put to /values, build updates
Ignore-this: 8ebe7c9293d7ae47f6de73677053cafb
darcs-hash:d871c2ddabe6bf403fc15c7f56a7325a98d45b71
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 20 Apr 2019 23:30:31 -0700 |
parents | c1792115b1d3 |
children | 92cb3245fdd1 |
line wrap: on
line diff
--- a/service/store/store.py Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/store.py Sat Apr 20 23:30:31 2019 -0700 @@ -23,17 +23,17 @@ CTX = ROOM['stored'] -class OutputPage(cyclone.web.RequestHandler): +class ValuesResource(cyclone.web.RequestHandler): def put(self): arg = self.request.arguments if arg.get('s') and arg.get('p'): self._onQueryStringStatement(arg['s'][-1], arg['p'][-1], self.request.body) else: self._onGraphBodyStatements(self.request.body, self.request.headers) - + post = put def _onQueryStringStatement(self, s, p, body): - subj = URIRef(arg['s'][-1]) - pred = URIRef(arg['p'][-1]) + subj = URIRef(s) + pred = URIRef(p) turtleLiteral = self.request.body try: obj = Literal(float(turtleLiteral)) @@ -77,14 +77,14 @@ if dbFile.exists(): masterGraph._graph.parse(dbFile.open(), format='nquads') - port = 10014 + port = 10015 reactor.listenTCP(port, cyclone.web.Application([ (r"/()", cyclone.web.StaticFileHandler, {"path": ".", "default_filename": "index.html"}), (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}), (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}), - (r'/output', OutputPage), + (r'/values', ValuesResource), ], masterGraph=masterGraph, dbFile=dbFile, debug=arg['-v']), interface='::') log.warn('serving on %s', port)