def validate_topics(): print 'Validating topics...' # configure parser parser = DmozStructureParser(DMOZ_STRUCTURE_FILE) parser.add_handler(DummyHandler()) # run parser.run()
def load_topics(): print 'Loading topics...' # configure session engine = create_engine(CONN_STR) Session = sessionmaker(bind=engine) session = Session() # configure parser parser = DmozStructureParser(DMOZ_STRUCTURE_FILE) parser.add_handler(TopicHandler(session)) # run parser.run()