MCPcopy Create free account
hub / github.com/ActiveState/code / convert

Function convert

recipes/Python/577886_Convert_Image_Format/recipe-577886.py:80–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 filelist = [file]
79 return filelist
80def convert():
81 newext = frmt.get()
82 filelist= selector()
83 should_delete= varDel.get()
84 done= "Done. Deleted" if should_delete else "Done. Created"
85 for f in filelist:
86 infile = os.path.join(indir, f)
87 ofile = os.path.join(outdir, f)
88 outfile = os.path.splitext(ofile)[0] + newext
89 succeed= save(infile, outfile)
90 if should_delete and succeed:
91 os.remove(infile)
92 done= "%s=%s" % (done,len(filelist))
93 win = Toplevel(root)
94 Button(win, text=done, command=win.destroy).pack()
95
96def ________________gui_________________():pass
97# Divide GUI into 3 frames: top, mid, bot

Callers

nothing calls this directly

Calls 7

selectorFunction · 0.85
saveFunction · 0.70
ButtonClass · 0.50
getMethod · 0.45
joinMethod · 0.45
removeMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected