summaryrefslogtreecommitdiff
path: root/src/leap/config/prefixers.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-21 13:39:09 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-22 13:05:03 -0300
commitd1dbe61039cb318efcf239dd9bf47fdbd82922d7 (patch)
tree7c17fe2cf89cce47ddd04bc1fbac67736dda085f /src/leap/config/prefixers.py
parent2b53c03c9acf42b240a57901ae1e6d4046f52fb2 (diff)
Add Windows prefixer
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 5a9b2112..460e5b46 100644
--- a/src/leap/config/prefixers.py
+++ b/src/leap/config/prefixers.py
@@ -99,6 +99,28 @@ class DarwinPrefixer(Prefixer):
return os.getenv("LEAP_CLIENT_PATH", config_dir)
+class WindowsPrefixer(Prefixer):
+ """
+ Config prefixer for the Windows 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.path.join(os.getcwd(), "config")
+
if __name__ == "__main__":
try:
abs_prefixer = Prefixer()