[Subversion] / RuleDispatch / src / dispatch / strategy.py  

Diff of /RuleDispatch/src/dispatch/strategy.py

Parent Directory | Revision Log

version 2426, Wed Nov 21 19:59:35 2007 UTC version 2427, Wed Nov 21 20:02:59 2007 UTC
Line 50 
Line 50 
 from dispatch.interfaces import *  from dispatch.interfaces import *
 from new import instancemethod  from new import instancemethod
 import dispatch  import dispatch
   from peak.util.extremes import Min, Max
   
 __all__ = [  __all__ = [
     'ProtocolCriterion', 'ClassCriterion', 'SubclassCriterion', 'Inequality',      'ProtocolCriterion', 'ClassCriterion', 'SubclassCriterion', 'Inequality',
Line 79 
Line 80 
   
   
   
   
 class SeededIndex(object):  class SeededIndex(object):
     """Index connecting seeds and results"""      """Index connecting seeds and results"""
   
Line 654 
Line 654 
   
   
   
 class _ExtremeType(object):     # Courtesy of PEP 326  
   
     def __init__(self, cmpr, rep):  
         object.__init__(self)  
         self._cmpr = cmpr  
         self._rep = rep  
   
     def __cmp__(self, other):  
         if isinstance(other, self.__class__) and\  
            other._cmpr == self._cmpr:  
             return 0  
         return self._cmpr  
   
     def __repr__(self):  
         return self._rep  
   
     def __lt__(self,other):  
         return self.__cmp__(other)<0  
   
     def __le__(self,other):  
         return self.__cmp__(other)<=0  
   
     def __gt__(self,other):  
         return self.__cmp__(other)>0  
   
     def __eq__(self,other):  
         return self.__cmp__(other)==0  
   
     def __ge__(self,other):  
         return self.__cmp__(other)>=0  
   
     def __ne__(self,other):  
         return self.__cmp__(other)<>0  
   
 Max = _ExtremeType(1, "Max")  
 Min = _ExtremeType(-1, "Min")  
   
   
   
   
   
 def dispatch_by_inequalities(table,ob):  def dispatch_by_inequalities(table,ob):
     key = ob,ob      key = ob,ob
     try:      try:


Generate output suitable for use with a patch program
Legend:
Removed from v.2426  
changed lines
  Added in v.2427

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help