def main(): args = get_args() if not os.path.exists(args.tmpdir): os.makedirs(args.tmpdir) conn = TypesDatabase.open_db(args.db) ac = AllCurves() ac.read_curves(args, conn) conn.commit() if len(ac.curves) == 0: msg('there are no results in the database') return ac.create_directories() sys.stderr.write('%s: write: (' % TOOL) ac.generate_index(args.htmldir) if ac.with_lists: ac.generate_context(args.htmldir) ac.generate_html() sys.stderr.write(')\n') redraw = ac.find_outdated() nredraw = len(redraw) if nredraw == 0: msg('all files up to date') else: msg('outdated: %d files' % nredraw) write_data(args, redraw) run(args, nredraw) os.remove(get_datafile(args)) msg('all done')
def main(): args = get_args() if not os.path.exists(args.tmpdir): os.makedirs(args.tmpdir) conn = TypesDatabase.open_db(args.db) ac = AllCurves() ac.read_curves(args, conn) conn.commit() if len(ac.curves) == 0: msg('there are no results in the database') return ac.create_directories() sys.stderr.write('%s: write: (' % TOOL) ac.generate_index(args.htmldir) if ac.with_lists: ac.generate_context(args.htmldir) ac.generate_html() sys.stderr.write(')\n') redraw = ac.find_outdated() nredraw = len(redraw) if nredraw == 0: msg('all files up to date') else: msg('outdated: %d files' % nredraw) write_data(args, redraw) run(args, nredraw) os.remove(get_datafile(args)) msg('all done')
def main(): args = get_args() conn = TypesDatabase.open_db(args.db) data = {} s = args.srcdir d = args.destdir if not os.path.exists(d): print d os.makedirs(d) for fn in os.listdir(s): if fn.startswith('.'): continue print fn shutil.copy2(os.path.join(s, fn), os.path.join(d, fn)) for w in what: dump(data, conn, *w) fn = "types-data.js" print(fn) jsfile = os.path.join(d, fn) with open(jsfile, "w") as f: f.write('types.data(') f.write(json.dumps(data, sort_keys=True, separators=(',', ':'))) f.write(')')
def init_and_get_task(args): conn = TypesDatabase.open_db(args.db) TypesDatabase.create_if_needed(conn) task = Task() if args.recalc: find_all(conn, args, task) else: find_missing(conn, args, task) conn.commit() task.prepare() return task
def postprocess(args): conn = TypesDatabase.open_db(args.db) TypesDatabase.refresh_result(conn) conn.commit()
def db_init(filename=TypesDatabase.DEFAULT_FILENAME): conn = TypesDatabase.open_db(filename) TypesDatabase.drop_views(conn) TypesDatabase.create_if_needed(conn) TypesDatabase.refresh_result(conn) conn.commit()
def db_init(filename=TypesDatabase.DEFAULT_FILENAME): conn = TypesDatabase.open_db(filename) TypesDatabase.drop_views(conn) TypesDatabase.create_if_needed(conn) TypesDatabase.refresh_result(conn) conn.commit()
def db_init(filename=TypesDatabase.DEFAULT_FILENAME): conn = TypesDatabase.open_db(filename) TypesDatabase.create_if_needed(conn) conn.commit()