def updateRule( self ): if not self.dirty: return self.dirty = False compiledCiteria = '' for item in self.items: if item.isActive(): compiledCiteria = compiledCiteria + ' ' + item.citeria if not compiledCiteria.strip(): self.compiledRule = None else: self.compiledRule = TagMatch.parseTagMatch( compiledCiteria, uppercase = True )
def updateRule(self): if not self.dirty: return self.dirty = False compiledCiteria = '' for item in self.items: if item.isActive(): compiledCiteria = compiledCiteria + ' ' + item.citeria if not compiledCiteria.strip(): self.compiledRule = None else: self.compiledRule = TagMatch.parseTagMatch(compiledCiteria, uppercase=True)
def searchAsset( self, citeria, **options ): if isinstance( citeria, TagMatch.TagMatchRule ): rule = citeria elif isinstance( citeria, ( str, unicode ) ): rule = TagMatch.parseTagMatch( citeria, **options ) else: rule = None if not rule: return [] result = [] for node in self.assetTable.values(): info = node.buildSearchInfo( **options ) if not info: continue if rule.evaluate( info ): result.append( node ) return result
def searchAsset(self, citeria, **options): if isinstance(citeria, TagMatch.TagMatchRule): rule = citeria elif isinstance(citeria, (str, unicode)): rule = TagMatch.parseTagMatch(citeria, **options) else: rule = None if not rule: return [] result = [] for node in self.assetTable.values(): info = node.buildSearchInfo(**options) if not info: continue if rule.evaluate(info): result.append(node) return result
def setCiteria( self, citeria ): self.citeria = citeria self.rule = TagMatch.parseTagMatch( citeria, uppercase = True )
def setCiteria(self, citeria): self.citeria = citeria self.rule = TagMatch.parseTagMatch(citeria, uppercase=True)