From 53d1b4a6f48a53c4c4ec4ac7031362b691c0366d Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 31 Oct 2019 21:10:28 -0700 Subject: Blacken the project (#141) --- examples/removeLineBreaks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/removeLineBreaks.py') diff --git a/examples/removeLineBreaks.py b/examples/removeLineBreaks.py index 1a77231..03315be 100644 --- a/examples/removeLineBreaks.py +++ b/examples/removeLineBreaks.py @@ -18,11 +18,14 @@ line_end = pp.LineEnd() # define an expression for the body of a line of text - use a predicate condition to # accept only lines with some content. def mustBeNonBlank(t): - return t[0] != '' + return t[0] != "" # could also be written as # return bool(t[0]) -lineBody = pp.SkipTo(line_end).addCondition(mustBeNonBlank, message="line body can't be empty") + +lineBody = pp.SkipTo(line_end).addCondition( + mustBeNonBlank, message="line body can't be empty" +) # now define a line with a trailing lineEnd, to be replaced with a space character textLine = lineBody + line_end().setParseAction(pp.replaceWith(" ")) -- cgit v1.2.1