22 Gather the apps defined used in a session.
24 if session_name ==
"":
25 session_dals = confdb.get_dals(class_name=
"Session")
26 if len(session_dals) == 0:
27 print(f
"Error could not find any Session in file {confdb.databases}")
29 session = session_dals[0]
32 session = confdb.get_dal(
"Session", session_name)
34 print(f
"Error could not find Session {session_name} in file {confdb.databases}")
37 segment = session.segment
61 """Script to enable or disable (-d) Resources from the first Session of the
62 specified OKS database file"""
63 if session_name ==
"":
64 session_dals = db.get_dals(class_name=
"Session")
65 if len(session_dals) == 0:
66 print(f
"Error could not find any Session in file {db.databases}")
68 session = session_dals[0]
71 session = db.get_dal(
"Session", session_name)
73 print(f
"Error could not find Session {session_name} in file {db.databases}")
76 disabled = session.disabled
79 res_dal = db.get_dal(
"ResourceBase", res)
81 print(f
"Error could not find Resource {res} in file {db.databases}")
85 if res_dal
in disabled:
87 f
"{res} is already in disabled relationship of Session {session.id}"
91 print(f
"Adding {res} to disabled relationship of Session {session.id}")
92 disabled.append(res_dal)
94 if res_dal
not in disabled:
95 print(f
"{res} is not in disabled relationship of Session {session.id}")
99 f
"Removing {res} from disabled relationship of Session {session.id}"
101 disabled.remove(res_dal)
102 session.disabled = disabled
103 db.update_dal(session)