Changeset 249

Show
Ignore:
Timestamp:
07/28/02 17:45:03 (6 years ago)
Author:
sholloway
Message:

Added some more documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBJabber/RBJabber/SubjectObserver/ProxySubject.py

    r191 r249  
    3131##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3232 
     33"""ProxySubejcts draw out some commonalities of subjects observing 
     34other subjects.  Based upon what they observer, the proxy subjects 
     35may filter/modify/extrapolate further results, or simple pass on a  
     36subset of those results.""" 
     37 
    3338#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3439#~ Imports  
     
    4449 
    4550class ProxySubjectTriggerMixin(object): 
     51    """This class makes it so that any setattr/delattr 
     52    calls UpdateObservers on the associated subject.""" 
     53 
     54    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     55    #~ Constants / Variables / Etc.  
     56    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     57 
    4658    _subject = None 
     59 
     60    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     61    #~ Special  
     62    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4763 
    4864    def __init__(self, subject=None): 
    4965        self.SetSubject(subject) 
    50  
    51     def SetSubject(self, subject): 
    52         self._subject = subject 
    5366 
    5467    def __setattr__(self, name, value): 
     
    6477        return result 
    6578 
     79    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     80    #~ Public Methods  
     81    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     82 
     83    def SetSubject(self, subject): 
     84        self._subject = subject 
     85 
    6686ProxySubjectTriggerMixin._ProxySubjectTriggerMixin__super = super(ProxySubjectTriggerMixin) 
    6787 
     
    6989 
    7090class ProxySubjectAcquisitionMixin(ProxySubjectTriggerMixin, Acquisition.AcquisitionMixin): 
     91    """This class couples the methods of Acquisition with UpdateObserver calls on attribute sets or deletes.""" 
    7192    def __init__(self, subject=None): 
    7293        ProxySubjectTriggerMixin.__init__(self, subject) 
     
    81102 
    82103class ProxySubject(ProxySubjectAcquisitionMixin): 
     104    """Binds ProxySubjectAcquisitionMixin to the Subject class by default""" 
    83105    def __init__(self, subject=None): 
    84106        ProxySubjectAcquisitionMixin.__init__(self, subject or Subject.Subject()) 
     
    87109 
    88110class ProxyCategorySubject(ProxySubjectAcquisitionMixin): 
     111    """Binds ProxySubjectAcquisitionMixin to the CategorySubject class by default""" 
    89112    def __init__(self, subject=None): 
    90113        ProxySubjectAcquisitionMixin.__init__(self, subject or CategorySubject.CategorySubject())