Changeset 6071 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 13 May 2011, 18:02:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py
r5988 r6071 10 10 from zope.component.interfaces import IFactory 11 11 from zope.interface import implementedBy 12 from zope.schema import getFieldNames 13 from zope.schema.fieldproperty import FieldProperty 12 14 13 15 def removeFileOrDirectory(filepath): … … 351 353 html, warnings = ReST2HTML_w_warnings(source_string) 352 354 return html 355 356 def attrs_to_fields(cls): 357 """Turn the attributes of a class into FieldProperty instances. 358 """ 359 iface = list(implementedBy(cls))[0] 360 for field_name in getFieldNames(iface): 361 setattr(cls, field_name, FieldProperty(iface[field_name])) 362 return cls
Note: See TracChangeset for help on using the changeset viewer.