changeset 1698:f140153c087c

bring back clientsession which doesn't belong in rdfdb Ignore-this: 706126cc1ce1a17823bf04a6d4523a6
author Drew Perttula <drewp@bigasterisk.com>
date Thu, 26 Apr 2018 08:21:31 +0000
parents 5c04a54df635
children bbe05d5c6a8f
files bin/curvecalc bin/effectsequencer bin/inputdemo bin/keyboardcomposer bin/paintserver bin/subcomposer light9/clientsession.py
diffstat 7 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/curvecalc	Thu Apr 26 08:21:31 2018 +0000
@@ -41,7 +41,7 @@
 from light9.gtkpyconsole import togglePyConsole
 from light9.namespaces import L9
 from light9.observable import Observable
-from rdfdb import clientsession
+from light9 import clientsession
 from rdfdb.patch import Patch
 from rdfdb.syncedgraph import SyncedGraph
 from light9.wavelength import wavelength
--- a/bin/effectsequencer	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/effectsequencer	Thu Apr 26 08:21:31 2018 +0000
@@ -13,7 +13,7 @@
 import cyclone.web
 from rdflib import URIRef
 from light9.effect.sequencer import Sequencer, sendToCollector
-from rdfdb import clientsession
+from light9 import clientsession
 
 class App(object):
     def __init__(self, show, session):
--- a/bin/inputdemo	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/inputdemo	Thu Apr 26 08:21:31 2018 +0000
@@ -9,7 +9,7 @@
 from gi.repository import Gtk
 from run_local import log
 from light9 import showconfig, networking
-from rdfdb import clientsession
+from light9 import clientsession
 from rdfdb.syncedgraph import SyncedGraph
 import cyclone.httpclient
 from light9.curvecalc.client import sendLiveInputPoint
--- a/bin/keyboardcomposer	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/keyboardcomposer	Thu Apr 26 08:21:31 2018 +0000
@@ -17,7 +17,7 @@
 from light9.uihelpers import toplevelat
 from light9.namespaces import L9, RDF, RDFS
 from light9.tkdnd import initTkdnd, dragSourceRegister, dropTargetRegister
-from rdfdb import clientsession
+from light9 import clientsession
 from rdfdb.syncedgraph import SyncedGraph
 from light9.effect.sequencer import CodeWatcher
 import light9.effect.effecteval
--- a/bin/paintserver	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/paintserver	Thu Apr 26 08:21:31 2018 +0000
@@ -11,7 +11,7 @@
 import optparse, sys, logging
 import cyclone.web
 from rdflib import URIRef
-from rdfdb import clientsession
+from light9 import clientsession
 import light9.paint.solve
 from lib.cycloneerr import PrettyErrorHandler
 from light9.namespaces import RDF, L9, DEV
--- a/bin/subcomposer	Thu Apr 26 08:20:19 2018 +0000
+++ b/bin/subcomposer	Thu Apr 26 08:21:31 2018 +0000
@@ -34,7 +34,7 @@
 from light9.Patch import get_channel_name
 from light9.uihelpers import toplevelat
 from rdfdb.syncedgraph import SyncedGraph
-from rdfdb import clientsession
+from light9 import clientsession
 from light9.tkdnd import initTkdnd
 from light9.namespaces import L9
 from rdfdb.patch import Patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/light9/clientsession.py	Thu Apr 26 08:21:31 2018 +0000
@@ -0,0 +1,17 @@
+"""
+some clients will support the concept of a named session that keeps
+multiple instances of that client separate
+"""
+from rdflib import URIRef
+from urllib import quote
+from light9 import showconfig
+
+def add_option(parser):
+    parser.add_option(
+        '-s', '--session',
+        help="name of session used for levels and window position",
+        default='default')
+
+def getUri(appName, opts):
+    return URIRef("%s/sessions/%s/%s" % (showconfig.showUri(), appName,
+                                         quote(opts.session, safe='')))