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

Function selector

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

Source from the content-addressed store, hash-verified

61 return False
62
63def selector():
64 path, file = os.path.split(openfile)
65 base, ext = os.path.splitext(file)
66 if varRec.get():
67 G= filePattern._paths_from_path_patterns([indir], includes=["*%s"%ext])
68 l=[g for g in G]
69 return l
70 else:
71 if var.get():
72 ls = os.listdir(indir)
73 filelist = []
74 for f in ls:
75 if os.path.splitext(f)[1] == ext:
76 filelist.append(f)
77 else:
78 filelist = [file]
79 return filelist
80def convert():
81 newext = frmt.get()
82 filelist= selector()

Callers 1

convertFunction · 0.85

Calls 4

splitMethod · 0.45
getMethod · 0.45
listdirMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected