summaryrefslogtreecommitdiff
path: root/src/leap/config/prefixers.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-21 14:51:58 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-21 14:51:58 -0300
commit2b53c03c9acf42b240a57901ae1e6d4046f52fb2 (patch)
tree46d8f0e4e4665835f319103149fb7e419162fae5 /src/leap/config/prefixers.py
parent344abd42c6b480a783ee05b6e92532a1113a86d2 (diff)
parent9dace17a4b162c3fbef9909b6f8226903b0ad445 (diff)
Merge remote-tracking branch 'kali/feature/osx-eip-rewrite' into develop
Diffstat (limited to 'src/leap/config/prefixers.py')
-rw-r--r--src/leap/config/prefixers.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/leap/config/prefixers.py b/src/leap/config/prefixers.py
index 557a77ac..5a9b2112 100644
--- a/src/leap/config/prefixers.py
+++ b/src/leap/config/prefixers.py
@@ -77,6 +77,28 @@ class LinuxPrefixer(Prefixer):
return os.path.join(os.getcwd(), "config")
+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()