Example #1
0
	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 )
Example #2
0
 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)
Example #3
0
File: asset.py Project: tommo/gii
	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
Example #4
0
 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
Example #5
0
	def setCiteria( self, citeria ):
		self.citeria = citeria
		self.rule = TagMatch.parseTagMatch( citeria, uppercase = True )
Example #6
0
 def setCiteria(self, citeria):
     self.citeria = citeria
     self.rule = TagMatch.parseTagMatch(citeria, uppercase=True)