Example #1
0
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
Example #2
0
File: abc.py Project: kurtjcu/Js2Py
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
Example #3
0
 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]
Example #4
0
 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]