Overhaul data management to get rid of __control__
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 27 Aug 2017 17:07:45 +0000 (17:07 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 28 Aug 2017 04:53:30 +0000 (04:53 +0000)
commitc29c06f95bcfb6f0e67be579d2f04e273ab43e9a
treec538ae7898d9f2f6e31cc463a1e6f94d71cc36c0
parentcf48b2ab0a6c287a3d6f3d9a1a4dac9bb49c0afc
Overhaul data management to get rid of __control__

Remap __control__ subkeys in data as follows:

    default_files -> .mudpy.filing.categories
    include_dirs -> _load
    include_files -> _load
    read_only -> _lock

Additionally, obsolete the __control__.private_files key by
switching from raw file/directory names to associative arrays in the
category defaults so that flags such as "private" can be added to
them, and make the category filenames automatically determined so
that they can be omitted unless specific overrides are required.

For the sake of future-proofing, rename the DataFile class to Data
and its "filename" attribute to "source" so that we avoid confusing
renames later when these might instead refer to some other storage
medium such as a table in a database. Similarly rename the Element
class attribute "filename" to "origin" attribute both to make it
more generic and to avoid confusion with "source" (an Element's
origin is a complete Data object, while a Data's source is just a
rooted-anchored file path currently).

Add a Universe.add_category convenience method to handle properly
guessing the corresponding fallback path and copying any declared
flags.
etc/mudpy.yaml
mudpy/data.py
mudpy/misc.py
mudpy/tests/fixtures/test_daemon.yaml
sample/__init__.yaml
share/archetype.yaml
share/command.yaml
share/menu.yaml