Explorar el Código

Making replacements respect the old __home__ convention

Andrej hace 1 año
padre
commit
e605512f15
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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))