try: os.mkdir(template_destination) except OSError: print "The %s database already exists" % dbname print "Do you want to delete this database? Yes/No" choice = raw_input().lower() if choice.startswith('y'): os.system('rm -rf %s' % template_destination) os.mkdir(template_destination) else: sys.exit() os.system("cp -r %s* %s" % (install_dir, template_destination)) os.system("cp %s.htaccess %s" % (install_dir, template_destination)) print "copied templates to %s" % template_destination #################### ## Load the files ## #################### l = Loader(workers, filters=filters, tables=tables, clean=False) l.setup_dir(data_destination, files) l.parse_files(XPaths, Metadata_XPaths, token_regex, non_nesting_tags, self_closing_tags, pseudo_empty_tags) l.merge_objects() l.analyze() l.make_tables() l.finish(Philo_Types, Metadata_XPaths, db_url=db_url) print >> sys.stderr, "done indexing." print >> sys.stderr, "db viewable at " + db_url + "/dispatcher.py/form"
try: os.mkdir(template_destination) except OSError: print "The %s database already exists" % dbname print "Do you want to delete this database? Yes/No" choice = raw_input().lower() if choice.startswith('y'): os.system('rm -rf %s' % template_destination) os.mkdir(template_destination) else: sys.exit() os.system("cp -r %s* %s" % (install_dir,template_destination)) os.system("cp %s.htaccess %s" % (install_dir,template_destination)) print "copied templates to %s" % template_destination #################### ## Load the files ## #################### l = Loader(workers, filters=filters, tables=tables, clean=True) l.setup_dir(data_destination,files) l.parse_files(XPaths,Metadata_XPaths,token_regex,non_nesting_tags,self_closing_tags,pseudo_empty_tags) l.merge_objects() l.analyze() l.make_tables() l.finish(Philo_Types, Metadata_XPaths,db_url=db_url) print >> sys.stderr, "done indexing." print >> sys.stderr, "db viewable at " + db_url