summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorTorben Hohn <torbenh@gmx.de>2009-11-28 12:17:43 +0100
committerTorben Hohn <torbenh@gmx.de>2009-11-28 12:17:43 +0100
commit1c2a7759443817cc7d5c5aa927b5be2ff5afd22c (patch)
treedbddcdf7946907c9d94803a907b76950245e1fd5 /python
parent3b0aa9b9938c84c5ec9ae8d4c1a418fbedcce0d3 (diff)
downloadjack1-1c2a7759443817cc7d5c5aa927b5be2ff5afd22c.tar.gz
remove sessionload and sessionsave... merged into sessionmanager
Diffstat (limited to 'python')
-rw-r--r--python/sessionload.py73
-rw-r--r--python/sessionsave.py38
2 files changed, 0 insertions, 111 deletions
diff --git a/python/sessionload.py b/python/sessionload.py
deleted file mode 100644
index 8f0aee3..0000000
--- a/python/sessionload.py
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-import libjack
-import state
-import subprocess
-
-SESSION_PATH="/home/torbenh/jackSessions/"
-
-sd = state.SessionDom( SESSION_PATH+"session.xml" )
-
-cl=libjack.JackClient("bla5")
-g=cl.get_graph()
-
-children = []
-
-for ic in sd.get_infra_clients():
- if not ic[0] in g.clients.keys():
- children.append( subprocess.Popen( ic[1], shell=True ) )
-
-
-print sd.get_client_names()
-
-g.ensure_clientnames( sd.get_reg_client_names() )
-
-# get graph again... renaming isnt prefect yet.
-g=cl.get_graph()
-# build up list of port connections
-
-conns = []
-for p in sd.get_port_names():
- for c in sd.get_connections_for_port( p ):
- conns.append( (p,c) )
-print conns
-
-# now fire up the processes
-for cname in sd.get_reg_client_names():
- cmd = sd.get_commandline_for_client( cname )
- children.append( subprocess.Popen( cmd, shell=True ) )
-
-avail_ports = g.get_port_list()
-# wait for ports to appear, and connect em.
-
-while len(conns) > 0:
- p = cl.port_queue.get()
- print p[0],p[1]
- pname = libjack.port_name(p[0])
- for c1 in conns:
- if c1[0]==pname:
- if c1[1] in avail_ports:
- cl.connect( pname, c1[1] )
-
- conns.remove( c1 )
- if (c1[1],c1[0]) in conns:
- conns.remove( (c1[1],c1[0]) )
-
- break
-
- if c1[1]==pname:
- if c1[0] in avail_ports:
- cl.connect( pname, c1[0] )
-
- conns.remove( c1 )
- if (c1[1],c1[0]) in conns:
- conns.remove( (c1[1],c1[0]) )
-
- break
-
- avail_ports.append( pname )
-
-
-print "session restored... exiting"
-cl.close()
-
diff --git a/python/sessionsave.py b/python/sessionsave.py
deleted file mode 100644
index d897793..0000000
--- a/python/sessionsave.py
+++ /dev/null
@@ -1,38 +0,0 @@
-
-import libjack
-import state
-
-SESSION_PATH="/home/torbenh/jackSessions/"
-implicit_clients = ["system"]
-infra_clients = { "a2j": "a2jmidid" }
-
-cl=libjack.JackClient("bla")
-notify = cl.session_save( SESSION_PATH )
-g=cl.get_graph()
-
-for n in notify:
- c = g.get_client( n.clientname )
- c.set_commandline( n.commandline )
-
-sd = state.SessionDom()
-
-for c in g.clients.values():
- if c.get_commandline() == "":
- if not c.name in infra_clients.keys()+implicit_clients:
- g.remove_client( c.name )
- elif c.name in implicit_clients:
- g.remove_client_only( c.name )
- else:
- c.set_infra( infra_clients[c.name] )
-
-
-for i in g.clients.values():
- sd.add_client(i)
-
-f = file( SESSION_PATH+"session.xml", "w" )
-f.write( sd.get_xml() )
-f.close()
-
-print sd.get_xml()
-
-cl.close()