Fix for wrong path for settings json files (#258)

Co-authored-by: AAGaming <aa@mail.catvibers.me>
This commit is contained in:
Marco Rodolfi
2022-11-20 01:34:38 +01:00
committed by GitHub
parent 1e02fcf394
commit 5d8601347a
2 changed files with 30 additions and 4 deletions
+10
View File
@@ -1,3 +1,5 @@
import grp
import pwd
import re
import ssl
import subprocess
@@ -56,6 +58,14 @@ def get_user() -> str:
raise ValueError("helpers.get_user method called before user variable was set. Run helpers.set_user first.")
return user
#Get the user owner of the given file path.
def get_user_owner(file_path) -> str:
return pwd.getpwuid(os.stat(file_path).st_uid)[0]
#Get the user group of the given file path.
def get_user_group(file_path) -> str:
return grp.getgrgid(os.stat(file_path).st_gid)[0]
# Set the global user group. get_user must be called first
def set_user_group() -> str:
global group