"""Miscellaneous functions for the mudpy engine."""
-# Copyright (c) 2004-2016 Jeremy Stanley <fungi@yuggoth.org>. Permission
+# Copyright (c) 2004-2017 Jeremy Stanley <fungi@yuggoth.org>. Permission
# to use, copy, modify, and distribute this software is granted under
# terms provided in the LICENSE file distributed with this software.
self.contents = {}
self.default_origins = {}
self.directions = set()
+ self.loading = False
self.loglines = []
self.private_files = []
self.reload_flag = False
def load(self):
"""Load universe data from persistent storage."""
+ # while loading, it's safe to update elements from read-only files
+ self.loading = True
+
# it's possible for this to enter before logging configuration is read
pending_loglines = []
for element in self.contents.values():
element.update_location()
element.clean_contents()
+
+ # done loading, so disallow updating elements from read-only files
+ self.loading = False
+
return pending_loglines
def new(self):