Mercurial > code > home > repos > homeauto
annotate lib/patchablegraph/browser_test.py @ 1562:c2ed44ed1e3c dependabot/pip/service/collector/twisted-19.7.0
Bump twisted from 19.2.0 to 19.7.0 in /service/collector
Bumps [twisted](https://github.com/twisted/twisted) from 19.2.0 to 19.7.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-19.2.0...twisted-19.7.0)
Signed-off-by: dependabot[bot] <support@github.com>
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
---|---|
date | Fri, 14 Feb 2020 10:01:26 +0000 |
parents | 9733063421e1 |
children |
rev | line source |
---|---|
1511
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
1 """ |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
2 see how a browser talks to this PatchableGraph |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
3 """ |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
4 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
5 from rdflib import Namespace, Literal, ConjunctiveGraph, URIRef, RDF |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
6 from twisted.internet import reactor |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
7 import cyclone.web |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
8 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
9 from standardservice.logsetup import log, verboseLogging |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
10 from patchablegraph import PatchableGraph, CycloneGraphEventsHandler, CycloneGraphHandler |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
11 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
12 verboseLogging(True) |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
13 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
14 graph = PatchableGraph() |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
15 g = ConjunctiveGraph() |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
16 g.add((URIRef('http://example.com/s'), |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
17 URIRef('http://example.com/p'), |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
18 URIRef('http://example.com/o'), |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
19 URIRef('http://example.com/g'))) |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
20 graph.setToGraph(g) |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
21 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
22 class Application(cyclone.web.Application): |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
23 def __init__(self): |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
24 handlers = [ |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
25 (r'/graph', CycloneGraphHandler, {'masterGraph': graph}), |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
26 (r'/graph/events', CycloneGraphEventsHandler, |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
27 {'masterGraph': graph}), |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
28 ] |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
29 cyclone.web.Application.__init__(self, handlers) |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
30 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
31 |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
32 reactor.listenTCP(8021, Application()) |
9733063421e1
add browser_test server for playing with /graph resource
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
33 reactor.run() |