Reload a module if it has changed since we last imported it.  This is
    necessary if module a imports script b, script b is changed, and then
    module c asks to import script b.

    :param key: our key used in the WatchList.
    :returns: True if reloaded.

def module_reload_changed(key):
    """
    Reload a module if it has changed since we last imported it.  This is
    necessary if module a imports script b, script b is changed, and then
    module c asks to import script b.

    :param key: our key used in the WatchList.
    :returns: True if reloaded.
    """
    imp.acquire_lock()
    try:
        modkey = module_sys_modules_key(key)
        if not modkey:
            return False
        found = None
        if modkey:
            for second in WatchList:
                secmodkey = module_sys_modules_key(second)
                if secmodkey and sys.modules[modkey] == sys.modules[secmodkey]:
                    found = second
                    foundmodkey = secmodkey
                    break
        if not found:
            return
        filemtime = module_getmtime(WatchList[found]["file"])
        filemtime = latest_submodule_time(found, filemtime)
        if filemtime > WatchList[found]["time"]:
            tangelo.log("Reloaded %s" % found)
            reload_including_local(sys.modules[foundmodkey])
            for second in WatchList:
                if WatchList[second]["file"] == WatchList[found]["file"]:
                    WatchList[second]["time"] = filemtime
    finally:
        imp.release_lock()
    return True