Mercurial > cgi-bin > hgweb.cgi > curlyq
diff curlyq @ 4:7a83e82e65a6
Remove some deadwood.
author | David Barts <n5jrn@me.com> |
---|---|
date | Thu, 26 Dec 2019 20:04:04 -0800 |
parents | 091c03f1b2e8 |
children | d5198c7ec54d |
line wrap: on
line diff
--- a/curlyq Thu Dec 26 19:54:45 2019 -0800 +++ b/curlyq Thu Dec 26 20:04:04 2019 -0800 @@ -5,8 +5,8 @@ import argparse import codecs -from curlers import TextCurler, HtmlCurler -from workspace import Workspace, Bounds, Mapping, SegmentedView +from curlers import TextCurler, HtmlCurler, uncurl +from workspace import Workspace from writer import CODECS_TO_NAME # V a r i a b l e s @@ -21,13 +21,14 @@ # F u n c t i o n s def normal(): - global input_fp, output_fp + global input_fp, output_fp, args with Workspace() as ws: curler = TextCurler(ws) while True: line = input_fp.readline() ws.write(line) if line == "" or line == "\n": + if args.force: uncurl(ws) curler.feed() output_fp.write(ws.getvalue()) ws.clear() @@ -43,6 +44,7 @@ if line == "": break ws.write(line) + if args.force: uncurl(ws) curler.feed() output_fp.write(ws.getvalue()) ws.clear() @@ -51,6 +53,7 @@ global input_fp, output_fp with Workspace(input_fp.read()) as ws: curler = HtmlCurler(ws) + if args.force: uncurl(ws) curler.feed() output_fp.write(ws.getvalue())