Changeset 3817
- Timestamp:
- 06/10/08 13:20:05 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ticketsubmitpolicyplugin/0.11/ticketsubmitpolicy/ticketsubmitpolicy.py
r3765 r3817 132 132 policies = ExtensionPoint(ITicketSubmitPolicy) 133 133 134 comparitors = {'!=': 'is', '==': 'isNot'} 134 comparitors = {'!=': 'is', 135 '==': 'isNot', 136 'in': 'isIn', 137 'not in': 'isNotIn' } 135 138 136 139 def policy_dict(self): … … 181 184 def filter_stream(self, req, method, filename, stream, data): 182 185 183 # temporary staging ground for ticket policy behavior184 # XXX things here should be abstracted185 # policies = [ {'contingentfield': 'type', 'value': 'defect',186 # 'function': 'requires', 'args': [ 'version' ]},187 # {'contingentfield': 'type', 'value': 'defect',188 # 'function': 'excludes', 'args': [ 'version' ]},189 # ]190 191 186 if filename == 'ticket.html': 192 187 … … 310 305 return (x != y); 311 306 } 307 308 function isIn(x, y) 309 { 310 for (index in y) 311 { 312 313 if(x == y[index]) 314 { 315 return true; 316 } 317 318 } 319 return false; 320 } 321 322 function isNotIn(x, y) 323 { 324 return !isIn(x,y); 325 } 326 312 327 """ 313 328 return string
