# the user's account name
elif macro == "$(account)":
- text = string.replace(text, macro, user.name)
+ text = string.replace(text, macro, user.account.get("name"))
# third person subjective pronoun
elif macro == "$(tpsp)":
def check_time(frequency):
"""Check for a factor of the current increment count."""
if type(frequency) is str:
- frequency = muffconf.getint("time", frequency)
- return not muffuniv.universe.internals["counters"].getint("elapsed") % frequency
+ frequency = muffuniv.universe.categories["internal"]["time"].getint(frequency)
+ if not "counters" in muffuniv.universe.categories["internal"]:
+ muffuniv.Element("internal:counters", muffuniv.universe)
+ return not muffuniv.universe.categories["internal"]["counters"].getint("elapsed") % frequency
def on_pulse():
"""The things which should happen on each pulse, aside from reloads."""
# periodically save everything
if check_time("frequency_save"):
- for user in muffvars.userlist: user.save()
muffuniv.universe.save()
# pause for a configurable amount of time (decimal seconds)
- time.sleep(muffconf.getfloat("time", "increment"))
+ time.sleep(muffuniv.universe.categories["internal"]["time"].getfloat("increment"))
# increment the elapsed increment counter
- muffuniv.universe.internals["counters"].set("elapsed", muffuniv.universe.internals["counters"].getint("elapsed") + 1)
+ muffuniv.universe.categories["internal"]["counters"].set("elapsed", muffuniv.universe.categories["internal"]["counters"].getint("elapsed") + 1)
def reload_data():
"""Reload data into new persistent objects."""