def get_include(name): path = '/Users/PiotrDabkowski/PycharmProjects/Js2Py/tests/test262/harness/' + name f = open(path) contents = stripHeader(f.read()) contents = re.sub(r'\r\n', '\n', contents) res = contents + "\n" f.close() return res
def GetInclude(self, name): if not name in self.include_cache: static = path.join(self.lib_root, name) if path.exists(static): f = open(static) contents = stripHeader(f.read()) contents = re.sub(r'\r\n', '\n', contents) self.include_cache[name] = contents + "\n" f.close() else: ReportError("Can't find: " + static) return self.include_cache[name]