Skip to content

Instantly share code, notes, and snippets.

@Ram-Z
Last active August 29, 2015 14:15
Show Gist options
  • Save Ram-Z/f0e8b9329415b01276cf to your computer and use it in GitHub Desktop.
Save Ram-Z/f0e8b9329415b01276cf to your computer and use it in GitHub Desktop.
diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py
index 69f22f0..4dbcb5c 100644
--- a/qutebrowser/config/configtypes.py
+++ b/qutebrowser/config/configtypes.py
@@ -837,6 +837,7 @@ class Directory(BaseType):
return
else:
raise configexc.ValidationError(value, "may not be empty!")
+ value = os.path.expandvars(value)
value = os.path.expanduser(value)
if not os.path.isdir(value):
raise configexc.ValidationError(value, "must be a valid "
@@ -847,6 +848,7 @@ class Directory(BaseType):
def transform(self, value):
if not value:
return None
+ value = os.path.expandvars(value)
return os.path.expanduser(value)
@@ -1147,7 +1149,8 @@ class UserStyleSheet(File):
raise configexc.ValidationError(value, "must be a valid file!")
def transform(self, value):
- path = os.path.expanduser(value)
+ path = os.path.expandvars(value)
+ path = os.path.expanduser(path)
if not value:
return None
elif os.path.isabs(path):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment