Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
In print output, show No Results if there are none.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shea Craig committed Sep 1, 2015
1 parent db96f05 commit 76babcf
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions spruce.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,31 +1349,34 @@ def print_output(report, verbose=False):
indent_size = 3 * " "
forest_length = (64 - len(report.heading)) / 2
print "%s %s %s " % (SPRUCE, report.heading, SPRUCE * forest_length)
for result in report.results:
if not result.include_in_non_verbose and not verbose:
continue
else:
print "\n%s %s (%i)" % (
SPRUCE, result.heading, len(result.results))
if result.description:
print textwrap.fill(result.description,
initial_indent=indent_size,
subsequent_indent=indent_size)
print
for line in sorted(result.results,
key=lambda s: s[1].upper().strip()):
if line[1].strip() == "":
text = "(***NO NAME: ID is %s***)" % line[0]
else:
text = line[1]
print "\t%s" % text

for heading, subsection in report.metadata.iteritems():
print "\n%s %s %s" % (SPRUCE, heading, SPRUCE)
for subheading, strings in subsection.iteritems():
print "%s %s" % (SPRUCE, subheading)
for line in strings:
print "\t%s" % line
if not report.results:
print "%s No Results %s" % (SPRUCE, SPRUCE)
else:
for result in report.results:
if not result.include_in_non_verbose and not verbose:
continue
else:
print "\n%s %s (%i)" % (
SPRUCE, result.heading, len(result.results))
if result.description:
print textwrap.fill(result.description,
initial_indent=indent_size,
subsequent_indent=indent_size)
print
for line in sorted(result.results,
key=lambda s: s[1].upper().strip()):
if line[1].strip() == "":
text = "(***NO NAME: ID is %s***)" % line[0]
else:
text = line[1]
print "\t%s" % text

for heading, subsection in report.metadata.iteritems():
print "\n%s %s %s" % (SPRUCE, heading, SPRUCE)
for subheading, strings in subsection.iteritems():
print "%s %s" % (SPRUCE, subheading)
for line in strings:
print "\t%s" % line


def get_cruftmoji(percentage):
Expand Down

0 comments on commit 76babcf

Please sign in to comment.