def analyze_it(self):
"""
Wrapper for the ruby analysis script.
Executes and get results from files.
"""
FNULL = open(os.devnull, 'w')
args = ['ruby', 'analysis_tools/AnalyzeIt.rb', self.storage_file]
proc = Popen(args, stdin=FNULL, stdout=FNULL, stderr=FNULL)
proc.wait()
FNULL.close()
# TEXT report, just UTF-8 decode/parsing
fname = self.storage_file + '.txt'
if os.path.exists(fname):
data = open(fname, 'rb').read()
self.txt_report = re.sub(r'[^\x00-\x7F]', '', data).decode('utf-8')
return True
评论列表
文章目录