configurationengine/source/plugins/symbian/ConeProjectConverterPlugin/projectconvertplugin/convertproject.py
equal
deleted
inserted
replaced
696 |
696 |
697 def handleMapping(self, data, mapping): |
697 def handleMapping(self, data, mapping): |
698 """ |
698 """ |
699 """ |
699 """ |
700 retStr = data |
700 retStr = data |
701 if not mapping: mapping = {} |
701 if not mapping: mapping = {} |
702 if data != None: |
702 if data != None: |
703 merged = dict(mapping.items() + self._get_env_variables().items()) |
703 merged = dict(mapping.items() + self._get_env_variables().items()) |
704 for key in merged.keys(): |
704 for key in merged.keys(): |
705 retStr = retStr.replace(key, merged[key]) |
705 # Do a case-insensitive replace so that things work |
|
706 # both in Linux and Windows |
|
707 pattern = re.compile(re.escape(key), re.IGNORECASE) |
|
708 retStr = re.sub(pattern, lambda m: merged[key], retStr) |
706 |
709 |
707 return retStr |
710 return retStr |
708 |
711 |
709 def _get_env_variables(self): |
712 def _get_env_variables(self): |
710 if not hasattr(self, '_env_dict'): |
713 if not hasattr(self, '_env_dict'): |