jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
782B

  1. import libjack
  2. import state
  3. SESSION_PATH="/home/torbenh/jackSessions/"
  4. implicit_clients = ["system"]
  5. infra_clients = { "a2j": "a2jmidid" }
  6. cl=libjack.JackClient("bla")
  7. notify = cl.session_save( SESSION_PATH )
  8. g=cl.get_graph()
  9. for n in notify:
  10. c = g.get_client( n.clientname )
  11. c.set_commandline( n.commandline )
  12. sd = state.SessionDom()
  13. for c in g.clients.values():
  14. if c.get_commandline() == "":
  15. if not c.name in infra_clients.keys()+implicit_clients:
  16. g.remove_client( c.name )
  17. elif c.name in implicit_clients:
  18. g.remove_client_only( c.name )
  19. else:
  20. c.set_infra( infra_clients[c.name] )
  21. for i in g.clients.values():
  22. sd.add_client(i)
  23. f = file( SESSION_PATH+"session.xml", "w" )
  24. f.write( sd.get_xml() )
  25. f.close()
  26. print sd.get_xml()
  27. cl.close()