Пример #1
0
 def load_addons(self):
     addondir = os.path.expanduser(self.cfg.get('main', 'addondir'))
     if addondir:
         addon_files = get_files_for_sets(self.sets, addondir, ".txt")
         kwdicts = [addons.load_addons(fn) for fn in addon_files]
         kwdict = addons.consolidate_keywords(kwdicts)
         addons.proliferate(self.cards, kwdict) # :-)
Пример #2
0
        del pool_dict[db_name]
        del addons._loaded[db_name]

    return get_pool()


def get_pool():

    config = cherrypy.request.app.config
    db_name = None

    try:
        db_name = cherrypy.session['db']
    except Exception, e:
        pass

    if db_name in pool_dict:
        pool = pool_dict[db_name]
    else:
        import addons

        pool = pool_dict[db_name] = Pool()

        try:
            addons.load_addons(db_name, config)
        except:
            del pool_dict[db_name]
            raise

    return pool
Пример #3
0
        
        del pool_dict[db_name]
        del addons._loaded[db_name]
    
    return get_pool()
        
def get_pool():

    config = cherrypy.request.app.config
    db_name = None

    try:
        db_name = cherrypy.session['db']
    except Exception, e:
        pass

    if db_name in pool_dict:
        pool = pool_dict[db_name]
    else:
        import addons

        pool = pool_dict[db_name] = Pool()
        
        try:
            addons.load_addons(db_name, config)
        except:
            del pool_dict[db_name]
            raise

    return pool