How to use the checklist.partcalculate function in checklist

To help you get started, we’ve selected a few checklist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JYamihud / blender-organizer / py_data / modules / analytics.py View on Github external
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
github JYamihud / blender-organizer / py_data / modules / assets.py View on Github external
###### 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"
github JYamihud / blender-organizer / py_data / modules / analytics.py View on Github external
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 #####