class ExtraConfigWatcher(object):

    def __init__(self, file):
        self.file = file
self.cached = dict()
self.last_date_modified = None

def update_config(self):
    """
        update the config by reloading the file
        """
if has_been_modified(self.file, self.last_date_modified):
    self.cached = get_dict_with_file(self.file)
self.last_date_modified = time.time()

def __getitem__(self, *args, **kwargs):
    self.update_config()
return self.cached.__getitem__(*args, **kwargs)

def __setitem__(self, *args, **kwargs):
    raise NotImplemented("you can't set config into this")
Processing some file before starting app and reacting for every change