Show
Ignore:
Timestamp:
03/08/10 22:17:24 (6 months ago)
Author:
erikj
Message:

add some docstring generation code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/camelot/view/controls/delegates/__init__.py

    r1150 r1179  
    11 
    2 """Camelot includes a number of Qt delegates, most of them are used as default 
    3 delegates for the various sqlalchemy and camelot field types. 
    4  
    5 Some delegates take specific arguments into account for their construction. 
    6 All :attr:`field_attributes` specified for a certain field will be propagated 
    7 towards the constructor of the delegate. 
    8 """ 
    92 
    103from delegatemanager import DelegateManager 
     
    3730from notedelegate import NoteDelegate 
    3831from labeldelegate import LabelDelegate 
     32 
     33doc = """Camelot includes a number of Qt delegates, most of them are used as default 
     34delegates for the various sqlalchemy and camelot field types. 
     35 
     36Some delegates take specific arguments into account for their construction. 
     37All :attr:`field_attributes` specified for a certain field will be propagated 
     38towards the constructor of the delegate.  Some of them will be used by the delegate 
     39itself, others will be used by the editor, created by the delegate. 
     40 
     41""" 
     42 
     43custom_delegates = list(CustomDelegate.__subclasses__()) 
     44custom_delegates.sort(key=lambda d:d.__name__) 
     45for custom_delegate in custom_delegates: 
     46    doc = doc + custom_delegate.__name__ + '\n' + '-'*len(custom_delegate.__name__) + '\n' 
     47    if hasattr(custom_delegate, '__doc__'): 
     48        doc = doc + custom_delegate.__doc__ + '\n' 
     49     
     50print doc 
     51 
     52__doc__ = doc