diff options
author | kali <kali@leap.se> | 2013-03-20 19:31:24 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-03-21 21:18:54 +0900 |
commit | e33081871affdbca197ea77c461b1379b9039117 (patch) | |
tree | 74ca5ac92ceaf48ac5352762fcffa8db987454c1 /src/leap/config/prefixers.py | |
parent | 5be6aba659b8e7db486e985ac1bb98bdae53233f (diff) |
add darwin prefixer and launcher
Diffstat (limited to 'src/leap/config/prefixers.py')
-rw-r--r-- | src/leap/config/prefixers.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/leap/config/prefixers.py b/src/leap/config/prefixers.py index c65d8f53..ebcd49e7 100644 --- a/src/leap/config/prefixers.py +++ b/src/leap/config/prefixers.py @@ -77,6 +77,28 @@ class LinuxPrefixer(Prefixer): return os.getenv("LEAP_CLIENT_PATH", config_dir) +class DarwinPrefixer(Prefixer): + """ + Config prefixer for the Darwin platform + """ + + def get_path_prefix(self, standalone=False): + """ + Returns the platform dependant path prefixer. + This method expects an env variable named LEAP_CLIENT_PATH if + standalone is used. + + @param standalone: if True it will return the prefix for a + standalone application. Otherwise, it will return the system + default for configuration storage. + @type standalone: bool + """ + config_dir = BaseDirectory.xdg_config_home + if not standalone: + return config_dir + return os.getenv("LEAP_CLIENT_PATH", config_dir) + + if __name__ == "__main__": try: abs_prefixer = Prefixer() |