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.

36 lines
697B

  1. import libjack
  2. import state
  3. SESSION_PATH="/home/torbenh/jackSessions/"
  4. implicit_clients = ["system"]
  5. infra_clients = ["system"]
  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. for c in g.clients.values():
  13. if c.get_commandline() == "":
  14. if not c.name in infra_clients:
  15. g.remove_client( c.name )
  16. elif c.name in implicit_clients:
  17. g.remove_client_only( c.name )
  18. sd = state.SessionDom()
  19. for i in g.clients.values():
  20. sd.add_client(i)
  21. f = file( SESSION_PATH+"session.xml", "w" )
  22. f.write( sd.get_xml() )
  23. f.close()
  24. print sd.get_xml()
  25. cl.close()