Kaydet (Commit) ef4455f5 authored tarafından Hakan Dündar's avatar Hakan Dündar

Several code simplifications

üst a1aac25e
This diff is collapsed.
......@@ -357,10 +357,10 @@ class UsersDetails:
etc_passwd_lines, user_group_names, user_group_ids = Users.users_groups_func()
# Get all user process PIDs and elapsed times (seconds) since they are started.
command_list = ["ps", "--no-headers", "-eo", "pid,etimes,user"]
if Config.environment_type == "flatpak":
ps_output_lines = (subprocess.check_output(["flatpak-spawn", "--host", "ps", "--no-headers", "-eo", "pid,etimes,user"], shell=False)).decode().strip().split("\n")
else:
ps_output_lines = (subprocess.check_output(["ps", "--no-headers", "-eo", "pid,etimes,user"], shell=False)).decode().strip().split("\n")
command_list = ["flatpak-spawn", "--host"] + command_list
ps_output_lines = (subprocess.run(command_list, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)).stdout.decode().strip().split("\n")
# Get user process PIDs, logged in users and user start times.
pid_list = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment