Fix unhandled exception in show file command
authorJeremy Stanley <fungi@yuggoth.org>
Wed, 27 Sep 2017 16:52:45 +0000 (16:52 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Wed, 27 Sep 2017 16:52:45 +0000 (16:52 +0000)
When generating the list of nodes from a file for the "show file"
command output, treat the data attribute as a list rather than a
dict. Previously, use of this command would crash the interpreter on
an unhandled exception attempting to invoke a nonexistent (since the
data model conversion) .keys() method.

While we're here, correct the output preamble to refer to the file
contents as "nodes" instead of "elements since it also includes
non-element nodes. Also correct the error message when a nonexistent
file is requested to say "file" instead of "category" (this was
probably cut-n-pasted from "show categories" and missed getting
updated).

For future safety, add a selftest to exercise the "show files"
command.


No differences found