소스 검색

Catch warnings when kniting files

wilsonfreitas 8 년 전
부모
커밋
0d2ef44896
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      rmd_reader/rmd_reader.py

+ 3 - 1
rmd_reader/rmd_reader.py

@@ -92,7 +92,9 @@ render_markdown()
 hook_plot <- knit_hooks$get('plot')
 knit_hooks$set(plot=function(x, options) hook_plot(paste0("{{filename}}/", x), options))
             '''.format(unnamed_chunk_label=chunk_label))
-        knitr.knit(filename, md_filename, quiet=QUIET, encoding=ENCODING)
+        with warnings.catch_warnings():
+            warnings.simplefilter("ignore")
+            knitr.knit(filename, md_filename, quiet=QUIET, encoding=ENCODING)
         # read md file - create a MarkdownReader
         md_reader = readers.MarkdownReader(self.settings)
         content, metadata = md_reader.read(md_filename)