diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-11-19 14:34:18 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-11-19 14:34:18 (GMT) |
commit | 28ecf70db57828db2ca279643bf9aeca7662f35c (patch) | |
tree | 09b7767bbc411f85313b58d6fe7e5e67d9392973 /Mac/Lib/test/cmtest.py | |
parent | 6045b9c93511c767f6cfa2d2fa299c76181acd9b (diff) | |
download | cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.zip cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.gz cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.bz2 |
Getting rid of support for MacOS9 and earlier. This is the first step,
and the biggest in size, but probably the easiest. Hunting through the
source code comes next.
Diffstat (limited to 'Mac/Lib/test/cmtest.py')
-rw-r--r-- | Mac/Lib/test/cmtest.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/Mac/Lib/test/cmtest.py b/Mac/Lib/test/cmtest.py deleted file mode 100644 index bdbca23..0000000 --- a/Mac/Lib/test/cmtest.py +++ /dev/null @@ -1,45 +0,0 @@ -"""cmtest - List all components in the system""" - -from Carbon import Cm -from Carbon import Res -from Carbon import sys - -def getstr255(r): - """Get string from str255 resource""" - if not r.data: return '' - len = ord(r.data[0]) - return r.data[1:1+len] - -def getinfo(c): - """Return (type, subtype, creator, fl1, fl2, name, description) for component""" - h1 = Res.Resource('') - h2 = Res.Resource('') - h3 = Res.Resource('') - type, subtype, creator, fl1, fl2 = c.GetComponentInfo(h1, h2, h3) - name = getstr255(h1) - description = getstr255(h2) - return type, subtype, creator, fl1, fl2, name, description - -def getallcomponents(): - """Return list with info for all components, sorted""" - any = ('\0\0\0\0', '\0\0\0\0', '\0\0\0\0', 0, 0) - c = None - rv = [] - while 1: - try: - c = Cm.FindNextComponent(c, any) - except Cm.Error: - break - rv.append(getinfo(c)) - rv.sort() - return rv - -def main(): - """Print info for all components""" - info = getallcomponents() - for type, subtype, creator, f1, f2, name, description in info: - print '%4.4s %4.4s %4.4s %s 0x%x 0x%x'%(type, subtype, creator, name, f1, f2) - print ' ', description - sys.exit(1) - -main() |