Browse Source

Making replacements respect the old __home__ convention

Andrej 1 year ago
parent
commit
e605512f15
1 changed files with 4 additions and 0 deletions
  1. 4 0
      parseConfig.py

+ 4 - 0
parseConfig.py

@@ -34,6 +34,10 @@ def replacePattern(v,setup=None):
    print('Replacing v={}'.format(v))
 
    #local HOME variable of the user executing the code
+   if v.find('__home__')>-1: 
+      x=re.sub(r'__home__',os.path.expanduser('~'),v)
+      print('Matching home {}->{}'.format(v,x))
+      return x
    if v.find('__[env]home__')>-1:
       x=re.sub(r'__\[env\]home__',os.path.expanduser('~'),v)
       print('Matching home {}->{}'.format(v,x))