Package Products :: Package ZenUtils :: Module FakeRequest
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenUtils.FakeRequest

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11 -class FakeRequest(dict):
12 ''' Used for ajax calls from event console and elsewhere. This is used 13 as a container for REQUEST['message'] which we are interested in. It has 14 the advantage over the regular REQUEST object in that it won't actually 15 bother to render anything when callZenScreen() is called with one. 16 ''' 17 dontRender = True 18 dontRedirect = True 19
20 - def __init__(self, *args, **kw):
21 dict.__init__(self, *args, **kw) 22 self['oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'] = True
23
24 - def setMessage(self, R):
25 if R and self.get('message', ''): 26 R['message'] = self['message']
27