From e27d5faab95ca26dd8fcb512ec09d729e1f388b4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 9 Jun 2013 11:37:10 +0100 Subject: Add parse_file method, and remove unwanted imports --- yarnlib/mdparser.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'yarnlib/mdparser.py') diff --git a/yarnlib/mdparser.py b/yarnlib/mdparser.py index ed2693c..6d16772 100644 --- a/yarnlib/mdparser.py +++ b/yarnlib/mdparser.py @@ -16,17 +16,9 @@ # =*= License: GPL-3+ =*= -import cliapp import logging import markdown -import os -import re -import shutil import StringIO -import sys -import tempfile -import time -import ttystatus from markdown.treeprocessors import Treeprocessor @@ -77,3 +69,7 @@ class MarkdownParser(object): markdown.markdown(text, output=f, extensions=[ext]) self.blocks = ext.blocks + def parse_file(self, filename): # pragma: no cover + with open(filename) as f: + self.parse_string(f.read()) + -- cgit v1.2.1