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)
commit0442cc957605e653874ffee536181013d4759b73
tree554e45831cda66b36f96472c45b3b5dbd62f0e0f
parent22cc63fe6c627d1bf54a87eee282ed2077484a4a
Fix unhandled exception in show file command

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.
mudpy/misc.py
mudpy/tests/selftest.py