def validate_pages(): print 'Validating pages...' # configure parser parser = DmozContentParser(DMOZ_CONTENT_FILE) parser.add_handler(DummyHandler()) # run parser.run()
def load_pages(): print 'Loading pages...' # configure session engine = create_engine(CONN_STR) Session = sessionmaker(bind=engine) session = Session() # configure parser parser = DmozContentParser(DMOZ_CONTENT_FILE) parser.add_handler(PageHandler(session)) # run parser.run()