diff --git a/src/Utils.py b/src/Utils.py index 1e4cfc014..4ba5ff420 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -47,7 +47,7 @@ import gen.lib import Errors from GrampsLocale import codeset -from const import TEMP_DIR, USER_HOME, WINDOWS +from const import TEMP_DIR, USER_HOME, WINDOWS, MACOS, LINUX from TransUtils import sgettext as _ #------------------------------------------------------------------------- @@ -210,6 +210,37 @@ def family_upper_name(family, db): name = mother.get_primary_name().get_upper_name() return name +#------------------------------------------------------------------------- +# +# Platform determination functions +# +#------------------------------------------------------------------------- + +def lin(): + """ + Return True if a linux system + Note: Normally do as linux in else statement of a check ! + """ + if platform.system() in LINUX: + return True + return False + +def mac(): + """ + Return True if a Macintosh system + """ + if platform.system() in MACOS: + return True + return False + +def win(): + """ + Return True if a windows system + """ + if platform.system() in WINDOWS: + return True + return False + #------------------------------------------------------------------------- # # String Encoding functions