コード例 #1
0
ファイル: abc.py プロジェクト: Leiguangr/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
コード例 #2
0
ファイル: abc.py プロジェクト: 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
コード例 #3
0
ファイル: test262.py プロジェクト: tschneidereit/test262
 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]
コード例 #4
0
ファイル: test262.py プロジェクト: RexSong/test262
 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]