Beispiel #1
0
def validate_topics():

    print 'Validating topics...'

    # configure parser
    parser = DmozStructureParser(DMOZ_STRUCTURE_FILE)
    parser.add_handler(DummyHandler())

    # run
    parser.run()
Beispiel #2
0
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()