def main(): global lines arr0 = lines[0:start] arr1 = lines[end:lngth] lines = arr0 + arr1 s = elel.join(lines, line_sp) fs.wfile(src, s)
def main(): projhd = tst.creat_projhd(args.proj_name,args.proj_desc) install = tst.creat_install(args.proj_name) license = tst.creat_license(args.proj_lic) src = (args.proj_name+".py") if(args.src_file=="") else args.src_file cd = fs.rfile(src) usage = creat_usage_from_code(cd) rst_str = projhd + install + license + usage dst = (args.proj_name+".rst") if(args.dst_file=="") else args.dst_file fs.wfile(dst,rst_str,codec=args.codec)
def main(): global lines dlines = lines[start:end] s = elel.join(dlines, line_sp) fs.wfile(dst, s) arr0 = lines[0:start] arr1 = lines[end:lngth] slines = arr0 + arr1 s = elel.join(slines, line_sp) fs.wfile(src, s)
def main(): kl, vl = tst.tst2kvlist(fn=args.test_file, codec=args.codec) minidoc.creat_svgs(kl, vl, still_frames=still_frames, rownums=int(args.rownums), dst_dir=args.dst_dir) rst_str = tst.creat_rst(kl, vl, title=args.title, title_bot=args.title_bot, entry_bot=args.entry_bot) fs.wfile(args.title + ".rst", rst_str, codec=args.codec)
def rplc_ver(): s = fs.rfile("./setup.py") lines = s.split("\n") for i in range(len(lines)): if("#@version@#" in lines[i]): line = lines[i] lines[i] = update_one(line) break else: pass s = "" for i in range(len(lines)): s = s + lines[i] + "\n" fs.wfile("./setup.py",s)
def main(): global lines lines = lines[start:end] s = elel.join(lines,line_sp) fs.wfile(dst,s)
def replace_each(fn): s = fs.rfile(fn) for each in PARAMS: s = s.replace("@" + each + "@", ARGS.__getattribute__(each)) fs.wfile(fn, s)
def csv_wdtb(src_fn,from_file=True): df = pd.read_csv(src_fn) js = df.T.to_json() dst_fn = fs.repl_suffix(src_fn,"dtb.json") fs.wfile(dst_fn,js)