Exemplo n.º 1
0
	def policy(self, token, base):
		if 'module' in token.attrs and ('inherited' in token.attrs or 'direct' in token.attrs):
			policy = ua_objects.getPolicyReference(base, token.attrs['module'])
			# need to call str() directly in order to force a correct translation
			token.value = str(_('No'))
			if 'direct' in token.attrs and policy:
				token.value = str(_('Yes'))
			elif 'inherited' in token.attrs and not policy:
				token.value = str(_('Yes'))
Exemplo n.º 2
0
	def policy( self, token, base ):
		if token.attrs.has_key( 'module' ) and ( token.attrs.has_key( 'inherited' ) or
												 token.attrs.has_key( 'direct' ) ):
			policy = ua_objects.getPolicyReference( base, token.attrs[ 'module' ] )
			# need to call str() directly in order to force a correct translation
			token.value = str(_( 'No' ))
			if token.attrs.has_key( 'direct' ) and policy:
				token.value = str(_( 'Yes' ))
			elif token.attrs.has_key( 'inherited' ) and not policy:
				token.value = str(_( 'Yes' ))