浏览代码

Making replacements respect the old __home__ convention

Andrej 1 年之前
父节点
当前提交
e605512f15
共有 1 个文件被更改,包括 4 次插入0 次删除
  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))