summaryrefslogtreecommitdiffstats
path: root/mdl_style.py
diff options
context:
space:
mode:
Diffstat (limited to 'mdl_style.py')
-rw-r--r--mdl_style.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mdl_style.py b/mdl_style.py
index c90f762..99b63c0 100644
--- a/mdl_style.py
+++ b/mdl_style.py
@@ -235,6 +235,18 @@ class LinkStyler(object):
return md(text)
+def _write_to(file_, content):
+ """Write `content` to `file_`.
+
+ `file_` is expected to be a sub-class of `io.TextIOBase`.
+ """
+ file_.truncate(0)
+ file_.seek(0)
+ file_.write(content)
+ file_.flush()
+ file_.close()
+
+
def _mdl_stylize(args):
ls = LinkStyler(args.link_style)
print(ls(args.file), end='')