1 """cmtest - List all components in the system"""
8 """Get string from str255 resource"""
9 if not r
.data
: return ''
11 return r
.data
[1:1+len]
14 """Return (type, subtype, creator, fl1, fl2, name, description) for component"""
18 type, subtype
, creator
, fl1
, fl2
= c
.GetComponentInfo(h1
, h2
, h3
)
20 description
= getstr255(h2
)
21 return type, subtype
, creator
, fl1
, fl2
, name
, description
23 def getallcomponents():
24 """Return list with info for all components, sorted"""
25 any
= ('\0\0\0\0', '\0\0\0\0', '\0\0\0\0', 0, 0)
30 c
= Cm
.FindNextComponent(c
, any
)
38 """Print info for all components"""
39 info
= getallcomponents()
40 for type, subtype
, creator
, f1
, f2
, name
, description
in info
:
41 print '%4.4s %4.4s %4.4s %s 0x%x 0x%x'%(type, subtype
, creator
, name
, f1
, f2
)
42 print ' ', description