How to use the deco.Deco function in deco

To help you get started, we’ve selected a few deco 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 Transkribus / TranskribusDU / TranskribusDU / visu / config.py View on Github external
if sNSURI[0] == '"': sNSURI = sNSURI[1:]
                if sNSURI[-1] == '"': sNSURI = sNSURI[0:-1]
                print "- NameSpace: %s=%s"%(sNSName, sNSURI)
                self.ltNSNameURI.append( (sNSName, sNSURI) )
        
        #Now loop over other sections, which should define a set of decorations
        decos = self.cfg.get(self.sSectionGeneral, "decos")
        lsDeco = decos.split()
        self.lDeco = [] #a list 
#        for sect in self.cfg.sections():  #random order!!! :-(
        for sect in lsDeco:
            if sect in lReservedSections: continue
            
            sType = self.cfg.get(sect, "type")      #get the name of the associated Python class
            try:
                cls=deco.Deco.getDecoClass(sType)  #get the associated Python class
                obj = cls(self.cfg, sect, None)                    #let the class creates an instance using the details in the config file
                self.lDeco.append(obj)
                #print "-", str(obj)
            except Exception, e:
                print "ERROR: ", e
        print "--- Done ---"

deco

A decorator for concurrency

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis