from NSAttributedStringData import *

propnumber = """{availableheader}
/*!
 *  @brief Set or get {name} attribute as NSNumber form.
 *  @details Generated by script {filename}
 */
@property(retain) NSNumber *{name}Number{available};
{availablefooter}
"""

propnormal = """{availableheader}
/*!
 *  @brief Set or get {name} attribute.
 *  @details Generated by script {filename}
 */
@property({attr}) {type}{typespace}{name}{available};
{availablefooter}"""

for prop in props:
    if prop.has_number:
        print propnumber.format(
            name=prop.name,
            available=' ' + prop.available_mac if prop.available else '',
            availableheader=prop.available_header if prop.available else '',
            availablefooter='#endif' if prop.available else '',
            filename=__file__,
        )
    print propnormal.format(
        attr=prop.proptype,
        type=prop.type,
        typespace='' if prop.is_pointer else ' ',
        name=prop.name,
        available=' ' + prop.available_mac if prop.available else '',
        availableheader=prop.available_header if prop.available else '',
        availablefooter='#endif' if prop.available else '',
        filename=__file__,
    )

