From 6ad95c52a2ed4aaeb6a2638138224f0f06bea6b8 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 4 Oct 2003 12:53:09 +0000 Subject: [PATCH] Added docstrings. --- src/world.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/world.py b/src/world.py index d720b34f5..d8758f69a 100644 --- a/src/world.py +++ b/src/world.py @@ -29,16 +29,17 @@ # POSSIBILITY OF SUCH DAMAGE. ### +""" +Module for general worldly stuff, like global variables and whatnot. +""" + from fix import * import os import gc import time -import copy import types -import string import atexit -import linecache try: import msvcrt except ImportError: @@ -66,6 +67,7 @@ except NameError: flushers = [] # A periodic function will flush all these. def flush(): + """Flushes all the registered flushers.""" for f in flushers: f() @@ -77,6 +79,7 @@ except NameError: def upkeep(): # Function to be run on occasion to do upkeep stuff. + """Does upkeep (like flushing, garbage collection, etc.)""" collected = gc.collect() if os.name == 'nt': msvcrt.heapmin() @@ -165,11 +168,11 @@ try: except NameError: oldobjects = {} def superReload(module): + """Reloads a module hardcore. But kinda broken -- don't use it.""" def updateFunction(old, new, attrs): """Update all attrs in old to the same attrs in new.""" for name in attrs: setattr(old, name, getattr(new, name)) - for (name, object) in module.__dict__.iteritems(): # For every attribute of the old module, keep the object. key = (module.__name__, name)