Skip to content

Commit

Permalink
Updated function name and removed unnecessary commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
calexandru2018 committed Jun 1, 2020
1 parent c03f4d6 commit bf8d850
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions linux_gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def get_gui_processes():

return processes

def check_polkit_exists():
def is_polkit_installed():
"""Checks for polkit/pkexec and sets to it if found.
"""
process = subprocess.run(["which", "pkexec"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
Expand All @@ -244,22 +244,6 @@ def check_polkit_exists():
if process.returncode == 0 and process.stdout.decode().strip("\n").split("/")[-1:][0] == "pkexec":
return_response = True

gui_logger.debug(">>> TRAY check_polkit_exists reponse: {}.".format(process))
gui_logger.debug(">>> {}.".format(process))

return return_response

# sudo_type = "sudo"
# if process.returncode == 0 and process.stdout.decode().strip("\n").split("/")[-1:][0] == "pkexec":
# gui_logger.debug(">>> TRAY PolKit/pkexec found.")
# try:
# sudo_type = get_gui_config("tray_tab", "run_commands_as")
# if sudo_type == "1":
# sudo_type = "pkexec"
# except KeyError:
# gui_logger.debug("[!] Could not get value from configurations file")

# return sudo_type




0 comments on commit bf8d850

Please sign in to comment.