Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, pf, box, win):
self.pf = pf # pf stands for project folder. It's a string to know
# where the project's folders start with
self.box = box # the gtk.Box() container to put this widget into
self.win = win
self.mainchecklist = checklist.partcalculate(checklist.openckecklist("project.progress"))
# drawing it's own box cutting in 2 for right and left halfs
# reading persentages
###### READING DATA #####
# checking if the item is finished...
# looking into the ast folder instead of dev
self.done = self.name+".blend" in os.walk(self.pf+"/ast/"+CUR).next()[2]
# getting the persentage from the checklist
self.percent = checklist.partcalculate(checklist.openckecklist(path+"/asset.progress"))
if self.done:
self.percent = 1.0 # just making sure
# getting the icon
if os.path.exists(self.path+"/renders/Preview.jpg"):
self.pic = thumbnailer.thumbnail(self.path+"/renders/Preview.jpg", 100, 100)
self.pic = gtk.gdk.pixbuf_new_from_file(self.pic)
self.preview = thumbnailer.thumbnail(self.path+"/renders/Preview.jpg", 400, 400)
self.preview = gtk.gdk.pixbuf_new_from_file(self.preview)
else:
self.pic = self.pf+"/py_data/icons/"+CUR+"_prev.png"
flist = []
if len(os.listdir("dev/"+f)) > 0:
for asset in os.listdir("dev/"+f):
if asset+".blend" in os.listdir("ast/"+f):
flist.append(1.0)
else:
try:
flist.append(checklist.partcalculate(checklist.openckecklist("dev/"+f+"/"+asset+"/asset.progress")))
except:
flist.append(0.0)
astlist.append(sum(flist)/len(flist))
else:
print f, "EMPTY"
astlist.append(1.0)
astlist.append(scenpercent)
projectpercent = (sum(astlist)/len(astlist))*100
#### SPANISH LANGUAGE EXCEPTION #####