#cache expansions of constant strings
cexpand={}
def varexpand(mystring,mydict={}):
def varexpand(mystring, mydict={}, remove_quotes=False):
newstring = cexpand.get(" "+mystring, None)
if newstring is not None:
return newstring
if (indoub):
newstring=newstring+"'"
else:
if not remove_quotes:
newstring += "'"
insing=not insing
pos=pos+1
continue
if (insing):
newstring=newstring+'"'
newstring += '"'
indoub=not indoub