diff --git a/sys/lib/python/bsddb/test/__init__.py b/sys/lib/python/bsddb/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sys/lib/python/bsddb/test/test_1413192.py b/sys/lib/python/bsddb/test/test_1413192.py deleted file mode 100644 index 436f40786..000000000 --- a/sys/lib/python/bsddb/test/test_1413192.py +++ /dev/null @@ -1,21 +0,0 @@ - -# http://python.org/sf/1413192 -# -# This test relies on the variable names, see the bug report for details. -# The problem was that the env was deallocated prior to the txn. - -try: - # For Pythons w/distutils and add-on pybsddb - from bsddb3 import db -except ImportError: - # For Python >= 2.3 builtin bsddb distribution - from bsddb import db - -env_name = '.' - -env = db.DBEnv() -env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN | db.DB_INIT_MPOOL) -the_txn = env.txn_begin() - -map = db.DB(env) -map.open('xxx.db', "p", db.DB_HASH, db.DB_CREATE, 0666, txn=the_txn) diff --git a/sys/lib/python/bsddb/test/test_all.py b/sys/lib/python/bsddb/test/test_all.py deleted file mode 100644 index ad8b1e9e9..000000000 --- a/sys/lib/python/bsddb/test/test_all.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Run all test cases. -""" - -import sys -import os -import unittest -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -verbose = 0 -if 'verbose' in sys.argv: - verbose = 1 - sys.argv.remove('verbose') - -if 'silent' in sys.argv: # take care of old flag, just in case - verbose = 0 - sys.argv.remove('silent') - - -def print_versions(): - print - print '-=' * 38 - print db.DB_VERSION_STRING - print 'bsddb.db.version(): %s' % (db.version(), ) - print 'bsddb.db.__version__: %s' % db.__version__ - print 'bsddb.db.cvsid: %s' % db.cvsid - print 'python version: %s' % sys.version - print 'My pid: %s' % os.getpid() - print '-=' * 38 - - -class PrintInfoFakeTest(unittest.TestCase): - def testPrintVersions(self): - print_versions() - - -# This little hack is for when this module is run as main and all the -# other modules import it so they will still be able to get the right -# verbose setting. It's confusing but it works. -import test_all -test_all.verbose = verbose - - -def suite(): - try: - # this is special, it used to segfault the interpreter - import test_1413192 - except: - pass - - test_modules = [ - 'test_associate', - 'test_basics', - 'test_compat', - 'test_compare', - 'test_dbobj', - 'test_dbshelve', - 'test_dbtables', - 'test_env_close', - 'test_get_none', - 'test_join', - 'test_lock', - 'test_misc', - 'test_pickle', - 'test_queue', - 'test_recno', - 'test_thread', - 'test_sequence', - 'test_cursor_pget_bug', - ] - - alltests = unittest.TestSuite() - for name in test_modules: - module = __import__(name) - alltests.addTest(module.test_suite()) - return alltests - - -def test_suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PrintInfoFakeTest)) - return suite - - -if __name__ == '__main__': - print_versions() - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/bsddb/test/test_associate.py b/sys/lib/python/bsddb/test/test_associate.py deleted file mode 100644 index 05ef83cb6..000000000 --- a/sys/lib/python/bsddb/test/test_associate.py +++ /dev/null @@ -1,478 +0,0 @@ -""" -TestCases for DB.associate. -""" - -import sys, os, string -import tempfile -import time -from pprint import pprint - -try: - from threading import Thread, currentThread - have_threads = 1 -except ImportError: - have_threads = 0 - -import unittest -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbshelve -except ImportError: - # For Python 2.3 - from bsddb import db, dbshelve - - -#---------------------------------------------------------------------- - - -musicdata = { -1 : ("Bad English", "The Price Of Love", "Rock"), -2 : ("DNA featuring Suzanne Vega", "Tom's Diner", "Rock"), -3 : ("George Michael", "Praying For Time", "Rock"), -4 : ("Gloria Estefan", "Here We Are", "Rock"), -5 : ("Linda Ronstadt", "Don't Know Much", "Rock"), -6 : ("Michael Bolton", "How Am I Supposed To Live Without You", "Blues"), -7 : ("Paul Young", "Oh Girl", "Rock"), -8 : ("Paula Abdul", "Opposites Attract", "Rock"), -9 : ("Richard Marx", "Should've Known Better", "Rock"), -10: ("Rod Stewart", "Forever Young", "Rock"), -11: ("Roxette", "Dangerous", "Rock"), -12: ("Sheena Easton", "The Lover In Me", "Rock"), -13: ("Sinead O'Connor", "Nothing Compares 2 U", "Rock"), -14: ("Stevie B.", "Because I Love You", "Rock"), -15: ("Taylor Dayne", "Love Will Lead You Back", "Rock"), -16: ("The Bangles", "Eternal Flame", "Rock"), -17: ("Wilson Phillips", "Release Me", "Rock"), -18: ("Billy Joel", "Blonde Over Blue", "Rock"), -19: ("Billy Joel", "Famous Last Words", "Rock"), -20: ("Billy Joel", "Lullabye (Goodnight, My Angel)", "Rock"), -21: ("Billy Joel", "The River Of Dreams", "Rock"), -22: ("Billy Joel", "Two Thousand Years", "Rock"), -23: ("Janet Jackson", "Alright", "Rock"), -24: ("Janet Jackson", "Black Cat", "Rock"), -25: ("Janet Jackson", "Come Back To Me", "Rock"), -26: ("Janet Jackson", "Escapade", "Rock"), -27: ("Janet Jackson", "Love Will Never Do (Without You)", "Rock"), -28: ("Janet Jackson", "Miss You Much", "Rock"), -29: ("Janet Jackson", "Rhythm Nation", "Rock"), -30: ("Janet Jackson", "State Of The World", "Rock"), -31: ("Janet Jackson", "The Knowledge", "Rock"), -32: ("Spyro Gyra", "End of Romanticism", "Jazz"), -33: ("Spyro Gyra", "Heliopolis", "Jazz"), -34: ("Spyro Gyra", "Jubilee", "Jazz"), -35: ("Spyro Gyra", "Little Linda", "Jazz"), -36: ("Spyro Gyra", "Morning Dance", "Jazz"), -37: ("Spyro Gyra", "Song for Lorraine", "Jazz"), -38: ("Yes", "Owner Of A Lonely Heart", "Rock"), -39: ("Yes", "Rhythm Of Love", "Rock"), -40: ("Cusco", "Dream Catcher", "New Age"), -41: ("Cusco", "Geronimos Laughter", "New Age"), -42: ("Cusco", "Ghost Dance", "New Age"), -43: ("Blue Man Group", "Drumbone", "New Age"), -44: ("Blue Man Group", "Endless Column", "New Age"), -45: ("Blue Man Group", "Klein Mandelbrot", "New Age"), -46: ("Kenny G", "Silhouette", "Jazz"), -47: ("Sade", "Smooth Operator", "Jazz"), -48: ("David Arkenstone", "Papillon (On The Wings Of The Butterfly)", - "New Age"), -49: ("David Arkenstone", "Stepping Stars", "New Age"), -50: ("David Arkenstone", "Carnation Lily Lily Rose", "New Age"), -51: ("David Lanz", "Behind The Waterfall", "New Age"), -52: ("David Lanz", "Cristofori's Dream", "New Age"), -53: ("David Lanz", "Heartsounds", "New Age"), -54: ("David Lanz", "Leaves on the Seine", "New Age"), -99: ("unknown artist", "Unnamed song", "Unknown"), -} - -#---------------------------------------------------------------------- - -class AssociateErrorTestCase(unittest.TestCase): - def setUp(self): - self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - os.mkdir(homeDir) - except os.error: - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - self.env = db.DBEnv() - self.env.open(homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) - - def tearDown(self): - self.env.close() - self.env = None - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - - def test00_associateDBError(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test00_associateDBError..." % \ - self.__class__.__name__ - - dupDB = db.DB(self.env) - dupDB.set_flags(db.DB_DUP) - dupDB.open(self.filename, "primary", db.DB_BTREE, db.DB_CREATE) - - secDB = db.DB(self.env) - secDB.open(self.filename, "secondary", db.DB_BTREE, db.DB_CREATE) - - # dupDB has been configured to allow duplicates, it can't - # associate with a secondary. BerkeleyDB will return an error. - try: - def f(a,b): return a+b - dupDB.associate(secDB, f) - except db.DBError: - # good - secDB.close() - dupDB.close() - else: - secDB.close() - dupDB.close() - self.fail("DBError exception was expected") - - - -#---------------------------------------------------------------------- - - -class AssociateTestCase(unittest.TestCase): - keytype = '' - envFlags = 0 - dbFlags = 0 - - def setUp(self): - self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - os.mkdir(homeDir) - except os.error: - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - self.env = db.DBEnv() - self.env.open(homeDir, db.DB_CREATE | db.DB_INIT_MPOOL | - db.DB_INIT_LOCK | db.DB_THREAD | self.envFlags) - - def tearDown(self): - self.closeDB() - self.env.close() - self.env = None - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def addDataToDB(self, d, txn=None): - for key, value in musicdata.items(): - if type(self.keytype) == type(''): - key = "%02d" % key - d.put(key, string.join(value, '|'), txn=txn) - - def createDB(self, txn=None): - self.cur = None - self.secDB = None - self.primary = db.DB(self.env) - self.primary.set_get_returns_none(2) - if db.version() >= (4, 1): - self.primary.open(self.filename, "primary", self.dbtype, - db.DB_CREATE | db.DB_THREAD | self.dbFlags, txn=txn) - else: - self.primary.open(self.filename, "primary", self.dbtype, - db.DB_CREATE | db.DB_THREAD | self.dbFlags) - - def closeDB(self): - if self.cur: - self.cur.close() - self.cur = None - if self.secDB: - self.secDB.close() - self.secDB = None - self.primary.close() - self.primary = None - - def getDB(self): - return self.primary - - - def test01_associateWithDB(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_associateWithDB..." % \ - self.__class__.__name__ - - self.createDB() - - self.secDB = db.DB(self.env) - self.secDB.set_flags(db.DB_DUP) - self.secDB.set_get_returns_none(2) - self.secDB.open(self.filename, "secondary", db.DB_BTREE, - db.DB_CREATE | db.DB_THREAD | self.dbFlags) - self.getDB().associate(self.secDB, self.getGenre) - - self.addDataToDB(self.getDB()) - - self.finish_test(self.secDB) - - - def test02_associateAfterDB(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_associateAfterDB..." % \ - self.__class__.__name__ - - self.createDB() - self.addDataToDB(self.getDB()) - - self.secDB = db.DB(self.env) - self.secDB.set_flags(db.DB_DUP) - self.secDB.open(self.filename, "secondary", db.DB_BTREE, - db.DB_CREATE | db.DB_THREAD | self.dbFlags) - - # adding the DB_CREATE flag will cause it to index existing records - self.getDB().associate(self.secDB, self.getGenre, db.DB_CREATE) - - self.finish_test(self.secDB) - - - def finish_test(self, secDB, txn=None): - # 'Blues' should not be in the secondary database - vals = secDB.pget('Blues', txn=txn) - assert vals == None, vals - - vals = secDB.pget('Unknown', txn=txn) - assert vals[0] == 99 or vals[0] == '99', vals - vals[1].index('Unknown') - vals[1].index('Unnamed') - vals[1].index('unknown') - - if verbose: - print "Primary key traversal:" - self.cur = self.getDB().cursor(txn) - count = 0 - rec = self.cur.first() - while rec is not None: - if type(self.keytype) == type(''): - assert string.atoi(rec[0]) # for primary db, key is a number - else: - assert rec[0] and type(rec[0]) == type(0) - count = count + 1 - if verbose: - print rec - rec = self.cur.next() - assert count == len(musicdata) # all items accounted for - - - if verbose: - print "Secondary key traversal:" - self.cur = secDB.cursor(txn) - count = 0 - - # test cursor pget - vals = self.cur.pget('Unknown', flags=db.DB_LAST) - assert vals[1] == 99 or vals[1] == '99', vals - assert vals[0] == 'Unknown' - vals[2].index('Unknown') - vals[2].index('Unnamed') - vals[2].index('unknown') - - vals = self.cur.pget('Unknown', data='wrong value', flags=db.DB_GET_BOTH) - assert vals == None, vals - - rec = self.cur.first() - assert rec[0] == "Jazz" - while rec is not None: - count = count + 1 - if verbose: - print rec - rec = self.cur.next() - # all items accounted for EXCEPT for 1 with "Blues" genre - assert count == len(musicdata)-1 - - self.cur = None - - def getGenre(self, priKey, priData): - assert type(priData) == type("") - if verbose: - print 'getGenre key: %r data: %r' % (priKey, priData) - genre = string.split(priData, '|')[2] - if genre == 'Blues': - return db.DB_DONOTINDEX - else: - return genre - - -#---------------------------------------------------------------------- - - -class AssociateHashTestCase(AssociateTestCase): - dbtype = db.DB_HASH - -class AssociateBTreeTestCase(AssociateTestCase): - dbtype = db.DB_BTREE - -class AssociateRecnoTestCase(AssociateTestCase): - dbtype = db.DB_RECNO - keytype = 0 - -#---------------------------------------------------------------------- - -class AssociateBTreeTxnTestCase(AssociateBTreeTestCase): - envFlags = db.DB_INIT_TXN - dbFlags = 0 - - def txn_finish_test(self, sDB, txn): - try: - self.finish_test(sDB, txn=txn) - finally: - if self.cur: - self.cur.close() - self.cur = None - if txn: - txn.commit() - - def test13_associate_in_transaction(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test13_associateAutoCommit..." % \ - self.__class__.__name__ - - txn = self.env.txn_begin() - try: - self.createDB(txn=txn) - - self.secDB = db.DB(self.env) - self.secDB.set_flags(db.DB_DUP) - self.secDB.set_get_returns_none(2) - self.secDB.open(self.filename, "secondary", db.DB_BTREE, - db.DB_CREATE | db.DB_THREAD, txn=txn) - if db.version() >= (4,1): - self.getDB().associate(self.secDB, self.getGenre, txn=txn) - else: - self.getDB().associate(self.secDB, self.getGenre) - - self.addDataToDB(self.getDB(), txn=txn) - except: - txn.abort() - raise - - self.txn_finish_test(self.secDB, txn=txn) - - -#---------------------------------------------------------------------- - -class ShelveAssociateTestCase(AssociateTestCase): - - def createDB(self): - self.primary = dbshelve.open(self.filename, - dbname="primary", - dbenv=self.env, - filetype=self.dbtype) - - def addDataToDB(self, d): - for key, value in musicdata.items(): - if type(self.keytype) == type(''): - key = "%02d" % key - d.put(key, value) # save the value as is this time - - - def getGenre(self, priKey, priData): - assert type(priData) == type(()) - if verbose: - print 'getGenre key: %r data: %r' % (priKey, priData) - genre = priData[2] - if genre == 'Blues': - return db.DB_DONOTINDEX - else: - return genre - - -class ShelveAssociateHashTestCase(ShelveAssociateTestCase): - dbtype = db.DB_HASH - -class ShelveAssociateBTreeTestCase(ShelveAssociateTestCase): - dbtype = db.DB_BTREE - -class ShelveAssociateRecnoTestCase(ShelveAssociateTestCase): - dbtype = db.DB_RECNO - keytype = 0 - - -#---------------------------------------------------------------------- - -class ThreadedAssociateTestCase(AssociateTestCase): - - def addDataToDB(self, d): - t1 = Thread(target = self.writer1, - args = (d, )) - t2 = Thread(target = self.writer2, - args = (d, )) - - t1.start() - t2.start() - t1.join() - t2.join() - - def writer1(self, d): - for key, value in musicdata.items(): - if type(self.keytype) == type(''): - key = "%02d" % key - d.put(key, string.join(value, '|')) - - def writer2(self, d): - for x in range(100, 600): - key = 'z%2d' % x - value = [key] * 4 - d.put(key, string.join(value, '|')) - - -class ThreadedAssociateHashTestCase(ShelveAssociateTestCase): - dbtype = db.DB_HASH - -class ThreadedAssociateBTreeTestCase(ShelveAssociateTestCase): - dbtype = db.DB_BTREE - -class ThreadedAssociateRecnoTestCase(ShelveAssociateTestCase): - dbtype = db.DB_RECNO - keytype = 0 - - -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - - if db.version() >= (3, 3, 11): - suite.addTest(unittest.makeSuite(AssociateErrorTestCase)) - - suite.addTest(unittest.makeSuite(AssociateHashTestCase)) - suite.addTest(unittest.makeSuite(AssociateBTreeTestCase)) - suite.addTest(unittest.makeSuite(AssociateRecnoTestCase)) - - if db.version() >= (4, 1): - suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase)) - - suite.addTest(unittest.makeSuite(ShelveAssociateHashTestCase)) - suite.addTest(unittest.makeSuite(ShelveAssociateBTreeTestCase)) - suite.addTest(unittest.makeSuite(ShelveAssociateRecnoTestCase)) - - if have_threads: - suite.addTest(unittest.makeSuite(ThreadedAssociateHashTestCase)) - suite.addTest(unittest.makeSuite(ThreadedAssociateBTreeTestCase)) - suite.addTest(unittest.makeSuite(ThreadedAssociateRecnoTestCase)) - - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_basics.py b/sys/lib/python/bsddb/test/test_basics.py deleted file mode 100644 index e6022ba51..000000000 --- a/sys/lib/python/bsddb/test/test_basics.py +++ /dev/null @@ -1,989 +0,0 @@ -""" -Basic TestCases for BTree and hash DBs, with and without a DBEnv, with -various DB flags, etc. -""" - -import os -import sys -import errno -import shutil -import string -import tempfile -from pprint import pprint -import unittest -import time - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -from test_all import verbose - -DASH = '-' - - -#---------------------------------------------------------------------- - -class VersionTestCase(unittest.TestCase): - def test00_version(self): - info = db.version() - if verbose: - print '\n', '-=' * 20 - print 'bsddb.db.version(): %s' % (info, ) - print db.DB_VERSION_STRING - print '-=' * 20 - assert info == (db.DB_VERSION_MAJOR, db.DB_VERSION_MINOR, - db.DB_VERSION_PATCH) - -#---------------------------------------------------------------------- - -class BasicTestCase(unittest.TestCase): - dbtype = db.DB_UNKNOWN # must be set in derived class - dbopenflags = 0 - dbsetflags = 0 - dbmode = 0660 - dbname = None - useEnv = 0 - envflags = 0 - envsetflags = 0 - - _numKeys = 1002 # PRIVATE. NOTE: must be an even value - - def setUp(self): - if self.useEnv: - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - shutil.rmtree(homeDir) - except OSError, e: - # unix returns ENOENT, windows returns ESRCH - if e.errno not in (errno.ENOENT, errno.ESRCH): raise - os.mkdir(homeDir) - try: - self.env = db.DBEnv() - self.env.set_lg_max(1024*1024) - self.env.set_tx_max(30) - self.env.set_tx_timestamp(int(time.time())) - self.env.set_flags(self.envsetflags, 1) - self.env.open(homeDir, self.envflags | db.DB_CREATE) - tempfile.tempdir = homeDir - self.filename = os.path.split(tempfile.mktemp())[1] - tempfile.tempdir = None - # Yes, a bare except is intended, since we're re-raising the exc. - except: - shutil.rmtree(homeDir) - raise - else: - self.env = None - self.filename = tempfile.mktemp() - - # create and open the DB - self.d = db.DB(self.env) - self.d.set_flags(self.dbsetflags) - if self.dbname: - self.d.open(self.filename, self.dbname, self.dbtype, - self.dbopenflags|db.DB_CREATE, self.dbmode) - else: - self.d.open(self.filename, # try out keyword args - mode = self.dbmode, - dbtype = self.dbtype, - flags = self.dbopenflags|db.DB_CREATE) - - self.populateDB() - - - def tearDown(self): - self.d.close() - if self.env is not None: - self.env.close() - shutil.rmtree(self.homeDir) - ## Make a new DBEnv to remove the env files from the home dir. - ## (It can't be done while the env is open, nor after it has been - ## closed, so we make a new one to do it.) - #e = db.DBEnv() - #e.remove(self.homeDir) - #os.remove(os.path.join(self.homeDir, self.filename)) - else: - os.remove(self.filename) - - - - def populateDB(self, _txn=None): - d = self.d - - for x in range(self._numKeys/2): - key = '%04d' % (self._numKeys - x) # insert keys in reverse order - data = self.makeData(key) - d.put(key, data, _txn) - - d.put('empty value', '', _txn) - - for x in range(self._numKeys/2-1): - key = '%04d' % x # and now some in forward order - data = self.makeData(key) - d.put(key, data, _txn) - - if _txn: - _txn.commit() - - num = len(d) - if verbose: - print "created %d records" % num - - - def makeData(self, key): - return DASH.join([key] * 5) - - - - #---------------------------------------- - - def test01_GetsAndPuts(self): - d = self.d - - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_GetsAndPuts..." % self.__class__.__name__ - - for key in ['0001', '0100', '0400', '0700', '0999']: - data = d.get(key) - if verbose: - print data - - assert d.get('0321') == '0321-0321-0321-0321-0321' - - # By default non-existant keys return None... - assert d.get('abcd') == None - - # ...but they raise exceptions in other situations. Call - # set_get_returns_none() to change it. - try: - d.delete('abcd') - except db.DBNotFoundError, val: - assert val[0] == db.DB_NOTFOUND - if verbose: print val - else: - self.fail("expected exception") - - - d.put('abcd', 'a new record') - assert d.get('abcd') == 'a new record' - - d.put('abcd', 'same key') - if self.dbsetflags & db.DB_DUP: - assert d.get('abcd') == 'a new record' - else: - assert d.get('abcd') == 'same key' - - - try: - d.put('abcd', 'this should fail', flags=db.DB_NOOVERWRITE) - except db.DBKeyExistError, val: - assert val[0] == db.DB_KEYEXIST - if verbose: print val - else: - self.fail("expected exception") - - if self.dbsetflags & db.DB_DUP: - assert d.get('abcd') == 'a new record' - else: - assert d.get('abcd') == 'same key' - - - d.sync() - d.close() - del d - - self.d = db.DB(self.env) - if self.dbname: - self.d.open(self.filename, self.dbname) - else: - self.d.open(self.filename) - d = self.d - - assert d.get('0321') == '0321-0321-0321-0321-0321' - if self.dbsetflags & db.DB_DUP: - assert d.get('abcd') == 'a new record' - else: - assert d.get('abcd') == 'same key' - - rec = d.get_both('0555', '0555-0555-0555-0555-0555') - if verbose: - print rec - - assert d.get_both('0555', 'bad data') == None - - # test default value - data = d.get('bad key', 'bad data') - assert data == 'bad data' - - # any object can pass through - data = d.get('bad key', self) - assert data == self - - s = d.stat() - assert type(s) == type({}) - if verbose: - print 'd.stat() returned this dictionary:' - pprint(s) - - - #---------------------------------------- - - def test02_DictionaryMethods(self): - d = self.d - - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_DictionaryMethods..." % \ - self.__class__.__name__ - - for key in ['0002', '0101', '0401', '0701', '0998']: - data = d[key] - assert data == self.makeData(key) - if verbose: - print data - - assert len(d) == self._numKeys - keys = d.keys() - assert len(keys) == self._numKeys - assert type(keys) == type([]) - - d['new record'] = 'a new record' - assert len(d) == self._numKeys+1 - keys = d.keys() - assert len(keys) == self._numKeys+1 - - d['new record'] = 'a replacement record' - assert len(d) == self._numKeys+1 - keys = d.keys() - assert len(keys) == self._numKeys+1 - - if verbose: - print "the first 10 keys are:" - pprint(keys[:10]) - - assert d['new record'] == 'a replacement record' - - assert d.has_key('0001') == 1 - assert d.has_key('spam') == 0 - - items = d.items() - assert len(items) == self._numKeys+1 - assert type(items) == type([]) - assert type(items[0]) == type(()) - assert len(items[0]) == 2 - - if verbose: - print "the first 10 items are:" - pprint(items[:10]) - - values = d.values() - assert len(values) == self._numKeys+1 - assert type(values) == type([]) - - if verbose: - print "the first 10 values are:" - pprint(values[:10]) - - - - #---------------------------------------- - - def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=0): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test03_SimpleCursorStuff (get_error %s, set_error %s)..." % \ - (self.__class__.__name__, get_raises_error, set_raises_error) - - if self.env and self.dbopenflags & db.DB_AUTO_COMMIT: - txn = self.env.txn_begin() - else: - txn = None - c = self.d.cursor(txn=txn) - - rec = c.first() - count = 0 - while rec is not None: - count = count + 1 - if verbose and count % 100 == 0: - print rec - try: - rec = c.next() - except db.DBNotFoundError, val: - if get_raises_error: - assert val[0] == db.DB_NOTFOUND - if verbose: print val - rec = None - else: - self.fail("unexpected DBNotFoundError") - assert c.get_current_size() == len(c.current()[1]), "%s != len(%r)" % (c.get_current_size(), c.current()[1]) - - assert count == self._numKeys - - - rec = c.last() - count = 0 - while rec is not None: - count = count + 1 - if verbose and count % 100 == 0: - print rec - try: - rec = c.prev() - except db.DBNotFoundError, val: - if get_raises_error: - assert val[0] == db.DB_NOTFOUND - if verbose: print val - rec = None - else: - self.fail("unexpected DBNotFoundError") - - assert count == self._numKeys - - rec = c.set('0505') - rec2 = c.current() - assert rec == rec2 - assert rec[0] == '0505' - assert rec[1] == self.makeData('0505') - assert c.get_current_size() == len(rec[1]) - - # make sure we get empty values properly - rec = c.set('empty value') - assert rec[1] == '' - assert c.get_current_size() == 0 - - try: - n = c.set('bad key') - except db.DBNotFoundError, val: - assert val[0] == db.DB_NOTFOUND - if verbose: print val - else: - if set_raises_error: - self.fail("expected exception") - if n != None: - self.fail("expected None: %r" % (n,)) - - rec = c.get_both('0404', self.makeData('0404')) - assert rec == ('0404', self.makeData('0404')) - - try: - n = c.get_both('0404', 'bad data') - except db.DBNotFoundError, val: - assert val[0] == db.DB_NOTFOUND - if verbose: print val - else: - if get_raises_error: - self.fail("expected exception") - if n != None: - self.fail("expected None: %r" % (n,)) - - if self.d.get_type() == db.DB_BTREE: - rec = c.set_range('011') - if verbose: - print "searched for '011', found: ", rec - - rec = c.set_range('011',dlen=0,doff=0) - if verbose: - print "searched (partial) for '011', found: ", rec - if rec[1] != '': self.fail('expected empty data portion') - - ev = c.set_range('empty value') - if verbose: - print "search for 'empty value' returned", ev - if ev[1] != '': self.fail('empty value lookup failed') - - c.set('0499') - c.delete() - try: - rec = c.current() - except db.DBKeyEmptyError, val: - if get_raises_error: - assert val[0] == db.DB_KEYEMPTY - if verbose: print val - else: - self.fail("unexpected DBKeyEmptyError") - else: - if get_raises_error: - self.fail('DBKeyEmptyError exception expected') - - c.next() - c2 = c.dup(db.DB_POSITION) - assert c.current() == c2.current() - - c2.put('', 'a new value', db.DB_CURRENT) - assert c.current() == c2.current() - assert c.current()[1] == 'a new value' - - c2.put('', 'er', db.DB_CURRENT, dlen=0, doff=5) - assert c2.current()[1] == 'a newer value' - - c.close() - c2.close() - if txn: - txn.commit() - - # time to abuse the closed cursors and hope we don't crash - methods_to_test = { - 'current': (), - 'delete': (), - 'dup': (db.DB_POSITION,), - 'first': (), - 'get': (0,), - 'next': (), - 'prev': (), - 'last': (), - 'put':('', 'spam', db.DB_CURRENT), - 'set': ("0505",), - } - for method, args in methods_to_test.items(): - try: - if verbose: - print "attempting to use a closed cursor's %s method" % \ - method - # a bug may cause a NULL pointer dereference... - apply(getattr(c, method), args) - except db.DBError, val: - assert val[0] == 0 - if verbose: print val - else: - self.fail("no exception raised when using a buggy cursor's" - "%s method" % method) - - # - # free cursor referencing a closed database, it should not barf: - # - oldcursor = self.d.cursor(txn=txn) - self.d.close() - - # this would originally cause a segfault when the cursor for a - # closed database was cleaned up. it should not anymore. - # SF pybsddb bug id 667343 - del oldcursor - - def test03b_SimpleCursorWithoutGetReturnsNone0(self): - # same test but raise exceptions instead of returning None - if verbose: - print '\n', '-=' * 30 - print "Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone..." % \ - self.__class__.__name__ - - old = self.d.set_get_returns_none(0) - assert old == 2 - self.test03_SimpleCursorStuff(get_raises_error=1, set_raises_error=1) - - def test03b_SimpleCursorWithGetReturnsNone1(self): - # same test but raise exceptions instead of returning None - if verbose: - print '\n', '-=' * 30 - print "Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone..." % \ - self.__class__.__name__ - - old = self.d.set_get_returns_none(1) - self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=1) - - - def test03c_SimpleCursorGetReturnsNone2(self): - # same test but raise exceptions instead of returning None - if verbose: - print '\n', '-=' * 30 - print "Running %s.test03c_SimpleCursorStuffWithoutSetReturnsNone..." % \ - self.__class__.__name__ - - old = self.d.set_get_returns_none(1) - assert old == 2 - old = self.d.set_get_returns_none(2) - assert old == 1 - self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0) - - #---------------------------------------- - - def test04_PartialGetAndPut(self): - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test04_PartialGetAndPut..." % \ - self.__class__.__name__ - - key = "partialTest" - data = "1" * 1000 + "2" * 1000 - d.put(key, data) - assert d.get(key) == data - assert d.get(key, dlen=20, doff=990) == ("1" * 10) + ("2" * 10) - - d.put("partialtest2", ("1" * 30000) + "robin" ) - assert d.get("partialtest2", dlen=5, doff=30000) == "robin" - - # There seems to be a bug in DB here... Commented out the test for - # now. - ##assert d.get("partialtest2", dlen=5, doff=30010) == "" - - if self.dbsetflags != db.DB_DUP: - # Partial put with duplicate records requires a cursor - d.put(key, "0000", dlen=2000, doff=0) - assert d.get(key) == "0000" - - d.put(key, "1111", dlen=1, doff=2) - assert d.get(key) == "0011110" - - #---------------------------------------- - - def test05_GetSize(self): - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test05_GetSize..." % self.__class__.__name__ - - for i in range(1, 50000, 500): - key = "size%s" % i - #print "before ", i, - d.put(key, "1" * i) - #print "after", - assert d.get_size(key) == i - #print "done" - - #---------------------------------------- - - def test06_Truncate(self): - if db.version() < (3,3): - # truncate is a feature of BerkeleyDB 3.3 and above - return - - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test99_Truncate..." % self.__class__.__name__ - - d.put("abcde", "ABCDE"); - num = d.truncate() - assert num >= 1, "truncate returned <= 0 on non-empty database" - num = d.truncate() - assert num == 0, "truncate on empty DB returned nonzero (%r)" % (num,) - - #---------------------------------------- - - -#---------------------------------------------------------------------- - - -class BasicBTreeTestCase(BasicTestCase): - dbtype = db.DB_BTREE - - -class BasicHashTestCase(BasicTestCase): - dbtype = db.DB_HASH - - -class BasicBTreeWithThreadFlagTestCase(BasicTestCase): - dbtype = db.DB_BTREE - dbopenflags = db.DB_THREAD - - -class BasicHashWithThreadFlagTestCase(BasicTestCase): - dbtype = db.DB_HASH - dbopenflags = db.DB_THREAD - - -class BasicWithEnvTestCase(BasicTestCase): - dbopenflags = db.DB_THREAD - useEnv = 1 - envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK - - #---------------------------------------- - - def test07_EnvRemoveAndRename(self): - if not self.env: - return - - if verbose: - print '\n', '-=' * 30 - print "Running %s.test07_EnvRemoveAndRename..." % self.__class__.__name__ - - # can't rename or remove an open DB - self.d.close() - - newname = self.filename + '.renamed' - self.env.dbrename(self.filename, None, newname) - self.env.dbremove(newname) - - # dbremove and dbrename are in 4.1 and later - if db.version() < (4,1): - del test07_EnvRemoveAndRename - - #---------------------------------------- - -class BasicBTreeWithEnvTestCase(BasicWithEnvTestCase): - dbtype = db.DB_BTREE - - -class BasicHashWithEnvTestCase(BasicWithEnvTestCase): - dbtype = db.DB_HASH - - -#---------------------------------------------------------------------- - -class BasicTransactionTestCase(BasicTestCase): - dbopenflags = db.DB_THREAD | db.DB_AUTO_COMMIT - useEnv = 1 - envflags = (db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK | - db.DB_INIT_TXN) - envsetflags = db.DB_AUTO_COMMIT - - - def tearDown(self): - self.txn.commit() - BasicTestCase.tearDown(self) - - - def populateDB(self): - txn = self.env.txn_begin() - BasicTestCase.populateDB(self, _txn=txn) - - self.txn = self.env.txn_begin() - - - def test06_Transactions(self): - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test06_Transactions..." % self.__class__.__name__ - - assert d.get('new rec', txn=self.txn) == None - d.put('new rec', 'this is a new record', self.txn) - assert d.get('new rec', txn=self.txn) == 'this is a new record' - self.txn.abort() - assert d.get('new rec') == None - - self.txn = self.env.txn_begin() - - assert d.get('new rec', txn=self.txn) == None - d.put('new rec', 'this is a new record', self.txn) - assert d.get('new rec', txn=self.txn) == 'this is a new record' - self.txn.commit() - assert d.get('new rec') == 'this is a new record' - - self.txn = self.env.txn_begin() - c = d.cursor(self.txn) - rec = c.first() - count = 0 - while rec is not None: - count = count + 1 - if verbose and count % 100 == 0: - print rec - rec = c.next() - assert count == self._numKeys+1 - - c.close() # Cursors *MUST* be closed before commit! - self.txn.commit() - - # flush pending updates - try: - self.env.txn_checkpoint (0, 0, 0) - except db.DBIncompleteError: - pass - - if db.version() >= (4,0): - statDict = self.env.log_stat(0); - assert statDict.has_key('magic') - assert statDict.has_key('version') - assert statDict.has_key('cur_file') - assert statDict.has_key('region_nowait') - - # must have at least one log file present: - logs = self.env.log_archive(db.DB_ARCH_ABS | db.DB_ARCH_LOG) - assert logs != None - for log in logs: - if verbose: - print 'log file: ' + log - if db.version() >= (4,2): - logs = self.env.log_archive(db.DB_ARCH_REMOVE) - assert not logs - - self.txn = self.env.txn_begin() - - #---------------------------------------- - - def test07_TxnTruncate(self): - if db.version() < (3,3): - # truncate is a feature of BerkeleyDB 3.3 and above - return - - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test07_TxnTruncate..." % self.__class__.__name__ - - d.put("abcde", "ABCDE"); - txn = self.env.txn_begin() - num = d.truncate(txn) - assert num >= 1, "truncate returned <= 0 on non-empty database" - num = d.truncate(txn) - assert num == 0, "truncate on empty DB returned nonzero (%r)" % (num,) - txn.commit() - - #---------------------------------------- - - def test08_TxnLateUse(self): - txn = self.env.txn_begin() - txn.abort() - try: - txn.abort() - except db.DBError, e: - pass - else: - raise RuntimeError, "DBTxn.abort() called after DB_TXN no longer valid w/o an exception" - - txn = self.env.txn_begin() - txn.commit() - try: - txn.commit() - except db.DBError, e: - pass - else: - raise RuntimeError, "DBTxn.commit() called after DB_TXN no longer valid w/o an exception" - - -class BTreeTransactionTestCase(BasicTransactionTestCase): - dbtype = db.DB_BTREE - -class HashTransactionTestCase(BasicTransactionTestCase): - dbtype = db.DB_HASH - - - -#---------------------------------------------------------------------- - -class BTreeRecnoTestCase(BasicTestCase): - dbtype = db.DB_BTREE - dbsetflags = db.DB_RECNUM - - def test07_RecnoInBTree(self): - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test07_RecnoInBTree..." % self.__class__.__name__ - - rec = d.get(200) - assert type(rec) == type(()) - assert len(rec) == 2 - if verbose: - print "Record #200 is ", rec - - c = d.cursor() - c.set('0200') - num = c.get_recno() - assert type(num) == type(1) - if verbose: - print "recno of d['0200'] is ", num - - rec = c.current() - assert c.set_recno(num) == rec - - c.close() - - - -class BTreeRecnoWithThreadFlagTestCase(BTreeRecnoTestCase): - dbopenflags = db.DB_THREAD - -#---------------------------------------------------------------------- - -class BasicDUPTestCase(BasicTestCase): - dbsetflags = db.DB_DUP - - def test08_DuplicateKeys(self): - d = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test08_DuplicateKeys..." % \ - self.__class__.__name__ - - d.put("dup0", "before") - for x in "The quick brown fox jumped over the lazy dog.".split(): - d.put("dup1", x) - d.put("dup2", "after") - - data = d.get("dup1") - assert data == "The" - if verbose: - print data - - c = d.cursor() - rec = c.set("dup1") - assert rec == ('dup1', 'The') - - next = c.next() - assert next == ('dup1', 'quick') - - rec = c.set("dup1") - count = c.count() - assert count == 9 - - next_dup = c.next_dup() - assert next_dup == ('dup1', 'quick') - - rec = c.set('dup1') - while rec is not None: - if verbose: - print rec - rec = c.next_dup() - - c.set('dup1') - rec = c.next_nodup() - assert rec[0] != 'dup1' - if verbose: - print rec - - c.close() - - - -class BTreeDUPTestCase(BasicDUPTestCase): - dbtype = db.DB_BTREE - -class HashDUPTestCase(BasicDUPTestCase): - dbtype = db.DB_HASH - -class BTreeDUPWithThreadTestCase(BasicDUPTestCase): - dbtype = db.DB_BTREE - dbopenflags = db.DB_THREAD - -class HashDUPWithThreadTestCase(BasicDUPTestCase): - dbtype = db.DB_HASH - dbopenflags = db.DB_THREAD - - -#---------------------------------------------------------------------- - -class BasicMultiDBTestCase(BasicTestCase): - dbname = 'first' - - def otherType(self): - if self.dbtype == db.DB_BTREE: - return db.DB_HASH - else: - return db.DB_BTREE - - def test09_MultiDB(self): - d1 = self.d - if verbose: - print '\n', '-=' * 30 - print "Running %s.test09_MultiDB..." % self.__class__.__name__ - - d2 = db.DB(self.env) - d2.open(self.filename, "second", self.dbtype, - self.dbopenflags|db.DB_CREATE) - d3 = db.DB(self.env) - d3.open(self.filename, "third", self.otherType(), - self.dbopenflags|db.DB_CREATE) - - for x in "The quick brown fox jumped over the lazy dog".split(): - d2.put(x, self.makeData(x)) - - for x in string.letters: - d3.put(x, x*70) - - d1.sync() - d2.sync() - d3.sync() - d1.close() - d2.close() - d3.close() - - self.d = d1 = d2 = d3 = None - - self.d = d1 = db.DB(self.env) - d1.open(self.filename, self.dbname, flags = self.dbopenflags) - d2 = db.DB(self.env) - d2.open(self.filename, "second", flags = self.dbopenflags) - d3 = db.DB(self.env) - d3.open(self.filename, "third", flags = self.dbopenflags) - - c1 = d1.cursor() - c2 = d2.cursor() - c3 = d3.cursor() - - count = 0 - rec = c1.first() - while rec is not None: - count = count + 1 - if verbose and (count % 50) == 0: - print rec - rec = c1.next() - assert count == self._numKeys - - count = 0 - rec = c2.first() - while rec is not None: - count = count + 1 - if verbose: - print rec - rec = c2.next() - assert count == 9 - - count = 0 - rec = c3.first() - while rec is not None: - count = count + 1 - if verbose: - print rec - rec = c3.next() - assert count == 52 - - - c1.close() - c2.close() - c3.close() - - d2.close() - d3.close() - - - -# Strange things happen if you try to use Multiple DBs per file without a -# DBEnv with MPOOL and LOCKing... - -class BTreeMultiDBTestCase(BasicMultiDBTestCase): - dbtype = db.DB_BTREE - dbopenflags = db.DB_THREAD - useEnv = 1 - envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK - -class HashMultiDBTestCase(BasicMultiDBTestCase): - dbtype = db.DB_HASH - dbopenflags = db.DB_THREAD - useEnv = 1 - envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK - - -#---------------------------------------------------------------------- -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - - suite.addTest(unittest.makeSuite(VersionTestCase)) - suite.addTest(unittest.makeSuite(BasicBTreeTestCase)) - suite.addTest(unittest.makeSuite(BasicHashTestCase)) - suite.addTest(unittest.makeSuite(BasicBTreeWithThreadFlagTestCase)) - suite.addTest(unittest.makeSuite(BasicHashWithThreadFlagTestCase)) - suite.addTest(unittest.makeSuite(BasicBTreeWithEnvTestCase)) - suite.addTest(unittest.makeSuite(BasicHashWithEnvTestCase)) - suite.addTest(unittest.makeSuite(BTreeTransactionTestCase)) - suite.addTest(unittest.makeSuite(HashTransactionTestCase)) - suite.addTest(unittest.makeSuite(BTreeRecnoTestCase)) - suite.addTest(unittest.makeSuite(BTreeRecnoWithThreadFlagTestCase)) - suite.addTest(unittest.makeSuite(BTreeDUPTestCase)) - suite.addTest(unittest.makeSuite(HashDUPTestCase)) - suite.addTest(unittest.makeSuite(BTreeDUPWithThreadTestCase)) - suite.addTest(unittest.makeSuite(HashDUPWithThreadTestCase)) - suite.addTest(unittest.makeSuite(BTreeMultiDBTestCase)) - suite.addTest(unittest.makeSuite(HashMultiDBTestCase)) - - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_compare.py b/sys/lib/python/bsddb/test/test_compare.py deleted file mode 100644 index 59a45ec50..000000000 --- a/sys/lib/python/bsddb/test/test_compare.py +++ /dev/null @@ -1,249 +0,0 @@ -""" -TestCases for python DB Btree key comparison function. -""" - -import sys, os, re -import test_all -from cStringIO import StringIO - -import unittest -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbshelve -except ImportError: - # For Python 2.3 - from bsddb import db, dbshelve - -lexical_cmp = cmp - -def lowercase_cmp(left, right): - return cmp (left.lower(), right.lower()) - -def make_reverse_comparator (cmp): - def reverse (left, right, delegate=cmp): - return - delegate (left, right) - return reverse - -_expected_lexical_test_data = ['', 'CCCP', 'a', 'aaa', 'b', 'c', 'cccce', 'ccccf'] -_expected_lowercase_test_data = ['', 'a', 'aaa', 'b', 'c', 'CC', 'cccce', 'ccccf', 'CCCP'] - -class ComparatorTests (unittest.TestCase): - def comparator_test_helper (self, comparator, expected_data): - data = expected_data[:] - data.sort (comparator) - self.failUnless (data == expected_data, - "comparator `%s' is not right: %s vs. %s" - % (comparator, expected_data, data)) - def test_lexical_comparator (self): - self.comparator_test_helper (lexical_cmp, _expected_lexical_test_data) - def test_reverse_lexical_comparator (self): - rev = _expected_lexical_test_data[:] - rev.reverse () - self.comparator_test_helper (make_reverse_comparator (lexical_cmp), - rev) - def test_lowercase_comparator (self): - self.comparator_test_helper (lowercase_cmp, - _expected_lowercase_test_data) - -class AbstractBtreeKeyCompareTestCase (unittest.TestCase): - env = None - db = None - - def setUp (self): - self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join (os.path.dirname (sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - os.mkdir (homeDir) - except os.error: - pass - - env = db.DBEnv () - env.open (homeDir, - db.DB_CREATE | db.DB_INIT_MPOOL - | db.DB_INIT_LOCK | db.DB_THREAD) - self.env = env - - def tearDown (self): - self.closeDB () - if self.env is not None: - self.env.close () - self.env = None - import glob - map (os.remove, glob.glob (os.path.join (self.homeDir, '*'))) - - def addDataToDB (self, data): - i = 0 - for item in data: - self.db.put (item, str (i)) - i = i + 1 - - def createDB (self, key_comparator): - self.db = db.DB (self.env) - self.setupDB (key_comparator) - self.db.open (self.filename, "test", db.DB_BTREE, db.DB_CREATE) - - def setupDB (self, key_comparator): - self.db.set_bt_compare (key_comparator) - - def closeDB (self): - if self.db is not None: - self.db.close () - self.db = None - - def startTest (self): - pass - - def finishTest (self, expected = None): - if expected is not None: - self.check_results (expected) - self.closeDB () - - def check_results (self, expected): - curs = self.db.cursor () - try: - index = 0 - rec = curs.first () - while rec: - key, ignore = rec - self.failUnless (index < len (expected), - "to many values returned from cursor") - self.failUnless (expected[index] == key, - "expected value `%s' at %d but got `%s'" - % (expected[index], index, key)) - index = index + 1 - rec = curs.next () - self.failUnless (index == len (expected), - "not enough values returned from cursor") - finally: - curs.close () - -class BtreeKeyCompareTestCase (AbstractBtreeKeyCompareTestCase): - def runCompareTest (self, comparator, data): - self.startTest () - self.createDB (comparator) - self.addDataToDB (data) - self.finishTest (data) - - def test_lexical_ordering (self): - self.runCompareTest (lexical_cmp, _expected_lexical_test_data) - - def test_reverse_lexical_ordering (self): - expected_rev_data = _expected_lexical_test_data[:] - expected_rev_data.reverse () - self.runCompareTest (make_reverse_comparator (lexical_cmp), - expected_rev_data) - - def test_compare_function_useless (self): - self.startTest () - def socialist_comparator (l, r): - return 0 - self.createDB (socialist_comparator) - self.addDataToDB (['b', 'a', 'd']) - # all things being equal the first key will be the only key - # in the database... (with the last key's value fwiw) - self.finishTest (['b']) - - -class BtreeExceptionsTestCase (AbstractBtreeKeyCompareTestCase): - def test_raises_non_callable (self): - self.startTest () - self.assertRaises (TypeError, self.createDB, 'abc') - self.assertRaises (TypeError, self.createDB, None) - self.finishTest () - - def test_set_bt_compare_with_function (self): - self.startTest () - self.createDB (lexical_cmp) - self.finishTest () - - def check_results (self, results): - pass - - def test_compare_function_incorrect (self): - self.startTest () - def bad_comparator (l, r): - return 1 - # verify that set_bt_compare checks that comparator('', '') == 0 - self.assertRaises (TypeError, self.createDB, bad_comparator) - self.finishTest () - - def verifyStderr(self, method, successRe): - """ - Call method() while capturing sys.stderr output internally and - call self.fail() if successRe.search() does not match the stderr - output. This is used to test for uncatchable exceptions. - """ - stdErr = sys.stderr - sys.stderr = StringIO() - try: - method() - finally: - temp = sys.stderr - sys.stderr = stdErr - errorOut = temp.getvalue() - if not successRe.search(errorOut): - self.fail("unexpected stderr output:\n"+errorOut) - - def _test_compare_function_exception (self): - self.startTest () - def bad_comparator (l, r): - if l == r: - # pass the set_bt_compare test - return 0 - raise RuntimeError, "i'm a naughty comparison function" - self.createDB (bad_comparator) - #print "\n*** test should print 2 uncatchable tracebacks ***" - self.addDataToDB (['a', 'b', 'c']) # this should raise, but... - self.finishTest () - - def test_compare_function_exception(self): - self.verifyStderr( - self._test_compare_function_exception, - re.compile('(^RuntimeError:.* naughty.*){2}', re.M|re.S) - ) - - def _test_compare_function_bad_return (self): - self.startTest () - def bad_comparator (l, r): - if l == r: - # pass the set_bt_compare test - return 0 - return l - self.createDB (bad_comparator) - #print "\n*** test should print 2 errors about returning an int ***" - self.addDataToDB (['a', 'b', 'c']) # this should raise, but... - self.finishTest () - - def test_compare_function_bad_return(self): - self.verifyStderr( - self._test_compare_function_bad_return, - re.compile('(^TypeError:.* return an int.*){2}', re.M|re.S) - ) - - - def test_cannot_assign_twice (self): - - def my_compare (a, b): - return 0 - - self.startTest () - self.createDB (my_compare) - try: - self.db.set_bt_compare (my_compare) - assert False, "this set should fail" - - except RuntimeError, msg: - pass - -def test_suite (): - res = unittest.TestSuite () - - res.addTest (unittest.makeSuite (ComparatorTests)) - if db.version () >= (3, 3, 11): - res.addTest (unittest.makeSuite (BtreeExceptionsTestCase)) - res.addTest (unittest.makeSuite (BtreeKeyCompareTestCase)) - return res - -if __name__ == '__main__': - unittest.main (defaultTest = 'suite') diff --git a/sys/lib/python/bsddb/test/test_compat.py b/sys/lib/python/bsddb/test/test_compat.py deleted file mode 100644 index b108db4c6..000000000 --- a/sys/lib/python/bsddb/test/test_compat.py +++ /dev/null @@ -1,191 +0,0 @@ -""" -Test cases adapted from the test_bsddb.py module in Python's -regression test suite. -""" - -import sys, os, string -import unittest -import tempfile - -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, hashopen, btopen, rnopen -except ImportError: - # For Python 2.3 - from bsddb import db, hashopen, btopen, rnopen - - -class CompatibilityTestCase(unittest.TestCase): - def setUp(self): - self.filename = tempfile.mktemp() - - def tearDown(self): - try: - os.remove(self.filename) - except os.error: - pass - - - def test01_btopen(self): - self.do_bthash_test(btopen, 'btopen') - - def test02_hashopen(self): - self.do_bthash_test(hashopen, 'hashopen') - - def test03_rnopen(self): - data = string.split("The quick brown fox jumped over the lazy dog.") - if verbose: - print "\nTesting: rnopen" - - f = rnopen(self.filename, 'c') - for x in range(len(data)): - f[x+1] = data[x] - - getTest = (f[1], f[2], f[3]) - if verbose: - print '%s %s %s' % getTest - - assert getTest[1] == 'quick', 'data mismatch!' - - rv = f.set_location(3) - if rv != (3, 'brown'): - self.fail('recno database set_location failed: '+repr(rv)) - - f[25] = 'twenty-five' - f.close() - del f - - f = rnopen(self.filename, 'w') - f[20] = 'twenty' - - def noRec(f): - rec = f[15] - self.assertRaises(KeyError, noRec, f) - - def badKey(f): - rec = f['a string'] - self.assertRaises(TypeError, badKey, f) - - del f[3] - - rec = f.first() - while rec: - if verbose: - print rec - try: - rec = f.next() - except KeyError: - break - - f.close() - - - def test04_n_flag(self): - f = hashopen(self.filename, 'n') - f.close() - - - def do_bthash_test(self, factory, what): - if verbose: - print '\nTesting: ', what - - f = factory(self.filename, 'c') - if verbose: - print 'creation...' - - # truth test - if f: - if verbose: print "truth test: true" - else: - if verbose: print "truth test: false" - - f['0'] = '' - f['a'] = 'Guido' - f['b'] = 'van' - f['c'] = 'Rossum' - f['d'] = 'invented' - # 'e' intentionally left out - f['f'] = 'Python' - if verbose: - print '%s %s %s' % (f['a'], f['b'], f['c']) - - if verbose: - print 'key ordering...' - start = f.set_location(f.first()[0]) - if start != ('0', ''): - self.fail("incorrect first() result: "+repr(start)) - while 1: - try: - rec = f.next() - except KeyError: - assert rec == f.last(), 'Error, last <> last!' - f.previous() - break - if verbose: - print rec - - assert f.has_key('f'), 'Error, missing key!' - - # test that set_location() returns the next nearest key, value - # on btree databases and raises KeyError on others. - if factory == btopen: - e = f.set_location('e') - if e != ('f', 'Python'): - self.fail('wrong key,value returned: '+repr(e)) - else: - try: - e = f.set_location('e') - except KeyError: - pass - else: - self.fail("set_location on non-existant key did not raise KeyError") - - f.sync() - f.close() - # truth test - try: - if f: - if verbose: print "truth test: true" - else: - if verbose: print "truth test: false" - except db.DBError: - pass - else: - self.fail("Exception expected") - - del f - - if verbose: - print 'modification...' - f = factory(self.filename, 'w') - f['d'] = 'discovered' - - if verbose: - print 'access...' - for key in f.keys(): - word = f[key] - if verbose: - print word - - def noRec(f): - rec = f['no such key'] - self.assertRaises(KeyError, noRec, f) - - def badKey(f): - rec = f[15] - self.assertRaises(TypeError, badKey, f) - - f.close() - - -#---------------------------------------------------------------------- - - -def test_suite(): - return unittest.makeSuite(CompatibilityTestCase) - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_cursor_pget_bug.py b/sys/lib/python/bsddb/test/test_cursor_pget_bug.py deleted file mode 100644 index de47e6d04..000000000 --- a/sys/lib/python/bsddb/test/test_cursor_pget_bug.py +++ /dev/null @@ -1,65 +0,0 @@ -import unittest -import sys, os, glob - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - - -#---------------------------------------------------------------------- - -class pget_bugTestCase(unittest.TestCase): - """Verify that cursor.pget works properly""" - db_name = 'test-cursor_pget.db' - - def setUp(self): - self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - try: - os.mkdir(self.homeDir) - except os.error: - pass - self.env = db.DBEnv() - self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) - self.primary_db = db.DB(self.env) - self.primary_db.open(self.db_name, 'primary', db.DB_BTREE, db.DB_CREATE) - self.secondary_db = db.DB(self.env) - self.secondary_db.set_flags(db.DB_DUP) - self.secondary_db.open(self.db_name, 'secondary', db.DB_BTREE, db.DB_CREATE) - self.primary_db.associate(self.secondary_db, lambda key, data: data) - self.primary_db.put('salad', 'eggs') - self.primary_db.put('spam', 'ham') - self.primary_db.put('omelet', 'eggs') - - - def tearDown(self): - self.secondary_db.close() - self.primary_db.close() - self.env.close() - del self.secondary_db - del self.primary_db - del self.env - for file in glob.glob(os.path.join(self.homeDir, '*')): - os.remove(file) - os.removedirs(self.homeDir) - - def test_pget(self): - cursor = self.secondary_db.cursor() - - self.assertEquals(('eggs', 'salad', 'eggs'), cursor.pget(key='eggs', flags=db.DB_SET)) - self.assertEquals(('eggs', 'omelet', 'eggs'), cursor.pget(db.DB_NEXT_DUP)) - self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) - - self.assertEquals(('ham', 'spam', 'ham'), cursor.pget('ham', 'spam', flags=db.DB_SET)) - self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) - - cursor.close() - - -def test_suite(): - return unittest.makeSuite(pget_bugTestCase) - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_dbobj.py b/sys/lib/python/bsddb/test/test_dbobj.py deleted file mode 100644 index 1ef382e0f..000000000 --- a/sys/lib/python/bsddb/test/test_dbobj.py +++ /dev/null @@ -1,82 +0,0 @@ - -import sys, os, string -import unittest -import glob - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbobj -except ImportError: - # For Python 2.3 - from bsddb import db, dbobj - - -#---------------------------------------------------------------------- - -class dbobjTestCase(unittest.TestCase): - """Verify that dbobj.DB and dbobj.DBEnv work properly""" - db_home = 'db_home' - db_name = 'test-dbobj.db' - - def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass - - def tearDown(self): - if hasattr(self, 'db'): - del self.db - if hasattr(self, 'env'): - del self.env - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def test01_both(self): - class TestDBEnv(dbobj.DBEnv): pass - class TestDB(dbobj.DB): - def put(self, key, *args, **kwargs): - key = string.upper(key) - # call our parent classes put method with an upper case key - return apply(dbobj.DB.put, (self, key) + args, kwargs) - self.env = TestDBEnv() - self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) - self.db = TestDB(self.env) - self.db.open(self.db_name, db.DB_HASH, db.DB_CREATE) - self.db.put('spam', 'eggs') - assert self.db.get('spam') == None, \ - "overridden dbobj.DB.put() method failed [1]" - assert self.db.get('SPAM') == 'eggs', \ - "overridden dbobj.DB.put() method failed [2]" - self.db.close() - self.env.close() - - def test02_dbobj_dict_interface(self): - self.env = dbobj.DBEnv() - self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) - self.db = dbobj.DB(self.env) - self.db.open(self.db_name+'02', db.DB_HASH, db.DB_CREATE) - # __setitem__ - self.db['spam'] = 'eggs' - # __len__ - assert len(self.db) == 1 - # __getitem__ - assert self.db['spam'] == 'eggs' - # __del__ - del self.db['spam'] - assert self.db.get('spam') == None, "dbobj __del__ failed" - self.db.close() - self.env.close() - - def test03_dbobj_type_before_open(self): - # Ensure this doesn't cause a segfault. - self.assertRaises(db.DBInvalidArgError, db.DB().type) - -#---------------------------------------------------------------------- - -def test_suite(): - return unittest.makeSuite(dbobjTestCase) - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_dbshelve.py b/sys/lib/python/bsddb/test/test_dbshelve.py deleted file mode 100644 index 722ee5b40..000000000 --- a/sys/lib/python/bsddb/test/test_dbshelve.py +++ /dev/null @@ -1,306 +0,0 @@ -""" -TestCases for checking dbShelve objects. -""" - -import sys, os, string -import tempfile, random -from pprint import pprint -from types import * -import unittest - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbshelve -except ImportError: - # For Python 2.3 - from bsddb import db, dbshelve - -from test_all import verbose - - -#---------------------------------------------------------------------- - -# We want the objects to be comparable so we can test dbshelve.values -# later on. -class DataClass: - def __init__(self): - self.value = random.random() - - def __cmp__(self, other): - return cmp(self.value, other) - -class DBShelveTestCase(unittest.TestCase): - def setUp(self): - self.filename = tempfile.mktemp() - self.do_open() - - def tearDown(self): - self.do_close() - try: - os.remove(self.filename) - except os.error: - pass - - def populateDB(self, d): - for x in string.letters: - d['S' + x] = 10 * x # add a string - d['I' + x] = ord(x) # add an integer - d['L' + x] = [x] * 10 # add a list - - inst = DataClass() # add an instance - inst.S = 10 * x - inst.I = ord(x) - inst.L = [x] * 10 - d['O' + x] = inst - - - # overridable in derived classes to affect how the shelf is created/opened - def do_open(self): - self.d = dbshelve.open(self.filename) - - # and closed... - def do_close(self): - self.d.close() - - - - def test01_basics(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_basics..." % self.__class__.__name__ - - self.populateDB(self.d) - self.d.sync() - self.do_close() - self.do_open() - d = self.d - - l = len(d) - k = d.keys() - s = d.stat() - f = d.fd() - - if verbose: - print "length:", l - print "keys:", k - print "stats:", s - - assert 0 == d.has_key('bad key') - assert 1 == d.has_key('IA') - assert 1 == d.has_key('OA') - - d.delete('IA') - del d['OA'] - assert 0 == d.has_key('IA') - assert 0 == d.has_key('OA') - assert len(d) == l-2 - - values = [] - for key in d.keys(): - value = d[key] - values.append(value) - if verbose: - print "%s: %s" % (key, value) - self.checkrec(key, value) - - dbvalues = d.values() - assert len(dbvalues) == len(d.keys()) - values.sort() - dbvalues.sort() - assert values == dbvalues - - items = d.items() - assert len(items) == len(values) - - for key, value in items: - self.checkrec(key, value) - - assert d.get('bad key') == None - assert d.get('bad key', None) == None - assert d.get('bad key', 'a string') == 'a string' - assert d.get('bad key', [1, 2, 3]) == [1, 2, 3] - - d.set_get_returns_none(0) - self.assertRaises(db.DBNotFoundError, d.get, 'bad key') - d.set_get_returns_none(1) - - d.put('new key', 'new data') - assert d.get('new key') == 'new data' - assert d['new key'] == 'new data' - - - - def test02_cursors(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_cursors..." % self.__class__.__name__ - - self.populateDB(self.d) - d = self.d - - count = 0 - c = d.cursor() - rec = c.first() - while rec is not None: - count = count + 1 - if verbose: - print rec - key, value = rec - self.checkrec(key, value) - rec = c.next() - del c - - assert count == len(d) - - count = 0 - c = d.cursor() - rec = c.last() - while rec is not None: - count = count + 1 - if verbose: - print rec - key, value = rec - self.checkrec(key, value) - rec = c.prev() - - assert count == len(d) - - c.set('SS') - key, value = c.current() - self.checkrec(key, value) - del c - - - - def checkrec(self, key, value): - x = key[1] - if key[0] == 'S': - assert type(value) == StringType - assert value == 10 * x - - elif key[0] == 'I': - assert type(value) == IntType - assert value == ord(x) - - elif key[0] == 'L': - assert type(value) == ListType - assert value == [x] * 10 - - elif key[0] == 'O': - assert type(value) == InstanceType - assert value.S == 10 * x - assert value.I == ord(x) - assert value.L == [x] * 10 - - else: - raise AssertionError, 'Unknown key type, fix the test' - -#---------------------------------------------------------------------- - -class BasicShelveTestCase(DBShelveTestCase): - def do_open(self): - self.d = dbshelve.DBShelf() - self.d.open(self.filename, self.dbtype, self.dbflags) - - def do_close(self): - self.d.close() - - -class BTreeShelveTestCase(BasicShelveTestCase): - dbtype = db.DB_BTREE - dbflags = db.DB_CREATE - - -class HashShelveTestCase(BasicShelveTestCase): - dbtype = db.DB_HASH - dbflags = db.DB_CREATE - - -class ThreadBTreeShelveTestCase(BasicShelveTestCase): - dbtype = db.DB_BTREE - dbflags = db.DB_CREATE | db.DB_THREAD - - -class ThreadHashShelveTestCase(BasicShelveTestCase): - dbtype = db.DB_HASH - dbflags = db.DB_CREATE | db.DB_THREAD - - -#---------------------------------------------------------------------- - -class BasicEnvShelveTestCase(DBShelveTestCase): - def do_open(self): - self.homeDir = homeDir = os.path.join( - os.path.dirname(sys.argv[0]), 'db_home') - try: os.mkdir(homeDir) - except os.error: pass - self.env = db.DBEnv() - self.env.open(homeDir, self.envflags | db.DB_INIT_MPOOL | db.DB_CREATE) - - self.filename = os.path.split(self.filename)[1] - self.d = dbshelve.DBShelf(self.env) - self.d.open(self.filename, self.dbtype, self.dbflags) - - - def do_close(self): - self.d.close() - self.env.close() - - - def tearDown(self): - self.do_close() - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - - -class EnvBTreeShelveTestCase(BasicEnvShelveTestCase): - envflags = 0 - dbtype = db.DB_BTREE - dbflags = db.DB_CREATE - - -class EnvHashShelveTestCase(BasicEnvShelveTestCase): - envflags = 0 - dbtype = db.DB_HASH - dbflags = db.DB_CREATE - - -class EnvThreadBTreeShelveTestCase(BasicEnvShelveTestCase): - envflags = db.DB_THREAD - dbtype = db.DB_BTREE - dbflags = db.DB_CREATE | db.DB_THREAD - - -class EnvThreadHashShelveTestCase(BasicEnvShelveTestCase): - envflags = db.DB_THREAD - dbtype = db.DB_HASH - dbflags = db.DB_CREATE | db.DB_THREAD - - -#---------------------------------------------------------------------- -# TODO: Add test cases for a DBShelf in a RECNO DB. - - -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - - suite.addTest(unittest.makeSuite(DBShelveTestCase)) - suite.addTest(unittest.makeSuite(BTreeShelveTestCase)) - suite.addTest(unittest.makeSuite(HashShelveTestCase)) - suite.addTest(unittest.makeSuite(ThreadBTreeShelveTestCase)) - suite.addTest(unittest.makeSuite(ThreadHashShelveTestCase)) - suite.addTest(unittest.makeSuite(EnvBTreeShelveTestCase)) - suite.addTest(unittest.makeSuite(EnvHashShelveTestCase)) - suite.addTest(unittest.makeSuite(EnvThreadBTreeShelveTestCase)) - suite.addTest(unittest.makeSuite(EnvThreadHashShelveTestCase)) - - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_dbtables.py b/sys/lib/python/bsddb/test/test_dbtables.py deleted file mode 100644 index f6724829a..000000000 --- a/sys/lib/python/bsddb/test/test_dbtables.py +++ /dev/null @@ -1,383 +0,0 @@ -#!/usr/bin/env python -# -#----------------------------------------------------------------------- -# A test suite for the table interface built on bsddb.db -#----------------------------------------------------------------------- -# -# Copyright (C) 2000, 2001 by Autonomous Zone Industries -# Copyright (C) 2002 Gregory P. Smith -# -# March 20, 2000 -# -# License: This is free software. You may use this software for any -# purpose including modification/redistribution, so long as -# this header remains intact and that you do not claim any -# rights of ownership or authorship of this software. This -# software has been tested, but no warranty is expressed or -# implied. -# -# -- Gregory P. Smith -# -# $Id: test_dbtables.py 46737 2006-06-08 05:38:11Z gregory.p.smith $ - -import sys, os, re -try: - import cPickle - pickle = cPickle -except ImportError: - import pickle - -import unittest -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbtables -except ImportError: - # For Python 2.3 - from bsddb import db, dbtables - - - -#---------------------------------------------------------------------- - -class TableDBTestCase(unittest.TestCase): - db_home = 'db_home' - db_name = 'test-table.db' - - def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass - self.tdb = dbtables.bsdTableDB( - filename='tabletest.db', dbhome=homeDir, create=1) - - def tearDown(self): - self.tdb.close() - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def test01(self): - tabname = "test01" - colname = 'cool numbers' - try: - self.tdb.Drop(tabname) - except dbtables.TableDBError: - pass - self.tdb.CreateTable(tabname, [colname]) - self.tdb.Insert(tabname, {colname: pickle.dumps(3.14159, 1)}) - - if verbose: - self.tdb._db_print() - - values = self.tdb.Select( - tabname, [colname], conditions={colname: None}) - - colval = pickle.loads(values[0][colname]) - assert(colval > 3.141 and colval < 3.142) - - - def test02(self): - tabname = "test02" - col0 = 'coolness factor' - col1 = 'but can it fly?' - col2 = 'Species' - testinfo = [ - {col0: pickle.dumps(8, 1), col1: 'no', col2: 'Penguin'}, - {col0: pickle.dumps(-1, 1), col1: 'no', col2: 'Turkey'}, - {col0: pickle.dumps(9, 1), col1: 'yes', col2: 'SR-71A Blackbird'} - ] - - try: - self.tdb.Drop(tabname) - except dbtables.TableDBError: - pass - self.tdb.CreateTable(tabname, [col0, col1, col2]) - for row in testinfo : - self.tdb.Insert(tabname, row) - - values = self.tdb.Select(tabname, [col2], - conditions={col0: lambda x: pickle.loads(x) >= 8}) - - assert len(values) == 2 - if values[0]['Species'] == 'Penguin' : - assert values[1]['Species'] == 'SR-71A Blackbird' - elif values[0]['Species'] == 'SR-71A Blackbird' : - assert values[1]['Species'] == 'Penguin' - else : - if verbose: - print "values= %r" % (values,) - raise "Wrong values returned!" - - def test03(self): - tabname = "test03" - try: - self.tdb.Drop(tabname) - except dbtables.TableDBError: - pass - if verbose: - print '...before CreateTable...' - self.tdb._db_print() - self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e']) - if verbose: - print '...after CreateTable...' - self.tdb._db_print() - self.tdb.Drop(tabname) - if verbose: - print '...after Drop...' - self.tdb._db_print() - self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e']) - - try: - self.tdb.Insert(tabname, - {'a': "", - 'e': pickle.dumps([{4:5, 6:7}, 'foo'], 1), - 'f': "Zero"}) - assert 0 - except dbtables.TableDBError: - pass - - try: - self.tdb.Select(tabname, [], conditions={'foo': '123'}) - assert 0 - except dbtables.TableDBError: - pass - - self.tdb.Insert(tabname, - {'a': '42', - 'b': "bad", - 'c': "meep", - 'e': 'Fuzzy wuzzy was a bear'}) - self.tdb.Insert(tabname, - {'a': '581750', - 'b': "good", - 'd': "bla", - 'c': "black", - 'e': 'fuzzy was here'}) - self.tdb.Insert(tabname, - {'a': '800000', - 'b': "good", - 'd': "bla", - 'c': "black", - 'e': 'Fuzzy wuzzy is a bear'}) - - if verbose: - self.tdb._db_print() - - # this should return two rows - values = self.tdb.Select(tabname, ['b', 'a', 'd'], - conditions={'e': re.compile('wuzzy').search, - 'a': re.compile('^[0-9]+$').match}) - assert len(values) == 2 - - # now lets delete one of them and try again - self.tdb.Delete(tabname, conditions={'b': dbtables.ExactCond('good')}) - values = self.tdb.Select( - tabname, ['a', 'd', 'b'], - conditions={'e': dbtables.PrefixCond('Fuzzy')}) - assert len(values) == 1 - assert values[0]['d'] == None - - values = self.tdb.Select(tabname, ['b'], - conditions={'c': lambda c: c == 'meep'}) - assert len(values) == 1 - assert values[0]['b'] == "bad" - - - def test04_MultiCondSelect(self): - tabname = "test04_MultiCondSelect" - try: - self.tdb.Drop(tabname) - except dbtables.TableDBError: - pass - self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e']) - - try: - self.tdb.Insert(tabname, - {'a': "", - 'e': pickle.dumps([{4:5, 6:7}, 'foo'], 1), - 'f': "Zero"}) - assert 0 - except dbtables.TableDBError: - pass - - self.tdb.Insert(tabname, {'a': "A", 'b': "B", 'c': "C", 'd': "D", - 'e': "E"}) - self.tdb.Insert(tabname, {'a': "-A", 'b': "-B", 'c': "-C", 'd': "-D", - 'e': "-E"}) - self.tdb.Insert(tabname, {'a': "A-", 'b': "B-", 'c': "C-", 'd': "D-", - 'e': "E-"}) - - if verbose: - self.tdb._db_print() - - # This select should return 0 rows. it is designed to test - # the bug identified and fixed in sourceforge bug # 590449 - # (Big Thanks to "Rob Tillotson (n9mtb)" for tracking this down - # and supplying a fix!! This one caused many headaches to say - # the least...) - values = self.tdb.Select(tabname, ['b', 'a', 'd'], - conditions={'e': dbtables.ExactCond('E'), - 'a': dbtables.ExactCond('A'), - 'd': dbtables.PrefixCond('-') - } ) - assert len(values) == 0, values - - - def test_CreateOrExtend(self): - tabname = "test_CreateOrExtend" - - self.tdb.CreateOrExtendTable( - tabname, ['name', 'taste', 'filling', 'alcohol content', 'price']) - try: - self.tdb.Insert(tabname, - {'taste': 'crap', - 'filling': 'no', - 'is it Guinness?': 'no'}) - assert 0, "Insert should've failed due to bad column name" - except: - pass - self.tdb.CreateOrExtendTable(tabname, - ['name', 'taste', 'is it Guinness?']) - - # these should both succeed as the table should contain the union of both sets of columns. - self.tdb.Insert(tabname, {'taste': 'crap', 'filling': 'no', - 'is it Guinness?': 'no'}) - self.tdb.Insert(tabname, {'taste': 'great', 'filling': 'yes', - 'is it Guinness?': 'yes', - 'name': 'Guinness'}) - - - def test_CondObjs(self): - tabname = "test_CondObjs" - - self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e', 'p']) - - self.tdb.Insert(tabname, {'a': "the letter A", - 'b': "the letter B", - 'c': "is for cookie"}) - self.tdb.Insert(tabname, {'a': "is for aardvark", - 'e': "the letter E", - 'c': "is for cookie", - 'd': "is for dog"}) - self.tdb.Insert(tabname, {'a': "the letter A", - 'e': "the letter E", - 'c': "is for cookie", - 'p': "is for Python"}) - - values = self.tdb.Select( - tabname, ['p', 'e'], - conditions={'e': dbtables.PrefixCond('the l')}) - assert len(values) == 2, values - assert values[0]['e'] == values[1]['e'], values - assert values[0]['p'] != values[1]['p'], values - - values = self.tdb.Select( - tabname, ['d', 'a'], - conditions={'a': dbtables.LikeCond('%aardvark%')}) - assert len(values) == 1, values - assert values[0]['d'] == "is for dog", values - assert values[0]['a'] == "is for aardvark", values - - values = self.tdb.Select(tabname, None, - {'b': dbtables.Cond(), - 'e':dbtables.LikeCond('%letter%'), - 'a':dbtables.PrefixCond('is'), - 'd':dbtables.ExactCond('is for dog'), - 'c':dbtables.PrefixCond('is for'), - 'p':lambda s: not s}) - assert len(values) == 1, values - assert values[0]['d'] == "is for dog", values - assert values[0]['a'] == "is for aardvark", values - - def test_Delete(self): - tabname = "test_Delete" - self.tdb.CreateTable(tabname, ['x', 'y', 'z']) - - # prior to 2001-05-09 there was a bug where Delete() would - # fail if it encountered any rows that did not have values in - # every column. - # Hunted and Squashed by (Jukka Santala - donwulff@nic.fi) - self.tdb.Insert(tabname, {'x': 'X1', 'y':'Y1'}) - self.tdb.Insert(tabname, {'x': 'X2', 'y':'Y2', 'z': 'Z2'}) - - self.tdb.Delete(tabname, conditions={'x': dbtables.PrefixCond('X')}) - values = self.tdb.Select(tabname, ['y'], - conditions={'x': dbtables.PrefixCond('X')}) - assert len(values) == 0 - - def test_Modify(self): - tabname = "test_Modify" - self.tdb.CreateTable(tabname, ['Name', 'Type', 'Access']) - - self.tdb.Insert(tabname, {'Name': 'Index to MP3 files.doc', - 'Type': 'Word', 'Access': '8'}) - self.tdb.Insert(tabname, {'Name': 'Nifty.MP3', 'Access': '1'}) - self.tdb.Insert(tabname, {'Type': 'Unknown', 'Access': '0'}) - - def set_type(type): - if type == None: - return 'MP3' - return type - - def increment_access(count): - return str(int(count)+1) - - def remove_value(value): - return None - - self.tdb.Modify(tabname, - conditions={'Access': dbtables.ExactCond('0')}, - mappings={'Access': remove_value}) - self.tdb.Modify(tabname, - conditions={'Name': dbtables.LikeCond('%MP3%')}, - mappings={'Type': set_type}) - self.tdb.Modify(tabname, - conditions={'Name': dbtables.LikeCond('%')}, - mappings={'Access': increment_access}) - - try: - self.tdb.Modify(tabname, - conditions={'Name': dbtables.LikeCond('%')}, - mappings={'Access': 'What is your quest?'}) - except TypeError: - # success, the string value in mappings isn't callable - pass - else: - raise RuntimeError, "why was TypeError not raised for bad callable?" - - # Delete key in select conditions - values = self.tdb.Select( - tabname, None, - conditions={'Type': dbtables.ExactCond('Unknown')}) - assert len(values) == 1, values - assert values[0]['Name'] == None, values - assert values[0]['Access'] == None, values - - # Modify value by select conditions - values = self.tdb.Select( - tabname, None, - conditions={'Name': dbtables.ExactCond('Nifty.MP3')}) - assert len(values) == 1, values - assert values[0]['Type'] == "MP3", values - assert values[0]['Access'] == "2", values - - # Make sure change applied only to select conditions - values = self.tdb.Select( - tabname, None, conditions={'Name': dbtables.LikeCond('%doc%')}) - assert len(values) == 1, values - assert values[0]['Type'] == "Word", values - assert values[0]['Access'] == "9", values - - -def test_suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TableDBTestCase)) - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_env_close.py b/sys/lib/python/bsddb/test/test_env_close.py deleted file mode 100644 index c1129417d..000000000 --- a/sys/lib/python/bsddb/test/test_env_close.py +++ /dev/null @@ -1,107 +0,0 @@ -"""TestCases for checking that it does not segfault when a DBEnv object -is closed before its DB objects. -""" - -import os -import sys -import tempfile -import glob -import unittest - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -from test_all import verbose - -# We're going to get warnings in this module about trying to close the db when -# its env is already closed. Let's just ignore those. -try: - import warnings -except ImportError: - pass -else: - warnings.filterwarnings('ignore', - message='DB could not be closed in', - category=RuntimeWarning) - - -#---------------------------------------------------------------------- - -class DBEnvClosedEarlyCrash(unittest.TestCase): - def setUp(self): - self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - try: os.mkdir(self.homeDir) - except os.error: pass - tempfile.tempdir = self.homeDir - self.filename = os.path.split(tempfile.mktemp())[1] - tempfile.tempdir = None - - def tearDown(self): - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - - def test01_close_dbenv_before_db(self): - dbenv = db.DBEnv() - dbenv.open(self.homeDir, - db.DB_INIT_CDB| db.DB_CREATE |db.DB_THREAD|db.DB_INIT_MPOOL, - 0666) - - d = db.DB(dbenv) - d.open(self.filename, db.DB_BTREE, db.DB_CREATE | db.DB_THREAD, 0666) - - try: - dbenv.close() - except db.DBError: - try: - d.close() - except db.DBError: - return - assert 0, \ - "DB close did not raise an exception about its "\ - "DBEnv being trashed" - - # XXX This may fail when using older versions of BerkeleyDB. - # E.g. 3.2.9 never raised the exception. - assert 0, "dbenv did not raise an exception about its DB being open" - - - def test02_close_dbenv_delete_db_success(self): - dbenv = db.DBEnv() - dbenv.open(self.homeDir, - db.DB_INIT_CDB| db.DB_CREATE |db.DB_THREAD|db.DB_INIT_MPOOL, - 0666) - - d = db.DB(dbenv) - d.open(self.filename, db.DB_BTREE, db.DB_CREATE | db.DB_THREAD, 0666) - - try: - dbenv.close() - except db.DBError: - pass # good, it should raise an exception - - del d - try: - import gc - except ImportError: - gc = None - if gc: - # force d.__del__ [DB_dealloc] to be called - gc.collect() - - -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(DBEnvClosedEarlyCrash)) - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_get_none.py b/sys/lib/python/bsddb/test/test_get_none.py deleted file mode 100644 index 5f09cecc6..000000000 --- a/sys/lib/python/bsddb/test/test_get_none.py +++ /dev/null @@ -1,101 +0,0 @@ -""" -TestCases for checking set_get_returns_none. -""" - -import sys, os, string -import tempfile -from pprint import pprint -import unittest - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -from test_all import verbose - - -#---------------------------------------------------------------------- - -class GetReturnsNoneTestCase(unittest.TestCase): - def setUp(self): - self.filename = tempfile.mktemp() - - def tearDown(self): - try: - os.remove(self.filename) - except os.error: - pass - - - def test01_get_returns_none(self): - d = db.DB() - d.open(self.filename, db.DB_BTREE, db.DB_CREATE) - d.set_get_returns_none(1) - - for x in string.letters: - d.put(x, x * 40) - - data = d.get('bad key') - assert data == None - - data = d.get('a') - assert data == 'a'*40 - - count = 0 - c = d.cursor() - rec = c.first() - while rec: - count = count + 1 - rec = c.next() - - assert rec == None - assert count == 52 - - c.close() - d.close() - - - def test02_get_raises_exception(self): - d = db.DB() - d.open(self.filename, db.DB_BTREE, db.DB_CREATE) - d.set_get_returns_none(0) - - for x in string.letters: - d.put(x, x * 40) - - self.assertRaises(db.DBNotFoundError, d.get, 'bad key') - self.assertRaises(KeyError, d.get, 'bad key') - - data = d.get('a') - assert data == 'a'*40 - - count = 0 - exceptionHappened = 0 - c = d.cursor() - rec = c.first() - while rec: - count = count + 1 - try: - rec = c.next() - except db.DBNotFoundError: # end of the records - exceptionHappened = 1 - break - - assert rec != None - assert exceptionHappened - assert count == 52 - - c.close() - d.close() - -#---------------------------------------------------------------------- - -def test_suite(): - return unittest.makeSuite(GetReturnsNoneTestCase) - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_join.py b/sys/lib/python/bsddb/test/test_join.py deleted file mode 100644 index 73edd114e..000000000 --- a/sys/lib/python/bsddb/test/test_join.py +++ /dev/null @@ -1,120 +0,0 @@ -"""TestCases for using the DB.join and DBCursor.join_item methods. -""" - -import sys, os, string -import tempfile -import time -from pprint import pprint - -try: - from threading import Thread, currentThread - have_threads = 1 -except ImportError: - have_threads = 0 - -import unittest -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbshelve -except ImportError: - # For Python 2.3 - from bsddb import db, dbshelve - - -#---------------------------------------------------------------------- - -ProductIndex = [ - ('apple', "Convenience Store"), - ('blueberry', "Farmer's Market"), - ('shotgun', "S-Mart"), # Aisle 12 - ('pear', "Farmer's Market"), - ('chainsaw', "S-Mart"), # "Shop smart. Shop S-Mart!" - ('strawberry', "Farmer's Market"), -] - -ColorIndex = [ - ('blue', "blueberry"), - ('red', "apple"), - ('red', "chainsaw"), - ('red', "strawberry"), - ('yellow', "peach"), - ('yellow', "pear"), - ('black', "shotgun"), -] - -class JoinTestCase(unittest.TestCase): - keytype = '' - - def setUp(self): - self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass - self.env = db.DBEnv() - self.env.open(homeDir, db.DB_CREATE | db.DB_INIT_MPOOL | db.DB_INIT_LOCK ) - - def tearDown(self): - self.env.close() - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def test01_join(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_join..." % \ - self.__class__.__name__ - - # create and populate primary index - priDB = db.DB(self.env) - priDB.open(self.filename, "primary", db.DB_BTREE, db.DB_CREATE) - map(lambda t, priDB=priDB: apply(priDB.put, t), ProductIndex) - - # create and populate secondary index - secDB = db.DB(self.env) - secDB.set_flags(db.DB_DUP | db.DB_DUPSORT) - secDB.open(self.filename, "secondary", db.DB_BTREE, db.DB_CREATE) - map(lambda t, secDB=secDB: apply(secDB.put, t), ColorIndex) - - sCursor = None - jCursor = None - try: - # lets look up all of the red Products - sCursor = secDB.cursor() - # Don't do the .set() in an assert, or you can get a bogus failure - # when running python -O - tmp = sCursor.set('red') - assert tmp - - # FIXME: jCursor doesn't properly hold a reference to its - # cursors, if they are closed before jcursor is used it - # can cause a crash. - jCursor = priDB.join([sCursor]) - - if jCursor.get(0) != ('apple', "Convenience Store"): - self.fail("join cursor positioned wrong") - if jCursor.join_item() != 'chainsaw': - self.fail("DBCursor.join_item returned wrong item") - if jCursor.get(0)[0] != 'strawberry': - self.fail("join cursor returned wrong thing") - if jCursor.get(0): # there were only three red items to return - self.fail("join cursor returned too many items") - finally: - if jCursor: - jCursor.close() - if sCursor: - sCursor.close() - priDB.close() - secDB.close() - - -def test_suite(): - suite = unittest.TestSuite() - - suite.addTest(unittest.makeSuite(JoinTestCase)) - - return suite diff --git a/sys/lib/python/bsddb/test/test_lock.py b/sys/lib/python/bsddb/test/test_lock.py deleted file mode 100644 index 7d7779805..000000000 --- a/sys/lib/python/bsddb/test/test_lock.py +++ /dev/null @@ -1,143 +0,0 @@ -""" -TestCases for testing the locking sub-system. -""" - -import sys, os, string -import tempfile -import time -from pprint import pprint - -try: - from threading import Thread, currentThread - have_threads = 1 -except ImportError: - have_threads = 0 - - -import unittest -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - - -#---------------------------------------------------------------------- - -class LockingTestCase(unittest.TestCase): - - def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass - self.env = db.DBEnv() - self.env.open(homeDir, db.DB_THREAD | db.DB_INIT_MPOOL | - db.DB_INIT_LOCK | db.DB_CREATE) - - - def tearDown(self): - self.env.close() - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - - def test01_simple(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_simple..." % self.__class__.__name__ - - anID = self.env.lock_id() - if verbose: - print "locker ID: %s" % anID - lock = self.env.lock_get(anID, "some locked thing", db.DB_LOCK_WRITE) - if verbose: - print "Aquired lock: %s" % lock - time.sleep(1) - self.env.lock_put(lock) - if verbose: - print "Released lock: %s" % lock - - - - - def test02_threaded(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_threaded..." % self.__class__.__name__ - - threads = [] - threads.append(Thread(target = self.theThread, - args=(5, db.DB_LOCK_WRITE))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_READ))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_READ))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_WRITE))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_READ))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_READ))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_WRITE))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_WRITE))) - threads.append(Thread(target = self.theThread, - args=(1, db.DB_LOCK_WRITE))) - - for t in threads: - t.start() - for t in threads: - t.join() - - def test03_set_timeout(self): - # test that the set_timeout call works - if hasattr(self.env, 'set_timeout'): - self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT) - self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT) - self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT) - self.env.set_timeout(7890123, db.DB_SET_TXN_TIMEOUT) - - def theThread(self, sleepTime, lockType): - name = currentThread().getName() - if lockType == db.DB_LOCK_WRITE: - lt = "write" - else: - lt = "read" - - anID = self.env.lock_id() - if verbose: - print "%s: locker ID: %s" % (name, anID) - - lock = self.env.lock_get(anID, "some locked thing", lockType) - if verbose: - print "%s: Aquired %s lock: %s" % (name, lt, lock) - - time.sleep(sleepTime) - - self.env.lock_put(lock) - if verbose: - print "%s: Released %s lock: %s" % (name, lt, lock) - - -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - - if have_threads: - suite.addTest(unittest.makeSuite(LockingTestCase)) - else: - suite.addTest(unittest.makeSuite(LockingTestCase, 'test01')) - - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_misc.py b/sys/lib/python/bsddb/test/test_misc.py deleted file mode 100644 index 88f700b46..000000000 --- a/sys/lib/python/bsddb/test/test_misc.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Miscellaneous bsddb module test cases -""" - -import os -import sys -import unittest - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbshelve, hashopen -except ImportError: - # For Python 2.3 - from bsddb import db, dbshelve, hashopen - -#---------------------------------------------------------------------- - -class MiscTestCase(unittest.TestCase): - def setUp(self): - self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - os.mkdir(homeDir) - except OSError: - pass - - def tearDown(self): - try: - os.remove(self.filename) - except OSError: - pass - import glob - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def test01_badpointer(self): - dbs = dbshelve.open(self.filename) - dbs.close() - self.assertRaises(db.DBError, dbs.get, "foo") - - def test02_db_home(self): - env = db.DBEnv() - # check for crash fixed when db_home is used before open() - assert env.db_home is None - env.open(self.homeDir, db.DB_CREATE) - assert self.homeDir == env.db_home - - def test03_repr_closed_db(self): - db = hashopen(self.filename) - db.close() - rp = repr(db) - self.assertEquals(rp, "{}") - - -#---------------------------------------------------------------------- - - -def test_suite(): - return unittest.makeSuite(MiscTestCase) - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_pickle.py b/sys/lib/python/bsddb/test/test_pickle.py deleted file mode 100644 index 3916e5cb9..000000000 --- a/sys/lib/python/bsddb/test/test_pickle.py +++ /dev/null @@ -1,75 +0,0 @@ - -import sys, os, string -import pickle -try: - import cPickle -except ImportError: - cPickle = None -import unittest -import glob - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError, e: - # For Python 2.3 - from bsddb import db - - -#---------------------------------------------------------------------- - -class pickleTestCase(unittest.TestCase): - """Verify that DBError can be pickled and unpickled""" - db_home = 'db_home' - db_name = 'test-dbobj.db' - - def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: os.mkdir(homeDir) - except os.error: pass - - def tearDown(self): - if hasattr(self, 'db'): - del self.db - if hasattr(self, 'env'): - del self.env - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def _base_test_pickle_DBError(self, pickle): - self.env = db.DBEnv() - self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) - self.db = db.DB(self.env) - self.db.open(self.db_name, db.DB_HASH, db.DB_CREATE) - self.db.put('spam', 'eggs') - assert self.db['spam'] == 'eggs' - try: - self.db.put('spam', 'ham', flags=db.DB_NOOVERWRITE) - except db.DBError, egg: - pickledEgg = pickle.dumps(egg) - #print repr(pickledEgg) - rottenEgg = pickle.loads(pickledEgg) - if rottenEgg.args != egg.args or type(rottenEgg) != type(egg): - raise Exception, (rottenEgg, '!=', egg) - else: - raise Exception, "where's my DBError exception?!?" - - self.db.close() - self.env.close() - - def test01_pickle_DBError(self): - self._base_test_pickle_DBError(pickle=pickle) - - if cPickle: - def test02_cPickle_DBError(self): - self._base_test_pickle_DBError(pickle=cPickle) - -#---------------------------------------------------------------------- - -def test_suite(): - return unittest.makeSuite(pickleTestCase) - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_queue.py b/sys/lib/python/bsddb/test/test_queue.py deleted file mode 100644 index 95cf20d0d..000000000 --- a/sys/lib/python/bsddb/test/test_queue.py +++ /dev/null @@ -1,173 +0,0 @@ -""" -TestCases for exercising a Queue DB. -""" - -import sys, os, string -import tempfile -from pprint import pprint -import unittest - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -from test_all import verbose - - -#---------------------------------------------------------------------- - -class SimpleQueueTestCase(unittest.TestCase): - def setUp(self): - self.filename = tempfile.mktemp() - - def tearDown(self): - try: - os.remove(self.filename) - except os.error: - pass - - - def test01_basic(self): - # Basic Queue tests using the deprecated DBCursor.consume method. - - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_basic..." % self.__class__.__name__ - - d = db.DB() - d.set_re_len(40) # Queues must be fixed length - d.open(self.filename, db.DB_QUEUE, db.DB_CREATE) - - if verbose: - print "before appends" + '-' * 30 - pprint(d.stat()) - - for x in string.letters: - d.append(x * 40) - - assert len(d) == 52 - - d.put(100, "some more data") - d.put(101, "and some more ") - d.put(75, "out of order") - d.put(1, "replacement data") - - assert len(d) == 55 - - if verbose: - print "before close" + '-' * 30 - pprint(d.stat()) - - d.close() - del d - d = db.DB() - d.open(self.filename) - - if verbose: - print "after open" + '-' * 30 - pprint(d.stat()) - - d.append("one more") - c = d.cursor() - - if verbose: - print "after append" + '-' * 30 - pprint(d.stat()) - - rec = c.consume() - while rec: - if verbose: - print rec - rec = c.consume() - c.close() - - if verbose: - print "after consume loop" + '-' * 30 - pprint(d.stat()) - - assert len(d) == 0, \ - "if you see this message then you need to rebuild " \ - "BerkeleyDB 3.1.17 with the patch in patches/qam_stat.diff" - - d.close() - - - - def test02_basicPost32(self): - # Basic Queue tests using the new DB.consume method in DB 3.2+ - # (No cursor needed) - - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_basicPost32..." % self.__class__.__name__ - - if db.version() < (3, 2, 0): - if verbose: - print "Test not run, DB not new enough..." - return - - d = db.DB() - d.set_re_len(40) # Queues must be fixed length - d.open(self.filename, db.DB_QUEUE, db.DB_CREATE) - - if verbose: - print "before appends" + '-' * 30 - pprint(d.stat()) - - for x in string.letters: - d.append(x * 40) - - assert len(d) == 52 - - d.put(100, "some more data") - d.put(101, "and some more ") - d.put(75, "out of order") - d.put(1, "replacement data") - - assert len(d) == 55 - - if verbose: - print "before close" + '-' * 30 - pprint(d.stat()) - - d.close() - del d - d = db.DB() - d.open(self.filename) - #d.set_get_returns_none(true) - - if verbose: - print "after open" + '-' * 30 - pprint(d.stat()) - - d.append("one more") - - if verbose: - print "after append" + '-' * 30 - pprint(d.stat()) - - rec = d.consume() - while rec: - if verbose: - print rec - rec = d.consume() - - if verbose: - print "after consume loop" + '-' * 30 - pprint(d.stat()) - - d.close() - - - -#---------------------------------------------------------------------- - -def test_suite(): - return unittest.makeSuite(SimpleQueueTestCase) - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_recno.py b/sys/lib/python/bsddb/test/test_recno.py deleted file mode 100644 index f1ea56afd..000000000 --- a/sys/lib/python/bsddb/test/test_recno.py +++ /dev/null @@ -1,295 +0,0 @@ -"""TestCases for exercising a Recno DB. -""" - -import os -import sys -import errno -import tempfile -from pprint import pprint -import unittest - -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db - -letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - - -#---------------------------------------------------------------------- - -class SimpleRecnoTestCase(unittest.TestCase): - def setUp(self): - self.filename = tempfile.mktemp() - - def tearDown(self): - try: - os.remove(self.filename) - except OSError, e: - if e.errno <> errno.EEXIST: raise - - def test01_basic(self): - d = db.DB() - - get_returns_none = d.set_get_returns_none(2) - d.set_get_returns_none(get_returns_none) - - d.open(self.filename, db.DB_RECNO, db.DB_CREATE) - - for x in letters: - recno = d.append(x * 60) - assert type(recno) == type(0) - assert recno >= 1 - if verbose: - print recno, - - if verbose: print - - stat = d.stat() - if verbose: - pprint(stat) - - for recno in range(1, len(d)+1): - data = d[recno] - if verbose: - print data - - assert type(data) == type("") - assert data == d.get(recno) - - try: - data = d[0] # This should raise a KeyError!?!?! - except db.DBInvalidArgError, val: - assert val[0] == db.EINVAL - if verbose: print val - else: - self.fail("expected exception") - - # test that has_key raises DB exceptions (fixed in pybsddb 4.3.2) - try: - d.has_key(0) - except db.DBError, val: - pass - else: - self.fail("has_key did not raise a proper exception") - - try: - data = d[100] - except KeyError: - pass - else: - self.fail("expected exception") - - try: - data = d.get(100) - except db.DBNotFoundError, val: - if get_returns_none: - self.fail("unexpected exception") - else: - assert data == None - - keys = d.keys() - if verbose: - print keys - assert type(keys) == type([]) - assert type(keys[0]) == type(123) - assert len(keys) == len(d) - - items = d.items() - if verbose: - pprint(items) - assert type(items) == type([]) - assert type(items[0]) == type(()) - assert len(items[0]) == 2 - assert type(items[0][0]) == type(123) - assert type(items[0][1]) == type("") - assert len(items) == len(d) - - assert d.has_key(25) - - del d[25] - assert not d.has_key(25) - - d.delete(13) - assert not d.has_key(13) - - data = d.get_both(26, "z" * 60) - assert data == "z" * 60 - if verbose: - print data - - fd = d.fd() - if verbose: - print fd - - c = d.cursor() - rec = c.first() - while rec: - if verbose: - print rec - rec = c.next() - - c.set(50) - rec = c.current() - if verbose: - print rec - - c.put(-1, "a replacement record", db.DB_CURRENT) - - c.set(50) - rec = c.current() - assert rec == (50, "a replacement record") - if verbose: - print rec - - rec = c.set_range(30) - if verbose: - print rec - - # test that non-existant key lookups work (and that - # DBC_set_range doesn't have a memleak under valgrind) - rec = c.set_range(999999) - assert rec == None - if verbose: - print rec - - c.close() - d.close() - - d = db.DB() - d.open(self.filename) - c = d.cursor() - - # put a record beyond the consecutive end of the recno's - d[100] = "way out there" - assert d[100] == "way out there" - - try: - data = d[99] - except KeyError: - pass - else: - self.fail("expected exception") - - try: - d.get(99) - except db.DBKeyEmptyError, val: - if get_returns_none: - self.fail("unexpected DBKeyEmptyError exception") - else: - assert val[0] == db.DB_KEYEMPTY - if verbose: print val - else: - if not get_returns_none: - self.fail("expected exception") - - rec = c.set(40) - while rec: - if verbose: - print rec - rec = c.next() - - c.close() - d.close() - - def test02_WithSource(self): - """ - A Recno file that is given a "backing source file" is essentially a - simple ASCII file. Normally each record is delimited by \n and so is - just a line in the file, but you can set a different record delimiter - if needed. - """ - source = os.path.join(os.path.dirname(sys.argv[0]), - 'db_home/test_recno.txt') - if not os.path.isdir('db_home'): - os.mkdir('db_home') - f = open(source, 'w') # create the file - f.close() - - d = db.DB() - # This is the default value, just checking if both int - d.set_re_delim(0x0A) - d.set_re_delim('\n') # and char can be used... - d.set_re_source(source) - d.open(self.filename, db.DB_RECNO, db.DB_CREATE) - - data = "The quick brown fox jumped over the lazy dog".split() - for datum in data: - d.append(datum) - d.sync() - d.close() - - # get the text from the backing source - text = open(source, 'r').read() - text = text.strip() - if verbose: - print text - print data - print text.split('\n') - - assert text.split('\n') == data - - # open as a DB again - d = db.DB() - d.set_re_source(source) - d.open(self.filename, db.DB_RECNO) - - d[3] = 'reddish-brown' - d[8] = 'comatose' - - d.sync() - d.close() - - text = open(source, 'r').read() - text = text.strip() - if verbose: - print text - print text.split('\n') - - assert text.split('\n') == \ - "The quick reddish-brown fox jumped over the comatose dog".split() - - def test03_FixedLength(self): - d = db.DB() - d.set_re_len(40) # fixed length records, 40 bytes long - d.set_re_pad('-') # sets the pad character... - d.set_re_pad(45) # ...test both int and char - d.open(self.filename, db.DB_RECNO, db.DB_CREATE) - - for x in letters: - d.append(x * 35) # These will be padded - - d.append('.' * 40) # this one will be exact - - try: # this one will fail - d.append('bad' * 20) - except db.DBInvalidArgError, val: - assert val[0] == db.EINVAL - if verbose: print val - else: - self.fail("expected exception") - - c = d.cursor() - rec = c.first() - while rec: - if verbose: - print rec - rec = c.next() - - c.close() - d.close() - - -#---------------------------------------------------------------------- - - -def test_suite(): - return unittest.makeSuite(SimpleRecnoTestCase) - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_sequence.py b/sys/lib/python/bsddb/test/test_sequence.py deleted file mode 100644 index 979f858c4..000000000 --- a/sys/lib/python/bsddb/test/test_sequence.py +++ /dev/null @@ -1,112 +0,0 @@ -import unittest -import os -import sys -import tempfile -import glob - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - from bsddb import db - -from test_all import verbose - - -class DBSequenceTest(unittest.TestCase): - def setUp(self): - self.int_32_max = 0x100000000 - self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - try: - os.mkdir(self.homeDir) - except os.error: - pass - tempfile.tempdir = self.homeDir - self.filename = os.path.split(tempfile.mktemp())[1] - tempfile.tempdir = None - - self.dbenv = db.DBEnv() - self.dbenv.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL, 0666) - self.d = db.DB(self.dbenv) - self.d.open(self.filename, db.DB_BTREE, db.DB_CREATE, 0666) - - def tearDown(self): - if hasattr(self, 'seq'): - self.seq.close() - del self.seq - if hasattr(self, 'd'): - self.d.close() - del self.d - if hasattr(self, 'dbenv'): - self.dbenv.close() - del self.dbenv - - files = glob.glob(os.path.join(self.homeDir, '*')) - for file in files: - os.remove(file) - - def test_get(self): - self.seq = db.DBSequence(self.d, flags=0) - start_value = 10 * self.int_32_max - self.assertEqual(0xA00000000, start_value) - self.assertEquals(None, self.seq.init_value(start_value)) - self.assertEquals(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE)) - self.assertEquals(start_value, self.seq.get(5)) - self.assertEquals(start_value + 5, self.seq.get()) - - def test_remove(self): - self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(None, self.seq.remove(txn=None, flags=0)) - del self.seq - - def test_get_key(self): - self.seq = db.DBSequence(self.d, flags=0) - key = 'foo' - self.assertEquals(None, self.seq.open(key=key, txn=None, flags=db.DB_CREATE)) - self.assertEquals(key, self.seq.get_key()) - - def test_get_dbp(self): - self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(self.d, self.seq.get_dbp()) - - def test_cachesize(self): - self.seq = db.DBSequence(self.d, flags=0) - cashe_size = 10 - self.assertEquals(None, self.seq.set_cachesize(cashe_size)) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(cashe_size, self.seq.get_cachesize()) - - def test_flags(self): - self.seq = db.DBSequence(self.d, flags=0) - flag = db.DB_SEQ_WRAP; - self.assertEquals(None, self.seq.set_flags(flag)) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(flag, self.seq.get_flags() & flag) - - def test_range(self): - self.seq = db.DBSequence(self.d, flags=0) - seq_range = (10 * self.int_32_max, 11 * self.int_32_max - 1) - self.assertEquals(None, self.seq.set_range(seq_range)) - self.seq.init_value(seq_range[0]) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(seq_range, self.seq.get_range()) - - def test_stat(self): - self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - stat = self.seq.stat() - for param in ('nowait', 'min', 'max', 'value', 'current', - 'flags', 'cache_size', 'last_value', 'wait'): - self.assertTrue(param in stat, "parameter %s isn't in stat info" % param) - -def test_suite(): - suite = unittest.TestSuite() - if db.version() >= (4,3): - suite.addTest(unittest.makeSuite(DBSequenceTest)) - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/bsddb/test/test_thread.py b/sys/lib/python/bsddb/test/test_thread.py deleted file mode 100644 index 31964f0b2..000000000 --- a/sys/lib/python/bsddb/test/test_thread.py +++ /dev/null @@ -1,506 +0,0 @@ -"""TestCases for multi-threaded access to a DB. -""" - -import os -import sys -import time -import errno -import shutil -import tempfile -from pprint import pprint -from random import random - -try: - True, False -except NameError: - True = 1 - False = 0 - -DASH = '-' - -try: - from threading import Thread, currentThread - have_threads = True -except ImportError: - have_threads = False - -try: - WindowsError -except NameError: - class WindowsError(Exception): - pass - -import unittest -from test_all import verbose - -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db, dbutils -except ImportError: - # For Python 2.3 - from bsddb import db, dbutils - - -#---------------------------------------------------------------------- - -class BaseThreadedTestCase(unittest.TestCase): - dbtype = db.DB_UNKNOWN # must be set in derived class - dbopenflags = 0 - dbsetflags = 0 - envflags = 0 - - def setUp(self): - if verbose: - dbutils._deadlock_VerboseFile = sys.stdout - - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') - self.homeDir = homeDir - try: - os.mkdir(homeDir) - except OSError, e: - if e.errno <> errno.EEXIST: raise - self.env = db.DBEnv() - self.setEnvOpts() - self.env.open(homeDir, self.envflags | db.DB_CREATE) - - self.filename = self.__class__.__name__ + '.db' - self.d = db.DB(self.env) - if self.dbsetflags: - self.d.set_flags(self.dbsetflags) - self.d.open(self.filename, self.dbtype, self.dbopenflags|db.DB_CREATE) - - def tearDown(self): - self.d.close() - self.env.close() - shutil.rmtree(self.homeDir) - - def setEnvOpts(self): - pass - - def makeData(self, key): - return DASH.join([key] * 5) - - -#---------------------------------------------------------------------- - - -class ConcurrentDataStoreBase(BaseThreadedTestCase): - dbopenflags = db.DB_THREAD - envflags = db.DB_THREAD | db.DB_INIT_CDB | db.DB_INIT_MPOOL - readers = 0 # derived class should set - writers = 0 - records = 1000 - - def test01_1WriterMultiReaders(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test01_1WriterMultiReaders..." % \ - self.__class__.__name__ - - threads = [] - for x in range(self.writers): - wt = Thread(target = self.writerThread, - args = (self.d, self.records, x), - name = 'writer %d' % x, - )#verbose = verbose) - threads.append(wt) - - for x in range(self.readers): - rt = Thread(target = self.readerThread, - args = (self.d, x), - name = 'reader %d' % x, - )#verbose = verbose) - threads.append(rt) - - for t in threads: - t.start() - for t in threads: - t.join() - - def writerThread(self, d, howMany, writerNum): - #time.sleep(0.01 * writerNum + 0.01) - name = currentThread().getName() - start = howMany * writerNum - stop = howMany * (writerNum + 1) - 1 - if verbose: - print "%s: creating records %d - %d" % (name, start, stop) - - for x in range(start, stop): - key = '%04d' % x - dbutils.DeadlockWrap(d.put, key, self.makeData(key), - max_retries=12) - if verbose and x % 100 == 0: - print "%s: records %d - %d finished" % (name, start, x) - - if verbose: - print "%s: finished creating records" % name - -## # Each write-cursor will be exclusive, the only one that can update the DB... -## if verbose: print "%s: deleting a few records" % name -## c = d.cursor(flags = db.DB_WRITECURSOR) -## for x in range(10): -## key = int(random() * howMany) + start -## key = '%04d' % key -## if d.has_key(key): -## c.set(key) -## c.delete() - -## c.close() - if verbose: - print "%s: thread finished" % name - - def readerThread(self, d, readerNum): - time.sleep(0.01 * readerNum) - name = currentThread().getName() - - for loop in range(5): - c = d.cursor() - count = 0 - rec = c.first() - while rec: - count += 1 - key, data = rec - self.assertEqual(self.makeData(key), data) - rec = c.next() - if verbose: - print "%s: found %d records" % (name, count) - c.close() - time.sleep(0.05) - - if verbose: - print "%s: thread finished" % name - - -class BTreeConcurrentDataStore(ConcurrentDataStoreBase): - dbtype = db.DB_BTREE - writers = 2 - readers = 10 - records = 1000 - - -class HashConcurrentDataStore(ConcurrentDataStoreBase): - dbtype = db.DB_HASH - writers = 2 - readers = 10 - records = 1000 - - -#---------------------------------------------------------------------- - -class SimpleThreadedBase(BaseThreadedTestCase): - dbopenflags = db.DB_THREAD - envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK - readers = 5 - writers = 3 - records = 1000 - - def setEnvOpts(self): - self.env.set_lk_detect(db.DB_LOCK_DEFAULT) - - def test02_SimpleLocks(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test02_SimpleLocks..." % self.__class__.__name__ - - threads = [] - for x in range(self.writers): - wt = Thread(target = self.writerThread, - args = (self.d, self.records, x), - name = 'writer %d' % x, - )#verbose = verbose) - threads.append(wt) - for x in range(self.readers): - rt = Thread(target = self.readerThread, - args = (self.d, x), - name = 'reader %d' % x, - )#verbose = verbose) - threads.append(rt) - - for t in threads: - t.start() - for t in threads: - t.join() - - def writerThread(self, d, howMany, writerNum): - name = currentThread().getName() - start = howMany * writerNum - stop = howMany * (writerNum + 1) - 1 - if verbose: - print "%s: creating records %d - %d" % (name, start, stop) - - # create a bunch of records - for x in xrange(start, stop): - key = '%04d' % x - dbutils.DeadlockWrap(d.put, key, self.makeData(key), - max_retries=12) - - if verbose and x % 100 == 0: - print "%s: records %d - %d finished" % (name, start, x) - - # do a bit or reading too - if random() <= 0.05: - for y in xrange(start, x): - key = '%04d' % x - data = dbutils.DeadlockWrap(d.get, key, max_retries=12) - self.assertEqual(data, self.makeData(key)) - - # flush them - try: - dbutils.DeadlockWrap(d.sync, max_retries=12) - except db.DBIncompleteError, val: - if verbose: - print "could not complete sync()..." - - # read them back, deleting a few - for x in xrange(start, stop): - key = '%04d' % x - data = dbutils.DeadlockWrap(d.get, key, max_retries=12) - if verbose and x % 100 == 0: - print "%s: fetched record (%s, %s)" % (name, key, data) - self.assertEqual(data, self.makeData(key)) - if random() <= 0.10: - dbutils.DeadlockWrap(d.delete, key, max_retries=12) - if verbose: - print "%s: deleted record %s" % (name, key) - - if verbose: - print "%s: thread finished" % name - - def readerThread(self, d, readerNum): - time.sleep(0.01 * readerNum) - name = currentThread().getName() - - for loop in range(5): - c = d.cursor() - count = 0 - rec = dbutils.DeadlockWrap(c.first, max_retries=10) - while rec: - count += 1 - key, data = rec - self.assertEqual(self.makeData(key), data) - rec = dbutils.DeadlockWrap(c.next, max_retries=10) - if verbose: - print "%s: found %d records" % (name, count) - c.close() - time.sleep(0.05) - - if verbose: - print "%s: thread finished" % name - - -class BTreeSimpleThreaded(SimpleThreadedBase): - dbtype = db.DB_BTREE - - -class HashSimpleThreaded(SimpleThreadedBase): - dbtype = db.DB_HASH - - -#---------------------------------------------------------------------- - - -class ThreadedTransactionsBase(BaseThreadedTestCase): - dbopenflags = db.DB_THREAD | db.DB_AUTO_COMMIT - envflags = (db.DB_THREAD | - db.DB_INIT_MPOOL | - db.DB_INIT_LOCK | - db.DB_INIT_LOG | - db.DB_INIT_TXN - ) - readers = 0 - writers = 0 - records = 2000 - txnFlag = 0 - - def setEnvOpts(self): - #self.env.set_lk_detect(db.DB_LOCK_DEFAULT) - pass - - def test03_ThreadedTransactions(self): - if verbose: - print '\n', '-=' * 30 - print "Running %s.test03_ThreadedTransactions..." % \ - self.__class__.__name__ - - threads = [] - for x in range(self.writers): - wt = Thread(target = self.writerThread, - args = (self.d, self.records, x), - name = 'writer %d' % x, - )#verbose = verbose) - threads.append(wt) - - for x in range(self.readers): - rt = Thread(target = self.readerThread, - args = (self.d, x), - name = 'reader %d' % x, - )#verbose = verbose) - threads.append(rt) - - dt = Thread(target = self.deadlockThread) - dt.start() - - for t in threads: - t.start() - for t in threads: - t.join() - - self.doLockDetect = False - dt.join() - - def doWrite(self, d, name, start, stop): - finished = False - while not finished: - try: - txn = self.env.txn_begin(None, self.txnFlag) - for x in range(start, stop): - key = '%04d' % x - d.put(key, self.makeData(key), txn) - if verbose and x % 100 == 0: - print "%s: records %d - %d finished" % (name, start, x) - txn.commit() - finished = True - except (db.DBLockDeadlockError, db.DBLockNotGrantedError), val: - if verbose: - print "%s: Aborting transaction (%s)" % (name, val[1]) - txn.abort() - time.sleep(0.05) - - def writerThread(self, d, howMany, writerNum): - name = currentThread().getName() - start = howMany * writerNum - stop = howMany * (writerNum + 1) - 1 - if verbose: - print "%s: creating records %d - %d" % (name, start, stop) - - step = 100 - for x in range(start, stop, step): - self.doWrite(d, name, x, min(stop, x+step)) - - if verbose: - print "%s: finished creating records" % name - if verbose: - print "%s: deleting a few records" % name - - finished = False - while not finished: - try: - recs = [] - txn = self.env.txn_begin(None, self.txnFlag) - for x in range(10): - key = int(random() * howMany) + start - key = '%04d' % key - data = d.get(key, None, txn, db.DB_RMW) - if data is not None: - d.delete(key, txn) - recs.append(key) - txn.commit() - finished = True - if verbose: - print "%s: deleted records %s" % (name, recs) - except (db.DBLockDeadlockError, db.DBLockNotGrantedError), val: - if verbose: - print "%s: Aborting transaction (%s)" % (name, val[1]) - txn.abort() - time.sleep(0.05) - - if verbose: - print "%s: thread finished" % name - - def readerThread(self, d, readerNum): - time.sleep(0.01 * readerNum + 0.05) - name = currentThread().getName() - - for loop in range(5): - finished = False - while not finished: - try: - txn = self.env.txn_begin(None, self.txnFlag) - c = d.cursor(txn) - count = 0 - rec = c.first() - while rec: - count += 1 - key, data = rec - self.assertEqual(self.makeData(key), data) - rec = c.next() - if verbose: print "%s: found %d records" % (name, count) - c.close() - txn.commit() - finished = True - except (db.DBLockDeadlockError, db.DBLockNotGrantedError), val: - if verbose: - print "%s: Aborting transaction (%s)" % (name, val[1]) - c.close() - txn.abort() - time.sleep(0.05) - - time.sleep(0.05) - - if verbose: - print "%s: thread finished" % name - - def deadlockThread(self): - self.doLockDetect = True - while self.doLockDetect: - time.sleep(0.5) - try: - aborted = self.env.lock_detect( - db.DB_LOCK_RANDOM, db.DB_LOCK_CONFLICT) - if verbose and aborted: - print "deadlock: Aborted %d deadlocked transaction(s)" \ - % aborted - except db.DBError: - pass - - -class BTreeThreadedTransactions(ThreadedTransactionsBase): - dbtype = db.DB_BTREE - writers = 3 - readers = 5 - records = 2000 - -class HashThreadedTransactions(ThreadedTransactionsBase): - dbtype = db.DB_HASH - writers = 1 - readers = 5 - records = 2000 - -class BTreeThreadedNoWaitTransactions(ThreadedTransactionsBase): - dbtype = db.DB_BTREE - writers = 3 - readers = 5 - records = 2000 - txnFlag = db.DB_TXN_NOWAIT - -class HashThreadedNoWaitTransactions(ThreadedTransactionsBase): - dbtype = db.DB_HASH - writers = 1 - readers = 5 - records = 2000 - txnFlag = db.DB_TXN_NOWAIT - - -#---------------------------------------------------------------------- - -def test_suite(): - suite = unittest.TestSuite() - - if have_threads: - suite.addTest(unittest.makeSuite(BTreeConcurrentDataStore)) - suite.addTest(unittest.makeSuite(HashConcurrentDataStore)) - suite.addTest(unittest.makeSuite(BTreeSimpleThreaded)) - suite.addTest(unittest.makeSuite(HashSimpleThreaded)) - suite.addTest(unittest.makeSuite(BTreeThreadedTransactions)) - suite.addTest(unittest.makeSuite(HashThreadedTransactions)) - suite.addTest(unittest.makeSuite(BTreeThreadedNoWaitTransactions)) - suite.addTest(unittest.makeSuite(HashThreadedNoWaitTransactions)) - - else: - print "Threads not available, skipping thread tests." - - return suite - - -if __name__ == '__main__': - unittest.main(defaultTest='test_suite') diff --git a/sys/lib/python/ctypes/test/__init__.py b/sys/lib/python/ctypes/test/__init__.py deleted file mode 100644 index 2ae54052d..000000000 --- a/sys/lib/python/ctypes/test/__init__.py +++ /dev/null @@ -1,202 +0,0 @@ -import glob, os, sys, unittest, getopt, time - -use_resources = [] - -class ResourceDenied(Exception): - """Test skipped because it requested a disallowed resource. - - This is raised when a test calls requires() for a resource that - has not be enabled. Resources are defined by test modules. - """ - -def is_resource_enabled(resource): - """Test whether a resource is enabled. - - If the caller's module is __main__ then automatically return True.""" - if sys._getframe().f_back.f_globals.get("__name__") == "__main__": - return True - result = use_resources is not None and \ - (resource in use_resources or "*" in use_resources) - if not result: - _unavail[resource] = None - return result - -_unavail = {} -def requires(resource, msg=None): - """Raise ResourceDenied if the specified resource is not available. - - If the caller's module is __main__ then automatically return True.""" - # see if the caller's module is __main__ - if so, treat as if - # the resource was set - if sys._getframe().f_back.f_globals.get("__name__") == "__main__": - return - if not is_resource_enabled(resource): - if msg is None: - msg = "Use of the `%s' resource not enabled" % resource - raise ResourceDenied(msg) - -def find_package_modules(package, mask): - import fnmatch - if hasattr(package, "__loader__"): - path = package.__name__.replace(".", os.path.sep) - mask = os.path.join(path, mask) - for fnm in package.__loader__._files.iterkeys(): - if fnmatch.fnmatchcase(fnm, mask): - yield os.path.splitext(fnm)[0].replace(os.path.sep, ".") - else: - path = package.__path__[0] - for fnm in os.listdir(path): - if fnmatch.fnmatchcase(fnm, mask): - yield "%s.%s" % (package.__name__, os.path.splitext(fnm)[0]) - -def get_tests(package, mask, verbosity): - """Return a list of skipped test modules, and a list of test cases.""" - tests = [] - skipped = [] - for modname in find_package_modules(package, mask): - try: - mod = __import__(modname, globals(), locals(), ['*']) - except ResourceDenied, detail: - skipped.append(modname) - if verbosity > 1: - print >> sys.stderr, "Skipped %s: %s" % (modname, detail) - continue - except Exception, detail: - print >> sys.stderr, "Warning: could not import %s: %s" % (modname, detail) - continue - for name in dir(mod): - if name.startswith("_"): - continue - o = getattr(mod, name) - if type(o) is type(unittest.TestCase) and issubclass(o, unittest.TestCase): - tests.append(o) - return skipped, tests - -def usage(): - print __doc__ - return 1 - -def test_with_refcounts(runner, verbosity, testcase): - """Run testcase several times, tracking reference counts.""" - import gc - import ctypes - ptc = ctypes._pointer_type_cache.copy() - cfc = ctypes._c_functype_cache.copy() - wfc = ctypes._win_functype_cache.copy() - - # when searching for refcount leaks, we have to manually reset any - # caches that ctypes has. - def cleanup(): - ctypes._pointer_type_cache = ptc.copy() - ctypes._c_functype_cache = cfc.copy() - ctypes._win_functype_cache = wfc.copy() - gc.collect() - - test = unittest.makeSuite(testcase) - for i in range(5): - rc = sys.gettotalrefcount() - runner.run(test) - cleanup() - COUNT = 5 - refcounts = [None] * COUNT - for i in range(COUNT): - rc = sys.gettotalrefcount() - runner.run(test) - cleanup() - refcounts[i] = sys.gettotalrefcount() - rc - if filter(None, refcounts): - print "%s leaks:\n\t" % testcase, refcounts - elif verbosity: - print "%s: ok." % testcase - -class TestRunner(unittest.TextTestRunner): - def run(self, test, skipped): - "Run the given test case or test suite." - # Same as unittest.TextTestRunner.run, except that it reports - # skipped tests. - result = self._makeResult() - startTime = time.time() - test(result) - stopTime = time.time() - timeTaken = stopTime - startTime - result.printErrors() - self.stream.writeln(result.separator2) - run = result.testsRun - if _unavail: #skipped: - requested = _unavail.keys() - requested.sort() - self.stream.writeln("Ran %d test%s in %.3fs (%s module%s skipped)" % - (run, run != 1 and "s" or "", timeTaken, - len(skipped), - len(skipped) != 1 and "s" or "")) - self.stream.writeln("Unavailable resources: %s" % ", ".join(requested)) - else: - self.stream.writeln("Ran %d test%s in %.3fs" % - (run, run != 1 and "s" or "", timeTaken)) - self.stream.writeln() - if not result.wasSuccessful(): - self.stream.write("FAILED (") - failed, errored = map(len, (result.failures, result.errors)) - if failed: - self.stream.write("failures=%d" % failed) - if errored: - if failed: self.stream.write(", ") - self.stream.write("errors=%d" % errored) - self.stream.writeln(")") - else: - self.stream.writeln("OK") - return result - - -def main(*packages): - try: - opts, args = getopt.getopt(sys.argv[1:], "rqvu:") - except getopt.error: - return usage() - - verbosity = 1 - search_leaks = False - for flag, value in opts: - if flag == "-q": - verbosity -= 1 - elif flag == "-v": - verbosity += 1 - elif flag == "-r": - try: - sys.gettotalrefcount - except AttributeError: - print >> sys.stderr, "-r flag requires Python debug build" - return -1 - search_leaks = True - elif flag == "-u": - use_resources.extend(value.split(",")) - - mask = "test_*.py" - if args: - mask = args[0] - - for package in packages: - run_tests(package, mask, verbosity, search_leaks) - - -def run_tests(package, mask, verbosity, search_leaks): - skipped, testcases = get_tests(package, mask, verbosity) - runner = TestRunner(verbosity=verbosity) - - suites = [unittest.makeSuite(o) for o in testcases] - suite = unittest.TestSuite(suites) - result = runner.run(suite, skipped) - - if search_leaks: - # hunt for refcount leaks - runner = BasicTestRunner() - for t in testcases: - test_with_refcounts(runner, verbosity, t) - - return bool(result.errors) - -class BasicTestRunner: - def run(self, test): - result = unittest.TestResult() - test(result) - return result diff --git a/sys/lib/python/ctypes/test/runtests.py b/sys/lib/python/ctypes/test/runtests.py deleted file mode 100644 index 14d7caa7c..000000000 --- a/sys/lib/python/ctypes/test/runtests.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Usage: runtests.py [-q] [-r] [-v] [-u resources] [mask] - -Run all tests found in this directory, and print a summary of the results. -Command line flags: - -q quiet mode: don't prnt anything while the tests are running - -r run tests repeatedly, look for refcount leaks - -u - Add resources to the lits of allowed resources. '*' allows all - resources. - -v verbose mode: print the test currently executed - mask mask to select filenames containing testcases, wildcards allowed -""" -import sys -import ctypes.test - -if __name__ == "__main__": - sys.exit(ctypes.test.main(ctypes.test)) diff --git a/sys/lib/python/ctypes/test/test_anon.py b/sys/lib/python/ctypes/test/test_anon.py deleted file mode 100644 index 99e02cb55..000000000 --- a/sys/lib/python/ctypes/test/test_anon.py +++ /dev/null @@ -1,60 +0,0 @@ -import unittest -from ctypes import * - -class AnonTest(unittest.TestCase): - - def test_anon(self): - class ANON(Union): - _fields_ = [("a", c_int), - ("b", c_int)] - - class Y(Structure): - _fields_ = [("x", c_int), - ("_", ANON), - ("y", c_int)] - _anonymous_ = ["_"] - - self.failUnlessEqual(Y.a.offset, sizeof(c_int)) - self.failUnlessEqual(Y.b.offset, sizeof(c_int)) - - self.failUnlessEqual(ANON.a.offset, 0) - self.failUnlessEqual(ANON.b.offset, 0) - - def test_anon_nonseq(self): - # TypeError: _anonymous_ must be a sequence - self.failUnlessRaises(TypeError, - lambda: type(Structure)("Name", - (Structure,), - {"_fields_": [], "_anonymous_": 42})) - - def test_anon_nonmember(self): - # AttributeError: type object 'Name' has no attribute 'x' - self.failUnlessRaises(AttributeError, - lambda: type(Structure)("Name", - (Structure,), - {"_fields_": [], - "_anonymous_": ["x"]})) - - def test_nested(self): - class ANON_S(Structure): - _fields_ = [("a", c_int)] - - class ANON_U(Union): - _fields_ = [("_", ANON_S), - ("b", c_int)] - _anonymous_ = ["_"] - - class Y(Structure): - _fields_ = [("x", c_int), - ("_", ANON_U), - ("y", c_int)] - _anonymous_ = ["_"] - - self.failUnlessEqual(Y.x.offset, 0) - self.failUnlessEqual(Y.a.offset, sizeof(c_int)) - self.failUnlessEqual(Y.b.offset, sizeof(c_int)) - self.failUnlessEqual(Y._.offset, sizeof(c_int)) - self.failUnlessEqual(Y.y.offset, sizeof(c_int) * 2) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_array_in_pointer.py b/sys/lib/python/ctypes/test/test_array_in_pointer.py deleted file mode 100644 index 3ed310cc6..000000000 --- a/sys/lib/python/ctypes/test/test_array_in_pointer.py +++ /dev/null @@ -1,64 +0,0 @@ -import unittest -from ctypes import * -from binascii import hexlify -import re - -def dump(obj): - # helper function to dump memory contents in hex, with a hyphen - # between the bytes. - h = hexlify(buffer(obj)) - return re.sub(r"(..)", r"\1-", h)[:-1] - - -class Value(Structure): - _fields_ = [("val", c_byte)] - -class Container(Structure): - _fields_ = [("pvalues", POINTER(Value))] - -class Test(unittest.TestCase): - def test(self): - # create an array of 4 values - val_array = (Value * 4)() - - # create a container, which holds a pointer to the pvalues array. - c = Container() - c.pvalues = val_array - - # memory contains 4 NUL bytes now, that's correct - self.failUnlessEqual("00-00-00-00", dump(val_array)) - - # set the values of the array through the pointer: - for i in range(4): - c.pvalues[i].val = i + 1 - - values = [c.pvalues[i].val for i in range(4)] - - # These are the expected results: here s the bug! - self.failUnlessEqual( - (values, dump(val_array)), - ([1, 2, 3, 4], "01-02-03-04") - ) - - def test_2(self): - - val_array = (Value * 4)() - - # memory contains 4 NUL bytes now, that's correct - self.failUnlessEqual("00-00-00-00", dump(val_array)) - - ptr = cast(val_array, POINTER(Value)) - # set the values of the array through the pointer: - for i in range(4): - ptr[i].val = i + 1 - - values = [ptr[i].val for i in range(4)] - - # These are the expected results: here s the bug! - self.failUnlessEqual( - (values, dump(val_array)), - ([1, 2, 3, 4], "01-02-03-04") - ) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_arrays.py b/sys/lib/python/ctypes/test/test_arrays.py deleted file mode 100644 index c812ff627..000000000 --- a/sys/lib/python/ctypes/test/test_arrays.py +++ /dev/null @@ -1,112 +0,0 @@ -import unittest -from ctypes import * - -formats = "bBhHiIlLqQfd" - -formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ - c_long, c_ulonglong, c_float, c_double - -class ArrayTestCase(unittest.TestCase): - def test_simple(self): - # create classes holding simple numeric types, and check - # various properties. - - init = range(15, 25) - - for fmt in formats: - alen = len(init) - int_array = ARRAY(fmt, alen) - - ia = int_array(*init) - # length of instance ok? - self.failUnlessEqual(len(ia), alen) - - # slot values ok? - values = [ia[i] for i in range(len(init))] - self.failUnlessEqual(values, init) - - # change the items - from operator import setitem - new_values = range(42, 42+alen) - [setitem(ia, n, new_values[n]) for n in range(alen)] - values = [ia[i] for i in range(len(init))] - self.failUnlessEqual(values, new_values) - - # are the items initialized to 0? - ia = int_array() - values = [ia[i] for i in range(len(init))] - self.failUnlessEqual(values, [0] * len(init)) - - # Too many in itializers should be caught - self.assertRaises(IndexError, int_array, *range(alen*2)) - - CharArray = ARRAY(c_char, 3) - - ca = CharArray("a", "b", "c") - - # Should this work? It doesn't: - # CharArray("abc") - self.assertRaises(TypeError, CharArray, "abc") - - self.failUnlessEqual(ca[0], "a") - self.failUnlessEqual(ca[1], "b") - self.failUnlessEqual(ca[2], "c") - self.failUnlessEqual(ca[-3], "a") - self.failUnlessEqual(ca[-2], "b") - self.failUnlessEqual(ca[-1], "c") - - self.failUnlessEqual(len(ca), 3) - - # slicing is now supported, but not extended slicing (3-argument)! - from operator import getslice, delitem - self.assertRaises(TypeError, getslice, ca, 0, 1, -1) - - # cannot delete items - self.assertRaises(TypeError, delitem, ca, 0) - - def test_numeric_arrays(self): - - alen = 5 - - numarray = ARRAY(c_int, alen) - - na = numarray() - values = [na[i] for i in range(alen)] - self.failUnlessEqual(values, [0] * alen) - - na = numarray(*[c_int()] * alen) - values = [na[i] for i in range(alen)] - self.failUnlessEqual(values, [0]*alen) - - na = numarray(1, 2, 3, 4, 5) - values = [i for i in na] - self.failUnlessEqual(values, [1, 2, 3, 4, 5]) - - na = numarray(*map(c_int, (1, 2, 3, 4, 5))) - values = [i for i in na] - self.failUnlessEqual(values, [1, 2, 3, 4, 5]) - - def test_classcache(self): - self.failUnless(not ARRAY(c_int, 3) is ARRAY(c_int, 4)) - self.failUnless(ARRAY(c_int, 3) is ARRAY(c_int, 3)) - - def test_from_address(self): - # Failed with 0.9.8, reported by JUrner - p = create_string_buffer("foo") - sz = (c_char * 3).from_address(addressof(p)) - self.failUnlessEqual(sz[:], "foo") - self.failUnlessEqual(sz.value, "foo") - - try: - create_unicode_buffer - except NameError: - pass - else: - def test_from_addressW(self): - p = create_unicode_buffer("foo") - sz = (c_wchar * 3).from_address(addressof(p)) - self.failUnlessEqual(sz[:], "foo") - self.failUnlessEqual(sz.value, "foo") - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_as_parameter.py b/sys/lib/python/ctypes/test/test_as_parameter.py deleted file mode 100644 index 058105933..000000000 --- a/sys/lib/python/ctypes/test/test_as_parameter.py +++ /dev/null @@ -1,215 +0,0 @@ -import unittest -from ctypes import * -import _ctypes_test - -dll = CDLL(_ctypes_test.__file__) - -try: - CALLBACK_FUNCTYPE = WINFUNCTYPE -except NameError: - # fake to enable this test on Linux - CALLBACK_FUNCTYPE = CFUNCTYPE - -class POINT(Structure): - _fields_ = [("x", c_int), ("y", c_int)] - -class BasicWrapTestCase(unittest.TestCase): - def wrap(self, param): - return param - - def test_wchar_parm(self): - try: - c_wchar - except NameError: - return - f = dll._testfunc_i_bhilfd - f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] - result = f(self.wrap(1), self.wrap(u"x"), self.wrap(3), self.wrap(4), self.wrap(5.0), self.wrap(6.0)) - self.failUnlessEqual(result, 139) - self.failUnless(type(result), int) - - def test_pointers(self): - f = dll._testfunc_p_p - f.restype = POINTER(c_int) - f.argtypes = [POINTER(c_int)] - - # This only works if the value c_int(42) passed to the - # function is still alive while the pointer (the result) is - # used. - - v = c_int(42) - - self.failUnlessEqual(pointer(v).contents.value, 42) - result = f(self.wrap(pointer(v))) - self.failUnlessEqual(type(result), POINTER(c_int)) - self.failUnlessEqual(result.contents.value, 42) - - # This on works... - result = f(self.wrap(pointer(v))) - self.failUnlessEqual(result.contents.value, v.value) - - p = pointer(c_int(99)) - result = f(self.wrap(p)) - self.failUnlessEqual(result.contents.value, 99) - - def test_shorts(self): - f = dll._testfunc_callback_i_if - - args = [] - expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, - 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] - - def callback(v): - args.append(v) - return v - - CallBack = CFUNCTYPE(c_int, c_int) - - cb = CallBack(callback) - f(self.wrap(2**18), self.wrap(cb)) - self.failUnlessEqual(args, expected) - - ################################################################ - - def test_callbacks(self): - f = dll._testfunc_callback_i_if - f.restype = c_int - - MyCallback = CFUNCTYPE(c_int, c_int) - - def callback(value): - #print "called back with", value - return value - - cb = MyCallback(callback) - - result = f(self.wrap(-10), self.wrap(cb)) - self.failUnlessEqual(result, -18) - - # test with prototype - f.argtypes = [c_int, MyCallback] - cb = MyCallback(callback) - - result = f(self.wrap(-10), self.wrap(cb)) - self.failUnlessEqual(result, -18) - - result = f(self.wrap(-10), self.wrap(cb)) - self.failUnlessEqual(result, -18) - - AnotherCallback = CALLBACK_FUNCTYPE(c_int, c_int, c_int, c_int, c_int) - - # check that the prototype works: we call f with wrong - # argument types - cb = AnotherCallback(callback) - self.assertRaises(ArgumentError, f, self.wrap(-10), self.wrap(cb)) - - def test_callbacks_2(self): - # Can also use simple datatypes as argument type specifiers - # for the callback function. - # In this case the call receives an instance of that type - f = dll._testfunc_callback_i_if - f.restype = c_int - - MyCallback = CFUNCTYPE(c_int, c_int) - - f.argtypes = [c_int, MyCallback] - - def callback(value): - #print "called back with", value - self.failUnlessEqual(type(value), int) - return value - - cb = MyCallback(callback) - result = f(self.wrap(-10), self.wrap(cb)) - self.failUnlessEqual(result, -18) - - def test_longlong_callbacks(self): - - f = dll._testfunc_callback_q_qf - f.restype = c_longlong - - MyCallback = CFUNCTYPE(c_longlong, c_longlong) - - f.argtypes = [c_longlong, MyCallback] - - def callback(value): - self.failUnless(isinstance(value, (int, long))) - return value & 0x7FFFFFFF - - cb = MyCallback(callback) - - self.failUnlessEqual(13577625587, int(f(self.wrap(1000000000000), self.wrap(cb)))) - - def test_byval(self): - # without prototype - ptin = POINT(1, 2) - ptout = POINT() - # EXPORT int _testfunc_byval(point in, point *pout) - result = dll._testfunc_byval(ptin, byref(ptout)) - got = result, ptout.x, ptout.y - expected = 3, 1, 2 - self.failUnlessEqual(got, expected) - - # with prototype - ptin = POINT(101, 102) - ptout = POINT() - dll._testfunc_byval.argtypes = (POINT, POINTER(POINT)) - dll._testfunc_byval.restype = c_int - result = dll._testfunc_byval(self.wrap(ptin), byref(ptout)) - got = result, ptout.x, ptout.y - expected = 203, 101, 102 - self.failUnlessEqual(got, expected) - - def test_struct_return_2H(self): - class S2H(Structure): - _fields_ = [("x", c_short), - ("y", c_short)] - dll.ret_2h_func.restype = S2H - dll.ret_2h_func.argtypes = [S2H] - inp = S2H(99, 88) - s2h = dll.ret_2h_func(self.wrap(inp)) - self.failUnlessEqual((s2h.x, s2h.y), (99*2, 88*3)) - - def test_struct_return_8H(self): - class S8I(Structure): - _fields_ = [("a", c_int), - ("b", c_int), - ("c", c_int), - ("d", c_int), - ("e", c_int), - ("f", c_int), - ("g", c_int), - ("h", c_int)] - dll.ret_8i_func.restype = S8I - dll.ret_8i_func.argtypes = [S8I] - inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) - s8i = dll.ret_8i_func(self.wrap(inp)) - self.failUnlessEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), - (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class AsParamWrapper(object): - def __init__(self, param): - self._as_parameter_ = param - -class AsParamWrapperTestCase(BasicWrapTestCase): - wrap = AsParamWrapper - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class AsParamPropertyWrapper(object): - def __init__(self, param): - self._param = param - - def getParameter(self): - return self._param - _as_parameter_ = property(getParameter) - -class AsParamPropertyWrapperTestCase(BasicWrapTestCase): - wrap = AsParamPropertyWrapper - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_bitfields.py b/sys/lib/python/ctypes/test/test_bitfields.py deleted file mode 100644 index 2867cbf93..000000000 --- a/sys/lib/python/ctypes/test/test_bitfields.py +++ /dev/null @@ -1,228 +0,0 @@ -from ctypes import * -import unittest -import os - -import ctypes -import _ctypes_test - -class BITS(Structure): - _fields_ = [("A", c_int, 1), - ("B", c_int, 2), - ("C", c_int, 3), - ("D", c_int, 4), - ("E", c_int, 5), - ("F", c_int, 6), - ("G", c_int, 7), - ("H", c_int, 8), - ("I", c_int, 9), - - ("M", c_short, 1), - ("N", c_short, 2), - ("O", c_short, 3), - ("P", c_short, 4), - ("Q", c_short, 5), - ("R", c_short, 6), - ("S", c_short, 7)] - -func = CDLL(_ctypes_test.__file__).unpack_bitfields -func.argtypes = POINTER(BITS), c_char - -##for n in "ABCDEFGHIMNOPQRS": -## print n, hex(getattr(BITS, n).size), getattr(BITS, n).offset - -class C_Test(unittest.TestCase): - - def test_ints(self): - for i in range(512): - for name in "ABCDEFGHI": - b = BITS() - setattr(b, name, i) - self.failUnlessEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name))) - - def test_shorts(self): - for i in range(256): - for name in "MNOPQRS": - b = BITS() - setattr(b, name, i) - self.failUnlessEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name))) - -signed_int_types = (c_byte, c_short, c_int, c_long, c_longlong) -unsigned_int_types = (c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong) -int_types = unsigned_int_types + signed_int_types - -class BitFieldTest(unittest.TestCase): - - def test_longlong(self): - class X(Structure): - _fields_ = [("a", c_longlong, 1), - ("b", c_longlong, 62), - ("c", c_longlong, 1)] - - self.failUnlessEqual(sizeof(X), sizeof(c_longlong)) - x = X() - x.a, x.b, x.c = -1, 7, -1 - self.failUnlessEqual((x.a, x.b, x.c), (-1, 7, -1)) - - def test_ulonglong(self): - class X(Structure): - _fields_ = [("a", c_ulonglong, 1), - ("b", c_ulonglong, 62), - ("c", c_ulonglong, 1)] - - self.failUnlessEqual(sizeof(X), sizeof(c_longlong)) - x = X() - self.failUnlessEqual((x.a, x.b, x.c), (0, 0, 0)) - x.a, x.b, x.c = 7, 7, 7 - self.failUnlessEqual((x.a, x.b, x.c), (1, 7, 1)) - - def test_signed(self): - for c_typ in signed_int_types: - class X(Structure): - _fields_ = [("dummy", c_typ), - ("a", c_typ, 3), - ("b", c_typ, 3), - ("c", c_typ, 1)] - self.failUnlessEqual(sizeof(X), sizeof(c_typ)*2) - - x = X() - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 0, 0)) - x.a = -1 - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, -1, 0, 0)) - x.a, x.b = 0, -1 - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, -1, 0)) - - - def test_unsigned(self): - for c_typ in unsigned_int_types: - class X(Structure): - _fields_ = [("a", c_typ, 3), - ("b", c_typ, 3), - ("c", c_typ, 1)] - self.failUnlessEqual(sizeof(X), sizeof(c_typ)) - - x = X() - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 0, 0)) - x.a = -1 - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, 7, 0, 0)) - x.a, x.b = 0, -1 - self.failUnlessEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 7, 0)) - - - def fail_fields(self, *fields): - return self.get_except(type(Structure), "X", (), - {"_fields_": fields}) - - def test_nonint_types(self): - # bit fields are not allowed on non-integer types. - result = self.fail_fields(("a", c_char_p, 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_char_p')) - - result = self.fail_fields(("a", c_void_p, 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_void_p')) - - if c_int != c_long: - result = self.fail_fields(("a", POINTER(c_int), 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type LP_c_int')) - - result = self.fail_fields(("a", c_char, 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_char')) - - try: - c_wchar - except NameError: - pass - else: - result = self.fail_fields(("a", c_wchar, 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_wchar')) - - class Dummy(Structure): - _fields_ = [] - - result = self.fail_fields(("a", Dummy, 1)) - self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type Dummy')) - - def test_single_bitfield_size(self): - for c_typ in int_types: - result = self.fail_fields(("a", c_typ, -1)) - self.failUnlessEqual(result, (ValueError, 'number of bits invalid for bit field')) - - result = self.fail_fields(("a", c_typ, 0)) - self.failUnlessEqual(result, (ValueError, 'number of bits invalid for bit field')) - - class X(Structure): - _fields_ = [("a", c_typ, 1)] - self.failUnlessEqual(sizeof(X), sizeof(c_typ)) - - class X(Structure): - _fields_ = [("a", c_typ, sizeof(c_typ)*8)] - self.failUnlessEqual(sizeof(X), sizeof(c_typ)) - - result = self.fail_fields(("a", c_typ, sizeof(c_typ)*8 + 1)) - self.failUnlessEqual(result, (ValueError, 'number of bits invalid for bit field')) - - def test_multi_bitfields_size(self): - class X(Structure): - _fields_ = [("a", c_short, 1), - ("b", c_short, 14), - ("c", c_short, 1)] - self.failUnlessEqual(sizeof(X), sizeof(c_short)) - - class X(Structure): - _fields_ = [("a", c_short, 1), - ("a1", c_short), - ("b", c_short, 14), - ("c", c_short, 1)] - self.failUnlessEqual(sizeof(X), sizeof(c_short)*3) - self.failUnlessEqual(X.a.offset, 0) - self.failUnlessEqual(X.a1.offset, sizeof(c_short)) - self.failUnlessEqual(X.b.offset, sizeof(c_short)*2) - self.failUnlessEqual(X.c.offset, sizeof(c_short)*2) - - class X(Structure): - _fields_ = [("a", c_short, 3), - ("b", c_short, 14), - ("c", c_short, 14)] - self.failUnlessEqual(sizeof(X), sizeof(c_short)*3) - self.failUnlessEqual(X.a.offset, sizeof(c_short)*0) - self.failUnlessEqual(X.b.offset, sizeof(c_short)*1) - self.failUnlessEqual(X.c.offset, sizeof(c_short)*2) - - - def get_except(self, func, *args, **kw): - try: - func(*args, **kw) - except Exception, detail: - return detail.__class__, str(detail) - - def test_mixed_1(self): - class X(Structure): - _fields_ = [("a", c_byte, 4), - ("b", c_int, 4)] - if os.name in ("nt", "ce"): - self.failUnlessEqual(sizeof(X), sizeof(c_int)*2) - else: - self.failUnlessEqual(sizeof(X), sizeof(c_int)) - - def test_mixed_2(self): - class X(Structure): - _fields_ = [("a", c_byte, 4), - ("b", c_int, 32)] - self.failUnlessEqual(sizeof(X), sizeof(c_int)*2) - - def test_mixed_3(self): - class X(Structure): - _fields_ = [("a", c_byte, 4), - ("b", c_ubyte, 4)] - self.failUnlessEqual(sizeof(X), sizeof(c_byte)) - - def test_anon_bitfields(self): - # anonymous bit-fields gave a strange error message - class X(Structure): - _fields_ = [("a", c_byte, 4), - ("b", c_ubyte, 4)] - class Y(Structure): - _anonymous_ = ["_"] - _fields_ = [("_", X)] - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_buffers.py b/sys/lib/python/ctypes/test/test_buffers.py deleted file mode 100644 index 07527a6dc..000000000 --- a/sys/lib/python/ctypes/test/test_buffers.py +++ /dev/null @@ -1,54 +0,0 @@ -from ctypes import * -import unittest - -class StringBufferTestCase(unittest.TestCase): - - def test_buffer(self): - b = create_string_buffer(32) - self.failUnlessEqual(len(b), 32) - self.failUnlessEqual(sizeof(b), 32 * sizeof(c_char)) - self.failUnless(type(b[0]) is str) - - b = create_string_buffer("abc") - self.failUnlessEqual(len(b), 4) # trailing nul char - self.failUnlessEqual(sizeof(b), 4 * sizeof(c_char)) - self.failUnless(type(b[0]) is str) - self.failUnlessEqual(b[0], "a") - self.failUnlessEqual(b[:], "abc\0") - - def test_string_conversion(self): - b = create_string_buffer(u"abc") - self.failUnlessEqual(len(b), 4) # trailing nul char - self.failUnlessEqual(sizeof(b), 4 * sizeof(c_char)) - self.failUnless(type(b[0]) is str) - self.failUnlessEqual(b[0], "a") - self.failUnlessEqual(b[:], "abc\0") - - try: - c_wchar - except NameError: - pass - else: - def test_unicode_buffer(self): - b = create_unicode_buffer(32) - self.failUnlessEqual(len(b), 32) - self.failUnlessEqual(sizeof(b), 32 * sizeof(c_wchar)) - self.failUnless(type(b[0]) is unicode) - - b = create_unicode_buffer(u"abc") - self.failUnlessEqual(len(b), 4) # trailing nul char - self.failUnlessEqual(sizeof(b), 4 * sizeof(c_wchar)) - self.failUnless(type(b[0]) is unicode) - self.failUnlessEqual(b[0], u"a") - self.failUnlessEqual(b[:], "abc\0") - - def test_unicode_conversion(self): - b = create_unicode_buffer("abc") - self.failUnlessEqual(len(b), 4) # trailing nul char - self.failUnlessEqual(sizeof(b), 4 * sizeof(c_wchar)) - self.failUnless(type(b[0]) is unicode) - self.failUnlessEqual(b[0], u"a") - self.failUnlessEqual(b[:], "abc\0") - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_byteswap.py b/sys/lib/python/ctypes/test/test_byteswap.py deleted file mode 100644 index 1f6899212..000000000 --- a/sys/lib/python/ctypes/test/test_byteswap.py +++ /dev/null @@ -1,280 +0,0 @@ -import sys, unittest, struct, math -from binascii import hexlify - -from ctypes import * - -def bin(s): - return hexlify(buffer(s)).upper() - -# Each *simple* type that supports different byte orders has an -# __ctype_be__ attribute that specifies the same type in BIG ENDIAN -# byte order, and a __ctype_le__ attribute that is the same type in -# LITTLE ENDIAN byte order. -# -# For Structures and Unions, these types are created on demand. - -class Test(unittest.TestCase): - def X_test(self): - print >> sys.stderr, sys.byteorder - for i in range(32): - bits = BITS() - setattr(bits, "i%s" % i, 1) - dump(bits) - - def test_endian_short(self): - if sys.byteorder == "little": - self.failUnless(c_short.__ctype_le__ is c_short) - self.failUnless(c_short.__ctype_be__.__ctype_le__ is c_short) - else: - self.failUnless(c_short.__ctype_be__ is c_short) - self.failUnless(c_short.__ctype_le__.__ctype_be__ is c_short) - s = c_short.__ctype_be__(0x1234) - self.failUnlessEqual(bin(struct.pack(">h", 0x1234)), "1234") - self.failUnlessEqual(bin(s), "1234") - self.failUnlessEqual(s.value, 0x1234) - - s = c_short.__ctype_le__(0x1234) - self.failUnlessEqual(bin(struct.pack("h", 0x1234)), "1234") - self.failUnlessEqual(bin(s), "1234") - self.failUnlessEqual(s.value, 0x1234) - - s = c_ushort.__ctype_le__(0x1234) - self.failUnlessEqual(bin(struct.pack("i", 0x12345678)), "12345678") - self.failUnlessEqual(bin(s), "12345678") - self.failUnlessEqual(s.value, 0x12345678) - - s = c_int.__ctype_le__(0x12345678) - self.failUnlessEqual(bin(struct.pack("I", 0x12345678)), "12345678") - self.failUnlessEqual(bin(s), "12345678") - self.failUnlessEqual(s.value, 0x12345678) - - s = c_uint.__ctype_le__(0x12345678) - self.failUnlessEqual(bin(struct.pack("q", 0x1234567890ABCDEF)), "1234567890ABCDEF") - self.failUnlessEqual(bin(s), "1234567890ABCDEF") - self.failUnlessEqual(s.value, 0x1234567890ABCDEF) - - s = c_longlong.__ctype_le__(0x1234567890ABCDEF) - self.failUnlessEqual(bin(struct.pack("Q", 0x1234567890ABCDEF)), "1234567890ABCDEF") - self.failUnlessEqual(bin(s), "1234567890ABCDEF") - self.failUnlessEqual(s.value, 0x1234567890ABCDEF) - - s = c_ulonglong.__ctype_le__(0x1234567890ABCDEF) - self.failUnlessEqual(bin(struct.pack("f", math.pi)), bin(s)) - - def test_endian_double(self): - if sys.byteorder == "little": - self.failUnless(c_double.__ctype_le__ is c_double) - self.failUnless(c_double.__ctype_be__.__ctype_le__ is c_double) - else: - self.failUnless(c_double.__ctype_be__ is c_double) - self.failUnless(c_double.__ctype_le__.__ctype_be__ is c_double) - s = c_double(math.pi) - self.failUnlessEqual(s.value, math.pi) - self.failUnlessEqual(bin(struct.pack("d", math.pi)), bin(s)) - s = c_double.__ctype_le__(math.pi) - self.failUnlessEqual(s.value, math.pi) - self.failUnlessEqual(bin(struct.pack("d", math.pi)), bin(s)) - - def test_endian_other(self): - self.failUnless(c_byte.__ctype_le__ is c_byte) - self.failUnless(c_byte.__ctype_be__ is c_byte) - - self.failUnless(c_ubyte.__ctype_le__ is c_ubyte) - self.failUnless(c_ubyte.__ctype_be__ is c_ubyte) - - self.failUnless(c_char.__ctype_le__ is c_char) - self.failUnless(c_char.__ctype_be__ is c_char) - - def test_struct_fields_1(self): - if sys.byteorder == "little": - base = BigEndianStructure - else: - base = LittleEndianStructure - - class T(base): - pass - _fields_ = [("a", c_ubyte), - ("b", c_byte), - ("c", c_short), - ("d", c_ushort), - ("e", c_int), - ("f", c_uint), - ("g", c_long), - ("h", c_ulong), - ("i", c_longlong), - ("k", c_ulonglong), - ("l", c_float), - ("m", c_double), - ("n", c_char), - - ("b1", c_byte, 3), - ("b2", c_byte, 3), - ("b3", c_byte, 2), - ("a", c_int * 3 * 3 * 3)] - T._fields_ = _fields_ - - # these fields do not support different byte order: - for typ in c_wchar, c_void_p, POINTER(c_int): - _fields_.append(("x", typ)) - class T(base): - pass - self.assertRaises(TypeError, setattr, T, "_fields_", [("x", typ)]) - - def test_struct_struct(self): - # Nested structures with different byte order not (yet) supported - if sys.byteorder == "little": - base = BigEndianStructure - else: - base = LittleEndianStructure - - class T(Structure): - _fields_ = [("a", c_int), - ("b", c_int)] - class S(base): - pass - self.assertRaises(TypeError, setattr, S, "_fields_", [("s", T)]) - - def test_struct_fields_2(self): - # standard packing in struct uses no alignment. - # So, we have to align using pad bytes. - # - # Unaligned accesses will crash Python (on those platforms that - # don't allow it, like sparc solaris). - if sys.byteorder == "little": - base = BigEndianStructure - fmt = ">bxhid" - else: - base = LittleEndianStructure - fmt = " float -> double - import math - self.check_type(c_float, math.e) - self.check_type(c_float, -math.e) - - def test_double(self): - self.check_type(c_double, 3.14) - self.check_type(c_double, -3.14) - - def test_char(self): - self.check_type(c_char, "x") - self.check_type(c_char, "a") - - # disabled: would now (correctly) raise a RuntimeWarning about - # a memory leak. A callback function cannot return a non-integral - # C type without causing a memory leak. -## def test_char_p(self): -## self.check_type(c_char_p, "abc") -## self.check_type(c_char_p, "def") - - def test_pyobject(self): - o = () - from sys import getrefcount as grc - for o in (), [], object(): - initial = grc(o) - # This call leaks a reference to 'o'... - self.check_type(py_object, o) - before = grc(o) - # ...but this call doesn't leak any more. Where is the refcount? - self.check_type(py_object, o) - after = grc(o) - self.failUnlessEqual((after, o), (before, o)) - - def test_unsupported_restype_1(self): - # Only "fundamental" result types are supported for callback - # functions, the type must have a non-NULL stgdict->setfunc. - # POINTER(c_double), for example, is not supported. - - prototype = self.functype.im_func(POINTER(c_double)) - # The type is checked when the prototype is called - self.assertRaises(TypeError, prototype, lambda: None) - - def test_unsupported_restype_2(self): - prototype = self.functype.im_func(object) - self.assertRaises(TypeError, prototype, lambda: None) - -try: - WINFUNCTYPE -except NameError: - pass -else: - class StdcallCallbacks(Callbacks): - functype = WINFUNCTYPE - -################################################################ - -class SampleCallbacksTestCase(unittest.TestCase): - - def test_integrate(self): - # Derived from some then non-working code, posted by David Foster - dll = CDLL(_ctypes_test.__file__) - - # The function prototype called by 'integrate': double func(double); - CALLBACK = CFUNCTYPE(c_double, c_double) - - # The integrate function itself, exposed from the _ctypes_test dll - integrate = dll.integrate - integrate.argtypes = (c_double, c_double, CALLBACK, c_long) - integrate.restype = c_double - - def func(x): - return x**2 - - result = integrate(0.0, 1.0, CALLBACK(func), 10) - diff = abs(result - 1./3.) - - self.failUnless(diff < 0.01, "%s not less than 0.01" % diff) - -################################################################ - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_cast.py b/sys/lib/python/ctypes/test/test_cast.py deleted file mode 100644 index 7371b0fe2..000000000 --- a/sys/lib/python/ctypes/test/test_cast.py +++ /dev/null @@ -1,77 +0,0 @@ -from ctypes import * -import unittest -import sys - -class Test(unittest.TestCase): - - def test_array2pointer(self): - array = (c_int * 3)(42, 17, 2) - - # casting an array to a pointer works. - ptr = cast(array, POINTER(c_int)) - self.failUnlessEqual([ptr[i] for i in range(3)], [42, 17, 2]) - - if 2*sizeof(c_short) == sizeof(c_int): - ptr = cast(array, POINTER(c_short)) - if sys.byteorder == "little": - self.failUnlessEqual([ptr[i] for i in range(6)], - [42, 0, 17, 0, 2, 0]) - else: - self.failUnlessEqual([ptr[i] for i in range(6)], - [0, 42, 0, 17, 0, 2]) - - def test_address2pointer(self): - array = (c_int * 3)(42, 17, 2) - - address = addressof(array) - ptr = cast(c_void_p(address), POINTER(c_int)) - self.failUnlessEqual([ptr[i] for i in range(3)], [42, 17, 2]) - - ptr = cast(address, POINTER(c_int)) - self.failUnlessEqual([ptr[i] for i in range(3)], [42, 17, 2]) - - def test_p2a_objects(self): - array = (c_char_p * 5)() - self.failUnlessEqual(array._objects, None) - array[0] = "foo bar" - self.failUnlessEqual(array._objects, {'0': "foo bar"}) - - p = cast(array, POINTER(c_char_p)) - # array and p share a common _objects attribute - self.failUnless(p._objects is array._objects) - self.failUnlessEqual(array._objects, {'0': "foo bar", id(array): array}) - p[0] = "spam spam" - self.failUnlessEqual(p._objects, {'0': "spam spam", id(array): array}) - self.failUnless(array._objects is p._objects) - p[1] = "foo bar" - self.failUnlessEqual(p._objects, {'1': 'foo bar', '0': "spam spam", id(array): array}) - self.failUnless(array._objects is p._objects) - - def test_other(self): - p = cast((c_int * 4)(1, 2, 3, 4), POINTER(c_int)) - self.failUnlessEqual(p[:4], [1,2, 3, 4]) - c_int() - self.failUnlessEqual(p[:4], [1, 2, 3, 4]) - p[2] = 96 - self.failUnlessEqual(p[:4], [1, 2, 96, 4]) - c_int() - self.failUnlessEqual(p[:4], [1, 2, 96, 4]) - - def test_char_p(self): - # This didn't work: bad argument to internal function - s = c_char_p("hiho") - self.failUnlessEqual(cast(cast(s, c_void_p), c_char_p).value, - "hiho") - - try: - c_wchar_p - except NameError: - pass - else: - def test_wchar_p(self): - s = c_wchar_p("hiho") - self.failUnlessEqual(cast(cast(s, c_void_p), c_wchar_p).value, - "hiho") - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_cfuncs.py b/sys/lib/python/ctypes/test/test_cfuncs.py deleted file mode 100644 index fa858a661..000000000 --- a/sys/lib/python/ctypes/test/test_cfuncs.py +++ /dev/null @@ -1,199 +0,0 @@ -# A lot of failures in these tests on Mac OS X. -# Byte order related? - -import unittest -from ctypes import * - -import _ctypes_test - -class CFunctions(unittest.TestCase): - _dll = CDLL(_ctypes_test.__file__) - - def S(self): - return c_longlong.in_dll(self._dll, "last_tf_arg_s").value - def U(self): - return c_ulonglong.in_dll(self._dll, "last_tf_arg_u").value - - def test_byte(self): - self._dll.tf_b.restype = c_byte - self._dll.tf_b.argtypes = (c_byte,) - self.failUnlessEqual(self._dll.tf_b(-126), -42) - self.failUnlessEqual(self.S(), -126) - - def test_byte_plus(self): - self._dll.tf_bb.restype = c_byte - self._dll.tf_bb.argtypes = (c_byte, c_byte) - self.failUnlessEqual(self._dll.tf_bb(0, -126), -42) - self.failUnlessEqual(self.S(), -126) - - def test_ubyte(self): - self._dll.tf_B.restype = c_ubyte - self._dll.tf_B.argtypes = (c_ubyte,) - self.failUnlessEqual(self._dll.tf_B(255), 85) - self.failUnlessEqual(self.U(), 255) - - def test_ubyte_plus(self): - self._dll.tf_bB.restype = c_ubyte - self._dll.tf_bB.argtypes = (c_byte, c_ubyte) - self.failUnlessEqual(self._dll.tf_bB(0, 255), 85) - self.failUnlessEqual(self.U(), 255) - - def test_short(self): - self._dll.tf_h.restype = c_short - self._dll.tf_h.argtypes = (c_short,) - self.failUnlessEqual(self._dll.tf_h(-32766), -10922) - self.failUnlessEqual(self.S(), -32766) - - def test_short_plus(self): - self._dll.tf_bh.restype = c_short - self._dll.tf_bh.argtypes = (c_byte, c_short) - self.failUnlessEqual(self._dll.tf_bh(0, -32766), -10922) - self.failUnlessEqual(self.S(), -32766) - - def test_ushort(self): - self._dll.tf_H.restype = c_ushort - self._dll.tf_H.argtypes = (c_ushort,) - self.failUnlessEqual(self._dll.tf_H(65535), 21845) - self.failUnlessEqual(self.U(), 65535) - - def test_ushort_plus(self): - self._dll.tf_bH.restype = c_ushort - self._dll.tf_bH.argtypes = (c_byte, c_ushort) - self.failUnlessEqual(self._dll.tf_bH(0, 65535), 21845) - self.failUnlessEqual(self.U(), 65535) - - def test_int(self): - self._dll.tf_i.restype = c_int - self._dll.tf_i.argtypes = (c_int,) - self.failUnlessEqual(self._dll.tf_i(-2147483646), -715827882) - self.failUnlessEqual(self.S(), -2147483646) - - def test_int_plus(self): - self._dll.tf_bi.restype = c_int - self._dll.tf_bi.argtypes = (c_byte, c_int) - self.failUnlessEqual(self._dll.tf_bi(0, -2147483646), -715827882) - self.failUnlessEqual(self.S(), -2147483646) - - def test_uint(self): - self._dll.tf_I.restype = c_uint - self._dll.tf_I.argtypes = (c_uint,) - self.failUnlessEqual(self._dll.tf_I(4294967295), 1431655765) - self.failUnlessEqual(self.U(), 4294967295) - - def test_uint_plus(self): - self._dll.tf_bI.restype = c_uint - self._dll.tf_bI.argtypes = (c_byte, c_uint) - self.failUnlessEqual(self._dll.tf_bI(0, 4294967295), 1431655765) - self.failUnlessEqual(self.U(), 4294967295) - - def test_long(self): - self._dll.tf_l.restype = c_long - self._dll.tf_l.argtypes = (c_long,) - self.failUnlessEqual(self._dll.tf_l(-2147483646), -715827882) - self.failUnlessEqual(self.S(), -2147483646) - - def test_long_plus(self): - self._dll.tf_bl.restype = c_long - self._dll.tf_bl.argtypes = (c_byte, c_long) - self.failUnlessEqual(self._dll.tf_bl(0, -2147483646), -715827882) - self.failUnlessEqual(self.S(), -2147483646) - - def test_ulong(self): - self._dll.tf_L.restype = c_ulong - self._dll.tf_L.argtypes = (c_ulong,) - self.failUnlessEqual(self._dll.tf_L(4294967295), 1431655765) - self.failUnlessEqual(self.U(), 4294967295) - - def test_ulong_plus(self): - self._dll.tf_bL.restype = c_ulong - self._dll.tf_bL.argtypes = (c_char, c_ulong) - self.failUnlessEqual(self._dll.tf_bL(' ', 4294967295), 1431655765) - self.failUnlessEqual(self.U(), 4294967295) - - def test_longlong(self): - self._dll.tf_q.restype = c_longlong - self._dll.tf_q.argtypes = (c_longlong, ) - self.failUnlessEqual(self._dll.tf_q(-9223372036854775806), -3074457345618258602) - self.failUnlessEqual(self.S(), -9223372036854775806) - - def test_longlong_plus(self): - self._dll.tf_bq.restype = c_longlong - self._dll.tf_bq.argtypes = (c_byte, c_longlong) - self.failUnlessEqual(self._dll.tf_bq(0, -9223372036854775806), -3074457345618258602) - self.failUnlessEqual(self.S(), -9223372036854775806) - - def test_ulonglong(self): - self._dll.tf_Q.restype = c_ulonglong - self._dll.tf_Q.argtypes = (c_ulonglong, ) - self.failUnlessEqual(self._dll.tf_Q(18446744073709551615), 6148914691236517205) - self.failUnlessEqual(self.U(), 18446744073709551615) - - def test_ulonglong_plus(self): - self._dll.tf_bQ.restype = c_ulonglong - self._dll.tf_bQ.argtypes = (c_byte, c_ulonglong) - self.failUnlessEqual(self._dll.tf_bQ(0, 18446744073709551615), 6148914691236517205) - self.failUnlessEqual(self.U(), 18446744073709551615) - - def test_float(self): - self._dll.tf_f.restype = c_float - self._dll.tf_f.argtypes = (c_float,) - self.failUnlessEqual(self._dll.tf_f(-42.), -14.) - self.failUnlessEqual(self.S(), -42) - - def test_float_plus(self): - self._dll.tf_bf.restype = c_float - self._dll.tf_bf.argtypes = (c_byte, c_float) - self.failUnlessEqual(self._dll.tf_bf(0, -42.), -14.) - self.failUnlessEqual(self.S(), -42) - - def test_double(self): - self._dll.tf_d.restype = c_double - self._dll.tf_d.argtypes = (c_double,) - self.failUnlessEqual(self._dll.tf_d(42.), 14.) - self.failUnlessEqual(self.S(), 42) - - def test_double_plus(self): - self._dll.tf_bd.restype = c_double - self._dll.tf_bd.argtypes = (c_byte, c_double) - self.failUnlessEqual(self._dll.tf_bd(0, 42.), 14.) - self.failUnlessEqual(self.S(), 42) - - def test_callwithresult(self): - def process_result(result): - return result * 2 - self._dll.tf_i.restype = process_result - self._dll.tf_i.argtypes = (c_int,) - self.failUnlessEqual(self._dll.tf_i(42), 28) - self.failUnlessEqual(self.S(), 42) - self.failUnlessEqual(self._dll.tf_i(-42), -28) - self.failUnlessEqual(self.S(), -42) - - def test_void(self): - self._dll.tv_i.restype = None - self._dll.tv_i.argtypes = (c_int,) - self.failUnlessEqual(self._dll.tv_i(42), None) - self.failUnlessEqual(self.S(), 42) - self.failUnlessEqual(self._dll.tv_i(-42), None) - self.failUnlessEqual(self.S(), -42) - -# The following repeates the above tests with stdcall functions (where -# they are available) -try: - WinDLL -except NameError: - pass -else: - class stdcall_dll(WinDLL): - def __getattr__(self, name): - if name[:2] == '__' and name[-2:] == '__': - raise AttributeError, name - func = self._FuncPtr(("s_" + name, self)) - setattr(self, name, func) - return func - - class stdcallCFunctions(CFunctions): - _dll = stdcall_dll(_ctypes_test.__file__) - pass - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_checkretval.py b/sys/lib/python/ctypes/test/test_checkretval.py deleted file mode 100644 index e055c49a3..000000000 --- a/sys/lib/python/ctypes/test/test_checkretval.py +++ /dev/null @@ -1,40 +0,0 @@ -import unittest -import sys - -from ctypes import * - -class CHECKED(c_int): - def _check_retval_(value): - # Receives a CHECKED instance. - return str(value.value) - _check_retval_ = staticmethod(_check_retval_) - -class Test(unittest.TestCase): - - def test_checkretval(self): - - import _ctypes_test - dll = CDLL(_ctypes_test.__file__) - self.failUnlessEqual(42, dll._testfunc_p_p(42)) - - dll._testfunc_p_p.restype = CHECKED - self.failUnlessEqual("42", dll._testfunc_p_p(42)) - - dll._testfunc_p_p.restype = None - self.failUnlessEqual(None, dll._testfunc_p_p(42)) - - del dll._testfunc_p_p.restype - self.failUnlessEqual(42, dll._testfunc_p_p(42)) - - try: - oledll - except NameError: - pass - else: - def test_oledll(self): - self.failUnlessRaises(WindowsError, - oledll.oleaut32.CreateTypeLib2, - 0, 0, 0) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_errcheck.py b/sys/lib/python/ctypes/test/test_errcheck.py deleted file mode 100644 index a4913f920..000000000 --- a/sys/lib/python/ctypes/test/test_errcheck.py +++ /dev/null @@ -1,19 +0,0 @@ -import sys -from ctypes import * - -##class HMODULE(Structure): -## _fields_ = [("value", c_void_p)] - -## def __repr__(self): -## return "" % self.value - -##windll.kernel32.GetModuleHandleA.restype = HMODULE - -##print windll.kernel32.GetModuleHandleA("python23.dll") -##print hex(sys.dllhandle) - -##def nonzero(handle): -## return (GetLastError(), handle) - -##windll.kernel32.GetModuleHandleA.errcheck = nonzero -##print windll.kernel32.GetModuleHandleA("spam") diff --git a/sys/lib/python/ctypes/test/test_find.py b/sys/lib/python/ctypes/test/test_find.py deleted file mode 100644 index 810467faa..000000000 --- a/sys/lib/python/ctypes/test/test_find.py +++ /dev/null @@ -1,104 +0,0 @@ -import unittest -import os, sys -from ctypes import * -from ctypes.util import find_library -from ctypes.test import is_resource_enabled - -if sys.platform == "win32": - lib_gl = find_library("OpenGL32") - lib_glu = find_library("Glu32") - lib_glut = find_library("glut32") - lib_gle = None -elif sys.platform == "darwin": - lib_gl = lib_glu = find_library("OpenGL") - lib_glut = find_library("GLUT") - lib_gle = None -else: - lib_gl = find_library("GL") - lib_glu = find_library("GLU") - lib_glut = find_library("glut") - lib_gle = find_library("gle") - -## print, for debugging -if is_resource_enabled("printing"): - if lib_gl or lib_glu or lib_glut or lib_gle: - print "OpenGL libraries:" - for item in (("GL", lib_gl), - ("GLU", lib_glu), - ("glut", lib_glut), - ("gle", lib_gle)): - print "\t", item - - -# On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode. -class Test_OpenGL_libs(unittest.TestCase): - def setUp(self): - self.gl = self.glu = self.gle = self.glut = None - if lib_gl: - self.gl = CDLL(lib_gl, mode=RTLD_GLOBAL) - if lib_glu: - self.glu = CDLL(lib_glu, RTLD_GLOBAL) - if lib_glut: - # On some systems, additional libraries seem to be - # required, loading glut fails with - # "OSError: /usr/lib/libglut.so.3: undefined symbol: XGetExtensionVersion" - # I cannot figure out how to repair the test on these - # systems (red hat), so we ignore it when the glut or gle - # libraries cannot be loaded. See also: - # https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1478253&group_id=5470 - # http://mail.python.org/pipermail/python-dev/2006-May/064789.html - try: - self.glut = CDLL(lib_glut) - except OSError: - pass - if lib_gle: - try: - self.gle = CDLL(lib_gle) - except OSError: - pass - - if lib_gl: - def test_gl(self): - if self.gl: - self.gl.glClearIndex - - if lib_glu: - def test_glu(self): - if self.glu: - self.glu.gluBeginCurve - - if lib_glut: - def test_glut(self): - if self.glut: - self.glut.glutWireTetrahedron - - if lib_gle: - def test_gle(self): - if self.gle: - self.gle.gleGetJoinStyle - -##if os.name == "posix" and sys.platform != "darwin": - -## # On platforms where the default shared library suffix is '.so', -## # at least some libraries can be loaded as attributes of the cdll -## # object, since ctypes now tries loading the lib again -## # with '.so' appended of the first try fails. -## # -## # Won't work for libc, unfortunately. OTOH, it isn't -## # needed for libc since this is already mapped into the current -## # process (?) -## # -## # On MAC OSX, it won't work either, because dlopen() needs a full path, -## # and the default suffix is either none or '.dylib'. - -## class LoadLibs(unittest.TestCase): -## def test_libm(self): -## import math -## libm = cdll.libm -## sqrt = libm.sqrt -## sqrt.argtypes = (c_double,) -## sqrt.restype = c_double -## self.failUnlessEqual(sqrt(2), math.sqrt(2)) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_funcptr.py b/sys/lib/python/ctypes/test/test_funcptr.py deleted file mode 100644 index 7ea873f0a..000000000 --- a/sys/lib/python/ctypes/test/test_funcptr.py +++ /dev/null @@ -1,127 +0,0 @@ -import os, unittest -from ctypes import * - -try: - WINFUNCTYPE -except NameError: - # fake to enable this test on Linux - WINFUNCTYPE = CFUNCTYPE - -import _ctypes_test -lib = CDLL(_ctypes_test.__file__) - -class CFuncPtrTestCase(unittest.TestCase): - def test_basic(self): - X = WINFUNCTYPE(c_int, c_int, c_int) - - def func(*args): - return len(args) - - x = X(func) - self.failUnlessEqual(x.restype, c_int) - self.failUnlessEqual(x.argtypes, (c_int, c_int)) - self.failUnlessEqual(sizeof(x), sizeof(c_voidp)) - self.failUnlessEqual(sizeof(X), sizeof(c_voidp)) - - def test_first(self): - StdCallback = WINFUNCTYPE(c_int, c_int, c_int) - CdeclCallback = CFUNCTYPE(c_int, c_int, c_int) - - def func(a, b): - return a + b - - s = StdCallback(func) - c = CdeclCallback(func) - - self.failUnlessEqual(s(1, 2), 3) - self.failUnlessEqual(c(1, 2), 3) - # The following no longer raises a TypeError - it is now - # possible, as in C, to call cdecl functions with more parameters. - #self.assertRaises(TypeError, c, 1, 2, 3) - self.failUnlessEqual(c(1, 2, 3, 4, 5, 6), 3) - if not WINFUNCTYPE is CFUNCTYPE and os.name != "ce": - self.assertRaises(TypeError, s, 1, 2, 3) - - def test_structures(self): - WNDPROC = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int) - - def wndproc(hwnd, msg, wParam, lParam): - return hwnd + msg + wParam + lParam - - HINSTANCE = c_int - HICON = c_int - HCURSOR = c_int - LPCTSTR = c_char_p - - class WNDCLASS(Structure): - _fields_ = [("style", c_uint), - ("lpfnWndProc", WNDPROC), - ("cbClsExtra", c_int), - ("cbWndExtra", c_int), - ("hInstance", HINSTANCE), - ("hIcon", HICON), - ("hCursor", HCURSOR), - ("lpszMenuName", LPCTSTR), - ("lpszClassName", LPCTSTR)] - - wndclass = WNDCLASS() - wndclass.lpfnWndProc = WNDPROC(wndproc) - - WNDPROC_2 = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int) - - # This is no longer true, now that WINFUNCTYPE caches created types internally. - ## # CFuncPtr subclasses are compared by identity, so this raises a TypeError: - ## self.assertRaises(TypeError, setattr, wndclass, - ## "lpfnWndProc", WNDPROC_2(wndproc)) - # instead: - - self.failUnless(WNDPROC is WNDPROC_2) - # 'wndclass.lpfnWndProc' leaks 94 references. Why? - self.failUnlessEqual(wndclass.lpfnWndProc(1, 2, 3, 4), 10) - - - f = wndclass.lpfnWndProc - - del wndclass - del wndproc - - self.failUnlessEqual(f(10, 11, 12, 13), 46) - - def test_dllfunctions(self): - - def NoNullHandle(value): - if not value: - raise WinError() - return value - - strchr = lib.my_strchr - strchr.restype = c_char_p - strchr.argtypes = (c_char_p, c_char) - self.failUnlessEqual(strchr("abcdefghi", "b"), "bcdefghi") - self.failUnlessEqual(strchr("abcdefghi", "x"), None) - - - strtok = lib.my_strtok - strtok.restype = c_char_p - # Neither of this does work: strtok changes the buffer it is passed -## strtok.argtypes = (c_char_p, c_char_p) -## strtok.argtypes = (c_string, c_char_p) - - def c_string(init): - size = len(init) + 1 - return (c_char*size)(*init) - - s = "a\nb\nc" - b = c_string(s) - -## b = (c_char * (len(s)+1))() -## b.value = s - -## b = c_string(s) - self.failUnlessEqual(strtok(b, "\n"), "a") - self.failUnlessEqual(strtok(None, "\n"), "b") - self.failUnlessEqual(strtok(None, "\n"), "c") - self.failUnlessEqual(strtok(None, "\n"), None) - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_functions.py b/sys/lib/python/ctypes/test/test_functions.py deleted file mode 100644 index 12bd59c4d..000000000 --- a/sys/lib/python/ctypes/test/test_functions.py +++ /dev/null @@ -1,395 +0,0 @@ -""" -Here is probably the place to write the docs, since the test-cases -show how the type behave. - -Later... -""" - -from ctypes import * -import sys, unittest - -try: - WINFUNCTYPE -except NameError: - # fake to enable this test on Linux - WINFUNCTYPE = CFUNCTYPE - -import _ctypes_test -dll = CDLL(_ctypes_test.__file__) -if sys.platform == "win32": - windll = WinDLL(_ctypes_test.__file__) - -class POINT(Structure): - _fields_ = [("x", c_int), ("y", c_int)] -class RECT(Structure): - _fields_ = [("left", c_int), ("top", c_int), - ("right", c_int), ("bottom", c_int)] -class FunctionTestCase(unittest.TestCase): - - def test_mro(self): - # in Python 2.3, this raises TypeError: MRO conflict among bases classes, - # in Python 2.2 it works. - # - # But in early versions of _ctypes.c, the result of tp_new - # wasn't checked, and it even crashed Python. - # Found by Greg Chapman. - - try: - class X(object, Array): - _length_ = 5 - _type_ = "i" - except TypeError: - pass - - - from _ctypes import _Pointer - try: - class X(object, _Pointer): - pass - except TypeError: - pass - - from _ctypes import _SimpleCData - try: - class X(object, _SimpleCData): - _type_ = "i" - except TypeError: - pass - - try: - class X(object, Structure): - _fields_ = [] - except TypeError: - pass - - - def test_wchar_parm(self): - try: - c_wchar - except NameError: - return - f = dll._testfunc_i_bhilfd - f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] - result = f(1, u"x", 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 139) - self.failUnlessEqual(type(result), int) - - def test_wchar_result(self): - try: - c_wchar - except NameError: - return - f = dll._testfunc_i_bhilfd - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] - f.restype = c_wchar - result = f(0, 0, 0, 0, 0, 0) - self.failUnlessEqual(result, u'\x00') - - def test_voidresult(self): - f = dll._testfunc_v - f.restype = None - f.argtypes = [c_int, c_int, POINTER(c_int)] - result = c_int() - self.failUnlessEqual(None, f(1, 2, byref(result))) - self.failUnlessEqual(result.value, 3) - - def test_intresult(self): - f = dll._testfunc_i_bhilfd - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] - f.restype = c_int - result = f(1, 2, 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 21) - self.failUnlessEqual(type(result), int) - - result = f(-1, -2, -3, -4, -5.0, -6.0) - self.failUnlessEqual(result, -21) - self.failUnlessEqual(type(result), int) - - # If we declare the function to return a short, - # is the high part split off? - f.restype = c_short - result = f(1, 2, 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 21) - self.failUnlessEqual(type(result), int) - - result = f(1, 2, 3, 0x10004, 5.0, 6.0) - self.failUnlessEqual(result, 21) - self.failUnlessEqual(type(result), int) - - # You cannot assing character format codes as restype any longer - self.assertRaises(TypeError, setattr, f, "restype", "i") - - def test_floatresult(self): - f = dll._testfunc_f_bhilfd - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] - f.restype = c_float - result = f(1, 2, 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 21) - self.failUnlessEqual(type(result), float) - - result = f(-1, -2, -3, -4, -5.0, -6.0) - self.failUnlessEqual(result, -21) - self.failUnlessEqual(type(result), float) - - def test_doubleresult(self): - f = dll._testfunc_d_bhilfd - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] - f.restype = c_double - result = f(1, 2, 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 21) - self.failUnlessEqual(type(result), float) - - result = f(-1, -2, -3, -4, -5.0, -6.0) - self.failUnlessEqual(result, -21) - self.failUnlessEqual(type(result), float) - - def test_longlongresult(self): - try: - c_longlong - except NameError: - return - f = dll._testfunc_q_bhilfd - f.restype = c_longlong - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] - result = f(1, 2, 3, 4, 5.0, 6.0) - self.failUnlessEqual(result, 21) - - f = dll._testfunc_q_bhilfdq - f.restype = c_longlong - f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double, c_longlong] - result = f(1, 2, 3, 4, 5.0, 6.0, 21) - self.failUnlessEqual(result, 42) - - def test_stringresult(self): - f = dll._testfunc_p_p - f.argtypes = None - f.restype = c_char_p - result = f("123") - self.failUnlessEqual(result, "123") - - result = f(None) - self.failUnlessEqual(result, None) - - def test_pointers(self): - f = dll._testfunc_p_p - f.restype = POINTER(c_int) - f.argtypes = [POINTER(c_int)] - - # This only works if the value c_int(42) passed to the - # function is still alive while the pointer (the result) is - # used. - - v = c_int(42) - - self.failUnlessEqual(pointer(v).contents.value, 42) - result = f(pointer(v)) - self.failUnlessEqual(type(result), POINTER(c_int)) - self.failUnlessEqual(result.contents.value, 42) - - # This on works... - result = f(pointer(v)) - self.failUnlessEqual(result.contents.value, v.value) - - p = pointer(c_int(99)) - result = f(p) - self.failUnlessEqual(result.contents.value, 99) - - arg = byref(v) - result = f(arg) - self.failIfEqual(result.contents, v.value) - - self.assertRaises(ArgumentError, f, byref(c_short(22))) - - # It is dangerous, however, because you don't control the lifetime - # of the pointer: - result = f(byref(c_int(99))) - self.failIfEqual(result.contents, 99) - - def test_errors(self): - f = dll._testfunc_p_p - f.restype = c_int - - class X(Structure): - _fields_ = [("y", c_int)] - - self.assertRaises(TypeError, f, X()) #cannot convert parameter - - ################################################################ - def test_shorts(self): - f = dll._testfunc_callback_i_if - - args = [] - expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, - 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] - - def callback(v): - args.append(v) - return v - - CallBack = CFUNCTYPE(c_int, c_int) - - cb = CallBack(callback) - f(2**18, cb) - self.failUnlessEqual(args, expected) - - ################################################################ - - - def test_callbacks(self): - f = dll._testfunc_callback_i_if - f.restype = c_int - - MyCallback = CFUNCTYPE(c_int, c_int) - - def callback(value): - #print "called back with", value - return value - - cb = MyCallback(callback) - result = f(-10, cb) - self.failUnlessEqual(result, -18) - - # test with prototype - f.argtypes = [c_int, MyCallback] - cb = MyCallback(callback) - result = f(-10, cb) - self.failUnlessEqual(result, -18) - - AnotherCallback = WINFUNCTYPE(c_int, c_int, c_int, c_int, c_int) - - # check that the prototype works: we call f with wrong - # argument types - cb = AnotherCallback(callback) - self.assertRaises(ArgumentError, f, -10, cb) - - - def test_callbacks_2(self): - # Can also use simple datatypes as argument type specifiers - # for the callback function. - # In this case the call receives an instance of that type - f = dll._testfunc_callback_i_if - f.restype = c_int - - MyCallback = CFUNCTYPE(c_int, c_int) - - f.argtypes = [c_int, MyCallback] - - def callback(value): - #print "called back with", value - self.failUnlessEqual(type(value), int) - return value - - cb = MyCallback(callback) - result = f(-10, cb) - self.failUnlessEqual(result, -18) - - def test_longlong_callbacks(self): - - f = dll._testfunc_callback_q_qf - f.restype = c_longlong - - MyCallback = CFUNCTYPE(c_longlong, c_longlong) - - f.argtypes = [c_longlong, MyCallback] - - def callback(value): - self.failUnless(isinstance(value, (int, long))) - return value & 0x7FFFFFFF - - cb = MyCallback(callback) - - self.failUnlessEqual(13577625587, f(1000000000000, cb)) - - def test_errors(self): - self.assertRaises(AttributeError, getattr, dll, "_xxx_yyy") - self.assertRaises(ValueError, c_int.in_dll, dll, "_xxx_yyy") - - def test_byval(self): - - # without prototype - ptin = POINT(1, 2) - ptout = POINT() - # EXPORT int _testfunc_byval(point in, point *pout) - result = dll._testfunc_byval(ptin, byref(ptout)) - got = result, ptout.x, ptout.y - expected = 3, 1, 2 - self.failUnlessEqual(got, expected) - - # with prototype - ptin = POINT(101, 102) - ptout = POINT() - dll._testfunc_byval.argtypes = (POINT, POINTER(POINT)) - dll._testfunc_byval.restype = c_int - result = dll._testfunc_byval(ptin, byref(ptout)) - got = result, ptout.x, ptout.y - expected = 203, 101, 102 - self.failUnlessEqual(got, expected) - - def test_struct_return_2H(self): - class S2H(Structure): - _fields_ = [("x", c_short), - ("y", c_short)] - dll.ret_2h_func.restype = S2H - dll.ret_2h_func.argtypes = [S2H] - inp = S2H(99, 88) - s2h = dll.ret_2h_func(inp) - self.failUnlessEqual((s2h.x, s2h.y), (99*2, 88*3)) - - if sys.platform == "win32": - def test_struct_return_2H_stdcall(self): - class S2H(Structure): - _fields_ = [("x", c_short), - ("y", c_short)] - - windll.s_ret_2h_func.restype = S2H - windll.s_ret_2h_func.argtypes = [S2H] - s2h = windll.s_ret_2h_func(S2H(99, 88)) - self.failUnlessEqual((s2h.x, s2h.y), (99*2, 88*3)) - - def test_struct_return_8H(self): - class S8I(Structure): - _fields_ = [("a", c_int), - ("b", c_int), - ("c", c_int), - ("d", c_int), - ("e", c_int), - ("f", c_int), - ("g", c_int), - ("h", c_int)] - dll.ret_8i_func.restype = S8I - dll.ret_8i_func.argtypes = [S8I] - inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) - s8i = dll.ret_8i_func(inp) - self.failUnlessEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), - (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) - - if sys.platform == "win32": - def test_struct_return_8H_stdcall(self): - class S8I(Structure): - _fields_ = [("a", c_int), - ("b", c_int), - ("c", c_int), - ("d", c_int), - ("e", c_int), - ("f", c_int), - ("g", c_int), - ("h", c_int)] - windll.s_ret_8i_func.restype = S8I - windll.s_ret_8i_func.argtypes = [S8I] - inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) - s8i = windll.s_ret_8i_func(inp) - self.failUnlessEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), - (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) - - def test_sf1651235(self): - # see http://www.python.org/sf/1651235 - - proto = CFUNCTYPE(c_int, RECT, POINT) - def callback(*args): - return 0 - - callback = proto(callback) - self.failUnlessRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT())) - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_incomplete.py b/sys/lib/python/ctypes/test/test_incomplete.py deleted file mode 100644 index af9f504f7..000000000 --- a/sys/lib/python/ctypes/test/test_incomplete.py +++ /dev/null @@ -1,42 +0,0 @@ -import unittest -from ctypes import * - -################################################################ -# -# The incomplete pointer example from the tutorial -# - -class MyTestCase(unittest.TestCase): - - def test_incomplete_example(self): - lpcell = POINTER("cell") - class cell(Structure): - _fields_ = [("name", c_char_p), - ("next", lpcell)] - - SetPointerType(lpcell, cell) - - c1 = cell() - c1.name = "foo" - c2 = cell() - c2.name = "bar" - - c1.next = pointer(c2) - c2.next = pointer(c1) - - p = c1 - - result = [] - for i in range(8): - result.append(p.name) - p = p.next[0] - self.failUnlessEqual(result, ["foo", "bar"] * 4) - - # to not leak references, we must clean _pointer_type_cache - from ctypes import _pointer_type_cache - del _pointer_type_cache[cell] - -################################################################ - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_init.py b/sys/lib/python/ctypes/test/test_init.py deleted file mode 100644 index 3d9dc9210..000000000 --- a/sys/lib/python/ctypes/test/test_init.py +++ /dev/null @@ -1,40 +0,0 @@ -from ctypes import * -import unittest - -class X(Structure): - _fields_ = [("a", c_int), - ("b", c_int)] - new_was_called = False - - def __new__(cls): - result = super(X, cls).__new__(cls) - result.new_was_called = True - return result - - def __init__(self): - self.a = 9 - self.b = 12 - -class Y(Structure): - _fields_ = [("x", X)] - - -class InitTest(unittest.TestCase): - def test_get(self): - # make sure the only accessing a nested structure - # doesn't call the structure's __new__ and __init__ - y = Y() - self.failUnlessEqual((y.x.a, y.x.b), (0, 0)) - self.failUnlessEqual(y.x.new_was_called, False) - - # But explicitely creating an X structure calls __new__ and __init__, of course. - x = X() - self.failUnlessEqual((x.a, x.b), (9, 12)) - self.failUnlessEqual(x.new_was_called, True) - - y.x = x - self.failUnlessEqual((y.x.a, y.x.b), (9, 12)) - self.failUnlessEqual(y.x.new_was_called, False) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_integers.py b/sys/lib/python/ctypes/test/test_integers.py deleted file mode 100644 index 5b6453a00..000000000 --- a/sys/lib/python/ctypes/test/test_integers.py +++ /dev/null @@ -1,5 +0,0 @@ -# superseeded by test_numbers.py -import unittest - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_internals.py b/sys/lib/python/ctypes/test/test_internals.py deleted file mode 100644 index 04b204039..000000000 --- a/sys/lib/python/ctypes/test/test_internals.py +++ /dev/null @@ -1,103 +0,0 @@ -# This tests the internal _objects attribute -import unittest -from ctypes import * -from sys import getrefcount as grc - -# XXX This test must be reviewed for correctness!!! - -""" -ctypes' types are container types. - -They have an internal memory block, which only consists of some bytes, -but it has to keep references to other objects as well. This is not -really needed for trivial C types like int or char, but it is important -for aggregate types like strings or pointers in particular. - -What about pointers? - -""" - -class ObjectsTestCase(unittest.TestCase): - def failUnlessSame(self, a, b): - self.failUnlessEqual(id(a), id(b)) - - def test_ints(self): - i = 42000123 - self.failUnlessEqual(3, grc(i)) - ci = c_int(i) - self.failUnlessEqual(3, grc(i)) - self.failUnlessEqual(ci._objects, None) - - def test_c_char_p(self): - s = "Hello, World" - self.failUnlessEqual(3, grc(s)) - cs = c_char_p(s) - self.failUnlessEqual(4, grc(s)) - self.failUnlessSame(cs._objects, s) - - def test_simple_struct(self): - class X(Structure): - _fields_ = [("a", c_int), ("b", c_int)] - - a = 421234 - b = 421235 - x = X() - self.failUnlessEqual(x._objects, None) - x.a = a - x.b = b - self.failUnlessEqual(x._objects, None) - - def test_embedded_structs(self): - class X(Structure): - _fields_ = [("a", c_int), ("b", c_int)] - - class Y(Structure): - _fields_ = [("x", X), ("y", X)] - - y = Y() - self.failUnlessEqual(y._objects, None) - - x1, x2 = X(), X() - y.x, y.y = x1, x2 - self.failUnlessEqual(y._objects, {"0": {}, "1": {}}) - x1.a, x2.b = 42, 93 - self.failUnlessEqual(y._objects, {"0": {}, "1": {}}) - - def test_xxx(self): - class X(Structure): - _fields_ = [("a", c_char_p), ("b", c_char_p)] - - class Y(Structure): - _fields_ = [("x", X), ("y", X)] - - s1 = "Hello, World" - s2 = "Hallo, Welt" - - x = X() - x.a = s1 - x.b = s2 - self.failUnlessEqual(x._objects, {"0": s1, "1": s2}) - - y = Y() - y.x = x - self.failUnlessEqual(y._objects, {"0": {"0": s1, "1": s2}}) -## x = y.x -## del y -## print x._b_base_._objects - - def test_ptr_struct(self): - class X(Structure): - _fields_ = [("data", POINTER(c_int))] - - A = c_int*4 - a = A(11, 22, 33, 44) - self.failUnlessEqual(a._objects, None) - - x = X() - x.data = a -##XXX print x._objects -##XXX print x.data[0] -##XXX print x.data._objects - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_keeprefs.py b/sys/lib/python/ctypes/test/test_keeprefs.py deleted file mode 100644 index 80b6ca2ae..000000000 --- a/sys/lib/python/ctypes/test/test_keeprefs.py +++ /dev/null @@ -1,152 +0,0 @@ -from ctypes import * -import unittest - -class SimpleTestCase(unittest.TestCase): - def test_cint(self): - x = c_int() - self.assertEquals(x._objects, None) - x.value = 42 - self.assertEquals(x._objects, None) - x = c_int(99) - self.assertEquals(x._objects, None) - - def test_ccharp(self): - x = c_char_p() - self.assertEquals(x._objects, None) - x.value = "abc" - self.assertEquals(x._objects, "abc") - x = c_char_p("spam") - self.assertEquals(x._objects, "spam") - -class StructureTestCase(unittest.TestCase): - def test_cint_struct(self): - class X(Structure): - _fields_ = [("a", c_int), - ("b", c_int)] - - x = X() - self.assertEquals(x._objects, None) - x.a = 42 - x.b = 99 - self.assertEquals(x._objects, None) - - def test_ccharp_struct(self): - class X(Structure): - _fields_ = [("a", c_char_p), - ("b", c_char_p)] - x = X() - self.assertEquals(x._objects, None) - - x.a = "spam" - x.b = "foo" - self.assertEquals(x._objects, {"0": "spam", "1": "foo"}) - - def test_struct_struct(self): - class POINT(Structure): - _fields_ = [("x", c_int), ("y", c_int)] - class RECT(Structure): - _fields_ = [("ul", POINT), ("lr", POINT)] - - r = RECT() - r.ul.x = 0 - r.ul.y = 1 - r.lr.x = 2 - r.lr.y = 3 - self.assertEquals(r._objects, None) - - r = RECT() - pt = POINT(1, 2) - r.ul = pt - self.assertEquals(r._objects, {'0': {}}) - r.ul.x = 22 - r.ul.y = 44 - self.assertEquals(r._objects, {'0': {}}) - r.lr = POINT() - self.assertEquals(r._objects, {'0': {}, '1': {}}) - -class ArrayTestCase(unittest.TestCase): - def test_cint_array(self): - INTARR = c_int * 3 - - ia = INTARR() - self.assertEquals(ia._objects, None) - ia[0] = 1 - ia[1] = 2 - ia[2] = 3 - self.assertEquals(ia._objects, None) - - class X(Structure): - _fields_ = [("x", c_int), - ("a", INTARR)] - - x = X() - x.x = 1000 - x.a[0] = 42 - x.a[1] = 96 - self.assertEquals(x._objects, None) - x.a = ia - self.assertEquals(x._objects, {'1': {}}) - -class PointerTestCase(unittest.TestCase): - def test_p_cint(self): - i = c_int(42) - x = pointer(i) - self.failUnlessEqual(x._objects, {'1': i}) - -class DeletePointerTestCase(unittest.TestCase): - def X_test(self): - class X(Structure): - _fields_ = [("p", POINTER(c_char_p))] - x = X() - i = c_char_p("abc def") - from sys import getrefcount as grc - print "2?", grc(i) - x.p = pointer(i) - print "3?", grc(i) - for i in range(320): - c_int(99) - x.p[0] - print x.p[0] -## del x -## print "2?", grc(i) -## del i - import gc - gc.collect() - for i in range(320): - c_int(99) - x.p[0] - print x.p[0] - print x.p.contents -## print x._objects - - x.p[0] = "spam spam" -## print x.p[0] - print "+" * 42 - print x._objects - -class PointerToStructure(unittest.TestCase): - def test(self): - class POINT(Structure): - _fields_ = [("x", c_int), ("y", c_int)] - class RECT(Structure): - _fields_ = [("a", POINTER(POINT)), - ("b", POINTER(POINT))] - r = RECT() - p1 = POINT(1, 2) - - r.a = pointer(p1) - r.b = pointer(p1) -## from pprint import pprint as pp -## pp(p1._objects) -## pp(r._objects) - - r.a[0].x = 42 - r.a[0].y = 99 - - # to avoid leaking when tests are run several times - # clean up the types left in the cache. - from ctypes import _pointer_type_cache - del _pointer_type_cache[POINT] - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_libc.py b/sys/lib/python/ctypes/test/test_libc.py deleted file mode 100644 index c39f3507c..000000000 --- a/sys/lib/python/ctypes/test/test_libc.py +++ /dev/null @@ -1,30 +0,0 @@ -import sys, os -import unittest - -from ctypes import * -import _ctypes_test - -lib = CDLL(_ctypes_test.__file__) - -class LibTest(unittest.TestCase): - def test_sqrt(self): - lib.my_sqrt.argtypes = c_double, - lib.my_sqrt.restype = c_double - self.failUnlessEqual(lib.my_sqrt(4.0), 2.0) - import math - self.failUnlessEqual(lib.my_sqrt(2.0), math.sqrt(2.0)) - - def test_qsort(self): - comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char)) - lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc - lib.my_qsort.restype = None - - def sort(a, b): - return cmp(a[0], b[0]) - - chars = create_string_buffer("spam, spam, and spam") - lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) - self.failUnlessEqual(chars.raw, " ,,aaaadmmmnpppsss\x00") - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_loading.py b/sys/lib/python/ctypes/test/test_loading.py deleted file mode 100644 index 1e7870b79..000000000 --- a/sys/lib/python/ctypes/test/test_loading.py +++ /dev/null @@ -1,78 +0,0 @@ -from ctypes import * -import sys, unittest -import os, StringIO -from ctypes.util import find_library -from ctypes.test import is_resource_enabled - -libc_name = None -if os.name == "nt": - libc_name = "msvcrt" -elif os.name == "ce": - libc_name = "coredll" -elif sys.platform == "cygwin": - libc_name = "cygwin1.dll" -else: - libc_name = find_library("c") - -if True or is_resource_enabled("printing"): - print >> sys.stderr, "\tfind_library('c') -> ", find_library('c') - print >> sys.stderr, "\tfind_library('m') -> ", find_library('m') - -class LoaderTest(unittest.TestCase): - - unknowndll = "xxrandomnamexx" - - if libc_name is not None: - def test_load(self): - CDLL(libc_name) - CDLL(os.path.basename(libc_name)) - self.assertRaises(OSError, CDLL, self.unknowndll) - - if libc_name is not None and os.path.basename(libc_name) == "libc.so.6": - def test_load_version(self): - cdll.LoadLibrary("libc.so.6") - # linux uses version, libc 9 should not exist - self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9") - self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) - - def test_find(self): - for name in ("c", "m"): - lib = find_library(name) - if lib: - cdll.LoadLibrary(lib) - CDLL(lib) - - if os.name in ("nt", "ce"): - def test_load_library(self): - if is_resource_enabled("printing"): - print find_library("kernel32") - print find_library("user32") - - if os.name == "nt": - windll.kernel32.GetModuleHandleW - windll["kernel32"].GetModuleHandleW - windll.LoadLibrary("kernel32").GetModuleHandleW - WinDLL("kernel32").GetModuleHandleW - elif os.name == "ce": - windll.coredll.GetModuleHandleW - windll["coredll"].GetModuleHandleW - windll.LoadLibrary("coredll").GetModuleHandleW - WinDLL("coredll").GetModuleHandleW - - def test_load_ordinal_functions(self): - import _ctypes_test - dll = WinDLL(_ctypes_test.__file__) - # We load the same function both via ordinal and name - func_ord = dll[2] - func_name = dll.GetString - # addressof gets the address where the function pointer is stored - a_ord = addressof(func_ord) - a_name = addressof(func_name) - f_ord_addr = c_void_p.from_address(a_ord).value - f_name_addr = c_void_p.from_address(a_name).value - self.failUnlessEqual(hex(f_ord_addr), hex(f_name_addr)) - - self.failUnlessRaises(AttributeError, dll.__getitem__, 1234) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_macholib.py b/sys/lib/python/ctypes/test/test_macholib.py deleted file mode 100644 index 4bb68ac63..000000000 --- a/sys/lib/python/ctypes/test/test_macholib.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -import sys -import unittest - -# Bob Ippolito: -""" -Ok.. the code to find the filename for __getattr__ should look -something like: - -import os -from macholib.dyld import dyld_find - -def find_lib(name): - possible = ['lib'+name+'.dylib', name+'.dylib', - name+'.framework/'+name] - for dylib in possible: - try: - return os.path.realpath(dyld_find(dylib)) - except ValueError: - pass - raise ValueError, "%s not found" % (name,) - -It'll have output like this: - - >>> find_lib('pthread') -'/usr/lib/libSystem.B.dylib' - >>> find_lib('z') -'/usr/lib/libz.1.dylib' - >>> find_lib('IOKit') -'/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit' - --bob - -""" - -from ctypes.macholib.dyld import dyld_find - -def find_lib(name): - possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name] - for dylib in possible: - try: - return os.path.realpath(dyld_find(dylib)) - except ValueError: - pass - raise ValueError, "%s not found" % (name,) - -class MachOTest(unittest.TestCase): - if sys.platform == "darwin": - def test_find(self): - - self.failUnlessEqual(find_lib('pthread'), - '/usr/lib/libSystem.B.dylib') - - result = find_lib('z') - self.failUnless(result.startswith('/usr/lib/libz.1')) - self.failUnless(result.endswith('.dylib')) - - self.failUnlessEqual(find_lib('IOKit'), - '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit') - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_memfunctions.py b/sys/lib/python/ctypes/test/test_memfunctions.py deleted file mode 100644 index aef7a739f..000000000 --- a/sys/lib/python/ctypes/test/test_memfunctions.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys -import unittest -from ctypes import * - -class MemFunctionsTest(unittest.TestCase): - def test_memmove(self): - # large buffers apparently increase the chance that the memory - # is allocated in high address space. - a = create_string_buffer(1000000) - p = "Hello, World" - result = memmove(a, p, len(p)) - self.failUnlessEqual(a.value, "Hello, World") - - self.failUnlessEqual(string_at(result), "Hello, World") - self.failUnlessEqual(string_at(result, 5), "Hello") - self.failUnlessEqual(string_at(result, 16), "Hello, World\0\0\0\0") - self.failUnlessEqual(string_at(result, 0), "") - - def test_memset(self): - a = create_string_buffer(1000000) - result = memset(a, ord('x'), 16) - self.failUnlessEqual(a.value, "xxxxxxxxxxxxxxxx") - - self.failUnlessEqual(string_at(result), "xxxxxxxxxxxxxxxx") - self.failUnlessEqual(string_at(a), "xxxxxxxxxxxxxxxx") - self.failUnlessEqual(string_at(a, 20), "xxxxxxxxxxxxxxxx\0\0\0\0") - - def test_cast(self): - a = (c_ubyte * 32)(*map(ord, "abcdef")) - self.failUnlessEqual(cast(a, c_char_p).value, "abcdef") - self.failUnlessEqual(cast(a, POINTER(c_byte))[:7], - [97, 98, 99, 100, 101, 102, 0]) - - def test_string_at(self): - s = string_at("foo bar") - # XXX The following may be wrong, depending on how Python - # manages string instances - self.failUnlessEqual(2, sys.getrefcount(s)) - self.failUnless(s, "foo bar") - - self.failUnlessEqual(string_at("foo bar", 8), "foo bar\0") - self.failUnlessEqual(string_at("foo bar", 3), "foo") - - try: - create_unicode_buffer - except NameError: - pass - else: - def test_wstring_at(self): - p = create_unicode_buffer("Hello, World") - a = create_unicode_buffer(1000000) - result = memmove(a, p, len(p) * sizeof(c_wchar)) - self.failUnlessEqual(a.value, "Hello, World") - - self.failUnlessEqual(wstring_at(a), "Hello, World") - self.failUnlessEqual(wstring_at(a, 5), "Hello") - self.failUnlessEqual(wstring_at(a, 16), "Hello, World\0\0\0\0") - self.failUnlessEqual(wstring_at(a, 0), "") - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_numbers.py b/sys/lib/python/ctypes/test/test_numbers.py deleted file mode 100644 index c22688dba..000000000 --- a/sys/lib/python/ctypes/test/test_numbers.py +++ /dev/null @@ -1,230 +0,0 @@ -from ctypes import * -import unittest -import sys, struct - -def valid_ranges(*types): - # given a sequence of numeric types, collect their _type_ - # attribute, which is a single format character compatible with - # the struct module, use the struct module to calculate the - # minimum and maximum value allowed for this format. - # Returns a list of (min, max) values. - result = [] - for t in types: - fmt = t._type_ - size = struct.calcsize(fmt) - a = struct.unpack(fmt, ("\x00"*32)[:size])[0] - b = struct.unpack(fmt, ("\xFF"*32)[:size])[0] - c = struct.unpack(fmt, ("\x7F"+"\x00"*32)[:size])[0] - d = struct.unpack(fmt, ("\x80"+"\xFF"*32)[:size])[0] - result.append((min(a, b, c, d), max(a, b, c, d))) - return result - -ArgType = type(byref(c_int(0))) - -unsigned_types = [c_ubyte, c_ushort, c_uint, c_ulong] -signed_types = [c_byte, c_short, c_int, c_long, c_longlong] - -float_types = [c_double, c_float] - -try: - c_ulonglong - c_longlong -except NameError: - pass -else: - unsigned_types.append(c_ulonglong) - signed_types.append(c_longlong) - -unsigned_ranges = valid_ranges(*unsigned_types) -signed_ranges = valid_ranges(*signed_types) - -################################################################ - -class NumberTestCase(unittest.TestCase): - - def test_default_init(self): - # default values are set to zero - for t in signed_types + unsigned_types + float_types: - self.failUnlessEqual(t().value, 0) - - def test_unsigned_values(self): - # the value given to the constructor is available - # as the 'value' attribute - for t, (l, h) in zip(unsigned_types, unsigned_ranges): - self.failUnlessEqual(t(l).value, l) - self.failUnlessEqual(t(h).value, h) - - def test_signed_values(self): - # see above - for t, (l, h) in zip(signed_types, signed_ranges): - self.failUnlessEqual(t(l).value, l) - self.failUnlessEqual(t(h).value, h) - - def test_typeerror(self): - # Only numbers are allowed in the contructor, - # otherwise TypeError is raised - for t in signed_types + unsigned_types + float_types: - self.assertRaises(TypeError, t, "") - self.assertRaises(TypeError, t, None) - -## def test_valid_ranges(self): -## # invalid values of the correct type -## # raise ValueError (not OverflowError) -## for t, (l, h) in zip(unsigned_types, unsigned_ranges): -## self.assertRaises(ValueError, t, l-1) -## self.assertRaises(ValueError, t, h+1) - - def test_from_param(self): - # the from_param class method attribute always - # returns PyCArgObject instances - for t in signed_types + unsigned_types + float_types: - self.failUnlessEqual(ArgType, type(t.from_param(0))) - - def test_byref(self): - # calling byref returns also a PyCArgObject instance - for t in signed_types + unsigned_types + float_types: - parm = byref(t()) - self.failUnlessEqual(ArgType, type(parm)) - - - def test_floats(self): - # c_float and c_double can be created from - # Python int, long and float - for t in float_types: - self.failUnlessEqual(t(2.0).value, 2.0) - self.failUnlessEqual(t(2).value, 2.0) - self.failUnlessEqual(t(2L).value, 2.0) - - def test_integers(self): - # integers cannot be constructed from floats - for t in signed_types + unsigned_types: - self.assertRaises(TypeError, t, 3.14) - - def test_sizes(self): - for t in signed_types + unsigned_types + float_types: - size = struct.calcsize(t._type_) - # sizeof of the type... - self.failUnlessEqual(sizeof(t), size) - # and sizeof of an instance - self.failUnlessEqual(sizeof(t()), size) - - def test_alignments(self): - for t in signed_types + unsigned_types + float_types: - code = t._type_ # the typecode - align = struct.calcsize("c%c" % code) - struct.calcsize(code) - - # alignment of the type... - self.failUnlessEqual((code, alignment(t)), - (code, align)) - # and alignment of an instance - self.failUnlessEqual((code, alignment(t())), - (code, align)) - - def test_int_from_address(self): - from array import array - for t in signed_types + unsigned_types: - # the array module doesn't suppport all format codes - # (no 'q' or 'Q') - try: - array(t._type_) - except ValueError: - continue - a = array(t._type_, [100]) - - # v now is an integer at an 'external' memory location - v = t.from_address(a.buffer_info()[0]) - self.failUnlessEqual(v.value, a[0]) - self.failUnlessEqual(type(v), t) - - # changing the value at the memory location changes v's value also - a[0] = 42 - self.failUnlessEqual(v.value, a[0]) - - - def test_float_from_address(self): - from array import array - for t in float_types: - a = array(t._type_, [3.14]) - v = t.from_address(a.buffer_info()[0]) - self.failUnlessEqual(v.value, a[0]) - self.failUnless(type(v) is t) - a[0] = 2.3456e17 - self.failUnlessEqual(v.value, a[0]) - self.failUnless(type(v) is t) - - def test_char_from_address(self): - from ctypes import c_char - from array import array - - a = array('c', 'x') - v = c_char.from_address(a.buffer_info()[0]) - self.failUnlessEqual(v.value, a[0]) - self.failUnless(type(v) is c_char) - - a[0] = '?' - self.failUnlessEqual(v.value, a[0]) - - def test_init(self): - # c_int() can be initialized from Python's int, and c_int. - # Not from c_long or so, which seems strange, abd should - # probably be changed: - self.assertRaises(TypeError, c_int, c_long(42)) - -## def test_perf(self): -## check_perf() - -from ctypes import _SimpleCData -class c_int_S(_SimpleCData): - _type_ = "i" - __slots__ = [] - -def run_test(rep, msg, func, arg=None): -## items = [None] * rep - items = range(rep) - from time import clock - if arg is not None: - start = clock() - for i in items: - func(arg); func(arg); func(arg); func(arg); func(arg) - stop = clock() - else: - start = clock() - for i in items: - func(); func(); func(); func(); func() - stop = clock() - print "%15s: %.2f us" % (msg, ((stop-start)*1e6/5/rep)) - -def check_perf(): - # Construct 5 objects - from ctypes import c_int - - REP = 200000 - - run_test(REP, "int()", int) - run_test(REP, "int(999)", int) - run_test(REP, "c_int()", c_int) - run_test(REP, "c_int(999)", c_int) - run_test(REP, "c_int_S()", c_int_S) - run_test(REP, "c_int_S(999)", c_int_S) - -# Python 2.3 -OO, win2k, P4 700 MHz: -# -# int(): 0.87 us -# int(999): 0.87 us -# c_int(): 3.35 us -# c_int(999): 3.34 us -# c_int_S(): 3.23 us -# c_int_S(999): 3.24 us - -# Python 2.2 -OO, win2k, P4 700 MHz: -# -# int(): 0.89 us -# int(999): 0.89 us -# c_int(): 9.99 us -# c_int(999): 10.02 us -# c_int_S(): 9.87 us -# c_int_S(999): 9.85 us - -if __name__ == '__main__': -## check_perf() - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_objects.py b/sys/lib/python/ctypes/test/test_objects.py deleted file mode 100644 index 4d921d2e5..000000000 --- a/sys/lib/python/ctypes/test/test_objects.py +++ /dev/null @@ -1,70 +0,0 @@ -r''' -This tests the '_objects' attribute of ctypes instances. '_objects' -holds references to objects that must be kept alive as long as the -ctypes instance, to make sure that the memory buffer is valid. - -WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself, -it MUST NEVER BE MODIFIED! - -'_objects' is initialized to a dictionary on first use, before that it -is None. - -Here is an array of string pointers: - ->>> from ctypes import * ->>> array = (c_char_p * 5)() ->>> print array._objects -None ->>> - -The memory block stores pointers to strings, and the strings itself -assigned from Python must be kept. - ->>> array[4] = 'foo bar' ->>> array._objects -{'4': 'foo bar'} ->>> array[4] -'foo bar' ->>> - -It gets more complicated when the ctypes instance itself is contained -in a 'base' object. - ->>> class X(Structure): -... _fields_ = [("x", c_int), ("y", c_int), ("array", c_char_p * 5)] -... ->>> x = X() ->>> print x._objects -None ->>> - -The'array' attribute of the 'x' object shares part of the memory buffer -of 'x' ('_b_base_' is either None, or the root object owning the memory block): - ->>> print x.array._b_base_ # doctest: +ELLIPSIS - ->>> - ->>> x.array[0] = 'spam spam spam' ->>> x._objects -{'0:2': 'spam spam spam'} ->>> x.array._b_base_._objects -{'0:2': 'spam spam spam'} ->>> - -''' - -import unittest, doctest, sys - -import ctypes.test.test_objects - -class TestCase(unittest.TestCase): - if sys.hexversion > 0x02040000: - # Python 2.3 has no ELLIPSIS flag, so we don't test with this - # version: - def test(self): - doctest.testmod(ctypes.test.test_objects) - -if __name__ == '__main__': - if sys.hexversion > 0x02040000: - doctest.testmod(ctypes.test.test_objects) diff --git a/sys/lib/python/ctypes/test/test_parameters.py b/sys/lib/python/ctypes/test/test_parameters.py deleted file mode 100644 index 1b7f0dc86..000000000 --- a/sys/lib/python/ctypes/test/test_parameters.py +++ /dev/null @@ -1,188 +0,0 @@ -import unittest, sys - -class SimpleTypesTestCase(unittest.TestCase): - - def setUp(self): - import ctypes - try: - from _ctypes import set_conversion_mode - except ImportError: - pass - else: - self.prev_conv_mode = set_conversion_mode("ascii", "strict") - - def tearDown(self): - try: - from _ctypes import set_conversion_mode - except ImportError: - pass - else: - set_conversion_mode(*self.prev_conv_mode) - - - def test_subclasses(self): - from ctypes import c_void_p, c_char_p - # ctypes 0.9.5 and before did overwrite from_param in SimpleType_new - class CVOIDP(c_void_p): - def from_param(cls, value): - return value * 2 - from_param = classmethod(from_param) - - class CCHARP(c_char_p): - def from_param(cls, value): - return value * 4 - from_param = classmethod(from_param) - - self.failUnlessEqual(CVOIDP.from_param("abc"), "abcabc") - self.failUnlessEqual(CCHARP.from_param("abc"), "abcabcabcabc") - - try: - from ctypes import c_wchar_p - except ImportError: - return - - class CWCHARP(c_wchar_p): - def from_param(cls, value): - return value * 3 - from_param = classmethod(from_param) - - self.failUnlessEqual(CWCHARP.from_param("abc"), "abcabcabc") - - # XXX Replace by c_char_p tests - def test_cstrings(self): - from ctypes import c_char_p, byref - - # c_char_p.from_param on a Python String packs the string - # into a cparam object - s = "123" - self.failUnless(c_char_p.from_param(s)._obj is s) - - # new in 0.9.1: convert (encode) unicode to ascii - self.failUnlessEqual(c_char_p.from_param(u"123")._obj, "123") - self.assertRaises(UnicodeEncodeError, c_char_p.from_param, u"123\377") - - self.assertRaises(TypeError, c_char_p.from_param, 42) - - # calling c_char_p.from_param with a c_char_p instance - # returns the argument itself: - a = c_char_p("123") - self.failUnless(c_char_p.from_param(a) is a) - - def test_cw_strings(self): - from ctypes import byref - try: - from ctypes import c_wchar_p - except ImportError: -## print "(No c_wchar_p)" - return - s = u"123" - if sys.platform == "win32": - self.failUnless(c_wchar_p.from_param(s)._obj is s) - self.assertRaises(TypeError, c_wchar_p.from_param, 42) - - # new in 0.9.1: convert (decode) ascii to unicode - self.failUnlessEqual(c_wchar_p.from_param("123")._obj, u"123") - self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, "123\377") - - pa = c_wchar_p.from_param(c_wchar_p(u"123")) - self.failUnlessEqual(type(pa), c_wchar_p) - - def test_int_pointers(self): - from ctypes import c_short, c_uint, c_int, c_long, POINTER, pointer - LPINT = POINTER(c_int) - -## p = pointer(c_int(42)) -## x = LPINT.from_param(p) - x = LPINT.from_param(pointer(c_int(42))) - self.failUnlessEqual(x.contents.value, 42) - self.failUnlessEqual(LPINT(c_int(42)).contents.value, 42) - - self.failUnlessEqual(LPINT.from_param(None), 0) - - if c_int != c_long: - self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42))) - self.assertRaises(TypeError, LPINT.from_param, pointer(c_uint(42))) - self.assertRaises(TypeError, LPINT.from_param, pointer(c_short(42))) - - def test_byref_pointer(self): - # The from_param class method of POINTER(typ) classes accepts what is - # returned by byref(obj), it type(obj) == typ - from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref - LPINT = POINTER(c_int) - - LPINT.from_param(byref(c_int(42))) - - self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22))) - if c_int != c_long: - self.assertRaises(TypeError, LPINT.from_param, byref(c_long(22))) - self.assertRaises(TypeError, LPINT.from_param, byref(c_uint(22))) - - def test_byref_pointerpointer(self): - # See above - from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref - - LPLPINT = POINTER(POINTER(c_int)) - LPLPINT.from_param(byref(pointer(c_int(42)))) - - self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_short(22)))) - if c_int != c_long: - self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_long(22)))) - self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_uint(22)))) - - def test_array_pointers(self): - from ctypes import c_short, c_uint, c_int, c_long, POINTER - INTARRAY = c_int * 3 - ia = INTARRAY() - self.failUnlessEqual(len(ia), 3) - self.failUnlessEqual([ia[i] for i in range(3)], [0, 0, 0]) - - # Pointers are only compatible with arrays containing items of - # the same type! - LPINT = POINTER(c_int) - LPINT.from_param((c_int*3)()) - self.assertRaises(TypeError, LPINT.from_param, c_short*3) - self.assertRaises(TypeError, LPINT.from_param, c_long*3) - self.assertRaises(TypeError, LPINT.from_param, c_uint*3) - -## def test_performance(self): -## check_perf() - - def test_noctypes_argtype(self): - import _ctypes_test - from ctypes import CDLL, c_void_p, ArgumentError - - func = CDLL(_ctypes_test.__file__)._testfunc_p_p - func.restype = c_void_p - # TypeError: has no from_param method - self.assertRaises(TypeError, setattr, func, "argtypes", (object,)) - - class Adapter(object): - def from_param(cls, obj): - return None - - func.argtypes = (Adapter(),) - self.failUnlessEqual(func(None), None) - self.failUnlessEqual(func(object()), None) - - class Adapter(object): - def from_param(cls, obj): - return obj - - func.argtypes = (Adapter(),) - # don't know how to convert parameter 1 - self.assertRaises(ArgumentError, func, object()) - self.failUnlessEqual(func(c_void_p(42)), 42) - - class Adapter(object): - def from_param(cls, obj): - raise ValueError(obj) - - func.argtypes = (Adapter(),) - # ArgumentError: argument 1: ValueError: 99 - self.assertRaises(ArgumentError, func, 99) - - -################################################################ - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_pointers.py b/sys/lib/python/ctypes/test/test_pointers.py deleted file mode 100644 index 586655af7..000000000 --- a/sys/lib/python/ctypes/test/test_pointers.py +++ /dev/null @@ -1,179 +0,0 @@ -import unittest - -from ctypes import * -import _ctypes_test - -ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, - c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] -python_types = [int, int, int, int, int, long, - int, long, long, long, float, float] - -class PointersTestCase(unittest.TestCase): - - def test_pointer_crash(self): - - class A(POINTER(c_ulong)): - pass - - POINTER(c_ulong)(c_ulong(22)) - # Pointer can't set contents: has no _type_ - self.failUnlessRaises(TypeError, A, c_ulong(33)) - - def test_pass_pointers(self): - dll = CDLL(_ctypes_test.__file__) - func = dll._testfunc_p_p - func.restype = c_long - - i = c_int(12345678) -## func.argtypes = (POINTER(c_int),) - address = func(byref(i)) - self.failUnlessEqual(c_int.from_address(address).value, 12345678) - - func.restype = POINTER(c_int) - res = func(pointer(i)) - self.failUnlessEqual(res.contents.value, 12345678) - self.failUnlessEqual(res[0], 12345678) - - def test_change_pointers(self): - dll = CDLL(_ctypes_test.__file__) - func = dll._testfunc_p_p - - i = c_int(87654) - func.restype = POINTER(c_int) - func.argtypes = (POINTER(c_int),) - - res = func(pointer(i)) - self.failUnlessEqual(res[0], 87654) - self.failUnlessEqual(res.contents.value, 87654) - - # C code: *res = 54345 - res[0] = 54345 - self.failUnlessEqual(i.value, 54345) - - # C code: - # int x = 12321; - # res = &x - res.contents = c_int(12321) - self.failUnlessEqual(i.value, 54345) - - def test_callbacks_with_pointers(self): - # a function type receiving a pointer - PROTOTYPE = CFUNCTYPE(c_int, POINTER(c_int)) - - self.result = [] - - def func(arg): - for i in range(10): -## print arg[i], - self.result.append(arg[i]) -## print - return 0 - callback = PROTOTYPE(func) - - dll = CDLL(_ctypes_test.__file__) - # This function expects a function pointer, - # and calls this with an integer pointer as parameter. - # The int pointer points to a table containing the numbers 1..10 - doit = dll._testfunc_callback_with_pointer - -## i = c_int(42) -## callback(byref(i)) -## self.failUnless(i.value == 84) - - doit(callback) -## print self.result - doit(callback) -## print self.result - - def test_basics(self): - from operator import delitem - for ct, pt in zip(ctype_types, python_types): - i = ct(42) - p = pointer(i) -## print type(p.contents), ct - self.failUnless(type(p.contents) is ct) - # p.contents is the same as p[0] -## print p.contents -## self.failUnless(p.contents == 42) -## self.failUnless(p[0] == 42) - - self.assertRaises(TypeError, delitem, p, 0) - - def test_from_address(self): - from array import array - a = array('i', [100, 200, 300, 400, 500]) - addr = a.buffer_info()[0] - - p = POINTER(POINTER(c_int)) -## print dir(p) -## print p.from_address -## print p.from_address(addr)[0][0] - - def test_other(self): - class Table(Structure): - _fields_ = [("a", c_int), - ("b", c_int), - ("c", c_int)] - - pt = pointer(Table(1, 2, 3)) - - self.failUnlessEqual(pt.contents.a, 1) - self.failUnlessEqual(pt.contents.b, 2) - self.failUnlessEqual(pt.contents.c, 3) - - pt.contents.c = 33 - - from ctypes import _pointer_type_cache - del _pointer_type_cache[Table] - - def test_basic(self): - p = pointer(c_int(42)) - # Although a pointer can be indexed, it ha no length - self.assertRaises(TypeError, len, p) - self.failUnlessEqual(p[0], 42) - self.failUnlessEqual(p.contents.value, 42) - - def test_charpp(self): - """Test that a character pointer-to-pointer is correctly passed""" - dll = CDLL(_ctypes_test.__file__) - func = dll._testfunc_c_p_p - func.restype = c_char_p - argv = (c_char_p * 2)() - argc = c_int( 2 ) - argv[0] = 'hello' - argv[1] = 'world' - result = func( byref(argc), argv ) - assert result == 'world', result - - def test_bug_1467852(self): - # http://sourceforge.net/tracker/?func=detail&atid=532154&aid=1467852&group_id=71702 - x = c_int(5) - dummy = [] - for i in range(32000): - dummy.append(c_int(i)) - y = c_int(6) - p = pointer(x) - pp = pointer(p) - q = pointer(y) - pp[0] = q # <== - self.failUnlessEqual(p[0], 6) - def test_c_void_p(self): - # http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470 - if sizeof(c_void_p) == 4: - self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, - c_void_p(-1).value) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, - c_void_p(-1).value) - elif sizeof(c_void_p) == 8: - self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, - 0xFFFFFFFFL) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, - c_void_p(-1).value) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFFL).value, - c_void_p(-1).value) - - self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted - self.assertRaises(TypeError, c_void_p, object()) # nor other objects - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_prototypes.py b/sys/lib/python/ctypes/test/test_prototypes.py deleted file mode 100644 index 9f020866f..000000000 --- a/sys/lib/python/ctypes/test/test_prototypes.py +++ /dev/null @@ -1,203 +0,0 @@ -from ctypes import * -import unittest - -# IMPORTANT INFO: -# -# Consider this call: -# func.restype = c_char_p -# func(c_char_p("123")) -# It returns -# "123" -# -# WHY IS THIS SO? -# -# argument tuple (c_char_p("123"), ) is destroyed after the function -# func is called, but NOT before the result is actually built. -# -# If the arglist would be destroyed BEFORE the result has been built, -# the c_char_p("123") object would already have a zero refcount, -# and the pointer passed to (and returned by) the function would -# probably point to deallocated space. -# -# In this case, there would have to be an additional reference to the argument... - -import _ctypes_test -testdll = CDLL(_ctypes_test.__file__) - -# Return machine address `a` as a (possibly long) non-negative integer. -# Starting with Python 2.5, id(anything) is always non-negative, and -# the ctypes addressof() inherits that via PyLong_FromVoidPtr(). -def positive_address(a): - if a >= 0: - return a - # View the bits in `a` as unsigned instead. - import struct - num_bits = struct.calcsize("P") * 8 # num bits in native machine address - a += 1L << num_bits - assert a >= 0 - return a - -def c_wbuffer(init): - n = len(init) + 1 - return (c_wchar * n)(*init) - -class CharPointersTestCase(unittest.TestCase): - - def setUp(self): - func = testdll._testfunc_p_p - func.restype = c_long - func.argtypes = None - - def test_int_pointer_arg(self): - func = testdll._testfunc_p_p - func.restype = c_long - self.failUnlessEqual(0, func(0)) - - ci = c_int(0) - - func.argtypes = POINTER(c_int), - self.failUnlessEqual(positive_address(addressof(ci)), - positive_address(func(byref(ci)))) - - func.argtypes = c_char_p, - self.assertRaises(ArgumentError, func, byref(ci)) - - func.argtypes = POINTER(c_short), - self.assertRaises(ArgumentError, func, byref(ci)) - - func.argtypes = POINTER(c_double), - self.assertRaises(ArgumentError, func, byref(ci)) - - def test_POINTER_c_char_arg(self): - func = testdll._testfunc_p_p - func.restype = c_char_p - func.argtypes = POINTER(c_char), - - self.failUnlessEqual(None, func(None)) - self.failUnlessEqual("123", func("123")) - self.failUnlessEqual(None, func(c_char_p(None))) - self.failUnlessEqual("123", func(c_char_p("123"))) - - self.failUnlessEqual("123", func(c_buffer("123"))) - ca = c_char("a") - self.failUnlessEqual("a", func(pointer(ca))[0]) - self.failUnlessEqual("a", func(byref(ca))[0]) - - def test_c_char_p_arg(self): - func = testdll._testfunc_p_p - func.restype = c_char_p - func.argtypes = c_char_p, - - self.failUnlessEqual(None, func(None)) - self.failUnlessEqual("123", func("123")) - self.failUnlessEqual(None, func(c_char_p(None))) - self.failUnlessEqual("123", func(c_char_p("123"))) - - self.failUnlessEqual("123", func(c_buffer("123"))) - ca = c_char("a") - self.failUnlessEqual("a", func(pointer(ca))[0]) - self.failUnlessEqual("a", func(byref(ca))[0]) - - def test_c_void_p_arg(self): - func = testdll._testfunc_p_p - func.restype = c_char_p - func.argtypes = c_void_p, - - self.failUnlessEqual(None, func(None)) - self.failUnlessEqual("123", func("123")) - self.failUnlessEqual("123", func(c_char_p("123"))) - self.failUnlessEqual(None, func(c_char_p(None))) - - self.failUnlessEqual("123", func(c_buffer("123"))) - ca = c_char("a") - self.failUnlessEqual("a", func(pointer(ca))[0]) - self.failUnlessEqual("a", func(byref(ca))[0]) - - func(byref(c_int())) - func(pointer(c_int())) - func((c_int * 3)()) - - try: - func.restype = c_wchar_p - except NameError: - pass - else: - self.failUnlessEqual(None, func(c_wchar_p(None))) - self.failUnlessEqual(u"123", func(c_wchar_p(u"123"))) - - def test_instance(self): - func = testdll._testfunc_p_p - func.restype = c_void_p - - class X: - _as_parameter_ = None - - func.argtypes = c_void_p, - self.failUnlessEqual(None, func(X())) - - func.argtypes = None - self.failUnlessEqual(None, func(X())) - -try: - c_wchar -except NameError: - pass -else: - class WCharPointersTestCase(unittest.TestCase): - - def setUp(self): - func = testdll._testfunc_p_p - func.restype = c_int - func.argtypes = None - - - def test_POINTER_c_wchar_arg(self): - func = testdll._testfunc_p_p - func.restype = c_wchar_p - func.argtypes = POINTER(c_wchar), - - self.failUnlessEqual(None, func(None)) - self.failUnlessEqual(u"123", func(u"123")) - self.failUnlessEqual(None, func(c_wchar_p(None))) - self.failUnlessEqual(u"123", func(c_wchar_p(u"123"))) - - self.failUnlessEqual(u"123", func(c_wbuffer(u"123"))) - ca = c_wchar("a") - self.failUnlessEqual(u"a", func(pointer(ca))[0]) - self.failUnlessEqual(u"a", func(byref(ca))[0]) - - def test_c_wchar_p_arg(self): - func = testdll._testfunc_p_p - func.restype = c_wchar_p - func.argtypes = c_wchar_p, - - c_wchar_p.from_param(u"123") - - self.failUnlessEqual(None, func(None)) - self.failUnlessEqual("123", func(u"123")) - self.failUnlessEqual(None, func(c_wchar_p(None))) - self.failUnlessEqual("123", func(c_wchar_p("123"))) - - # XXX Currently, these raise TypeErrors, although they shouldn't: - self.failUnlessEqual("123", func(c_wbuffer("123"))) - ca = c_wchar("a") - self.failUnlessEqual("a", func(pointer(ca))[0]) - self.failUnlessEqual("a", func(byref(ca))[0]) - -class ArrayTest(unittest.TestCase): - def test(self): - func = testdll._testfunc_ai8 - func.restype = POINTER(c_int) - func.argtypes = c_int * 8, - - func((c_int * 8)(1, 2, 3, 4, 5, 6, 7, 8)) - - # This did crash before: - - def func(): pass - CFUNCTYPE(None, c_int * 3)(func) - -################################################################ - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_python_api.py b/sys/lib/python/ctypes/test/test_python_api.py deleted file mode 100644 index 9d134740f..000000000 --- a/sys/lib/python/ctypes/test/test_python_api.py +++ /dev/null @@ -1,87 +0,0 @@ -from ctypes import * -import unittest, sys -from ctypes.test import is_resource_enabled - -################################################################ -# This section should be moved into ctypes\__init__.py, when it's ready. - -from _ctypes import PyObj_FromPtr - -################################################################ - -from sys import getrefcount as grc - - -class PythonAPITestCase(unittest.TestCase): - - def test_PyString_FromStringAndSize(self): - PyString_FromStringAndSize = pythonapi.PyString_FromStringAndSize - - PyString_FromStringAndSize.restype = py_object - PyString_FromStringAndSize.argtypes = c_char_p, c_int - - self.failUnlessEqual(PyString_FromStringAndSize("abcdefghi", 3), "abc") - - def test_PyString_FromString(self): - pythonapi.PyString_FromString.restype = py_object - pythonapi.PyString_FromString.argtypes = (c_char_p,) - - s = "abc" - refcnt = grc(s) - pyob = pythonapi.PyString_FromString(s) - self.failUnlessEqual(grc(s), refcnt) - self.failUnlessEqual(s, pyob) - del pyob - self.failUnlessEqual(grc(s), refcnt) - - if is_resource_enabled("refcount"): - # This test is unreliable, because it is possible that code in - # unittest changes the refcount of the '42' integer. So, it - # is disabled by default. - def test_PyInt_Long(self): - ref42 = grc(42) - pythonapi.PyInt_FromLong.restype = py_object - self.failUnlessEqual(pythonapi.PyInt_FromLong(42), 42) - - self.failUnlessEqual(grc(42), ref42) - - pythonapi.PyInt_AsLong.argtypes = (py_object,) - pythonapi.PyInt_AsLong.restype = c_long - - res = pythonapi.PyInt_AsLong(42) - self.failUnlessEqual(grc(res), ref42 + 1) - del res - self.failUnlessEqual(grc(42), ref42) - - def test_PyObj_FromPtr(self): - s = "abc def ghi jkl" - ref = grc(s) - # id(python-object) is the address - pyobj = PyObj_FromPtr(id(s)) - self.failUnless(s is pyobj) - - self.failUnlessEqual(grc(s), ref + 1) - del pyobj - self.failUnlessEqual(grc(s), ref) - - def test_PyOS_snprintf(self): - PyOS_snprintf = pythonapi.PyOS_snprintf - PyOS_snprintf.argtypes = POINTER(c_char), c_int, c_char_p - - buf = c_buffer(256) - PyOS_snprintf(buf, sizeof(buf), "Hello from %s", "ctypes") - self.failUnlessEqual(buf.value, "Hello from ctypes") - - PyOS_snprintf(buf, sizeof(buf), "Hello from %s", "ctypes", 1, 2, 3) - self.failUnlessEqual(buf.value, "Hello from ctypes") - - # not enough arguments - self.failUnlessRaises(TypeError, PyOS_snprintf, buf) - - def test_pyobject_repr(self): - self.failUnlessEqual(repr(py_object()), "py_object()") - self.failUnlessEqual(repr(py_object(42)), "py_object(42)") - self.failUnlessEqual(repr(py_object(object)), "py_object(%r)" % object) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_random_things.py b/sys/lib/python/ctypes/test/test_random_things.py deleted file mode 100644 index 78a665bc5..000000000 --- a/sys/lib/python/ctypes/test/test_random_things.py +++ /dev/null @@ -1,71 +0,0 @@ -from ctypes import * -import unittest, sys - -def callback_func(arg): - 42 / arg - raise ValueError, arg - -if sys.platform == "win32": - - class call_function_TestCase(unittest.TestCase): - # _ctypes.call_function is deprecated and private, but used by - # Gary Bishp's readline module. If we have it, we must test it as well. - - def test(self): - from _ctypes import call_function - hdll = windll.kernel32.LoadLibraryA("kernel32") - funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA") - - self.failUnlessEqual(call_function(funcaddr, (None,)), - windll.kernel32.GetModuleHandleA(None)) - -class CallbackTracbackTestCase(unittest.TestCase): - # When an exception is raised in a ctypes callback function, the C - # code prints a traceback. - # - # This test makes sure the exception types *and* the exception - # value is printed correctly. - # - # Changed in 0.9.3: No longer is '(in callback)' prepended to the - # error message - instead a additional frame for the C code is - # created, then a full traceback printed. When SystemExit is - # raised in a callback function, the interpreter exits. - - def capture_stderr(self, func, *args, **kw): - # helper - call function 'func', and return the captured stderr - import StringIO - old_stderr = sys.stderr - logger = sys.stderr = StringIO.StringIO() - try: - func(*args, **kw) - finally: - sys.stderr = old_stderr - return logger.getvalue() - - def test_ValueError(self): - cb = CFUNCTYPE(c_int, c_int)(callback_func) - out = self.capture_stderr(cb, 42) - self.failUnlessEqual(out.splitlines()[-1], - "ValueError: 42") - - def test_IntegerDivisionError(self): - cb = CFUNCTYPE(c_int, c_int)(callback_func) - out = self.capture_stderr(cb, 0) - self.failUnlessEqual(out.splitlines()[-1][:19], - "ZeroDivisionError: ") - - def test_FloatDivisionError(self): - cb = CFUNCTYPE(c_int, c_double)(callback_func) - out = self.capture_stderr(cb, 0.0) - self.failUnlessEqual(out.splitlines()[-1][:19], - "ZeroDivisionError: ") - - def test_TypeErrorDivisionError(self): - cb = CFUNCTYPE(c_int, c_char_p)(callback_func) - out = self.capture_stderr(cb, "spam") - self.failUnlessEqual(out.splitlines()[-1], - "TypeError: " - "unsupported operand type(s) for /: 'int' and 'str'") - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_refcounts.py b/sys/lib/python/ctypes/test/test_refcounts.py deleted file mode 100644 index 448f292cd..000000000 --- a/sys/lib/python/ctypes/test/test_refcounts.py +++ /dev/null @@ -1,98 +0,0 @@ -import unittest -import ctypes -import gc - -MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int) -OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) - -import _ctypes_test -dll = ctypes.CDLL(_ctypes_test.__file__) - -class RefcountTestCase(unittest.TestCase): - - def test_1(self): - from sys import getrefcount as grc - - f = dll._testfunc_callback_i_if - f.restype = ctypes.c_int - f.argtypes = [ctypes.c_int, MyCallback] - - def callback(value): - #print "called back with", value - return value - - self.failUnlessEqual(grc(callback), 2) - cb = MyCallback(callback) - - self.failUnless(grc(callback) > 2) - result = f(-10, cb) - self.failUnlessEqual(result, -18) - cb = None - - gc.collect() - - self.failUnlessEqual(grc(callback), 2) - - - def test_refcount(self): - from sys import getrefcount as grc - def func(*args): - pass - # this is the standard refcount for func - self.failUnlessEqual(grc(func), 2) - - # the CFuncPtr instance holds atr least one refcount on func: - f = OtherCallback(func) - self.failUnless(grc(func) > 2) - - # and may release it again - del f - self.failUnless(grc(func) >= 2) - - # but now it must be gone - gc.collect() - self.failUnless(grc(func) == 2) - - class X(ctypes.Structure): - _fields_ = [("a", OtherCallback)] - x = X() - x.a = OtherCallback(func) - - # the CFuncPtr instance holds atr least one refcount on func: - self.failUnless(grc(func) > 2) - - # and may release it again - del x - self.failUnless(grc(func) >= 2) - - # and now it must be gone again - gc.collect() - self.failUnlessEqual(grc(func), 2) - - f = OtherCallback(func) - - # the CFuncPtr instance holds atr least one refcount on func: - self.failUnless(grc(func) > 2) - - # create a cycle - f.cycle = f - - del f - gc.collect() - self.failUnlessEqual(grc(func), 2) - -class AnotherLeak(unittest.TestCase): - def test_callback(self): - import sys - - proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int) - def func(a, b): - return a * b * 2 - f = proto(func) - - a = sys.getrefcount(ctypes.c_int) - f(1, 2) - self.failUnlessEqual(sys.getrefcount(ctypes.c_int), a) - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_repr.py b/sys/lib/python/ctypes/test/test_repr.py deleted file mode 100644 index 1044f6713..000000000 --- a/sys/lib/python/ctypes/test/test_repr.py +++ /dev/null @@ -1,29 +0,0 @@ -from ctypes import * -import unittest - -subclasses = [] -for base in [c_byte, c_short, c_int, c_long, c_longlong, - c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong, - c_float, c_double]: - class X(base): - pass - subclasses.append(X) - -class X(c_char): - pass - -# This test checks if the __repr__ is correct for subclasses of simple types - -class ReprTest(unittest.TestCase): - def test_numbers(self): - for typ in subclasses: - base = typ.__bases__[0] - self.failUnless(repr(base(42)).startswith(base.__name__)) - self.failUnlessEqual(": " - "expected string or Unicode object, int found") - else: - self.failUnlessEqual(msg, - "(Phone) exceptions.TypeError: " - "expected string or Unicode object, int found") - - cls, msg = self.get_except(Person, "Someone", ("a", "b", "c")) - self.failUnlessEqual(cls, RuntimeError) - if issubclass(Exception, object): - self.failUnlessEqual(msg, - "(Phone) : too many initializers") - else: - self.failUnlessEqual(msg, "(Phone) exceptions.ValueError: too many initializers") - - - def get_except(self, func, *args): - try: - func(*args) - except Exception, detail: - return detail.__class__, str(detail) - - -## def test_subclass_creation(self): -## meta = type(Structure) -## # same as 'class X(Structure): pass' -## # fails, since we need either a _fields_ or a _abstract_ attribute -## cls, msg = self.get_except(meta, "X", (Structure,), {}) -## self.failUnlessEqual((cls, msg), -## (AttributeError, "class must define a '_fields_' attribute")) - - def test_abstract_class(self): - class X(Structure): - _abstract_ = "something" - # try 'X()' - cls, msg = self.get_except(eval, "X()", locals()) - self.failUnlessEqual((cls, msg), (TypeError, "abstract class")) - - def test_methods(self): -## class X(Structure): -## _fields_ = [] - - self.failUnless("in_dll" in dir(type(Structure))) - self.failUnless("from_address" in dir(type(Structure))) - self.failUnless("in_dll" in dir(type(Structure))) - -class PointerMemberTestCase(unittest.TestCase): - - def test(self): - # a Structure with a POINTER field - class S(Structure): - _fields_ = [("array", POINTER(c_int))] - - s = S() - # We can assign arrays of the correct type - s.array = (c_int * 3)(1, 2, 3) - items = [s.array[i] for i in range(3)] - self.failUnlessEqual(items, [1, 2, 3]) - - # The following are bugs, but are included here because the unittests - # also describe the current behaviour. - # - # This fails with SystemError: bad arg to internal function - # or with IndexError (with a patch I have) - - s.array[0] = 42 - - items = [s.array[i] for i in range(3)] - self.failUnlessEqual(items, [42, 2, 3]) - - s.array[0] = 1 - -## s.array[1] = 42 - - items = [s.array[i] for i in range(3)] - self.failUnlessEqual(items, [1, 2, 3]) - - def test_none_to_pointer_fields(self): - class S(Structure): - _fields_ = [("x", c_int), - ("p", POINTER(c_int))] - - s = S() - s.x = 12345678 - s.p = None - self.failUnlessEqual(s.x, 12345678) - -class TestRecursiveStructure(unittest.TestCase): - def test_contains_itself(self): - class Recursive(Structure): - pass - - try: - Recursive._fields_ = [("next", Recursive)] - except AttributeError, details: - self.failUnless("Structure or union cannot contain itself" in - str(details)) - else: - self.fail("Structure or union cannot contain itself") - - - def test_vice_versa(self): - class First(Structure): - pass - class Second(Structure): - pass - - First._fields_ = [("second", Second)] - - try: - Second._fields_ = [("first", First)] - except AttributeError, details: - self.failUnless("_fields_ is final" in - str(details)) - else: - self.fail("AttributeError not raised") - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_unaligned_structures.py b/sys/lib/python/ctypes/test/test_unaligned_structures.py deleted file mode 100644 index 89343ba48..000000000 --- a/sys/lib/python/ctypes/test/test_unaligned_structures.py +++ /dev/null @@ -1,45 +0,0 @@ -import sys, unittest -from ctypes import * - -structures = [] -byteswapped_structures = [] - - -if sys.byteorder == "little": - SwappedStructure = BigEndianStructure -else: - SwappedStructure = LittleEndianStructure - -for typ in [c_short, c_int, c_long, c_longlong, - c_float, c_double, - c_ushort, c_uint, c_ulong, c_ulonglong]: - class X(Structure): - _pack_ = 1 - _fields_ = [("pad", c_byte), - ("value", typ)] - class Y(SwappedStructure): - _pack_ = 1 - _fields_ = [("pad", c_byte), - ("value", typ)] - structures.append(X) - byteswapped_structures.append(Y) - -class TestStructures(unittest.TestCase): - def test_native(self): - for typ in structures: -## print typ.value - self.failUnlessEqual(typ.value.offset, 1) - o = typ() - o.value = 4 - self.failUnlessEqual(o.value, 4) - - def test_swapped(self): - for typ in byteswapped_structures: -## print >> sys.stderr, typ.value - self.failUnlessEqual(typ.value.offset, 1) - o = typ() - o.value = 4 - self.failUnlessEqual(o.value, 4) - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_unicode.py b/sys/lib/python/ctypes/test/test_unicode.py deleted file mode 100644 index 78c5cf87c..000000000 --- a/sys/lib/python/ctypes/test/test_unicode.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: latin-1 -import unittest -import ctypes - -try: - ctypes.c_wchar -except AttributeError: - pass -else: - import _ctypes_test - dll = ctypes.CDLL(_ctypes_test.__file__) - wcslen = dll.my_wcslen - wcslen.argtypes = [ctypes.c_wchar_p] - - - class UnicodeTestCase(unittest.TestCase): - def setUp(self): - self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict") - - def tearDown(self): - ctypes.set_conversion_mode(*self.prev_conv_mode) - - def test_ascii_strict(self): - ctypes.set_conversion_mode("ascii", "strict") - # no conversions take place with unicode arguments - self.failUnlessEqual(wcslen(u"abc"), 3) - self.failUnlessEqual(wcslen(u"ab\u2070"), 3) - # string args are converted - self.failUnlessEqual(wcslen("abc"), 3) - self.failUnlessRaises(ctypes.ArgumentError, wcslen, "abä") - - def test_ascii_replace(self): - ctypes.set_conversion_mode("ascii", "replace") - self.failUnlessEqual(wcslen(u"abc"), 3) - self.failUnlessEqual(wcslen(u"ab\u2070"), 3) - self.failUnlessEqual(wcslen("abc"), 3) - self.failUnlessEqual(wcslen("abä"), 3) - - def test_ascii_ignore(self): - ctypes.set_conversion_mode("ascii", "ignore") - self.failUnlessEqual(wcslen(u"abc"), 3) - self.failUnlessEqual(wcslen(u"ab\u2070"), 3) - # ignore error mode skips non-ascii characters - self.failUnlessEqual(wcslen("abc"), 3) - self.failUnlessEqual(wcslen("äöüß"), 0) - - def test_latin1_strict(self): - ctypes.set_conversion_mode("latin-1", "strict") - self.failUnlessEqual(wcslen(u"abc"), 3) - self.failUnlessEqual(wcslen(u"ab\u2070"), 3) - self.failUnlessEqual(wcslen("abc"), 3) - self.failUnlessEqual(wcslen("äöüß"), 4) - - def test_buffers(self): - ctypes.set_conversion_mode("ascii", "strict") - buf = ctypes.create_unicode_buffer("abc") - self.failUnlessEqual(len(buf), 3+1) - - ctypes.set_conversion_mode("ascii", "replace") - buf = ctypes.create_unicode_buffer("abäöü") - self.failUnlessEqual(buf[:], u"ab\uFFFD\uFFFD\uFFFD\0") - - ctypes.set_conversion_mode("ascii", "ignore") - buf = ctypes.create_unicode_buffer("abäöü") - # is that correct? not sure. But with 'ignore', you get what you pay for.. - self.failUnlessEqual(buf[:], u"ab\0\0\0\0") - - import _ctypes_test - func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p - - class StringTestCase(UnicodeTestCase): - def setUp(self): - self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict") - func.argtypes = [ctypes.c_char_p] - func.restype = ctypes.c_char_p - - def tearDown(self): - ctypes.set_conversion_mode(*self.prev_conv_mode) - func.argtypes = None - func.restype = ctypes.c_int - - def test_ascii_replace(self): - ctypes.set_conversion_mode("ascii", "strict") - self.failUnlessEqual(func("abc"), "abc") - self.failUnlessEqual(func(u"abc"), "abc") - self.assertRaises(ctypes.ArgumentError, func, u"abä") - - def test_ascii_ignore(self): - ctypes.set_conversion_mode("ascii", "ignore") - self.failUnlessEqual(func("abc"), "abc") - self.failUnlessEqual(func(u"abc"), "abc") - self.failUnlessEqual(func(u"äöüß"), "") - - def test_ascii_replace(self): - ctypes.set_conversion_mode("ascii", "replace") - self.failUnlessEqual(func("abc"), "abc") - self.failUnlessEqual(func(u"abc"), "abc") - self.failUnlessEqual(func(u"äöüß"), "????") - - def test_buffers(self): - ctypes.set_conversion_mode("ascii", "strict") - buf = ctypes.create_string_buffer(u"abc") - self.failUnlessEqual(len(buf), 3+1) - - ctypes.set_conversion_mode("ascii", "replace") - buf = ctypes.create_string_buffer(u"abäöü") - self.failUnlessEqual(buf[:], "ab???\0") - - ctypes.set_conversion_mode("ascii", "ignore") - buf = ctypes.create_string_buffer(u"abäöü") - # is that correct? not sure. But with 'ignore', you get what you pay for.. - self.failUnlessEqual(buf[:], "ab\0\0\0\0") - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_values.py b/sys/lib/python/ctypes/test/test_values.py deleted file mode 100644 index 7ba3e21ef..000000000 --- a/sys/lib/python/ctypes/test/test_values.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -A testcase which accesses *values* in a dll. -""" - -import unittest -from ctypes import * - -import _ctypes_test - -class ValuesTestCase(unittest.TestCase): - - def test_an_integer(self): - ctdll = CDLL(_ctypes_test.__file__) - an_integer = c_int.in_dll(ctdll, "an_integer") - x = an_integer.value - self.failUnlessEqual(x, ctdll.get_an_integer()) - an_integer.value *= 2 - self.failUnlessEqual(x*2, ctdll.get_an_integer()) - - def test_undefined(self): - ctdll = CDLL(_ctypes_test.__file__) - self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol") - - class Win_ValuesTestCase(unittest.TestCase): - """This test only works when python itself is a dll/shared library""" - - def test_optimizeflag(self): - # This test accesses the Py_OptimizeFlag intger, which is - # exported by the Python dll. - - # It's value is set depending on the -O and -OO flags: - # if not given, it is 0 and __debug__ is 1. - # If -O is given, the flag is 1, for -OO it is 2. - # docstrings are also removed in the latter case. - opt = c_int.in_dll(pydll, "Py_OptimizeFlag").value - if __debug__: - self.failUnlessEqual(opt, 0) - elif ValuesTestCase.__doc__ is not None: - self.failUnlessEqual(opt, 1) - else: - self.failUnlessEqual(opt, 2) - - def test_frozentable(self): - # Python exports a PyImport_FrozenModules symbol. This is a - # pointer to an array of struct _frozen entries. The end of the - # array is marked by an entry containing a NULL name and zero - # size. - - # In standard Python, this table contains a __hello__ - # module, and a __phello__ package containing a spam - # module. - class struct_frozen(Structure): - _fields_ = [("name", c_char_p), - ("code", POINTER(c_ubyte)), - ("size", c_int)] - FrozenTable = POINTER(struct_frozen) - - ft = FrozenTable.in_dll(pydll, "PyImport_FrozenModules") - # ft is a pointer to the struct_frozen entries: - items = [] - for entry in ft: - # This is dangerous. We *can* iterate over a pointer, but - # the loop will not terminate (maybe with an access - # violation;-) because the pointer instance has no size. - if entry.name is None: - break - items.append((entry.name, entry.size)) - import sys - if sys.version_info[:2] >= (2, 3): - expected = [("__hello__", 104), ("__phello__", -104), ("__phello__.spam", 104)] - else: - expected = [("__hello__", 100), ("__phello__", -100), ("__phello__.spam", 100)] - self.failUnlessEqual(items, expected) - - from ctypes import _pointer_type_cache - del _pointer_type_cache[struct_frozen] - - def test_undefined(self): - self.assertRaises(ValueError, c_int.in_dll, pydll, "Undefined_Symbol") - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_varsize_struct.py b/sys/lib/python/ctypes/test/test_varsize_struct.py deleted file mode 100644 index 06d232315..000000000 --- a/sys/lib/python/ctypes/test/test_varsize_struct.py +++ /dev/null @@ -1,50 +0,0 @@ -from ctypes import * -import unittest - -class VarSizeTest(unittest.TestCase): - def test_resize(self): - class X(Structure): - _fields_ = [("item", c_int), - ("array", c_int * 1)] - - self.failUnlessEqual(sizeof(X), sizeof(c_int) * 2) - x = X() - x.item = 42 - x.array[0] = 100 - self.failUnlessEqual(sizeof(x), sizeof(c_int) * 2) - - # make room for one additional item - new_size = sizeof(X) + sizeof(c_int) * 1 - resize(x, new_size) - self.failUnlessEqual(sizeof(x), new_size) - self.failUnlessEqual((x.item, x.array[0]), (42, 100)) - - # make room for 10 additional items - new_size = sizeof(X) + sizeof(c_int) * 9 - resize(x, new_size) - self.failUnlessEqual(sizeof(x), new_size) - self.failUnlessEqual((x.item, x.array[0]), (42, 100)) - - # make room for one additional item - new_size = sizeof(X) + sizeof(c_int) * 1 - resize(x, new_size) - self.failUnlessEqual(sizeof(x), new_size) - self.failUnlessEqual((x.item, x.array[0]), (42, 100)) - - def test_array_invalid_length(self): - # cannot create arrays with non-positive size - self.failUnlessRaises(ValueError, lambda: c_int * -1) - self.failUnlessRaises(ValueError, lambda: c_int * -3) - - def test_zerosized_array(self): - array = (c_int * 0)() - # accessing elements of zero-sized arrays raise IndexError - self.failUnlessRaises(IndexError, array.__setitem__, 0, None) - self.failUnlessRaises(IndexError, array.__getitem__, 0) - self.failUnlessRaises(IndexError, array.__setitem__, 1, None) - self.failUnlessRaises(IndexError, array.__getitem__, 1) - self.failUnlessRaises(IndexError, array.__setitem__, -1, None) - self.failUnlessRaises(IndexError, array.__getitem__, -1) - -if __name__ == "__main__": - unittest.main() diff --git a/sys/lib/python/ctypes/test/test_win32.py b/sys/lib/python/ctypes/test/test_win32.py deleted file mode 100644 index db530d3af..000000000 --- a/sys/lib/python/ctypes/test/test_win32.py +++ /dev/null @@ -1,60 +0,0 @@ -# Windows specific tests - -from ctypes import * -from ctypes.test import is_resource_enabled -import unittest, sys - -import _ctypes_test - -if sys.platform == "win32": - - class WindowsTestCase(unittest.TestCase): - def test_callconv_1(self): - # Testing stdcall function - - IsWindow = windll.user32.IsWindow - # ValueError: Procedure probably called with not enough arguments (4 bytes missing) - self.assertRaises(ValueError, IsWindow) - - # This one should succeeed... - self.failUnlessEqual(0, IsWindow(0)) - - # ValueError: Procedure probably called with too many arguments (8 bytes in excess) - self.assertRaises(ValueError, IsWindow, 0, 0, 0) - - def test_callconv_2(self): - # Calling stdcall function as cdecl - - IsWindow = cdll.user32.IsWindow - - # ValueError: Procedure called with not enough arguments (4 bytes missing) - # or wrong calling convention - self.assertRaises(ValueError, IsWindow, None) - - if is_resource_enabled("SEH"): - def test_SEH(self): - # Call functions with invalid arguments, and make sure that access violations - # are trapped and raise an exception. - self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32) - -class Structures(unittest.TestCase): - - def test_struct_by_value(self): - class POINT(Structure): - _fields_ = [("x", c_long), - ("y", c_long)] - - class RECT(Structure): - _fields_ = [("left", c_long), - ("top", c_long), - ("right", c_long), - ("bottom", c_long)] - - dll = CDLL(_ctypes_test.__file__) - - pt = POINT(10, 10) - rect = RECT(0, 0, 20, 20) - self.failUnlessEqual(1, dll.PointInRect(byref(rect), pt)) - -if __name__ == '__main__': - unittest.main() diff --git a/sys/lib/python/email/test/__init__.py b/sys/lib/python/email/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sys/lib/python/email/test/data/PyBanner048.gif b/sys/lib/python/email/test/data/PyBanner048.gif deleted file mode 100644 index 1a5c87f64..000000000 Binary files a/sys/lib/python/email/test/data/PyBanner048.gif and /dev/null differ diff --git a/sys/lib/python/email/test/data/audiotest.au b/sys/lib/python/email/test/data/audiotest.au deleted file mode 100644 index 1ad28ce1f..000000000 Binary files a/sys/lib/python/email/test/data/audiotest.au and /dev/null differ diff --git a/sys/lib/python/email/test/data/msg_01.txt b/sys/lib/python/email/test/data/msg_01.txt deleted file mode 100644 index 7e33bcf96..000000000 --- a/sys/lib/python/email/test/data/msg_01.txt +++ /dev/null @@ -1,19 +0,0 @@ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) - id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 - - -Hi, - -Do you like this message? - --Me diff --git a/sys/lib/python/email/test/data/msg_02.txt b/sys/lib/python/email/test/data/msg_02.txt deleted file mode 100644 index 43f248038..000000000 --- a/sys/lib/python/email/test/data/msg_02.txt +++ /dev/null @@ -1,135 +0,0 @@ -MIME-version: 1.0 -From: ppp-request@zzz.org -Sender: ppp-admin@zzz.org -To: ppp@zzz.org -Subject: Ppp digest, Vol 1 #2 - 5 msgs -Date: Fri, 20 Apr 2001 20:18:00 -0400 (EDT) -X-Mailer: Mailman v2.0.4 -X-Mailman-Version: 2.0.4 -Content-Type: multipart/mixed; boundary="192.168.1.2.889.32614.987812255.500.21814" - ---192.168.1.2.889.32614.987812255.500.21814 -Content-type: text/plain; charset=us-ascii -Content-description: Masthead (Ppp digest, Vol 1 #2) - -Send Ppp mailing list submissions to - ppp@zzz.org - -To subscribe or unsubscribe via the World Wide Web, visit - http://www.zzz.org/mailman/listinfo/ppp -or, via email, send a message with subject or body 'help' to - ppp-request@zzz.org - -You can reach the person managing the list at - ppp-admin@zzz.org - -When replying, please edit your Subject line so it is more specific -than "Re: Contents of Ppp digest..." - - ---192.168.1.2.889.32614.987812255.500.21814 -Content-type: text/plain; charset=us-ascii -Content-description: Today's Topics (5 msgs) - -Today's Topics: - - 1. testing #1 (Barry A. Warsaw) - 2. testing #2 (Barry A. Warsaw) - 3. testing #3 (Barry A. Warsaw) - 4. testing #4 (Barry A. Warsaw) - 5. testing #5 (Barry A. Warsaw) - ---192.168.1.2.889.32614.987812255.500.21814 -Content-Type: multipart/digest; boundary="__--__--" - ---__--__-- - -Message: 1 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Date: Fri, 20 Apr 2001 20:16:13 -0400 -To: ppp@zzz.org -From: barry@digicool.com (Barry A. Warsaw) -Subject: [Ppp] testing #1 -Precedence: bulk - - -hello - - ---__--__-- - -Message: 2 -Date: Fri, 20 Apr 2001 20:16:21 -0400 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -To: ppp@zzz.org -From: barry@digicool.com (Barry A. Warsaw) -Precedence: bulk - - -hello - - ---__--__-- - -Message: 3 -Date: Fri, 20 Apr 2001 20:16:25 -0400 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -To: ppp@zzz.org -From: barry@digicool.com (Barry A. Warsaw) -Subject: [Ppp] testing #3 -Precedence: bulk - - -hello - - ---__--__-- - -Message: 4 -Date: Fri, 20 Apr 2001 20:16:28 -0400 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -To: ppp@zzz.org -From: barry@digicool.com (Barry A. Warsaw) -Subject: [Ppp] testing #4 -Precedence: bulk - - -hello - - ---__--__-- - -Message: 5 -Date: Fri, 20 Apr 2001 20:16:32 -0400 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -To: ppp@zzz.org -From: barry@digicool.com (Barry A. Warsaw) -Subject: [Ppp] testing #5 -Precedence: bulk - - -hello - - - - ---__--__---- ---192.168.1.2.889.32614.987812255.500.21814 -Content-type: text/plain; charset=us-ascii -Content-description: Digest Footer - -_______________________________________________ -Ppp mailing list -Ppp@zzz.org -http://www.zzz.org/mailman/listinfo/ppp - - ---192.168.1.2.889.32614.987812255.500.21814-- - -End of Ppp Digest - diff --git a/sys/lib/python/email/test/data/msg_03.txt b/sys/lib/python/email/test/data/msg_03.txt deleted file mode 100644 index c748ebf11..000000000 --- a/sys/lib/python/email/test/data/msg_03.txt +++ /dev/null @@ -1,16 +0,0 @@ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) - id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 - - -Hi, - -Do you like this message? - --Me diff --git a/sys/lib/python/email/test/data/msg_04.txt b/sys/lib/python/email/test/data/msg_04.txt deleted file mode 100644 index 1f633c449..000000000 --- a/sys/lib/python/email/test/data/msg_04.txt +++ /dev/null @@ -1,37 +0,0 @@ -Return-Path: -Delivered-To: barry@python.org -Received: by mail.python.org (Postfix, from userid 889) - id C2BF0D37C6; Tue, 11 Sep 2001 00:05:05 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="h90VIIIKmx" -Content-Transfer-Encoding: 7bit -Message-ID: <15261.36209.358846.118674@anthem.python.org> -From: barry@python.org (Barry A. Warsaw) -To: barry@python.org -Subject: a simple multipart -Date: Tue, 11 Sep 2001 00:05:05 -0400 -X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid -X-Attribution: BAW -X-Oblique-Strategy: Make a door into a window - - ---h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; - filename="msg.txt" -Content-Transfer-Encoding: 7bit - -a simple kind of mirror -to reflect upon our own - ---h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; - filename="msg.txt" -Content-Transfer-Encoding: 7bit - -a simple kind of mirror -to reflect upon our own - ---h90VIIIKmx-- - diff --git a/sys/lib/python/email/test/data/msg_05.txt b/sys/lib/python/email/test/data/msg_05.txt deleted file mode 100644 index 87d5e9cbf..000000000 --- a/sys/lib/python/email/test/data/msg_05.txt +++ /dev/null @@ -1,28 +0,0 @@ -From: foo -Subject: bar -To: baz -MIME-Version: 1.0 -Content-Type: multipart/report; report-type=delivery-status; - boundary="D1690A7AC1.996856090/mail.example.com" -Message-Id: <20010803162810.0CA8AA7ACC@mail.example.com> - -This is a MIME-encapsulated message. - ---D1690A7AC1.996856090/mail.example.com -Content-Type: text/plain - -Yadda yadda yadda - ---D1690A7AC1.996856090/mail.example.com - -Yadda yadda yadda - ---D1690A7AC1.996856090/mail.example.com -Content-Type: message/rfc822 - -From: nobody@python.org - -Yadda yadda yadda - ---D1690A7AC1.996856090/mail.example.com-- - diff --git a/sys/lib/python/email/test/data/msg_06.txt b/sys/lib/python/email/test/data/msg_06.txt deleted file mode 100644 index 69f3a47ff..000000000 --- a/sys/lib/python/email/test/data/msg_06.txt +++ /dev/null @@ -1,33 +0,0 @@ -Return-Path: -Delivered-To: barry@python.org -MIME-Version: 1.0 -Content-Type: message/rfc822 -Content-Description: forwarded message -Content-Transfer-Encoding: 7bit -Message-ID: <15265.9482.641338.555352@python.org> -From: barry@zope.com (Barry A. Warsaw) -Sender: barry@python.org -To: barry@python.org -Subject: forwarded message from Barry A. Warsaw -Date: Thu, 13 Sep 2001 17:28:42 -0400 -X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid -X-Attribution: BAW -X-Oblique-Strategy: Be dirty -X-Url: http://barry.wooz.org - -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Return-Path: -Delivered-To: barry@python.org -Message-ID: <15265.9468.713530.98441@python.org> -From: barry@zope.com (Barry A. Warsaw) -Sender: barry@python.org -To: barry@python.org -Subject: testing -Date: Thu, 13 Sep 2001 17:28:28 -0400 -X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid -X-Attribution: BAW -X-Oblique-Strategy: Spectrum analysis -X-Url: http://barry.wooz.org - - diff --git a/sys/lib/python/email/test/data/msg_07.txt b/sys/lib/python/email/test/data/msg_07.txt deleted file mode 100644 index 721f3a0d3..000000000 --- a/sys/lib/python/email/test/data/msg_07.txt +++ /dev/null @@ -1,83 +0,0 @@ -MIME-Version: 1.0 -From: Barry -To: Dingus Lovers -Subject: Here is your dingus fish -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - -Hi there, - -This is the dingus fish. - ---BOUNDARY -Content-Type: image/gif; name="dingusfish.gif" -Content-Transfer-Encoding: base64 -content-disposition: attachment; filename="dingusfish.gif" - -R0lGODdhAAEAAfAAAP///wAAACwAAAAAAAEAAQAC/oSPqcvtD6OctNqLs968+w+G4kiW5omm6sq2 -7gvH8kzX9o3n+s73/g8MCofEovGITGICTKbyCV0FDNOo9SqpQqpOrJfXzTQj2vD3TGtqL+NtGQ2f -qTXmxzuOd7WXdcc9DyjU53ewFni4s0fGhdiYaEhGBelICTNoV1j5NUnFcrmUqemjNifJVWpaOqaI -oFq3SspZsSraE7sHq3jr1MZqWvi662vxV4tD+pvKW6aLDOCLyur8PDwbanyDeq0N3DctbQYeLDvR -RY6t95m6UB0d3mwIrV7e2VGNvjjffukeJp4w7F65KecGFsTHQGAygOrgrWs1jt28Rc88KESYcGLA -/obvTkH6p+CinWJiJmIMqXGQwH/y4qk0SYjgQTczT3ajKZGfuI0uJ4kkVI/DT5s3/ejkxI0aT4Y+ -YTYgWbImUaXk9nlLmnSh1qJiJFl0OpUqRK4oOy7NyRQtHWofhoYVxkwWXKUSn0YsS+fUV6lhqfYb -6ayd3Z5qQdG1B7bvQzaJjwUV2lixMUZ7JVsOlfjWVr/3NB/uFvnySBN6Dcb6rGwaRM3wsormw5cC -M9NxWy/bWdufudCvy8bOAjXjVVwta/uO21sE5RHBCzNFXtgq9ORtH4eYjVP4Yryo026nvkFmCeyA -B29efV6ravCMK5JwWd5897Qrx7ll38o6iHDZ/rXPR//feevhF4l7wjUGX3xq1eeRfM4RSJGBIV1D -z1gKPkfWag3mVBVvva1RlX5bAJTPR/2YqNtw/FkIYYEi/pIZiAdpcxpoHtmnYYoZtvhUftzdx5ZX -JSKDW405zkGcZzzGZ6KEv4FI224oDmijlEf+xp6MJK5ojY/ASeVUR+wsKRuJ+XFZ5o7ZeEime8t1 -ouUsU6YjF5ZtUihhkGfCdFQLWQFJ3UXxmElfhQnR+eCdcDbkFZp6vTRmj56ApCihn5QGpaToNZmR -n3NVSpZcQpZ2KEONusaiCsKAug0wkQbJSFO+PTSjneGxOuFjPlUk3ovWvdIerjUg9ZGIOtGq/qeX -eCYrrCX+1UPsgTKGGRSbzd5q156d/gpfbJxe66eD5iQKrXj7RGgruGxs62qebBHUKS32CKluCiqZ -qh+pmehmEb71noAUoe5e9Zm17S7773V10pjrtG4CmuurCV/n6zLK5turWNhqOvFXbjhZrMD0YhKe -wR0zOyuvsh6MWrGoIuzvyWu5y1WIFAqmJselypxXh6dKLNOKEB98L88bS2rkNqqlKzCNJp9c0G0j -Gzh0iRrCbHSXmPR643QS+4rWhgFmnSbSuXCjS0xAOWkU2UdLqyuUNfHSFdUouy3bm5i5GnDM3tG8 -doJ4r5tqu3pPbRSVfvs8uJzeNXhp3n4j/tZ42SwH7eaWUUOjc3qFV9453UHTXZfcLH+OeNs5g36x -lBnHvTm7EbMbLeuaLncao8vWCXimfo1o+843Ak6y4ChNeGntvAYvfLK4ezmoyNIbNCLTCXO9ZV3A -E8/s88RczPzDwI4Ob7XZyl7+9Miban29h+tJZPrE21wgvBphDfrrfPdCTPKJD/y98L1rZwHcV6Jq -Zab0metpuNIX/qAFPoz171WUaUb4HAhBSzHuHfjzHb3kha/2Cctis/ORArVHNYfFyYRH2pYIRzic -isVOfPWD1b6mRTqpCRBozzof6UZVvFXRxWIr3GGrEviGYgyPMfahheiSaLs/9QeFu7oZ/ndSY8DD -ya9x+uPed+7mxN2IzIISBOMLFYWVqC3Pew1T2nFuuCiwZS5/v6II10i4t1OJcUH2U9zxKodHsGGv -Oa+zkvNUYUOa/TCCRutF9MzDwdlUMJADTCGSbDQ5OV4PTamDoPEi6Ecc/RF5RWwkcdSXvSOaDWSn -I9LlvubFTQpuc6JKXLcKeb+xdbKRBnwREemXyjg6ME65aJiOuBgrktzykfPLJBKR9ClMavJ62/Ff -BlNIyod9yX9wcSXexnXFpvkrbXk64xsx5Db7wXKP5fSgsvwIMM/9631VLBfkmtbHRXpqmtei52hG -pUwSlo+BASQoeILDOBgREECxBBh5/iYmNsQ9dIv5+OI++QkqdsJPc3uykz5fkM+OraeekcQF7X4n -B5S67za5U967PmooGQhUXfF7afXyCD7ONdRe17QogYjVx38uLwtrS6nhTnm15LQUnu9E2uK6CNI/ -1HOABj0ESwOjut4FEpFQpdNAm4K2LHnDWHNcmKB2ioKBogysVZtMO2nSxUdZ8Yk2kJc7URioLVI0 -YgmtIwZj4LoeKemgnOnbUdGnzZ4Oa6scqiolBGqS6RgWNLu0RMhcaE6rhhU4hiuqFXPAG8fGwTPW -FKeLMtdVmXLSs5YJGF/YeVm7rREMlY3UYE+yCxbaMXX8y15m5zVHq6GOKDMynzII/jdUHdyVqIy0 -ifX2+r/EgtZcvRzSb72gU9ui87M2VecjKildW/aFqaYhKoryUjfB/g4qtyVuc60xFDGmCxwjW+qu -zjuwl2GkOWn66+3QiiEctvd04OVvcCVzjgT7lrkvjVGKKHmmlDUKowSeikb5kK/mJReuWOxONx+s -ULsl+Lqb0CVn0SrVyJ6wt4t6yTeSCafhPhAf0OXn6L60UMxiLolFAtmN35S2Ob1lZpQ1r/n0Qb5D -oQ1zJiRVDgF8N3Q8TYfbi3DyWCy3lT1nxyBs6FT3S2GOzWRlxwKvlRP0RPJA9SjxEy0UoEnkA+M4 -cnzLMJrBGWLFEaaUb5lvpqbq/loOaU5+DFuHPxo82/OZuM8FXG3oVNZhtWpMpb/0Xu5m/LfLhHZQ -7yuVI0MqZ7NE43imC8jH3IwGZlbPm0xkJYs7+2U48hXTsFSMqgGDvai0kLxyynKNT/waj+q1c1tz -GjOpPBgdCSq3UKZxCSsqFIY+O6JbAWGWcV1pwqLyj5sGqCF1xb1F3varUWqrJv6cN3PrUXzijtfZ -FshpBL3Xwr4GIPvU2N8EjrJgS1zl21rbXQMXeXc5jjFyrhpCzijSv/RQtyPSzHCFMhlME95fHglt -pRsX+dfSQjUeHAlpWzJ5iOo79Ldnaxai6bXTcGO3fp07ri7HLEmXXPlYi8bv/qVxvNcdra6m7Rlb -6JBTb5fd66VhFRjGArh2n7R1rDW4P5NOT9K0I183T2scYkeZ3q/VFyLb09U9ajzXBS8Kgkhc4mBS -kYY9cy3Vy9lUnuNJH8HGIclUilwnBtjUOH0gteGOZ4c/XNrhXLSYDyxfnD8z1pDy7rYRvDolhnbe -UMzxCZUs40s6s7UIvBnLgc0+vKuOkIXeOrDymlp+Zxra4MZLBbVrqD/jTJ597pDmnw5c4+DbyB88 -9Cg9DodYcSuMZT/114pptqc/EuTjRPvH/z5slzI3tluOEBBLqOXLOX+0I5929tO97wkvl/atCz+y -xJrdwteW2FNW/NSmBP+f/maYtVs/bYyBC7Ox3jsYZHL05CIrBa/nS+b3bHfiYm4Ueil1YZZSgAUI -fFZ1dxUmeA2oQRQ3RuGXNGLFV9/XbGFGPV6kfzk1TBBCd+izc7q1H+OHMJwmaBX2IQNYVAKHYepV -SSGCe6CnbYHHETKGNe43EDvFgZr0gB/nVHPHZ80VV1ojOiI3XDvYIkl4ayo4bxQIgrFXWTvBI0nH -VElWMuw2aLUWCRHHf8ymVCHjFlJnOSojfevCYyyyZDH0IcvHhrsnQ5O1OsWzONuVVKIxSxiFZ/tR -fKDAf6xFTnw4O9Qig2VCfW2hJQrmMOuHW0W3dLQmCMO2ccdUd/xyfflH/olTiHZVdGwb8nIwRzSE -J15jFlOJuBZBZ4CiyHyd2IFylFlB+HgHhYabhWOGwYO1ZH/Og1dtQlFMk352CGRSIFTapnWQEUtN -l4zv8S0aaCFDyGCBqDUxZYpxGHX01y/JuH1xhn7TOCnNCI4eKDs5WGX4R425F4vF1o3BJ4vO0otq -I3rimI7jJY1jISqnBxknCIvruF83mF5wN4X7qGLIhR8A2Vg0yFERSIXn9Vv3GHy3Vj/WIkKddlYi -yIMv2I/VMjTLpW7pt05SWIZR0RPyxpB4SIUM9lBPGBl0GC7oSEEwRYLe4pJpZY2P0zbI1n+Oc44w -qY3PUnmF0ixjVpDD/mJ9wpOBGTVgXlaCaZiPcIWK5NiKBIiPdGaQ0TWGvAiG7nMchdZb7Vgf8zNi -MuMyzRdy/lePe9iC4TRx7WhhOQI/QiSVNAmAa2lT/piFbuh7ofJoYSZzrSZ1bvmWw3eN2nKUPVky -uPN5/VRfohRd0VYZoqhKIlU6TXYhJxmPUIloAwc1bPmHEpaZYZORHNlXUJM07hATwHR8MJYqkwWR -WaIezFhxSFlc8/Fq82hEnpeRozg3ULhhr9lAGtVEkCg5ZNRuuVleBPaZadhG0ZgkyPmDOTOKzViM -YgOcpukKqQcbjAWS0IleQ2ROjdh6A+md1qWdBRSX7iSYgFRTtRmBpJioieXJiHfJiMGIR9fJOn8I -MSfXYhspn4ooSa2mSAj4n+8Bmg03fBJZoPOJgsVZRxu1oOMRPXYYjdqjihFaEoZpXBREanuJoRI6 -cibFinq4ngUKh/wQd/H5ofYCZ0HJXR62opZFaAT0iFIZo4DIiUojkjeqKiuoZirKo5Y1a7AWckGa -BkuYoD5lpDK6eUs6CkDqpETwl1EqpfhJpVeKpVl6EgUAADs= - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_08.txt b/sys/lib/python/email/test/data/msg_08.txt deleted file mode 100644 index b5630836c..000000000 --- a/sys/lib/python/email/test/data/msg_08.txt +++ /dev/null @@ -1,24 +0,0 @@ -MIME-Version: 1.0 -From: Barry Warsaw -To: Dingus Lovers -Subject: Lyrics -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/html; charset="iso-8859-1" - - ---BOUNDARY -Content-Type: text/plain; charset="iso-8859-2" - - ---BOUNDARY -Content-Type: text/plain; charset="koi8-r" - - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_09.txt b/sys/lib/python/email/test/data/msg_09.txt deleted file mode 100644 index 575c4c205..000000000 --- a/sys/lib/python/email/test/data/msg_09.txt +++ /dev/null @@ -1,24 +0,0 @@ -MIME-Version: 1.0 -From: Barry Warsaw -To: Dingus Lovers -Subject: Lyrics -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/html; charset="iso-8859-1" - - ---BOUNDARY -Content-Type: text/plain - - ---BOUNDARY -Content-Type: text/plain; charset="koi8-r" - - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_10.txt b/sys/lib/python/email/test/data/msg_10.txt deleted file mode 100644 index bd30d13ad..000000000 --- a/sys/lib/python/email/test/data/msg_10.txt +++ /dev/null @@ -1,32 +0,0 @@ -MIME-Version: 1.0 -From: Barry Warsaw -To: Dingus Lovers -Subject: Lyrics -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit - -This is a 7bit encoded message. - ---BOUNDARY -Content-Type: text/html; charset="iso-8859-1" -Content-Transfer-Encoding: Quoted-Printable - -=A1This is a Quoted Printable encoded message! - ---BOUNDARY -Content-Type: text/plain; charset="iso-8859-1" -Content-Transfer-Encoding: Base64 - -VGhpcyBpcyBhIEJhc2U2NCBlbmNvZGVkIG1lc3NhZ2Uu - - ---BOUNDARY -Content-Type: text/plain; charset="iso-8859-1" - -This has no Content-Transfer-Encoding: header. - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_11.txt b/sys/lib/python/email/test/data/msg_11.txt deleted file mode 100644 index 8f7f1991c..000000000 --- a/sys/lib/python/email/test/data/msg_11.txt +++ /dev/null @@ -1,7 +0,0 @@ -Content-Type: message/rfc822 -MIME-Version: 1.0 -Subject: The enclosing message - -Subject: An enclosed message - -Here is the body of the message. diff --git a/sys/lib/python/email/test/data/msg_12.txt b/sys/lib/python/email/test/data/msg_12.txt deleted file mode 100644 index 4bec8d944..000000000 --- a/sys/lib/python/email/test/data/msg_12.txt +++ /dev/null @@ -1,36 +0,0 @@ -MIME-Version: 1.0 -From: Barry Warsaw -To: Dingus Lovers -Subject: Lyrics -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/html; charset="iso-8859-1" - - ---BOUNDARY -Content-Type: multipart/mixed; boundary="ANOTHER" - ---ANOTHER -Content-Type: text/plain; charset="iso-8859-2" - - ---ANOTHER -Content-Type: text/plain; charset="iso-8859-3" - ---ANOTHER-- - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/plain; charset="koi8-r" - - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_12a.txt b/sys/lib/python/email/test/data/msg_12a.txt deleted file mode 100644 index e94224ecf..000000000 --- a/sys/lib/python/email/test/data/msg_12a.txt +++ /dev/null @@ -1,38 +0,0 @@ -MIME-Version: 1.0 -From: Barry Warsaw -To: Dingus Lovers -Subject: Lyrics -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/html; charset="iso-8859-1" - - ---BOUNDARY -Content-Type: multipart/mixed; boundary="ANOTHER" - ---ANOTHER -Content-Type: text/plain; charset="iso-8859-2" - - ---ANOTHER -Content-Type: text/plain; charset="iso-8859-3" - - ---ANOTHER-- - - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - - ---BOUNDARY -Content-Type: text/plain; charset="koi8-r" - - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_13.txt b/sys/lib/python/email/test/data/msg_13.txt deleted file mode 100644 index 8e6d52d5b..000000000 --- a/sys/lib/python/email/test/data/msg_13.txt +++ /dev/null @@ -1,94 +0,0 @@ -MIME-Version: 1.0 -From: Barry -To: Dingus Lovers -Subject: Here is your dingus fish -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="OUTER" - ---OUTER -Content-Type: text/plain; charset="us-ascii" - -A text/plain part - ---OUTER -Content-Type: multipart/mixed; boundary=BOUNDARY - - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" - -Hi there, - -This is the dingus fish. - ---BOUNDARY -Content-Type: image/gif; name="dingusfish.gif" -Content-Transfer-Encoding: base64 -content-disposition: attachment; filename="dingusfish.gif" - -R0lGODdhAAEAAfAAAP///wAAACwAAAAAAAEAAQAC/oSPqcvtD6OctNqLs968+w+G4kiW5omm6sq2 -7gvH8kzX9o3n+s73/g8MCofEovGITGICTKbyCV0FDNOo9SqpQqpOrJfXzTQj2vD3TGtqL+NtGQ2f -qTXmxzuOd7WXdcc9DyjU53ewFni4s0fGhdiYaEhGBelICTNoV1j5NUnFcrmUqemjNifJVWpaOqaI -oFq3SspZsSraE7sHq3jr1MZqWvi662vxV4tD+pvKW6aLDOCLyur8PDwbanyDeq0N3DctbQYeLDvR -RY6t95m6UB0d3mwIrV7e2VGNvjjffukeJp4w7F65KecGFsTHQGAygOrgrWs1jt28Rc88KESYcGLA -/obvTkH6p+CinWJiJmIMqXGQwH/y4qk0SYjgQTczT3ajKZGfuI0uJ4kkVI/DT5s3/ejkxI0aT4Y+ -YTYgWbImUaXk9nlLmnSh1qJiJFl0OpUqRK4oOy7NyRQtHWofhoYVxkwWXKUSn0YsS+fUV6lhqfYb -6ayd3Z5qQdG1B7bvQzaJjwUV2lixMUZ7JVsOlfjWVr/3NB/uFvnySBN6Dcb6rGwaRM3wsormw5cC -M9NxWy/bWdufudCvy8bOAjXjVVwta/uO21sE5RHBCzNFXtgq9ORtH4eYjVP4Yryo026nvkFmCeyA -B29efV6ravCMK5JwWd5897Qrx7ll38o6iHDZ/rXPR//feevhF4l7wjUGX3xq1eeRfM4RSJGBIV1D -z1gKPkfWag3mVBVvva1RlX5bAJTPR/2YqNtw/FkIYYEi/pIZiAdpcxpoHtmnYYoZtvhUftzdx5ZX -JSKDW405zkGcZzzGZ6KEv4FI224oDmijlEf+xp6MJK5ojY/ASeVUR+wsKRuJ+XFZ5o7ZeEime8t1 -ouUsU6YjF5ZtUihhkGfCdFQLWQFJ3UXxmElfhQnR+eCdcDbkFZp6vTRmj56ApCihn5QGpaToNZmR -n3NVSpZcQpZ2KEONusaiCsKAug0wkQbJSFO+PTSjneGxOuFjPlUk3ovWvdIerjUg9ZGIOtGq/qeX -eCYrrCX+1UPsgTKGGRSbzd5q156d/gpfbJxe66eD5iQKrXj7RGgruGxs62qebBHUKS32CKluCiqZ -qh+pmehmEb71noAUoe5e9Zm17S7773V10pjrtG4CmuurCV/n6zLK5turWNhqOvFXbjhZrMD0YhKe -wR0zOyuvsh6MWrGoIuzvyWu5y1WIFAqmJselypxXh6dKLNOKEB98L88bS2rkNqqlKzCNJp9c0G0j -Gzh0iRrCbHSXmPR643QS+4rWhgFmnSbSuXCjS0xAOWkU2UdLqyuUNfHSFdUouy3bm5i5GnDM3tG8 -doJ4r5tqu3pPbRSVfvs8uJzeNXhp3n4j/tZ42SwH7eaWUUOjc3qFV9453UHTXZfcLH+OeNs5g36x -lBnHvTm7EbMbLeuaLncao8vWCXimfo1o+843Ak6y4ChNeGntvAYvfLK4ezmoyNIbNCLTCXO9ZV3A -E8/s88RczPzDwI4Ob7XZyl7+9Miban29h+tJZPrE21wgvBphDfrrfPdCTPKJD/y98L1rZwHcV6Jq -Zab0metpuNIX/qAFPoz171WUaUb4HAhBSzHuHfjzHb3kha/2Cctis/ORArVHNYfFyYRH2pYIRzic -isVOfPWD1b6mRTqpCRBozzof6UZVvFXRxWIr3GGrEviGYgyPMfahheiSaLs/9QeFu7oZ/ndSY8DD -ya9x+uPed+7mxN2IzIISBOMLFYWVqC3Pew1T2nFuuCiwZS5/v6II10i4t1OJcUH2U9zxKodHsGGv -Oa+zkvNUYUOa/TCCRutF9MzDwdlUMJADTCGSbDQ5OV4PTamDoPEi6Ecc/RF5RWwkcdSXvSOaDWSn -I9LlvubFTQpuc6JKXLcKeb+xdbKRBnwREemXyjg6ME65aJiOuBgrktzykfPLJBKR9ClMavJ62/Ff -BlNIyod9yX9wcSXexnXFpvkrbXk64xsx5Db7wXKP5fSgsvwIMM/9631VLBfkmtbHRXpqmtei52hG -pUwSlo+BASQoeILDOBgREECxBBh5/iYmNsQ9dIv5+OI++QkqdsJPc3uykz5fkM+OraeekcQF7X4n -B5S67za5U967PmooGQhUXfF7afXyCD7ONdRe17QogYjVx38uLwtrS6nhTnm15LQUnu9E2uK6CNI/ -1HOABj0ESwOjut4FEpFQpdNAm4K2LHnDWHNcmKB2ioKBogysVZtMO2nSxUdZ8Yk2kJc7URioLVI0 -YgmtIwZj4LoeKemgnOnbUdGnzZ4Oa6scqiolBGqS6RgWNLu0RMhcaE6rhhU4hiuqFXPAG8fGwTPW -FKeLMtdVmXLSs5YJGF/YeVm7rREMlY3UYE+yCxbaMXX8y15m5zVHq6GOKDMynzII/jdUHdyVqIy0 -ifX2+r/EgtZcvRzSb72gU9ui87M2VecjKildW/aFqaYhKoryUjfB/g4qtyVuc60xFDGmCxwjW+qu -zjuwl2GkOWn66+3QiiEctvd04OVvcCVzjgT7lrkvjVGKKHmmlDUKowSeikb5kK/mJReuWOxONx+s -ULsl+Lqb0CVn0SrVyJ6wt4t6yTeSCafhPhAf0OXn6L60UMxiLolFAtmN35S2Ob1lZpQ1r/n0Qb5D -oQ1zJiRVDgF8N3Q8TYfbi3DyWCy3lT1nxyBs6FT3S2GOzWRlxwKvlRP0RPJA9SjxEy0UoEnkA+M4 -cnzLMJrBGWLFEaaUb5lvpqbq/loOaU5+DFuHPxo82/OZuM8FXG3oVNZhtWpMpb/0Xu5m/LfLhHZQ -7yuVI0MqZ7NE43imC8jH3IwGZlbPm0xkJYs7+2U48hXTsFSMqgGDvai0kLxyynKNT/waj+q1c1tz -GjOpPBgdCSq3UKZxCSsqFIY+O6JbAWGWcV1pwqLyj5sGqCF1xb1F3varUWqrJv6cN3PrUXzijtfZ -FshpBL3Xwr4GIPvU2N8EjrJgS1zl21rbXQMXeXc5jjFyrhpCzijSv/RQtyPSzHCFMhlME95fHglt -pRsX+dfSQjUeHAlpWzJ5iOo79Ldnaxai6bXTcGO3fp07ri7HLEmXXPlYi8bv/qVxvNcdra6m7Rlb -6JBTb5fd66VhFRjGArh2n7R1rDW4P5NOT9K0I183T2scYkeZ3q/VFyLb09U9ajzXBS8Kgkhc4mBS -kYY9cy3Vy9lUnuNJH8HGIclUilwnBtjUOH0gteGOZ4c/XNrhXLSYDyxfnD8z1pDy7rYRvDolhnbe -UMzxCZUs40s6s7UIvBnLgc0+vKuOkIXeOrDymlp+Zxra4MZLBbVrqD/jTJ597pDmnw5c4+DbyB88 -9Cg9DodYcSuMZT/114pptqc/EuTjRPvH/z5slzI3tluOEBBLqOXLOX+0I5929tO97wkvl/atCz+y -xJrdwteW2FNW/NSmBP+f/maYtVs/bYyBC7Ox3jsYZHL05CIrBa/nS+b3bHfiYm4Ueil1YZZSgAUI -fFZ1dxUmeA2oQRQ3RuGXNGLFV9/XbGFGPV6kfzk1TBBCd+izc7q1H+OHMJwmaBX2IQNYVAKHYepV -SSGCe6CnbYHHETKGNe43EDvFgZr0gB/nVHPHZ80VV1ojOiI3XDvYIkl4ayo4bxQIgrFXWTvBI0nH -VElWMuw2aLUWCRHHf8ymVCHjFlJnOSojfevCYyyyZDH0IcvHhrsnQ5O1OsWzONuVVKIxSxiFZ/tR -fKDAf6xFTnw4O9Qig2VCfW2hJQrmMOuHW0W3dLQmCMO2ccdUd/xyfflH/olTiHZVdGwb8nIwRzSE -J15jFlOJuBZBZ4CiyHyd2IFylFlB+HgHhYabhWOGwYO1ZH/Og1dtQlFMk352CGRSIFTapnWQEUtN -l4zv8S0aaCFDyGCBqDUxZYpxGHX01y/JuH1xhn7TOCnNCI4eKDs5WGX4R425F4vF1o3BJ4vO0otq -I3rimI7jJY1jISqnBxknCIvruF83mF5wN4X7qGLIhR8A2Vg0yFERSIXn9Vv3GHy3Vj/WIkKddlYi -yIMv2I/VMjTLpW7pt05SWIZR0RPyxpB4SIUM9lBPGBl0GC7oSEEwRYLe4pJpZY2P0zbI1n+Oc44w -qY3PUnmF0ixjVpDD/mJ9wpOBGTVgXlaCaZiPcIWK5NiKBIiPdGaQ0TWGvAiG7nMchdZb7Vgf8zNi -MuMyzRdy/lePe9iC4TRx7WhhOQI/QiSVNAmAa2lT/piFbuh7ofJoYSZzrSZ1bvmWw3eN2nKUPVky -uPN5/VRfohRd0VYZoqhKIlU6TXYhJxmPUIloAwc1bPmHEpaZYZORHNlXUJM07hATwHR8MJYqkwWR -WaIezFhxSFlc8/Fq82hEnpeRozg3ULhhr9lAGtVEkCg5ZNRuuVleBPaZadhG0ZgkyPmDOTOKzViM -YgOcpukKqQcbjAWS0IleQ2ROjdh6A+md1qWdBRSX7iSYgFRTtRmBpJioieXJiHfJiMGIR9fJOn8I -MSfXYhspn4ooSa2mSAj4n+8Bmg03fBJZoPOJgsVZRxu1oOMRPXYYjdqjihFaEoZpXBREanuJoRI6 -cibFinq4ngUKh/wQd/H5ofYCZ0HJXR62opZFaAT0iFIZo4DIiUojkjeqKiuoZirKo5Y1a7AWckGa -BkuYoD5lpDK6eUs6CkDqpETwl1EqpfhJpVeKpVl6EgUAADs= - ---BOUNDARY-- - ---OUTER-- diff --git a/sys/lib/python/email/test/data/msg_14.txt b/sys/lib/python/email/test/data/msg_14.txt deleted file mode 100644 index 5d98d2fd1..000000000 --- a/sys/lib/python/email/test/data/msg_14.txt +++ /dev/null @@ -1,23 +0,0 @@ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) - id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: text; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 - - -Hi, - -I'm sorry but I'm using a drainbread ISP, which although big and -wealthy can't seem to generate standard compliant email. :( - -This message has a Content-Type: header with no subtype. I hope you -can still read it. - --Me diff --git a/sys/lib/python/email/test/data/msg_15.txt b/sys/lib/python/email/test/data/msg_15.txt deleted file mode 100644 index 33b8487aa..000000000 --- a/sys/lib/python/email/test/data/msg_15.txt +++ /dev/null @@ -1,52 +0,0 @@ -Return-Path: -Received: from fepD.post.tele.dk (195.41.46.149) by mail.groupcare.dk (LSMTP for Windows NT v1.1b) with SMTP id <0.0014F8A2@mail.groupcare.dk>; Mon, 30 Apr 2001 12:17:50 +0200 -User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2106 -Subject: XX -From: xx@xx.dk -To: XX -Message-ID: -Mime-version: 1.0 -Content-type: multipart/mixed; - boundary="MS_Mac_OE_3071477847_720252_MIME_Part" - -> Denne meddelelse er i MIME-format. Da dit postl¾sningsprogram ikke forstŒr dette format, kan del af eller hele meddelelsen v¾re ul¾selig. - ---MS_Mac_OE_3071477847_720252_MIME_Part -Content-type: multipart/alternative; - boundary="MS_Mac_OE_3071477847_720252_MIME_Part" - - ---MS_Mac_OE_3071477847_720252_MIME_Part -Content-type: text/plain; charset="ISO-8859-1" -Content-transfer-encoding: quoted-printable - -Some removed test. - ---MS_Mac_OE_3071477847_720252_MIME_Part -Content-type: text/html; charset="ISO-8859-1" -Content-transfer-encoding: quoted-printable - - - -Some removed HTML - - -Some removed text. - - - - ---MS_Mac_OE_3071477847_720252_MIME_Part-- - - ---MS_Mac_OE_3071477847_720252_MIME_Part -Content-type: image/gif; name="xx.gif"; - x-mac-creator="6F676C65"; - x-mac-type="47494666" -Content-disposition: attachment -Content-transfer-encoding: base64 - -Some removed base64 encoded chars. - ---MS_Mac_OE_3071477847_720252_MIME_Part-- - diff --git a/sys/lib/python/email/test/data/msg_16.txt b/sys/lib/python/email/test/data/msg_16.txt deleted file mode 100644 index 56167e9f5..000000000 --- a/sys/lib/python/email/test/data/msg_16.txt +++ /dev/null @@ -1,123 +0,0 @@ -Return-Path: <> -Delivered-To: scr-admin@socal-raves.org -Received: from cougar.noc.ucla.edu (cougar.noc.ucla.edu [169.232.10.18]) - by babylon.socal-raves.org (Postfix) with ESMTP id CCC2C51B84 - for ; Sun, 23 Sep 2001 20:13:54 -0700 (PDT) -Received: from sims-ms-daemon by cougar.noc.ucla.edu - (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) - id <0GK500B01D0B8Y@cougar.noc.ucla.edu> for scr-admin@socal-raves.org; Sun, - 23 Sep 2001 20:14:35 -0700 (PDT) -Received: from cougar.noc.ucla.edu - (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) - id <0GK500B01D0B8X@cougar.noc.ucla.edu>; Sun, 23 Sep 2001 20:14:35 -0700 (PDT) -Date: Sun, 23 Sep 2001 20:14:35 -0700 (PDT) -From: Internet Mail Delivery -Subject: Delivery Notification: Delivery has failed -To: scr-admin@socal-raves.org -Message-id: <0GK500B04D0B8X@cougar.noc.ucla.edu> -MIME-version: 1.0 -Sender: scr-owner@socal-raves.org -Errors-To: scr-owner@socal-raves.org -X-BeenThere: scr@socal-raves.org -X-Mailman-Version: 2.1a3 -Precedence: bulk -List-Help: -List-Post: -List-Subscribe: , - -List-Id: SoCal-Raves -List-Unsubscribe: , - -List-Archive: -Content-Type: multipart/report; boundary="Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA)" - - ---Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) -Content-type: text/plain; charset=ISO-8859-1 - -This report relates to a message you sent with the following header fields: - - Message-id: <002001c144a6$8752e060$56104586@oxy.edu> - Date: Sun, 23 Sep 2001 20:10:55 -0700 - From: "Ian T. Henry" - To: SoCal Raves - Subject: [scr] yeah for Ians!! - -Your message cannot be delivered to the following recipients: - - Recipient address: jangel1@cougar.noc.ucla.edu - Reason: recipient reached disk quota - - ---Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) -Content-type: message/DELIVERY-STATUS - -Original-envelope-id: 0GK500B4HD0888@cougar.noc.ucla.edu -Reporting-MTA: dns; cougar.noc.ucla.edu - -Action: failed -Status: 5.0.0 (recipient reached disk quota) -Original-recipient: rfc822;jangel1@cougar.noc.ucla.edu -Final-recipient: rfc822;jangel1@cougar.noc.ucla.edu - ---Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) -Content-type: MESSAGE/RFC822 - -Return-path: scr-admin@socal-raves.org -Received: from sims-ms-daemon by cougar.noc.ucla.edu - (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) - id <0GK500B01D0B8X@cougar.noc.ucla.edu>; Sun, 23 Sep 2001 20:14:35 -0700 (PDT) -Received: from panther.noc.ucla.edu by cougar.noc.ucla.edu - (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) - with ESMTP id <0GK500B4GD0888@cougar.noc.ucla.edu> for jangel1@sims-ms-daemon; - Sun, 23 Sep 2001 20:14:33 -0700 (PDT) -Received: from babylon.socal-raves.org - (ip-209-85-222-117.dreamhost.com [209.85.222.117]) - by panther.noc.ucla.edu (8.9.1a/8.9.1) with ESMTP id UAA09793 for - ; Sun, 23 Sep 2001 20:14:32 -0700 (PDT) -Received: from babylon (localhost [127.0.0.1]) by babylon.socal-raves.org - (Postfix) with ESMTP id D3B2951B70; Sun, 23 Sep 2001 20:13:47 -0700 (PDT) -Received: by babylon.socal-raves.org (Postfix, from userid 60001) - id A611F51B82; Sun, 23 Sep 2001 20:13:46 -0700 (PDT) -Received: from tiger.cc.oxy.edu (tiger.cc.oxy.edu [134.69.3.112]) - by babylon.socal-raves.org (Postfix) with ESMTP id ADA7351B70 for - ; Sun, 23 Sep 2001 20:13:44 -0700 (PDT) -Received: from ent (n16h86.dhcp.oxy.edu [134.69.16.86]) - by tiger.cc.oxy.edu (8.8.8/8.8.8) with SMTP id UAA08100 for - ; Sun, 23 Sep 2001 20:14:24 -0700 (PDT) -Date: Sun, 23 Sep 2001 20:10:55 -0700 -From: "Ian T. Henry" -Subject: [scr] yeah for Ians!! -Sender: scr-admin@socal-raves.org -To: SoCal Raves -Errors-to: scr-admin@socal-raves.org -Message-id: <002001c144a6$8752e060$56104586@oxy.edu> -MIME-version: 1.0 -X-Mailer: Microsoft Outlook Express 5.50.4522.1200 -Content-type: text/plain; charset=us-ascii -Precedence: bulk -Delivered-to: scr-post@babylon.socal-raves.org -Delivered-to: scr@socal-raves.org -X-Converted-To-Plain-Text: from multipart/alternative by demime 0.98e -X-Converted-To-Plain-Text: Alternative section used was text/plain -X-BeenThere: scr@socal-raves.org -X-Mailman-Version: 2.1a3 -List-Help: -List-Post: -List-Subscribe: , - -List-Id: SoCal-Raves -List-Unsubscribe: , - -List-Archive: - -I always love to find more Ian's that are over 3 years old!! - -Ian -_______________________________________________ -For event info, list questions, or to unsubscribe, see http://www.socal-raves.org/ - - - ---Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA)-- - diff --git a/sys/lib/python/email/test/data/msg_17.txt b/sys/lib/python/email/test/data/msg_17.txt deleted file mode 100644 index 8d86e4180..000000000 --- a/sys/lib/python/email/test/data/msg_17.txt +++ /dev/null @@ -1,12 +0,0 @@ -MIME-Version: 1.0 -From: Barry -To: Dingus Lovers -Subject: Here is your dingus fish -Date: Fri, 20 Apr 2001 19:35:02 -0400 -Content-Type: multipart/mixed; boundary="BOUNDARY" - -Hi there, - -This is the dingus fish. - -[Non-text (image/gif) part of message omitted, filename dingusfish.gif] diff --git a/sys/lib/python/email/test/data/msg_18.txt b/sys/lib/python/email/test/data/msg_18.txt deleted file mode 100644 index f9f4904d3..000000000 --- a/sys/lib/python/email/test/data/msg_18.txt +++ /dev/null @@ -1,6 +0,0 @@ -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; - spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" - diff --git a/sys/lib/python/email/test/data/msg_19.txt b/sys/lib/python/email/test/data/msg_19.txt deleted file mode 100644 index 49bf7fccd..000000000 --- a/sys/lib/python/email/test/data/msg_19.txt +++ /dev/null @@ -1,43 +0,0 @@ -Send Ppp mailing list submissions to - ppp@zzz.org - -To subscribe or unsubscribe via the World Wide Web, visit - http://www.zzz.org/mailman/listinfo/ppp -or, via email, send a message with subject or body 'help' to - ppp-request@zzz.org - -You can reach the person managing the list at - ppp-admin@zzz.org - -When replying, please edit your Subject line so it is more specific -than "Re: Contents of Ppp digest..." - -Today's Topics: - - 1. testing #1 (Barry A. Warsaw) - 2. testing #2 (Barry A. Warsaw) - 3. testing #3 (Barry A. Warsaw) - 4. testing #4 (Barry A. Warsaw) - 5. testing #5 (Barry A. Warsaw) - -hello - - -hello - - -hello - - -hello - - -hello - - - -_______________________________________________ -Ppp mailing list -Ppp@zzz.org -http://www.zzz.org/mailman/listinfo/ppp - diff --git a/sys/lib/python/email/test/data/msg_20.txt b/sys/lib/python/email/test/data/msg_20.txt deleted file mode 100644 index 1a6a88783..000000000 --- a/sys/lib/python/email/test/data/msg_20.txt +++ /dev/null @@ -1,22 +0,0 @@ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) - id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Cc: ccc@zzz.org -CC: ddd@zzz.org -cc: eee@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 - - -Hi, - -Do you like this message? - --Me diff --git a/sys/lib/python/email/test/data/msg_21.txt b/sys/lib/python/email/test/data/msg_21.txt deleted file mode 100644 index 23590b255..000000000 --- a/sys/lib/python/email/test/data/msg_21.txt +++ /dev/null @@ -1,20 +0,0 @@ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: Test -Content-Type: multipart/mixed; boundary="BOUNDARY" - -MIME message ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -One ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -Two ---BOUNDARY-- -End of MIME message diff --git a/sys/lib/python/email/test/data/msg_22.txt b/sys/lib/python/email/test/data/msg_22.txt deleted file mode 100644 index af9de5fa2..000000000 --- a/sys/lib/python/email/test/data/msg_22.txt +++ /dev/null @@ -1,46 +0,0 @@ -Mime-Version: 1.0 -Message-Id: -Date: Tue, 16 Oct 2001 13:59:25 +0300 -To: a@example.com -From: b@example.com -Content-Type: multipart/mixed; boundary="============_-1208892523==_============" - ---============_-1208892523==_============ -Content-Type: text/plain; charset="us-ascii" ; format="flowed" - -Text text text. ---============_-1208892523==_============ -Content-Id: -Content-Type: image/jpeg; name="wibble.JPG" - ; x-mac-type="4A504547" - ; x-mac-creator="474B4F4E" -Content-Disposition: attachment; filename="wibble.JPG" -Content-Transfer-Encoding: base64 - -/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB -AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAALCAXABIEBAREA -g6bCjjw/pIZSjO6FWFpldjySOmCNrO7DBZibUXhTwtCixw+GtAijVdqxxaPp0aKvmGXa -qrbBQvms0mAMeYS/3iTV1dG0hHaRNK01XblnWxtVdjkHLMIgTyqnk9VB7CrP2KzIINpa -4O7I+zxYO9WV8jZg71Zlb+8rMDkEirAVQFAUAKAFAAAUAYAUDgADgY6DjpRtXj5RxjHA -4wQRj0wQCMdCAewpaKKK/9k= ---============_-1208892523==_============ -Content-Id: -Content-Type: image/jpeg; name="wibble2.JPG" - ; x-mac-type="4A504547" - ; x-mac-creator="474B4F4E" -Content-Disposition: attachment; filename="wibble2.JPG" -Content-Transfer-Encoding: base64 - -/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB -AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAALCAXABJ0BAREA -/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA -W6NFJJBEkU10kKGTcWMDwxuU+0JHvk8qAtOpNwqSR0n8c3BlDyXHlqsUltHEiTvdXLxR -7vMiGDNJAJWkAMk8ZkCFp5G2oo5W++INrbQtNfTQxJAuXlupz9oS4d5Y1W+E2XlWZJJE -Y7LWYQxTLE1zuMbfBPxw8X2fibVdIbSbI6nLZxX635t9TjtYreWR7WGKJTLJFFKSlozO -0ShxIXM43uC3/9k= ---============_-1208892523==_============ -Content-Type: text/plain; charset="us-ascii" ; format="flowed" - -Text text text. ---============_-1208892523==_============-- - diff --git a/sys/lib/python/email/test/data/msg_23.txt b/sys/lib/python/email/test/data/msg_23.txt deleted file mode 100644 index bb2e8ec36..000000000 --- a/sys/lib/python/email/test/data/msg_23.txt +++ /dev/null @@ -1,8 +0,0 @@ -From: aperson@dom.ain -Content-Type: multipart/mixed; boundary="BOUNDARY" - ---BOUNDARY -Content-Type: text/plain - -A message part ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_24.txt b/sys/lib/python/email/test/data/msg_24.txt deleted file mode 100644 index 4e52339e8..000000000 --- a/sys/lib/python/email/test/data/msg_24.txt +++ /dev/null @@ -1,10 +0,0 @@ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY - - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_25.txt b/sys/lib/python/email/test/data/msg_25.txt deleted file mode 100644 index 9e35275fe..000000000 --- a/sys/lib/python/email/test/data/msg_25.txt +++ /dev/null @@ -1,117 +0,0 @@ -From MAILER-DAEMON Fri Apr 06 16:46:09 2001 -Received: from [204.245.199.98] (helo=zinfandel.lacita.com) - by www.linux.org.uk with esmtp (Exim 3.13 #1) - id 14lYR6-0008Iv-00 - for linuxuser-admin@www.linux.org.uk; Fri, 06 Apr 2001 16:46:09 +0100 -Received: from localhost (localhost) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with internal id JAB03225; Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) -Date: Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) -From: Mail Delivery Subsystem -Subject: Returned mail: Too many hops 19 (17 max): from via [199.164.235.226], to -Message-Id: <200104061723.JAB03225@zinfandel.lacita.com> -To: -To: postmaster@zinfandel.lacita.com -MIME-Version: 1.0 -Content-Type: multipart/report; report-type=delivery-status; - bo -Auto-Submitted: auto-generated (failure) - -This is a MIME-encapsulated message - ---JAB03225.986577786/zinfandel.lacita.com - -The original message was received at Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) -from [199.164.235.226] - - ----- The following addresses have delivery notifications ----- - (unrecoverable error) - - ----- Transcript of session follows ----- -554 Too many hops 19 (17 max): from via [199.164.235.226], to - ---JAB03225.986577786/zinfandel.lacita.com -Content-Type: message/delivery-status - -Reporting-MTA: dns; zinfandel.lacita.com -Received-From-MTA: dns; [199.164.235.226] -Arrival-Date: Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) - -Final-Recipient: rfc822; scoffman@wellpartner.com -Action: failed -Status: 5.4.6 -Last-Attempt-Date: Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) - ---JAB03225.986577786/zinfandel.lacita.com -Content-Type: text/rfc822-headers - -Return-Path: linuxuser-admin@www.linux.org.uk -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03225 for ; Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03221 for ; Fri, 6 Apr 2001 09:22:18 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03217 for ; Fri, 6 Apr 2001 09:21:37 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03213 for ; Fri, 6 Apr 2001 09:20:56 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03209 for ; Fri, 6 Apr 2001 09:20:15 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03205 for ; Fri, 6 Apr 2001 09:19:33 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03201 for ; Fri, 6 Apr 2001 09:18:52 -0800 (GMT-0800) -Received: from zinfandel.lacita.com ([204.245.199.98]) - by - fo -Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03197 for ; Fri, 6 Apr 2001 09:17:54 -0800 (GMT-0800) -Received: from www.linux.org.uk (parcelfarce.linux.theplanet.co.uk [195.92.249.252]) - by - fo -Received: from localhost.localdomain - ([ - by - id -Received: from [212.1.130.11] (helo=s1.uklinux.net ident=root) - by - id - fo -Received: from server (ppp-2-22.cvx4.telinco.net [212.1.149.22]) - by - fo -From: Daniel James -Organization: LinuxUser -To: linuxuser@www.linux.org.uk -X-Mailer: KMail [version 1.1.99] -Content-Type: text/plain; - c -MIME-Version: 1.0 -Message-Id: <01040616033903.00962@server> -Content-Transfer-Encoding: 8bit -Subject: [LinuxUser] bulletin no. 45 -Sender: linuxuser-admin@www.linux.org.uk -Errors-To: linuxuser-admin@www.linux.org.uk -X-BeenThere: linuxuser@www.linux.org.uk -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: -List-Post: -List-Subscribe: , - -List-Unsubscribe: , - -Date: Fri, 6 Apr 2001 16:03:39 +0100 - ---JAB03225.986577786/zinfandel.lacita.com-- - - diff --git a/sys/lib/python/email/test/data/msg_26.txt b/sys/lib/python/email/test/data/msg_26.txt deleted file mode 100644 index 6c71bced9..000000000 --- a/sys/lib/python/email/test/data/msg_26.txt +++ /dev/null @@ -1,45 +0,0 @@ -Received: from xcar [192.168.0.2] by jeeves.wooster.local - (SMTPD32-7.07 EVAL) id AFF92F0214; Sun, 12 May 2002 08:55:37 +0100 -Date: Sun, 12 May 2002 08:56:15 +0100 -From: Father Time -To: timbo@jeeves.wooster.local -Subject: IMAP file test -Message-ID: <6df65d354b.father.time@rpc.wooster.local> -X-Organization: Home -User-Agent: Messenger-Pro/2.50a (MsgServe/1.50) (RISC-OS/4.02) POPstar/2.03 -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="1618492860--2051301190--113853680" -Status: R -X-UIDL: 319998302 - -This message is in MIME format which your mailer apparently does not support. -You either require a newer version of your software which supports MIME, or -a separate MIME decoding utility. Alternatively, ask the sender of this -message to resend it in a different format. - ---1618492860--2051301190--113853680 -Content-Type: text/plain; charset=us-ascii - -Simple email with attachment. - - ---1618492860--2051301190--113853680 -Content-Type: application/riscos; name="clock.bmp,69c"; type=BMP; load=&fff69c4b; exec=&355dd4d1; access=&03 -Content-Disposition: attachment; filename="clock.bmp" -Content-Transfer-Encoding: base64 - -Qk12AgAAAAAAAHYAAAAoAAAAIAAAACAAAAABAAQAAAAAAAAAAADXDQAA1w0AAAAAAAAA -AAAAAAAAAAAAiAAAiAAAAIiIAIgAAACIAIgAiIgAALu7uwCIiIgAERHdACLuIgAz//8A -zAAAAN0R3QDu7iIA////AAAAAAAAAAAAAAAAAAAAAAAAAAi3AAAAAAAAADeAAAAAAAAA -C3ADMzMzMANwAAAAAAAAAAAHMAAAAANwAAAAAAAAAACAMAd3zPfwAwgAAAAAAAAIAwd/ -f8x/f3AwgAAAAAAAgDB0x/f3//zPAwgAAAAAAAcHfM9////8z/AwAAAAAAiwd/f3//// -////A4AAAAAAcEx/f///////zAMAAAAAiwfM9////3///8zwOAAAAAcHf3////B///// -8DAAAAALB/f3///wd3d3//AwAAAABwTPf//wCQAAD/zAMAAAAAsEx/f///B////8wDAA -AAAHB39////wf/////AwAAAACwf39///8H/////wMAAAAIcHfM9///B////M8DgAAAAA -sHTH///wf///xAMAAAAACHB3f3//8H////cDgAAAAAALB3zH//D//M9wMAAAAAAAgLB0 -z39///xHAwgAAAAAAAgLB3d3RHd3cDCAAAAAAAAAgLAHd0R3cAMIAAAAAAAAgAgLcAAA -AAMwgAgAAAAACDAAAAu7t7cwAAgDgAAAAABzcIAAAAAAAAgDMwAAAAAAN7uwgAAAAAgH -MzMAAAAACH97tzAAAAALu3c3gAAAAAAL+7tzDABAu7f7cAAAAAAACA+3MA7EQAv/sIAA -AAAAAAAIAAAAAAAAAIAAAAAA - ---1618492860--2051301190--113853680-- diff --git a/sys/lib/python/email/test/data/msg_27.txt b/sys/lib/python/email/test/data/msg_27.txt deleted file mode 100644 index d0191769d..000000000 --- a/sys/lib/python/email/test/data/msg_27.txt +++ /dev/null @@ -1,15 +0,0 @@ -Return-Path: -Received: by mail.dom.ain (Postfix, from userid 889) - id B9D0AD35DB; Tue, 4 Jun 2002 21:46:59 -0400 (EDT) -Message-ID: <15613.28051.707126.569693@dom.ain> -Date: Tue, 4 Jun 2002 21:46:59 -0400 -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Subject: bug demonstration - 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 - more text -From: aperson@dom.ain (Anne P. Erson) -To: bperson@dom.ain (Barney P. Erson) - -test diff --git a/sys/lib/python/email/test/data/msg_28.txt b/sys/lib/python/email/test/data/msg_28.txt deleted file mode 100644 index 1e4824cab..000000000 --- a/sys/lib/python/email/test/data/msg_28.txt +++ /dev/null @@ -1,25 +0,0 @@ -From: aperson@dom.ain -MIME-Version: 1.0 -Content-Type: multipart/digest; boundary=BOUNDARY - ---BOUNDARY -Content-Type: message/rfc822 - -Content-Type: text/plain; charset=us-ascii -To: aa@bb.org -From: cc@dd.org -Subject: ee - -message 1 - ---BOUNDARY -Content-Type: message/rfc822 - -Content-Type: text/plain; charset=us-ascii -To: aa@bb.org -From: cc@dd.org -Subject: ee - -message 2 - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_29.txt b/sys/lib/python/email/test/data/msg_29.txt deleted file mode 100644 index 1fab56161..000000000 --- a/sys/lib/python/email/test/data/msg_29.txt +++ /dev/null @@ -1,22 +0,0 @@ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) - id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii; - title*0*="us-ascii'en'This%20is%20even%20more%20"; - title*1*="%2A%2A%2Afun%2A%2A%2A%20"; - title*2="isn't it!" -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 - - -Hi, - -Do you like this message? - --Me diff --git a/sys/lib/python/email/test/data/msg_30.txt b/sys/lib/python/email/test/data/msg_30.txt deleted file mode 100644 index 4334bb6e6..000000000 --- a/sys/lib/python/email/test/data/msg_30.txt +++ /dev/null @@ -1,23 +0,0 @@ -From: aperson@dom.ain -MIME-Version: 1.0 -Content-Type: multipart/digest; boundary=BOUNDARY - ---BOUNDARY - -Content-Type: text/plain; charset=us-ascii -To: aa@bb.org -From: cc@dd.org -Subject: ee - -message 1 - ---BOUNDARY - -Content-Type: text/plain; charset=us-ascii -To: aa@bb.org -From: cc@dd.org -Subject: ee - -message 2 - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_31.txt b/sys/lib/python/email/test/data/msg_31.txt deleted file mode 100644 index 1e58e56cf..000000000 --- a/sys/lib/python/email/test/data/msg_31.txt +++ /dev/null @@ -1,15 +0,0 @@ -From: aperson@dom.ain -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary=BOUNDARY_ - ---BOUNDARY -Content-Type: text/plain - -message 1 - ---BOUNDARY -Content-Type: text/plain - -message 2 - ---BOUNDARY-- diff --git a/sys/lib/python/email/test/data/msg_32.txt b/sys/lib/python/email/test/data/msg_32.txt deleted file mode 100644 index 07ec5af9a..000000000 --- a/sys/lib/python/email/test/data/msg_32.txt +++ /dev/null @@ -1,14 +0,0 @@ -Delivered-To: freebsd-isp@freebsd.org -Date: Tue, 26 Sep 2000 12:23:03 -0500 -From: Anne Person -To: Barney Dude -Subject: Re: Limiting Perl CPU Utilization... -Mime-Version: 1.0 -Content-Type: text/plain; charset*=ansi-x3.4-1968''us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.3.8i -Sender: owner-freebsd-isp@FreeBSD.ORG -Precedence: bulk -X-Loop: FreeBSD.org - -Some message. diff --git a/sys/lib/python/email/test/data/msg_33.txt b/sys/lib/python/email/test/data/msg_33.txt deleted file mode 100644 index 042787a4f..000000000 --- a/sys/lib/python/email/test/data/msg_33.txt +++ /dev/null @@ -1,29 +0,0 @@ -Delivered-To: freebsd-isp@freebsd.org -Date: Wed, 27 Sep 2000 11:11:09 -0500 -From: Anne Person -To: Barney Dude -Subject: Re: Limiting Perl CPU Utilization... -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg*=ansi-x3.4-1968''pgp-md5; - protocol*=ansi-x3.4-1968''application%2Fpgp-signature; - boundary*="ansi-x3.4-1968''EeQfGwPcQSOJBaQU" -Content-Disposition: inline -Sender: owner-freebsd-isp@FreeBSD.ORG -Precedence: bulk -X-Loop: FreeBSD.org - - ---EeQfGwPcQSOJBaQU -Content-Type: text/plain; charset*=ansi-x3.4-1968''us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -part 1 - ---EeQfGwPcQSOJBaQU -Content-Type: text/plain -Content-Disposition: inline - -part 2 - ---EeQfGwPcQSOJBaQU-- diff --git a/sys/lib/python/email/test/data/msg_34.txt b/sys/lib/python/email/test/data/msg_34.txt deleted file mode 100644 index 055dfea53..000000000 --- a/sys/lib/python/email/test/data/msg_34.txt +++ /dev/null @@ -1,19 +0,0 @@ -From: aperson@dom.ain -To: bperson@dom.ain -Content-Type: multipart/digest; boundary=XYZ - ---XYZ -Content-Type: text/plain - - -This is a text plain part that is counter to recommended practice in -RFC 2046, $5.1.5, but is not illegal - ---XYZ - -From: cperson@dom.ain -To: dperson@dom.ain - -A submessage - ---XYZ-- diff --git a/sys/lib/python/email/test/data/msg_35.txt b/sys/lib/python/email/test/data/msg_35.txt deleted file mode 100644 index be7d5a2f7..000000000 --- a/sys/lib/python/email/test/data/msg_35.txt +++ /dev/null @@ -1,4 +0,0 @@ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: here's something interesting -counter to RFC 2822, there's no separating newline here diff --git a/sys/lib/python/email/test/data/msg_36.txt b/sys/lib/python/email/test/data/msg_36.txt deleted file mode 100644 index 5632c3062..000000000 --- a/sys/lib/python/email/test/data/msg_36.txt +++ /dev/null @@ -1,40 +0,0 @@ -Mime-Version: 1.0 -Content-Type: Multipart/Mixed; Boundary="NextPart" -To: IETF-Announce:; -From: Internet-Drafts@ietf.org -Subject: I-D ACTION:draft-ietf-mboned-mix-00.txt -Date: Tue, 22 Dec 1998 16:55:06 -0500 - ---NextPart - -Blah blah blah - ---NextPart -Content-Type: Multipart/Alternative; Boundary="OtherAccess" - ---OtherAccess -Content-Type: Message/External-body; - access-type="mail-server"; - server="mailserv@ietf.org" - -Content-Type: text/plain -Content-ID: <19981222151406.I-D@ietf.org> - -ENCODING mime -FILE /internet-drafts/draft-ietf-mboned-mix-00.txt - ---OtherAccess -Content-Type: Message/External-body; - name="draft-ietf-mboned-mix-00.txt"; - site="ftp.ietf.org"; - access-type="anon-ftp"; - directory="internet-drafts" - -Content-Type: text/plain -Content-ID: <19981222151406.I-D@ietf.org> - - ---OtherAccess-- - ---NextPart-- - diff --git a/sys/lib/python/email/test/data/msg_37.txt b/sys/lib/python/email/test/data/msg_37.txt deleted file mode 100644 index 038d34a1a..000000000 --- a/sys/lib/python/email/test/data/msg_37.txt +++ /dev/null @@ -1,22 +0,0 @@ -Content-Type: multipart/mixed; boundary=ABCDE - ---ABCDE -Content-Type: text/x-one - -Blah - ---ABCDE ---ABCDE -Content-Type: text/x-two - -Blah - ---ABCDE ---ABCDE ---ABCDE ---ABCDE -Content-Type: text/x-two - -Blah - ---ABCDE-- diff --git a/sys/lib/python/email/test/data/msg_38.txt b/sys/lib/python/email/test/data/msg_38.txt deleted file mode 100644 index 006df81cb..000000000 --- a/sys/lib/python/email/test/data/msg_38.txt +++ /dev/null @@ -1,101 +0,0 @@ -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" - -------- =_aaaaaaaaaa0 -Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa1" -Content-ID: <20592.1022586929.1@example.com> - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa2" -Content-ID: <20592.1022586929.2@example.com> - -------- =_aaaaaaaaaa2 -Content-Type: text/plain -Content-ID: <20592.1022586929.3@example.com> -Content-Description: very tricky -Content-Transfer-Encoding: 7bit - - -Unlike the test test_nested-multiples-with-internal-boundary, this -piece of text not only contains the outer boundary tags -------- =_aaaaaaaaaa1 -and -------- =_aaaaaaaaaa0 -but puts them at the start of a line! And, to be even nastier, it -even includes a couple of end tags, such as this one: - -------- =_aaaaaaaaaa1-- - -and this one, which is from a multipart we haven't even seen yet! - -------- =_aaaaaaaaaa4-- - -This will, I'm sure, cause much breakage of MIME parsers. But, as -far as I can tell, it's perfectly legal. I have not yet ever seen -a case of this in the wild, but I've seen *similar* things. - - -------- =_aaaaaaaaaa2 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.4@example.com> -Content-Description: patch2 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa2-- - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa3" -Content-ID: <20592.1022586929.6@example.com> - -------- =_aaaaaaaaaa3 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.7@example.com> -Content-Description: patch3 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa3 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.8@example.com> -Content-Description: patch4 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa3-- - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa4" -Content-ID: <20592.1022586929.10@example.com> - -------- =_aaaaaaaaaa4 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.11@example.com> -Content-Description: patch5 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa4 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.12@example.com> -Content-Description: patch6 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa4-- - -------- =_aaaaaaaaaa1-- - -------- =_aaaaaaaaaa0 -Content-Type: text/plain; charset="us-ascii" -Content-ID: <20592.1022586929.15@example.com> - --- -It's never too late to have a happy childhood. - -------- =_aaaaaaaaaa0-- diff --git a/sys/lib/python/email/test/data/msg_39.txt b/sys/lib/python/email/test/data/msg_39.txt deleted file mode 100644 index 124b26919..000000000 --- a/sys/lib/python/email/test/data/msg_39.txt +++ /dev/null @@ -1,83 +0,0 @@ -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" - -------- =_aaaaaaaaaa0 -Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa1" -Content-ID: <20592.1022586929.1@example.com> - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1" -Content-ID: <20592.1022586929.2@example.com> - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.3@example.com> -Content-Description: patch1 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.4@example.com> -Content-Description: patch2 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1-- - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1" -Content-ID: <20592.1022586929.6@example.com> - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.7@example.com> -Content-Description: patch3 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.8@example.com> -Content-Description: patch4 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1-- - -------- =_aaaaaaaaaa1 -Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1" -Content-ID: <20592.1022586929.10@example.com> - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.11@example.com> -Content-Description: patch5 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1 -Content-Type: application/octet-stream -Content-ID: <20592.1022586929.12@example.com> -Content-Description: patch6 -Content-Transfer-Encoding: base64 - -XXX - -------- =_aaaaaaaaaa1-- - -------- =_aaaaaaaaaa1-- - -------- =_aaaaaaaaaa0 -Content-Type: text/plain; charset="us-ascii" -Content-ID: <20592.1022586929.15@example.com> - --- -It's never too late to have a happy childhood. - -------- =_aaaaaaaaaa0-- diff --git a/sys/lib/python/email/test/data/msg_40.txt b/sys/lib/python/email/test/data/msg_40.txt deleted file mode 100644 index 1435fa1e1..000000000 --- a/sys/lib/python/email/test/data/msg_40.txt +++ /dev/null @@ -1,10 +0,0 @@ -MIME-Version: 1.0 -Content-Type: text/html; boundary="--961284236552522269" - -----961284236552522269 -Content-Type: text/html; -Content-Transfer-Encoding: 7Bit - - - -----961284236552522269-- diff --git a/sys/lib/python/email/test/data/msg_41.txt b/sys/lib/python/email/test/data/msg_41.txt deleted file mode 100644 index 76cdd1cb7..000000000 --- a/sys/lib/python/email/test/data/msg_41.txt +++ /dev/null @@ -1,8 +0,0 @@ -From: "Allison Dunlap" -To: yyy@example.com -Subject: 64423 -Date: Sun, 11 Jul 2004 16:09:27 -0300 -MIME-Version: 1.0 -Content-Type: multipart/alternative; - -Blah blah blah diff --git a/sys/lib/python/email/test/data/msg_42.txt b/sys/lib/python/email/test/data/msg_42.txt deleted file mode 100644 index a75f8f4a0..000000000 --- a/sys/lib/python/email/test/data/msg_42.txt +++ /dev/null @@ -1,20 +0,0 @@ -Content-Type: multipart/mixed; boundary="AAA" -From: Mail Delivery Subsystem -To: yyy@example.com - -This is a MIME-encapsulated message - ---AAA - -Stuff - ---AAA -Content-Type: message/rfc822 - -From: webmaster@python.org -To: zzz@example.com -Content-Type: multipart/mixed; boundary="BBB" - ---BBB-- - ---AAA-- diff --git a/sys/lib/python/email/test/data/msg_43.txt b/sys/lib/python/email/test/data/msg_43.txt deleted file mode 100644 index 797d12c56..000000000 --- a/sys/lib/python/email/test/data/msg_43.txt +++ /dev/null @@ -1,217 +0,0 @@ -From SRS0=aO/p=ON=bag.python.org=None@bounce2.pobox.com Fri Nov 26 21:40:36 2004 -X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] - [nil nil nil nil nil nil nil "MAILER DAEMON <>" "MAILER DAEMON <>" nil nil "Banned file: auto__mail.python.bat in mail from you" "^From:" nil nil nil nil "Banned file: auto__mail.python.bat in mail from you" nil nil nil nil nil nil nil] - nil) -MIME-Version: 1.0 -Message-Id: -Content-Type: multipart/report; report-type=delivery-status; - charset=utf-8; - boundary="----------=_1101526904-1956-5" -X-Virus-Scanned: by XS4ALL Virus Scanner -X-UIDL: 4\G!!! -To: -Subject: Banned file: auto__mail.python.bat in mail from you -Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -This is a multi-part message in MIME format... - -------------=_1101526904-1956-5 -Content-Type: text/plain; charset="utf-8" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -BANNED FILENAME ALERT - -Your message to: xxxxxxx@dot.ca.gov, xxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxx@dot.ca.gov, xxxxxx@dot.ca.gov, xxxxxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxx@dot.ca.gov, xxxxxxx@dot.ca.gov, xxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxx@dot.ca.gov, xxx@dot.ca.gov, xxxxxxx@dot.ca.gov, xxxxxxx@dot.ca.gov, xxxxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxx@dot.ca.gov, xxx@dot.ca.gov, xxxxxxxx@dot.ca.gov, xxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxxx@dot.ca.gov, xxxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxx@dot.ca.gov, xxxxxxx@dot.ca.gov, xxxxxxxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxxx@dot.ca.gov, xxxx@dot.ca.gov, xxxxxxxx@dot.ca.gov, xxxxxxxxxx@dot.ca.gov, xxxxxxxxxxxxxxxxxx@dot.ca.gov -was blocked by our Spam Firewall. The email you sent with the following subject has NOT BEEN DELIVERED: - -Subject: Delivery_failure_notice - -An attachment in that mail was of a file type that the Spam Firewall is set to block. - - - -------------=_1101526904-1956-5 -Content-Type: message/delivery-status -Content-Disposition: inline -Content-Transfer-Encoding: 7bit -Content-Description: Delivery error report - -Reporting-MTA: dns; sacspam01.dot.ca.gov -Received-From-MTA: smtp; sacspam01.dot.ca.gov ([127.0.0.1]) -Arrival-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -Final-Recipient: rfc822; xxxxxxx@dot.ca.gov -Action: failed -Status: 5.7.1 -Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, id=01956-02-2 - BANNED: auto__mail.python.bat -Last-Attempt-Date: Fri, 26 Nov 2004 19:41:44 -0800 (PST) - -------------=_1101526904-1956-5 -Content-Type: text/rfc822-headers -Content-Disposition: inline -Content-Transfer-Encoding: 7bit -Content-Description: Undelivered-message headers - -Received: from kgsav.org (ppp-70-242-162-63.dsl.spfdmo.swbell.net [70.242.162.63]) - by sacspam01.dot.ca.gov (Spam Firewall) with SMTP - id A232AD03DE3A; Fri, 26 Nov 2004 19:41:35 -0800 (PST) -From: webmaster@python.org -To: xxxxx@dot.ca.gov -Date: Sat, 27 Nov 2004 03:35:30 UTC -Subject: Delivery_failure_notice -Importance: Normal -X-Priority: 3 (Normal) -X-MSMail-Priority: Normal -Message-ID: -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="====67bd2b7a5.f99f7" -Content-Transfer-Encoding: 7bit - -------------=_1101526904-1956-5-- - diff --git a/sys/lib/python/email/test/data/msg_44.txt b/sys/lib/python/email/test/data/msg_44.txt deleted file mode 100644 index ae462a61b..000000000 --- a/sys/lib/python/email/test/data/msg_44.txt +++ /dev/null @@ -1,35 +0,0 @@ -Return-Path: -Delivered-To: barry@python.org -Received: by mail.python.org (Postfix, from userid 889) - id C2BF0D37C6; Tue, 11 Sep 2001 00:05:05 -0400 (EDT) -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="h90VIIIKmx" -Content-Transfer-Encoding: 7bit -Message-ID: <15261.36209.358846.118674@anthem.python.org> -From: barry@python.org (Barry A. Warsaw) -To: barry@python.org -Subject: a simple multipart -Date: Tue, 11 Sep 2001 00:05:05 -0400 -X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid -X-Attribution: BAW -X-Oblique-Strategy: Make a door into a window - - ---h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; name="msg.txt" -Content-Transfer-Encoding: 7bit - -a simple kind of mirror -to reflect upon our own - ---h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; name="msg.txt" -Content-Transfer-Encoding: 7bit - -a simple kind of mirror -to reflect upon our own - ---h90VIIIKmx-- - diff --git a/sys/lib/python/email/test/test_email.py b/sys/lib/python/email/test/test_email.py deleted file mode 100644 index a03299991..000000000 --- a/sys/lib/python/email/test/test_email.py +++ /dev/null @@ -1,3274 +0,0 @@ -# Copyright (C) 2001-2007 Python Software Foundation -# Contact: email-sig@python.org -# email package unit tests - -import os -import sys -import time -import base64 -import difflib -import unittest -import warnings -from cStringIO import StringIO - -import email - -from email.Charset import Charset -from email.Header import Header, decode_header, make_header -from email.Parser import Parser, HeaderParser -from email.Generator import Generator, DecodedGenerator -from email.Message import Message -from email.MIMEAudio import MIMEAudio -from email.MIMEText import MIMEText -from email.MIMEImage import MIMEImage -from email.MIMEBase import MIMEBase -from email.MIMEMessage import MIMEMessage -from email.MIMEMultipart import MIMEMultipart -from email import Utils -from email import Errors -from email import Encoders -from email import Iterators -from email import base64MIME -from email import quopriMIME - -from test.test_support import findfile, run_unittest -from email.test import __file__ as landmark - - -NL = '\n' -EMPTYSTRING = '' -SPACE = ' ' - - - -def openfile(filename, mode='r'): - path = os.path.join(os.path.dirname(landmark), 'data', filename) - return open(path, mode) - - - -# Base test class -class TestEmailBase(unittest.TestCase): - def ndiffAssertEqual(self, first, second): - """Like failUnlessEqual except use ndiff for readable output.""" - if first <> second: - sfirst = str(first) - ssecond = str(second) - diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines()) - fp = StringIO() - print >> fp, NL, NL.join(diff) - raise self.failureException, fp.getvalue() - - def _msgobj(self, filename): - fp = openfile(findfile(filename)) - try: - msg = email.message_from_file(fp) - finally: - fp.close() - return msg - - - -# Test various aspects of the Message class's API -class TestMessageAPI(TestEmailBase): - def test_get_all(self): - eq = self.assertEqual - msg = self._msgobj('msg_20.txt') - eq(msg.get_all('cc'), ['ccc@zzz.org', 'ddd@zzz.org', 'eee@zzz.org']) - eq(msg.get_all('xx', 'n/a'), 'n/a') - - def test_getset_charset(self): - eq = self.assertEqual - msg = Message() - eq(msg.get_charset(), None) - charset = Charset('iso-8859-1') - msg.set_charset(charset) - eq(msg['mime-version'], '1.0') - eq(msg.get_content_type(), 'text/plain') - eq(msg['content-type'], 'text/plain; charset="iso-8859-1"') - eq(msg.get_param('charset'), 'iso-8859-1') - eq(msg['content-transfer-encoding'], 'quoted-printable') - eq(msg.get_charset().input_charset, 'iso-8859-1') - # Remove the charset - msg.set_charset(None) - eq(msg.get_charset(), None) - eq(msg['content-type'], 'text/plain') - # Try adding a charset when there's already MIME headers present - msg = Message() - msg['MIME-Version'] = '2.0' - msg['Content-Type'] = 'text/x-weird' - msg['Content-Transfer-Encoding'] = 'quinted-puntable' - msg.set_charset(charset) - eq(msg['mime-version'], '2.0') - eq(msg['content-type'], 'text/x-weird; charset="iso-8859-1"') - eq(msg['content-transfer-encoding'], 'quinted-puntable') - - def test_set_charset_from_string(self): - eq = self.assertEqual - msg = Message() - msg.set_charset('us-ascii') - eq(msg.get_charset().input_charset, 'us-ascii') - eq(msg['content-type'], 'text/plain; charset="us-ascii"') - - def test_set_payload_with_charset(self): - msg = Message() - charset = Charset('iso-8859-1') - msg.set_payload('This is a string payload', charset) - self.assertEqual(msg.get_charset().input_charset, 'iso-8859-1') - - def test_get_charsets(self): - eq = self.assertEqual - - msg = self._msgobj('msg_08.txt') - charsets = msg.get_charsets() - eq(charsets, [None, 'us-ascii', 'iso-8859-1', 'iso-8859-2', 'koi8-r']) - - msg = self._msgobj('msg_09.txt') - charsets = msg.get_charsets('dingbat') - eq(charsets, ['dingbat', 'us-ascii', 'iso-8859-1', 'dingbat', - 'koi8-r']) - - msg = self._msgobj('msg_12.txt') - charsets = msg.get_charsets() - eq(charsets, [None, 'us-ascii', 'iso-8859-1', None, 'iso-8859-2', - 'iso-8859-3', 'us-ascii', 'koi8-r']) - - def test_get_filename(self): - eq = self.assertEqual - - msg = self._msgobj('msg_04.txt') - filenames = [p.get_filename() for p in msg.get_payload()] - eq(filenames, ['msg.txt', 'msg.txt']) - - msg = self._msgobj('msg_07.txt') - subpart = msg.get_payload(1) - eq(subpart.get_filename(), 'dingusfish.gif') - - def test_get_filename_with_name_parameter(self): - eq = self.assertEqual - - msg = self._msgobj('msg_44.txt') - filenames = [p.get_filename() for p in msg.get_payload()] - eq(filenames, ['msg.txt', 'msg.txt']) - - def test_get_boundary(self): - eq = self.assertEqual - msg = self._msgobj('msg_07.txt') - # No quotes! - eq(msg.get_boundary(), 'BOUNDARY') - - def test_set_boundary(self): - eq = self.assertEqual - # This one has no existing boundary parameter, but the Content-Type: - # header appears fifth. - msg = self._msgobj('msg_01.txt') - msg.set_boundary('BOUNDARY') - header, value = msg.items()[4] - eq(header.lower(), 'content-type') - eq(value, 'text/plain; charset="us-ascii"; boundary="BOUNDARY"') - # This one has a Content-Type: header, with a boundary, stuck in the - # middle of its headers. Make sure the order is preserved; it should - # be fifth. - msg = self._msgobj('msg_04.txt') - msg.set_boundary('BOUNDARY') - header, value = msg.items()[4] - eq(header.lower(), 'content-type') - eq(value, 'multipart/mixed; boundary="BOUNDARY"') - # And this one has no Content-Type: header at all. - msg = self._msgobj('msg_03.txt') - self.assertRaises(Errors.HeaderParseError, - msg.set_boundary, 'BOUNDARY') - - def test_get_decoded_payload(self): - eq = self.assertEqual - msg = self._msgobj('msg_10.txt') - # The outer message is a multipart - eq(msg.get_payload(decode=True), None) - # Subpart 1 is 7bit encoded - eq(msg.get_payload(0).get_payload(decode=True), - 'This is a 7bit encoded message.\n') - # Subpart 2 is quopri - eq(msg.get_payload(1).get_payload(decode=True), - '\xa1This is a Quoted Printable encoded message!\n') - # Subpart 3 is base64 - eq(msg.get_payload(2).get_payload(decode=True), - 'This is a Base64 encoded message.') - # Subpart 4 has no Content-Transfer-Encoding: header. - eq(msg.get_payload(3).get_payload(decode=True), - 'This has no Content-Transfer-Encoding: header.\n') - - def test_get_decoded_uu_payload(self): - eq = self.assertEqual - msg = Message() - msg.set_payload('begin 666 -\n+:&5L;&\\@=V]R;&0 \n \nend\n') - for cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'): - msg['content-transfer-encoding'] = cte - eq(msg.get_payload(decode=True), 'hello world') - # Now try some bogus data - msg.set_payload('foo') - eq(msg.get_payload(decode=True), 'foo') - - def test_decode_bogus_uu_payload_quietly(self): - msg = Message() - msg.set_payload('begin 664 foo.txt\n%' % i for i in range(10)]) - msg.set_payload('Test') - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), """\ -From: test@dom.ain -References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain> -\t<5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain> - -Test""") - - def test_no_split_long_header(self): - eq = self.ndiffAssertEqual - hstr = 'References: ' + 'x' * 80 - h = Header(hstr, continuation_ws='\t') - eq(h.encode(), """\ -References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx""") - - def test_splitting_multiple_long_lines(self): - eq = self.ndiffAssertEqual - hstr = """\ -from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -""" - h = Header(hstr, continuation_ws='\t') - eq(h.encode(), """\ -from babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST)""") - - def test_splitting_first_line_only_is_long(self): - eq = self.ndiffAssertEqual - hstr = """\ -from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] helo=cthulhu.gerg.ca) -\tby kronos.mems-exchange.org with esmtp (Exim 4.05) -\tid 17k4h5-00034i-00 -\tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""" - h = Header(hstr, maxlinelen=78, header_name='Received', - continuation_ws='\t') - eq(h.encode(), """\ -from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] -\thelo=cthulhu.gerg.ca) -\tby kronos.mems-exchange.org with esmtp (Exim 4.05) -\tid 17k4h5-00034i-00 -\tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""") - - def test_long_8bit_header(self): - eq = self.ndiffAssertEqual - msg = Message() - h = Header('Britische Regierung gibt', 'iso-8859-1', - header_name='Subject') - h.append('gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte') - msg['Subject'] = h - eq(msg.as_string(), """\ -Subject: =?iso-8859-1?q?Britische_Regierung_gibt?= =?iso-8859-1?q?gr=FCnes?= - =?iso-8859-1?q?_Licht_f=FCr_Offshore-Windkraftprojekte?= - -""") - - def test_long_8bit_header_no_charset(self): - eq = self.ndiffAssertEqual - msg = Message() - msg['Reply-To'] = 'Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte ' - eq(msg.as_string(), """\ -Reply-To: Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte - -""") - - def test_long_to_header(self): - eq = self.ndiffAssertEqual - to = '"Someone Test #A" ,,"Someone Test #B" , "Someone Test #C" , "Someone Test #D" ' - msg = Message() - msg['To'] = to - eq(msg.as_string(0), '''\ -To: "Someone Test #A" , , -\t"Someone Test #B" , -\t"Someone Test #C" , -\t"Someone Test #D" - -''') - - def test_long_line_after_append(self): - eq = self.ndiffAssertEqual - s = 'This is an example of string which has almost the limit of header length.' - h = Header(s) - h.append('Add another line.') - eq(h.encode(), """\ -This is an example of string which has almost the limit of header length. - Add another line.""") - - def test_shorter_line_with_append(self): - eq = self.ndiffAssertEqual - s = 'This is a shorter line.' - h = Header(s) - h.append('Add another sentence. (Surprise?)') - eq(h.encode(), - 'This is a shorter line. Add another sentence. (Surprise?)') - - def test_long_field_name(self): - eq = self.ndiffAssertEqual - fn = 'X-Very-Very-Very-Long-Header-Name' - gs = "Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s\xfcdl\xfcndischen Wandgem\xe4lden vorbei, gegen die rotierenden Klingen bef\xf6rdert. " - h = Header(gs, 'iso-8859-1', header_name=fn) - # BAW: this seems broken because the first line is too long - eq(h.encode(), """\ -=?iso-8859-1?q?Die_Mieter_treten_hier_?= - =?iso-8859-1?q?ein_werden_mit_einem_Foerderband_komfortabel_den_Korridor_?= - =?iso-8859-1?q?entlang=2C_an_s=FCdl=FCndischen_Wandgem=E4lden_vorbei=2C_g?= - =?iso-8859-1?q?egen_die_rotierenden_Klingen_bef=F6rdert=2E_?=""") - - def test_long_received_header(self): - h = 'from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700' - msg = Message() - msg['Received-1'] = Header(h, continuation_ws='\t') - msg['Received-2'] = h - self.assertEqual(msg.as_string(), """\ -Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by -\throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; -\tWed, 05 Mar 2003 18:10:18 -0700 -Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by -\throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; -\tWed, 05 Mar 2003 18:10:18 -0700 - -""") - - def test_string_headerinst_eq(self): - h = '<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner\'s message of "Thu, 6 Mar 2003 13:58:21 +0100")' - msg = Message() - msg['Received-1'] = Header(h, header_name='Received-1', - continuation_ws='\t') - msg['Received-2'] = h - self.assertEqual(msg.as_string(), """\ -Received-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> -\t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") -Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> -\t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") - -""") - - def test_long_unbreakable_lines_with_continuation(self): - eq = self.ndiffAssertEqual - msg = Message() - t = """\ - iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 - locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp""" - msg['Face-1'] = t - msg['Face-2'] = Header(t, header_name='Face-2') - eq(msg.as_string(), """\ -Face-1: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 -\tlocQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp -Face-2: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 - locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp - -""") - - def test_another_long_multiline_header(self): - eq = self.ndiffAssertEqual - m = '''\ -Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsoft SMTPSVC(5.0.2195.4905); -\tWed, 16 Oct 2002 07:41:11 -0700''' - msg = email.message_from_string(m) - eq(msg.as_string(), '''\ -Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with -\tMicrosoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700 - -''') - - def test_long_lines_with_different_header(self): - eq = self.ndiffAssertEqual - h = """\ -List-Unsubscribe: , - """ - msg = Message() - msg['List'] = h - msg['List'] = Header(h, header_name='List') - eq(msg.as_string(), """\ -List: List-Unsubscribe: , -\t -List: List-Unsubscribe: , - - -""") - - - -# Test mangling of "From " lines in the body of a message -class TestFromMangling(unittest.TestCase): - def setUp(self): - self.msg = Message() - self.msg['From'] = 'aaa@bbb.org' - self.msg.set_payload("""\ -From the desk of A.A.A.: -Blah blah blah -""") - - def test_mangled_from(self): - s = StringIO() - g = Generator(s, mangle_from_=True) - g.flatten(self.msg) - self.assertEqual(s.getvalue(), """\ -From: aaa@bbb.org - ->From the desk of A.A.A.: -Blah blah blah -""") - - def test_dont_mangle_from(self): - s = StringIO() - g = Generator(s, mangle_from_=False) - g.flatten(self.msg) - self.assertEqual(s.getvalue(), """\ -From: aaa@bbb.org - -From the desk of A.A.A.: -Blah blah blah -""") - - - -# Test the basic MIMEAudio class -class TestMIMEAudio(unittest.TestCase): - def setUp(self): - # Make sure we pick up the audiotest.au that lives in email/test/data. - # In Python, there's an audiotest.au living in Lib/test but that isn't - # included in some binary distros that don't include the test - # package. The trailing empty string on the .join() is significant - # since findfile() will do a dirname(). - datadir = os.path.join(os.path.dirname(landmark), 'data', '') - fp = open(findfile('audiotest.au', datadir), 'rb') - try: - self._audiodata = fp.read() - finally: - fp.close() - self._au = MIMEAudio(self._audiodata) - - def test_guess_minor_type(self): - self.assertEqual(self._au.get_content_type(), 'audio/basic') - - def test_encoding(self): - payload = self._au.get_payload() - self.assertEqual(base64.decodestring(payload), self._audiodata) - - def test_checkSetMinor(self): - au = MIMEAudio(self._audiodata, 'fish') - self.assertEqual(au.get_content_type(), 'audio/fish') - - def test_add_header(self): - eq = self.assertEqual - unless = self.failUnless - self._au.add_header('Content-Disposition', 'attachment', - filename='audiotest.au') - eq(self._au['content-disposition'], - 'attachment; filename="audiotest.au"') - eq(self._au.get_params(header='content-disposition'), - [('attachment', ''), ('filename', 'audiotest.au')]) - eq(self._au.get_param('filename', header='content-disposition'), - 'audiotest.au') - missing = [] - eq(self._au.get_param('attachment', header='content-disposition'), '') - unless(self._au.get_param('foo', failobj=missing, - header='content-disposition') is missing) - # Try some missing stuff - unless(self._au.get_param('foobar', missing) is missing) - unless(self._au.get_param('attachment', missing, - header='foobar') is missing) - - - -# Test the basic MIMEImage class -class TestMIMEImage(unittest.TestCase): - def setUp(self): - fp = openfile('PyBanner048.gif') - try: - self._imgdata = fp.read() - finally: - fp.close() - self._im = MIMEImage(self._imgdata) - - def test_guess_minor_type(self): - self.assertEqual(self._im.get_content_type(), 'image/gif') - - def test_encoding(self): - payload = self._im.get_payload() - self.assertEqual(base64.decodestring(payload), self._imgdata) - - def test_checkSetMinor(self): - im = MIMEImage(self._imgdata, 'fish') - self.assertEqual(im.get_content_type(), 'image/fish') - - def test_add_header(self): - eq = self.assertEqual - unless = self.failUnless - self._im.add_header('Content-Disposition', 'attachment', - filename='dingusfish.gif') - eq(self._im['content-disposition'], - 'attachment; filename="dingusfish.gif"') - eq(self._im.get_params(header='content-disposition'), - [('attachment', ''), ('filename', 'dingusfish.gif')]) - eq(self._im.get_param('filename', header='content-disposition'), - 'dingusfish.gif') - missing = [] - eq(self._im.get_param('attachment', header='content-disposition'), '') - unless(self._im.get_param('foo', failobj=missing, - header='content-disposition') is missing) - # Try some missing stuff - unless(self._im.get_param('foobar', missing) is missing) - unless(self._im.get_param('attachment', missing, - header='foobar') is missing) - - - -# Test the basic MIMEText class -class TestMIMEText(unittest.TestCase): - def setUp(self): - self._msg = MIMEText('hello there') - - def test_types(self): - eq = self.assertEqual - unless = self.failUnless - eq(self._msg.get_content_type(), 'text/plain') - eq(self._msg.get_param('charset'), 'us-ascii') - missing = [] - unless(self._msg.get_param('foobar', missing) is missing) - unless(self._msg.get_param('charset', missing, header='foobar') - is missing) - - def test_payload(self): - self.assertEqual(self._msg.get_payload(), 'hello there') - self.failUnless(not self._msg.is_multipart()) - - def test_charset(self): - eq = self.assertEqual - msg = MIMEText('hello there', _charset='us-ascii') - eq(msg.get_charset().input_charset, 'us-ascii') - eq(msg['content-type'], 'text/plain; charset="us-ascii"') - - - -# Test complicated multipart/* messages -class TestMultipart(TestEmailBase): - def setUp(self): - fp = openfile('PyBanner048.gif') - try: - data = fp.read() - finally: - fp.close() - - container = MIMEBase('multipart', 'mixed', boundary='BOUNDARY') - image = MIMEImage(data, name='dingusfish.gif') - image.add_header('content-disposition', 'attachment', - filename='dingusfish.gif') - intro = MIMEText('''\ -Hi there, - -This is the dingus fish. -''') - container.attach(intro) - container.attach(image) - container['From'] = 'Barry ' - container['To'] = 'Dingus Lovers ' - container['Subject'] = 'Here is your dingus fish' - - now = 987809702.54848599 - timetuple = time.localtime(now) - if timetuple[-1] == 0: - tzsecs = time.timezone - else: - tzsecs = time.altzone - if tzsecs > 0: - sign = '-' - else: - sign = '+' - tzoffset = ' %s%04d' % (sign, tzsecs / 36) - container['Date'] = time.strftime( - '%a, %d %b %Y %H:%M:%S', - time.localtime(now)) + tzoffset - self._msg = container - self._im = image - self._txt = intro - - def test_hierarchy(self): - # convenience - eq = self.assertEqual - unless = self.failUnless - raises = self.assertRaises - # tests - m = self._msg - unless(m.is_multipart()) - eq(m.get_content_type(), 'multipart/mixed') - eq(len(m.get_payload()), 2) - raises(IndexError, m.get_payload, 2) - m0 = m.get_payload(0) - m1 = m.get_payload(1) - unless(m0 is self._txt) - unless(m1 is self._im) - eq(m.get_payload(), [m0, m1]) - unless(not m0.is_multipart()) - unless(not m1.is_multipart()) - - def test_empty_multipart_idempotent(self): - text = """\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY - - ---BOUNDARY-- -""" - msg = Parser().parsestr(text) - self.ndiffAssertEqual(text, msg.as_string()) - - def test_no_parts_in_a_multipart_with_none_epilogue(self): - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.set_boundary('BOUNDARY') - self.ndiffAssertEqual(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY - ---BOUNDARY--''') - - def test_no_parts_in_a_multipart_with_empty_epilogue(self): - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = '' - outer.epilogue = '' - outer.set_boundary('BOUNDARY') - self.ndiffAssertEqual(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY - ---BOUNDARY-- -''') - - def test_one_part_in_a_multipart(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.set_boundary('BOUNDARY') - msg = MIMEText('hello world') - outer.attach(msg) - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - def test_seq_parts_in_a_multipart_with_empty_preamble(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = '' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_none_preamble(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = None - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_none_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = None - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_empty_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = '' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY-- -''') - - - def test_seq_parts_in_a_multipart_with_nl_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = '\n' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY-- - -''') - - def test_message_external_body(self): - eq = self.assertEqual - msg = self._msgobj('msg_36.txt') - eq(len(msg.get_payload()), 2) - msg1 = msg.get_payload(1) - eq(msg1.get_content_type(), 'multipart/alternative') - eq(len(msg1.get_payload()), 2) - for subpart in msg1.get_payload(): - eq(subpart.get_content_type(), 'message/external-body') - eq(len(subpart.get_payload()), 1) - subsubpart = subpart.get_payload(0) - eq(subsubpart.get_content_type(), 'text/plain') - - def test_double_boundary(self): - # msg_37.txt is a multipart that contains two dash-boundary's in a - # row. Our interpretation of RFC 2046 calls for ignoring the second - # and subsequent boundaries. - msg = self._msgobj('msg_37.txt') - self.assertEqual(len(msg.get_payload()), 3) - - def test_nested_inner_contains_outer_boundary(self): - eq = self.ndiffAssertEqual - # msg_38.txt has an inner part that contains outer boundaries. My - # interpretation of RFC 2046 (based on sections 5.1 and 5.1.2) say - # these are illegal and should be interpreted as unterminated inner - # parts. - msg = self._msgobj('msg_38.txt') - sfp = StringIO() - Iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/mixed - multipart/mixed - multipart/alternative - text/plain - text/plain - text/plain - text/plain -""") - - def test_nested_with_same_boundary(self): - eq = self.ndiffAssertEqual - # msg 39.txt is similarly evil in that it's got inner parts that use - # the same boundary as outer parts. Again, I believe the way this is - # parsed is closest to the spirit of RFC 2046 - msg = self._msgobj('msg_39.txt') - sfp = StringIO() - Iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/mixed - multipart/mixed - multipart/alternative - application/octet-stream - application/octet-stream - text/plain -""") - - def test_boundary_in_non_multipart(self): - msg = self._msgobj('msg_40.txt') - self.assertEqual(msg.as_string(), '''\ -MIME-Version: 1.0 -Content-Type: text/html; boundary="--961284236552522269" - -----961284236552522269 -Content-Type: text/html; -Content-Transfer-Encoding: 7Bit - - - -----961284236552522269-- -''') - - def test_boundary_with_leading_space(self): - eq = self.assertEqual - msg = email.message_from_string('''\ -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary=" XXXX" - --- XXXX -Content-Type: text/plain - - --- XXXX -Content-Type: text/plain - --- XXXX-- -''') - self.failUnless(msg.is_multipart()) - eq(msg.get_boundary(), ' XXXX') - eq(len(msg.get_payload()), 2) - - def test_boundary_without_trailing_newline(self): - m = Parser().parsestr("""\ -Content-Type: multipart/mixed; boundary="===============0012394164==" -MIME-Version: 1.0 - ---===============0012394164== -Content-Type: image/file1.jpg -MIME-Version: 1.0 -Content-Transfer-Encoding: base64 - -YXNkZg== ---===============0012394164==--""") - self.assertEquals(m.get_payload(0).get_payload(), 'YXNkZg==') - - - -# Test some badly formatted messages -class TestNonConformant(TestEmailBase): - def test_parse_missing_minor_type(self): - eq = self.assertEqual - msg = self._msgobj('msg_14.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - - def test_same_boundary_inner_outer(self): - unless = self.failUnless - msg = self._msgobj('msg_15.txt') - # XXX We can probably eventually do better - inner = msg.get_payload(0) - unless(hasattr(inner, 'defects')) - self.assertEqual(len(inner.defects), 1) - unless(isinstance(inner.defects[0], - Errors.StartBoundaryNotFoundDefect)) - - def test_multipart_no_boundary(self): - unless = self.failUnless - msg = self._msgobj('msg_25.txt') - unless(isinstance(msg.get_payload(), str)) - self.assertEqual(len(msg.defects), 2) - unless(isinstance(msg.defects[0], Errors.NoBoundaryInMultipartDefect)) - unless(isinstance(msg.defects[1], - Errors.MultipartInvariantViolationDefect)) - - def test_invalid_content_type(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - msg = Message() - # RFC 2045, $5.2 says invalid yields text/plain - msg['Content-Type'] = 'text' - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_content_type(), 'text/plain') - # Clear the old value and try something /really/ invalid - del msg['content-type'] - msg['Content-Type'] = 'foo' - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_content_type(), 'text/plain') - # Still, make sure that the message is idempotently generated - s = StringIO() - g = Generator(s) - g.flatten(msg) - neq(s.getvalue(), 'Content-Type: foo\n\n') - - def test_no_start_boundary(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_31.txt') - eq(msg.get_payload(), """\ ---BOUNDARY -Content-Type: text/plain - -message 1 - ---BOUNDARY -Content-Type: text/plain - -message 2 - ---BOUNDARY-- -""") - - def test_no_separating_blank_line(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_35.txt') - eq(msg.as_string(), """\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: here's something interesting - -counter to RFC 2822, there's no separating newline here -""") - - def test_lying_multipart(self): - unless = self.failUnless - msg = self._msgobj('msg_41.txt') - unless(hasattr(msg, 'defects')) - self.assertEqual(len(msg.defects), 2) - unless(isinstance(msg.defects[0], Errors.NoBoundaryInMultipartDefect)) - unless(isinstance(msg.defects[1], - Errors.MultipartInvariantViolationDefect)) - - def test_missing_start_boundary(self): - outer = self._msgobj('msg_42.txt') - # The message structure is: - # - # multipart/mixed - # text/plain - # message/rfc822 - # multipart/mixed [*] - # - # [*] This message is missing its start boundary - bad = outer.get_payload(1).get_payload(0) - self.assertEqual(len(bad.defects), 1) - self.failUnless(isinstance(bad.defects[0], - Errors.StartBoundaryNotFoundDefect)) - - - -# Test RFC 2047 header encoding and decoding -class TestRFC2047(unittest.TestCase): - def test_rfc2047_multiline(self): - eq = self.assertEqual - s = """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz - foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=""" - dh = decode_header(s) - eq(dh, [ - ('Re:', None), - ('r\x8aksm\x9arg\x8cs', 'mac-iceland'), - ('baz foo bar', None), - ('r\x8aksm\x9arg\x8cs', 'mac-iceland')]) - eq(str(make_header(dh)), - """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar - =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=""") - - def test_whitespace_eater_unicode(self): - eq = self.assertEqual - s = '=?ISO-8859-1?Q?Andr=E9?= Pirard ' - dh = decode_header(s) - eq(dh, [('Andr\xe9', 'iso-8859-1'), ('Pirard ', None)]) - hu = unicode(make_header(dh)).encode('latin-1') - eq(hu, 'Andr\xe9 Pirard ') - - def test_whitespace_eater_unicode_2(self): - eq = self.assertEqual - s = 'The =?iso-8859-1?b?cXVpY2sgYnJvd24gZm94?= jumped over the =?iso-8859-1?b?bGF6eSBkb2c=?=' - dh = decode_header(s) - eq(dh, [('The', None), ('quick brown fox', 'iso-8859-1'), - ('jumped over the', None), ('lazy dog', 'iso-8859-1')]) - hu = make_header(dh).__unicode__() - eq(hu, u'The quick brown fox jumped over the lazy dog') - - def test_rfc2047_without_whitespace(self): - s = 'Sm=?ISO-8859-1?B?9g==?=rg=?ISO-8859-1?B?5Q==?=sbord' - dh = decode_header(s) - self.assertEqual(dh, [(s, None)]) - - def test_rfc2047_with_whitespace(self): - s = 'Sm =?ISO-8859-1?B?9g==?= rg =?ISO-8859-1?B?5Q==?= sbord' - dh = decode_header(s) - self.assertEqual(dh, [('Sm', None), ('\xf6', 'iso-8859-1'), - ('rg', None), ('\xe5', 'iso-8859-1'), - ('sbord', None)]) - - - -# Test the MIMEMessage class -class TestMIMEMessage(TestEmailBase): - def setUp(self): - fp = openfile('msg_11.txt') - try: - self._text = fp.read() - finally: - fp.close() - - def test_type_error(self): - self.assertRaises(TypeError, MIMEMessage, 'a plain string') - - def test_valid_argument(self): - eq = self.assertEqual - unless = self.failUnless - subject = 'A sub-message' - m = Message() - m['Subject'] = subject - r = MIMEMessage(m) - eq(r.get_content_type(), 'message/rfc822') - payload = r.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - subpart = payload[0] - unless(subpart is m) - eq(subpart['subject'], subject) - - def test_bad_multipart(self): - eq = self.assertEqual - msg1 = Message() - msg1['Subject'] = 'subpart 1' - msg2 = Message() - msg2['Subject'] = 'subpart 2' - r = MIMEMessage(msg1) - self.assertRaises(Errors.MultipartConversionError, r.attach, msg2) - - def test_generate(self): - # First craft the message to be encapsulated - m = Message() - m['Subject'] = 'An enclosed message' - m.set_payload('Here is the body of the message.\n') - r = MIMEMessage(m) - r['Subject'] = 'The enclosing message' - s = StringIO() - g = Generator(s) - g.flatten(r) - self.assertEqual(s.getvalue(), """\ -Content-Type: message/rfc822 -MIME-Version: 1.0 -Subject: The enclosing message - -Subject: An enclosed message - -Here is the body of the message. -""") - - def test_parse_message_rfc822(self): - eq = self.assertEqual - unless = self.failUnless - msg = self._msgobj('msg_11.txt') - eq(msg.get_content_type(), 'message/rfc822') - payload = msg.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - submsg = payload[0] - self.failUnless(isinstance(submsg, Message)) - eq(submsg['subject'], 'An enclosed message') - eq(submsg.get_payload(), 'Here is the body of the message.\n') - - def test_dsn(self): - eq = self.assertEqual - unless = self.failUnless - # msg 16 is a Delivery Status Notification, see RFC 1894 - msg = self._msgobj('msg_16.txt') - eq(msg.get_content_type(), 'multipart/report') - unless(msg.is_multipart()) - eq(len(msg.get_payload()), 3) - # Subpart 1 is a text/plain, human readable section - subpart = msg.get_payload(0) - eq(subpart.get_content_type(), 'text/plain') - eq(subpart.get_payload(), """\ -This report relates to a message you sent with the following header fields: - - Message-id: <002001c144a6$8752e060$56104586@oxy.edu> - Date: Sun, 23 Sep 2001 20:10:55 -0700 - From: "Ian T. Henry" - To: SoCal Raves - Subject: [scr] yeah for Ians!! - -Your message cannot be delivered to the following recipients: - - Recipient address: jangel1@cougar.noc.ucla.edu - Reason: recipient reached disk quota - -""") - # Subpart 2 contains the machine parsable DSN information. It - # consists of two blocks of headers, represented by two nested Message - # objects. - subpart = msg.get_payload(1) - eq(subpart.get_content_type(), 'message/delivery-status') - eq(len(subpart.get_payload()), 2) - # message/delivery-status should treat each block as a bunch of - # headers, i.e. a bunch of Message objects. - dsn1 = subpart.get_payload(0) - unless(isinstance(dsn1, Message)) - eq(dsn1['original-envelope-id'], '0GK500B4HD0888@cougar.noc.ucla.edu') - eq(dsn1.get_param('dns', header='reporting-mta'), '') - # Try a missing one - eq(dsn1.get_param('nsd', header='reporting-mta'), None) - dsn2 = subpart.get_payload(1) - unless(isinstance(dsn2, Message)) - eq(dsn2['action'], 'failed') - eq(dsn2.get_params(header='original-recipient'), - [('rfc822', ''), ('jangel1@cougar.noc.ucla.edu', '')]) - eq(dsn2.get_param('rfc822', header='final-recipient'), '') - # Subpart 3 is the original message - subpart = msg.get_payload(2) - eq(subpart.get_content_type(), 'message/rfc822') - payload = subpart.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - subsubpart = payload[0] - unless(isinstance(subsubpart, Message)) - eq(subsubpart.get_content_type(), 'text/plain') - eq(subsubpart['message-id'], - '<002001c144a6$8752e060$56104586@oxy.edu>') - - def test_epilogue(self): - eq = self.ndiffAssertEqual - fp = openfile('msg_21.txt') - try: - text = fp.read() - finally: - fp.close() - msg = Message() - msg['From'] = 'aperson@dom.ain' - msg['To'] = 'bperson@dom.ain' - msg['Subject'] = 'Test' - msg.preamble = 'MIME message' - msg.epilogue = 'End of MIME message\n' - msg1 = MIMEText('One') - msg2 = MIMEText('Two') - msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY') - msg.attach(msg1) - msg.attach(msg2) - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), text) - - def test_no_nl_preamble(self): - eq = self.ndiffAssertEqual - msg = Message() - msg['From'] = 'aperson@dom.ain' - msg['To'] = 'bperson@dom.ain' - msg['Subject'] = 'Test' - msg.preamble = 'MIME message' - msg.epilogue = '' - msg1 = MIMEText('One') - msg2 = MIMEText('Two') - msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY') - msg.attach(msg1) - msg.attach(msg2) - eq(msg.as_string(), """\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: Test -Content-Type: multipart/mixed; boundary="BOUNDARY" - -MIME message ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -One ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -Two ---BOUNDARY-- -""") - - def test_default_type(self): - eq = self.assertEqual - fp = openfile('msg_30.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - container1 = msg.get_payload(0) - eq(container1.get_default_type(), 'message/rfc822') - eq(container1.get_content_type(), 'message/rfc822') - container2 = msg.get_payload(1) - eq(container2.get_default_type(), 'message/rfc822') - eq(container2.get_content_type(), 'message/rfc822') - container1a = container1.get_payload(0) - eq(container1a.get_default_type(), 'text/plain') - eq(container1a.get_content_type(), 'text/plain') - container2a = container2.get_payload(0) - eq(container2a.get_default_type(), 'text/plain') - eq(container2a.get_content_type(), 'text/plain') - - def test_default_type_with_explicit_container_type(self): - eq = self.assertEqual - fp = openfile('msg_28.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - container1 = msg.get_payload(0) - eq(container1.get_default_type(), 'message/rfc822') - eq(container1.get_content_type(), 'message/rfc822') - container2 = msg.get_payload(1) - eq(container2.get_default_type(), 'message/rfc822') - eq(container2.get_content_type(), 'message/rfc822') - container1a = container1.get_payload(0) - eq(container1a.get_default_type(), 'text/plain') - eq(container1a.get_content_type(), 'text/plain') - container2a = container2.get_payload(0) - eq(container2a.get_default_type(), 'text/plain') - eq(container2a.get_content_type(), 'text/plain') - - def test_default_type_non_parsed(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - # Set up container - container = MIMEMultipart('digest', 'BOUNDARY') - container.epilogue = '' - # Set up subparts - subpart1a = MIMEText('message 1\n') - subpart2a = MIMEText('message 2\n') - subpart1 = MIMEMessage(subpart1a) - subpart2 = MIMEMessage(subpart2a) - container.attach(subpart1) - container.attach(subpart2) - eq(subpart1.get_content_type(), 'message/rfc822') - eq(subpart1.get_default_type(), 'message/rfc822') - eq(subpart2.get_content_type(), 'message/rfc822') - eq(subpart2.get_default_type(), 'message/rfc822') - neq(container.as_string(0), '''\ -Content-Type: multipart/digest; boundary="BOUNDARY" -MIME-Version: 1.0 - ---BOUNDARY -Content-Type: message/rfc822 -MIME-Version: 1.0 - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 1 - ---BOUNDARY -Content-Type: message/rfc822 -MIME-Version: 1.0 - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 2 - ---BOUNDARY-- -''') - del subpart1['content-type'] - del subpart1['mime-version'] - del subpart2['content-type'] - del subpart2['mime-version'] - eq(subpart1.get_content_type(), 'message/rfc822') - eq(subpart1.get_default_type(), 'message/rfc822') - eq(subpart2.get_content_type(), 'message/rfc822') - eq(subpart2.get_default_type(), 'message/rfc822') - neq(container.as_string(0), '''\ -Content-Type: multipart/digest; boundary="BOUNDARY" -MIME-Version: 1.0 - ---BOUNDARY - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 1 - ---BOUNDARY - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 2 - ---BOUNDARY-- -''') - - def test_mime_attachments_in_constructor(self): - eq = self.assertEqual - text1 = MIMEText('') - text2 = MIMEText('') - msg = MIMEMultipart(_subparts=(text1, text2)) - eq(len(msg.get_payload()), 2) - eq(msg.get_payload(0), text1) - eq(msg.get_payload(1), text2) - - - -# A general test of parser->model->generator idempotency. IOW, read a message -# in, parse it into a message object tree, then without touching the tree, -# regenerate the plain text. The original text and the transformed text -# should be identical. Note: that we ignore the Unix-From since that may -# contain a changed date. -class TestIdempotent(TestEmailBase): - def _msgobj(self, filename): - fp = openfile(filename) - try: - data = fp.read() - finally: - fp.close() - msg = email.message_from_string(data) - return msg, data - - def _idempotent(self, msg, text): - eq = self.ndiffAssertEqual - s = StringIO() - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - eq(text, s.getvalue()) - - def test_parse_text_message(self): - eq = self.assertEquals - msg, text = self._msgobj('msg_01.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_params()[1], ('charset', 'us-ascii')) - eq(msg.get_param('charset'), 'us-ascii') - eq(msg.preamble, None) - eq(msg.epilogue, None) - self._idempotent(msg, text) - - def test_parse_untyped_message(self): - eq = self.assertEquals - msg, text = self._msgobj('msg_03.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_params(), None) - eq(msg.get_param('charset'), None) - self._idempotent(msg, text) - - def test_simple_multipart(self): - msg, text = self._msgobj('msg_04.txt') - self._idempotent(msg, text) - - def test_MIME_digest(self): - msg, text = self._msgobj('msg_02.txt') - self._idempotent(msg, text) - - def test_long_header(self): - msg, text = self._msgobj('msg_27.txt') - self._idempotent(msg, text) - - def test_MIME_digest_with_part_headers(self): - msg, text = self._msgobj('msg_28.txt') - self._idempotent(msg, text) - - def test_mixed_with_image(self): - msg, text = self._msgobj('msg_06.txt') - self._idempotent(msg, text) - - def test_multipart_report(self): - msg, text = self._msgobj('msg_05.txt') - self._idempotent(msg, text) - - def test_dsn(self): - msg, text = self._msgobj('msg_16.txt') - self._idempotent(msg, text) - - def test_preamble_epilogue(self): - msg, text = self._msgobj('msg_21.txt') - self._idempotent(msg, text) - - def test_multipart_one_part(self): - msg, text = self._msgobj('msg_23.txt') - self._idempotent(msg, text) - - def test_multipart_no_parts(self): - msg, text = self._msgobj('msg_24.txt') - self._idempotent(msg, text) - - def test_no_start_boundary(self): - msg, text = self._msgobj('msg_31.txt') - self._idempotent(msg, text) - - def test_rfc2231_charset(self): - msg, text = self._msgobj('msg_32.txt') - self._idempotent(msg, text) - - def test_more_rfc2231_parameters(self): - msg, text = self._msgobj('msg_33.txt') - self._idempotent(msg, text) - - def test_text_plain_in_a_multipart_digest(self): - msg, text = self._msgobj('msg_34.txt') - self._idempotent(msg, text) - - def test_nested_multipart_mixeds(self): - msg, text = self._msgobj('msg_12a.txt') - self._idempotent(msg, text) - - def test_message_external_body_idempotent(self): - msg, text = self._msgobj('msg_36.txt') - self._idempotent(msg, text) - - def test_content_type(self): - eq = self.assertEquals - unless = self.failUnless - # Get a message object and reset the seek pointer for other tests - msg, text = self._msgobj('msg_05.txt') - eq(msg.get_content_type(), 'multipart/report') - # Test the Content-Type: parameters - params = {} - for pk, pv in msg.get_params(): - params[pk] = pv - eq(params['report-type'], 'delivery-status') - eq(params['boundary'], 'D1690A7AC1.996856090/mail.example.com') - eq(msg.preamble, 'This is a MIME-encapsulated message.\n') - eq(msg.epilogue, '\n') - eq(len(msg.get_payload()), 3) - # Make sure the subparts are what we expect - msg1 = msg.get_payload(0) - eq(msg1.get_content_type(), 'text/plain') - eq(msg1.get_payload(), 'Yadda yadda yadda\n') - msg2 = msg.get_payload(1) - eq(msg2.get_content_type(), 'text/plain') - eq(msg2.get_payload(), 'Yadda yadda yadda\n') - msg3 = msg.get_payload(2) - eq(msg3.get_content_type(), 'message/rfc822') - self.failUnless(isinstance(msg3, Message)) - payload = msg3.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - msg4 = payload[0] - unless(isinstance(msg4, Message)) - eq(msg4.get_payload(), 'Yadda yadda yadda\n') - - def test_parser(self): - eq = self.assertEquals - unless = self.failUnless - msg, text = self._msgobj('msg_06.txt') - # Check some of the outer headers - eq(msg.get_content_type(), 'message/rfc822') - # Make sure the payload is a list of exactly one sub-Message, and that - # that submessage has a type of text/plain - payload = msg.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - msg1 = payload[0] - self.failUnless(isinstance(msg1, Message)) - eq(msg1.get_content_type(), 'text/plain') - self.failUnless(isinstance(msg1.get_payload(), str)) - eq(msg1.get_payload(), '\n') - - - -# Test various other bits of the package's functionality -class TestMiscellaneous(TestEmailBase): - def test_message_from_string(self): - fp = openfile('msg_01.txt') - try: - text = fp.read() - finally: - fp.close() - msg = email.message_from_string(text) - s = StringIO() - # Don't wrap/continue long headers since we're trying to test - # idempotency. - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - self.assertEqual(text, s.getvalue()) - - def test_message_from_file(self): - fp = openfile('msg_01.txt') - try: - text = fp.read() - fp.seek(0) - msg = email.message_from_file(fp) - s = StringIO() - # Don't wrap/continue long headers since we're trying to test - # idempotency. - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - self.assertEqual(text, s.getvalue()) - finally: - fp.close() - - def test_message_from_string_with_class(self): - unless = self.failUnless - fp = openfile('msg_01.txt') - try: - text = fp.read() - finally: - fp.close() - # Create a subclass - class MyMessage(Message): - pass - - msg = email.message_from_string(text, MyMessage) - unless(isinstance(msg, MyMessage)) - # Try something more complicated - fp = openfile('msg_02.txt') - try: - text = fp.read() - finally: - fp.close() - msg = email.message_from_string(text, MyMessage) - for subpart in msg.walk(): - unless(isinstance(subpart, MyMessage)) - - def test_message_from_file_with_class(self): - unless = self.failUnless - # Create a subclass - class MyMessage(Message): - pass - - fp = openfile('msg_01.txt') - try: - msg = email.message_from_file(fp, MyMessage) - finally: - fp.close() - unless(isinstance(msg, MyMessage)) - # Try something more complicated - fp = openfile('msg_02.txt') - try: - msg = email.message_from_file(fp, MyMessage) - finally: - fp.close() - for subpart in msg.walk(): - unless(isinstance(subpart, MyMessage)) - - def test__all__(self): - module = __import__('email') - all = module.__all__ - all.sort() - self.assertEqual(all, [ - # Old names - 'Charset', 'Encoders', 'Errors', 'Generator', - 'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', - 'MIMEImage', 'MIMEMessage', 'MIMEMultipart', - 'MIMENonMultipart', 'MIMEText', 'Message', - 'Parser', 'Utils', 'base64MIME', - # new names - 'base64mime', 'charset', 'encoders', 'errors', 'generator', - 'header', 'iterators', 'message', 'message_from_file', - 'message_from_string', 'mime', 'parser', - 'quopriMIME', 'quoprimime', 'utils', - ]) - - def test_formatdate(self): - now = time.time() - self.assertEqual(Utils.parsedate(Utils.formatdate(now))[:6], - time.gmtime(now)[:6]) - - def test_formatdate_localtime(self): - now = time.time() - self.assertEqual( - Utils.parsedate(Utils.formatdate(now, localtime=True))[:6], - time.localtime(now)[:6]) - - def test_formatdate_usegmt(self): - now = time.time() - self.assertEqual( - Utils.formatdate(now, localtime=False), - time.strftime('%a, %d %b %Y %H:%M:%S -0000', time.gmtime(now))) - self.assertEqual( - Utils.formatdate(now, localtime=False, usegmt=True), - time.strftime('%a, %d %b %Y %H:%M:%S GMT', time.gmtime(now))) - - def test_parsedate_none(self): - self.assertEqual(Utils.parsedate(''), None) - - def test_parsedate_compact(self): - # The FWS after the comma is optional - self.assertEqual(Utils.parsedate('Wed,3 Apr 2002 14:58:26 +0800'), - Utils.parsedate('Wed, 3 Apr 2002 14:58:26 +0800')) - - def test_parsedate_no_dayofweek(self): - eq = self.assertEqual - eq(Utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'), - (2003, 2, 25, 13, 47, 26, 0, 1, -1, -28800)) - - def test_parsedate_compact_no_dayofweek(self): - eq = self.assertEqual - eq(Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'), - (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800)) - - def test_parsedate_acceptable_to_time_functions(self): - eq = self.assertEqual - timetup = Utils.parsedate('5 Feb 2003 13:47:26 -0800') - t = int(time.mktime(timetup)) - eq(time.localtime(t)[:6], timetup[:6]) - eq(int(time.strftime('%Y', timetup)), 2003) - timetup = Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800') - t = int(time.mktime(timetup[:9])) - eq(time.localtime(t)[:6], timetup[:6]) - eq(int(time.strftime('%Y', timetup[:9])), 2003) - - def test_parseaddr_empty(self): - self.assertEqual(Utils.parseaddr('<>'), ('', '')) - self.assertEqual(Utils.formataddr(Utils.parseaddr('<>')), '') - - def test_noquote_dump(self): - self.assertEqual( - Utils.formataddr(('A Silly Person', 'person@dom.ain')), - 'A Silly Person ') - - def test_escape_dump(self): - self.assertEqual( - Utils.formataddr(('A (Very) Silly Person', 'person@dom.ain')), - r'"A \(Very\) Silly Person" ') - a = r'A \(Special\) Person' - b = 'person@dom.ain' - self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b)) - - def test_escape_backslashes(self): - self.assertEqual( - Utils.formataddr(('Arthur \Backslash\ Foobar', 'person@dom.ain')), - r'"Arthur \\Backslash\\ Foobar" ') - a = r'Arthur \Backslash\ Foobar' - b = 'person@dom.ain' - self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b)) - - def test_name_with_dot(self): - x = 'John X. Doe ' - y = '"John X. Doe" ' - a, b = ('John X. Doe', 'jxd@example.com') - self.assertEqual(Utils.parseaddr(x), (a, b)) - self.assertEqual(Utils.parseaddr(y), (a, b)) - # formataddr() quotes the name if there's a dot in it - self.assertEqual(Utils.formataddr((a, b)), y) - - def test_multiline_from_comment(self): - x = """\ -Foo -\tBar """ - self.assertEqual(Utils.parseaddr(x), ('Foo Bar', 'foo@example.com')) - - def test_quote_dump(self): - self.assertEqual( - Utils.formataddr(('A Silly; Person', 'person@dom.ain')), - r'"A Silly; Person" ') - - def test_fix_eols(self): - eq = self.assertEqual - eq(Utils.fix_eols('hello'), 'hello') - eq(Utils.fix_eols('hello\n'), 'hello\r\n') - eq(Utils.fix_eols('hello\r'), 'hello\r\n') - eq(Utils.fix_eols('hello\r\n'), 'hello\r\n') - eq(Utils.fix_eols('hello\n\r'), 'hello\r\n\r\n') - - def test_charset_richcomparisons(self): - eq = self.assertEqual - ne = self.failIfEqual - cset1 = Charset() - cset2 = Charset() - eq(cset1, 'us-ascii') - eq(cset1, 'US-ASCII') - eq(cset1, 'Us-AsCiI') - eq('us-ascii', cset1) - eq('US-ASCII', cset1) - eq('Us-AsCiI', cset1) - ne(cset1, 'usascii') - ne(cset1, 'USASCII') - ne(cset1, 'UsAsCiI') - ne('usascii', cset1) - ne('USASCII', cset1) - ne('UsAsCiI', cset1) - eq(cset1, cset2) - eq(cset2, cset1) - - def test_getaddresses(self): - eq = self.assertEqual - eq(Utils.getaddresses(['aperson@dom.ain (Al Person)', - 'Bud Person ']), - [('Al Person', 'aperson@dom.ain'), - ('Bud Person', 'bperson@dom.ain')]) - - def test_getaddresses_nasty(self): - eq = self.assertEqual - eq(Utils.getaddresses(['foo: ;']), [('', '')]) - eq(Utils.getaddresses( - ['[]*-- =~$']), - [('', ''), ('', ''), ('', '*--')]) - eq(Utils.getaddresses( - ['foo: ;', '"Jason R. Mastaler" ']), - [('', ''), ('Jason R. Mastaler', 'jason@dom.ain')]) - - def test_getaddresses_embedded_comment(self): - """Test proper handling of a nested comment""" - eq = self.assertEqual - addrs = Utils.getaddresses(['User ((nested comment)) ']) - eq(addrs[0][1], 'foo@bar.com') - - def test_utils_quote_unquote(self): - eq = self.assertEqual - msg = Message() - msg.add_header('content-disposition', 'attachment', - filename='foo\\wacky"name') - eq(msg.get_filename(), 'foo\\wacky"name') - - def test_get_body_encoding_with_bogus_charset(self): - charset = Charset('not a charset') - self.assertEqual(charset.get_body_encoding(), 'base64') - - def test_get_body_encoding_with_uppercase_charset(self): - eq = self.assertEqual - msg = Message() - msg['Content-Type'] = 'text/plain; charset=UTF-8' - eq(msg['content-type'], 'text/plain; charset=UTF-8') - charsets = msg.get_charsets() - eq(len(charsets), 1) - eq(charsets[0], 'utf-8') - charset = Charset(charsets[0]) - eq(charset.get_body_encoding(), 'base64') - msg.set_payload('hello world', charset=charset) - eq(msg.get_payload(), 'aGVsbG8gd29ybGQ=\n') - eq(msg.get_payload(decode=True), 'hello world') - eq(msg['content-transfer-encoding'], 'base64') - # Try another one - msg = Message() - msg['Content-Type'] = 'text/plain; charset="US-ASCII"' - charsets = msg.get_charsets() - eq(len(charsets), 1) - eq(charsets[0], 'us-ascii') - charset = Charset(charsets[0]) - eq(charset.get_body_encoding(), Encoders.encode_7or8bit) - msg.set_payload('hello world', charset=charset) - eq(msg.get_payload(), 'hello world') - eq(msg['content-transfer-encoding'], '7bit') - - def test_charsets_case_insensitive(self): - lc = Charset('us-ascii') - uc = Charset('US-ASCII') - self.assertEqual(lc.get_body_encoding(), uc.get_body_encoding()) - - def test_partial_falls_inside_message_delivery_status(self): - eq = self.ndiffAssertEqual - # The Parser interface provides chunks of data to FeedParser in 8192 - # byte gulps. SF bug #1076485 found one of those chunks inside - # message/delivery-status header block, which triggered an - # unreadline() of NeedMoreData. - msg = self._msgobj('msg_43.txt') - sfp = StringIO() - Iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/report - text/plain - message/delivery-status - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/rfc822-headers -""") - - - -# Test the iterator/generators -class TestIterators(TestEmailBase): - def test_body_line_iterator(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - # First a simple non-multipart message - msg = self._msgobj('msg_01.txt') - it = Iterators.body_line_iterator(msg) - lines = list(it) - eq(len(lines), 6) - neq(EMPTYSTRING.join(lines), msg.get_payload()) - # Now a more complicated multipart - msg = self._msgobj('msg_02.txt') - it = Iterators.body_line_iterator(msg) - lines = list(it) - eq(len(lines), 43) - fp = openfile('msg_19.txt') - try: - neq(EMPTYSTRING.join(lines), fp.read()) - finally: - fp.close() - - def test_typed_subpart_iterator(self): - eq = self.assertEqual - msg = self._msgobj('msg_04.txt') - it = Iterators.typed_subpart_iterator(msg, 'text') - lines = [] - subparts = 0 - for subpart in it: - subparts += 1 - lines.append(subpart.get_payload()) - eq(subparts, 2) - eq(EMPTYSTRING.join(lines), """\ -a simple kind of mirror -to reflect upon our own -a simple kind of mirror -to reflect upon our own -""") - - def test_typed_subpart_iterator_default_type(self): - eq = self.assertEqual - msg = self._msgobj('msg_03.txt') - it = Iterators.typed_subpart_iterator(msg, 'text', 'plain') - lines = [] - subparts = 0 - for subpart in it: - subparts += 1 - lines.append(subpart.get_payload()) - eq(subparts, 1) - eq(EMPTYSTRING.join(lines), """\ - -Hi, - -Do you like this message? - --Me -""") - - - -class TestParsers(TestEmailBase): - def test_header_parser(self): - eq = self.assertEqual - # Parse only the headers of a complex multipart MIME document - fp = openfile('msg_02.txt') - try: - msg = HeaderParser().parse(fp) - finally: - fp.close() - eq(msg['from'], 'ppp-request@zzz.org') - eq(msg['to'], 'ppp@zzz.org') - eq(msg.get_content_type(), 'multipart/mixed') - self.failIf(msg.is_multipart()) - self.failUnless(isinstance(msg.get_payload(), str)) - - def test_whitespace_continuation(self): - eq = self.assertEqual - # This message contains a line after the Subject: header that has only - # whitespace, but it is not empty! - msg = email.message_from_string("""\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: the next line has a space on it -\x20 -Date: Mon, 8 Apr 2002 15:09:19 -0400 -Message-ID: spam - -Here's the message body -""") - eq(msg['subject'], 'the next line has a space on it\n ') - eq(msg['message-id'], 'spam') - eq(msg.get_payload(), "Here's the message body\n") - - def test_whitespace_continuation_last_header(self): - eq = self.assertEqual - # Like the previous test, but the subject line is the last - # header. - msg = email.message_from_string("""\ -From: aperson@dom.ain -To: bperson@dom.ain -Date: Mon, 8 Apr 2002 15:09:19 -0400 -Message-ID: spam -Subject: the next line has a space on it -\x20 - -Here's the message body -""") - eq(msg['subject'], 'the next line has a space on it\n ') - eq(msg['message-id'], 'spam') - eq(msg.get_payload(), "Here's the message body\n") - - def test_crlf_separation(self): - eq = self.assertEqual - fp = openfile('msg_26.txt', mode='rb') - try: - msg = Parser().parse(fp) - finally: - fp.close() - eq(len(msg.get_payload()), 2) - part1 = msg.get_payload(0) - eq(part1.get_content_type(), 'text/plain') - eq(part1.get_payload(), 'Simple email with attachment.\r\n\r\n') - part2 = msg.get_payload(1) - eq(part2.get_content_type(), 'application/riscos') - - def test_multipart_digest_with_extra_mime_headers(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - fp = openfile('msg_28.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - # Structure is: - # multipart/digest - # message/rfc822 - # text/plain - # message/rfc822 - # text/plain - eq(msg.is_multipart(), 1) - eq(len(msg.get_payload()), 2) - part1 = msg.get_payload(0) - eq(part1.get_content_type(), 'message/rfc822') - eq(part1.is_multipart(), 1) - eq(len(part1.get_payload()), 1) - part1a = part1.get_payload(0) - eq(part1a.is_multipart(), 0) - eq(part1a.get_content_type(), 'text/plain') - neq(part1a.get_payload(), 'message 1\n') - # next message/rfc822 - part2 = msg.get_payload(1) - eq(part2.get_content_type(), 'message/rfc822') - eq(part2.is_multipart(), 1) - eq(len(part2.get_payload()), 1) - part2a = part2.get_payload(0) - eq(part2a.is_multipart(), 0) - eq(part2a.get_content_type(), 'text/plain') - neq(part2a.get_payload(), 'message 2\n') - - def test_three_lines(self): - # A bug report by Andrew McNamara - lines = ['From: Andrew Person From', 'From']) - eq(msg.get_payload(), 'body') - - def test_rfc2822_space_not_allowed_in_header(self): - eq = self.assertEqual - m = '>From foo@example.com 11:25:53\nFrom: bar\n!"#QUX;~: zoo\n\nbody' - msg = email.message_from_string(m) - eq(len(msg.keys()), 0) - - def test_rfc2822_one_character_header(self): - eq = self.assertEqual - m = 'A: first header\nB: second header\nCC: third header\n\nbody' - msg = email.message_from_string(m) - headers = msg.keys() - headers.sort() - eq(headers, ['A', 'B', 'CC']) - eq(msg.get_payload(), 'body') - - - -class TestBase64(unittest.TestCase): - def test_len(self): - eq = self.assertEqual - eq(base64MIME.base64_len('hello'), - len(base64MIME.encode('hello', eol=''))) - for size in range(15): - if size == 0 : bsize = 0 - elif size <= 3 : bsize = 4 - elif size <= 6 : bsize = 8 - elif size <= 9 : bsize = 12 - elif size <= 12: bsize = 16 - else : bsize = 20 - eq(base64MIME.base64_len('x'*size), bsize) - - def test_decode(self): - eq = self.assertEqual - eq(base64MIME.decode(''), '') - eq(base64MIME.decode('aGVsbG8='), 'hello') - eq(base64MIME.decode('aGVsbG8=', 'X'), 'hello') - eq(base64MIME.decode('aGVsbG8NCndvcmxk\n', 'X'), 'helloXworld') - - def test_encode(self): - eq = self.assertEqual - eq(base64MIME.encode(''), '') - eq(base64MIME.encode('hello'), 'aGVsbG8=\n') - # Test the binary flag - eq(base64MIME.encode('hello\n'), 'aGVsbG8K\n') - eq(base64MIME.encode('hello\n', 0), 'aGVsbG8NCg==\n') - # Test the maxlinelen arg - eq(base64MIME.encode('xxxx ' * 20, maxlinelen=40), """\ -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IA== -""") - # Test the eol argument - eq(base64MIME.encode('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IA==\r -""") - - def test_header_encode(self): - eq = self.assertEqual - he = base64MIME.header_encode - eq(he('hello'), '=?iso-8859-1?b?aGVsbG8=?=') - eq(he('hello\nworld'), '=?iso-8859-1?b?aGVsbG8NCndvcmxk?=') - # Test the charset option - eq(he('hello', charset='iso-8859-2'), '=?iso-8859-2?b?aGVsbG8=?=') - # Test the keep_eols flag - eq(he('hello\nworld', keep_eols=True), - '=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=') - # Test the maxlinelen argument - eq(he('xxxx ' * 20, maxlinelen=40), """\ -=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?= - =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?= - =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?= - =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?= - =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?= - =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=""") - # Test the eol argument - eq(he('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?=\r - =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?=\r - =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?=\r - =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?=\r - =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?=\r - =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=""") - - - -class TestQuopri(unittest.TestCase): - def setUp(self): - self.hlit = [chr(x) for x in range(ord('a'), ord('z')+1)] + \ - [chr(x) for x in range(ord('A'), ord('Z')+1)] + \ - [chr(x) for x in range(ord('0'), ord('9')+1)] + \ - ['!', '*', '+', '-', '/', ' '] - self.hnon = [chr(x) for x in range(256) if chr(x) not in self.hlit] - assert len(self.hlit) + len(self.hnon) == 256 - self.blit = [chr(x) for x in range(ord(' '), ord('~')+1)] + ['\t'] - self.blit.remove('=') - self.bnon = [chr(x) for x in range(256) if chr(x) not in self.blit] - assert len(self.blit) + len(self.bnon) == 256 - - def test_header_quopri_check(self): - for c in self.hlit: - self.failIf(quopriMIME.header_quopri_check(c)) - for c in self.hnon: - self.failUnless(quopriMIME.header_quopri_check(c)) - - def test_body_quopri_check(self): - for c in self.blit: - self.failIf(quopriMIME.body_quopri_check(c)) - for c in self.bnon: - self.failUnless(quopriMIME.body_quopri_check(c)) - - def test_header_quopri_len(self): - eq = self.assertEqual - hql = quopriMIME.header_quopri_len - enc = quopriMIME.header_encode - for s in ('hello', 'h@e@l@l@o@'): - # Empty charset and no line-endings. 7 == RFC chrome - eq(hql(s), len(enc(s, charset='', eol=''))-7) - for c in self.hlit: - eq(hql(c), 1) - for c in self.hnon: - eq(hql(c), 3) - - def test_body_quopri_len(self): - eq = self.assertEqual - bql = quopriMIME.body_quopri_len - for c in self.blit: - eq(bql(c), 1) - for c in self.bnon: - eq(bql(c), 3) - - def test_quote_unquote_idempotent(self): - for x in range(256): - c = chr(x) - self.assertEqual(quopriMIME.unquote(quopriMIME.quote(c)), c) - - def test_header_encode(self): - eq = self.assertEqual - he = quopriMIME.header_encode - eq(he('hello'), '=?iso-8859-1?q?hello?=') - eq(he('hello\nworld'), '=?iso-8859-1?q?hello=0D=0Aworld?=') - # Test the charset option - eq(he('hello', charset='iso-8859-2'), '=?iso-8859-2?q?hello?=') - # Test the keep_eols flag - eq(he('hello\nworld', keep_eols=True), '=?iso-8859-1?q?hello=0Aworld?=') - # Test a non-ASCII character - eq(he('hello\xc7there'), '=?iso-8859-1?q?hello=C7there?=') - # Test the maxlinelen argument - eq(he('xxxx ' * 20, maxlinelen=40), """\ -=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?= - =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?= - =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?= - =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?= - =?iso-8859-1?q?x_xxxx_xxxx_?=""") - # Test the eol argument - eq(he('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?=\r - =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?=\r - =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?=\r - =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?=\r - =?iso-8859-1?q?x_xxxx_xxxx_?=""") - - def test_decode(self): - eq = self.assertEqual - eq(quopriMIME.decode(''), '') - eq(quopriMIME.decode('hello'), 'hello') - eq(quopriMIME.decode('hello', 'X'), 'hello') - eq(quopriMIME.decode('hello\nworld', 'X'), 'helloXworld') - - def test_encode(self): - eq = self.assertEqual - eq(quopriMIME.encode(''), '') - eq(quopriMIME.encode('hello'), 'hello') - # Test the binary flag - eq(quopriMIME.encode('hello\r\nworld'), 'hello\nworld') - eq(quopriMIME.encode('hello\r\nworld', 0), 'hello\nworld') - # Test the maxlinelen arg - eq(quopriMIME.encode('xxxx ' * 20, maxlinelen=40), """\ -xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx= - xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx= -x xxxx xxxx xxxx xxxx=20""") - # Test the eol argument - eq(quopriMIME.encode('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=\r - xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=\r -x xxxx xxxx xxxx xxxx=20""") - eq(quopriMIME.encode("""\ -one line - -two line"""), """\ -one line - -two line""") - - - -# Test the Charset class -class TestCharset(unittest.TestCase): - def tearDown(self): - from email import Charset as CharsetModule - try: - del CharsetModule.CHARSETS['fake'] - except KeyError: - pass - - def test_idempotent(self): - eq = self.assertEqual - # Make sure us-ascii = no Unicode conversion - c = Charset('us-ascii') - s = 'Hello World!' - sp = c.to_splittable(s) - eq(s, c.from_splittable(sp)) - # test 8-bit idempotency with us-ascii - s = '\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa' - sp = c.to_splittable(s) - eq(s, c.from_splittable(sp)) - - def test_body_encode(self): - eq = self.assertEqual - # Try a charset with QP body encoding - c = Charset('iso-8859-1') - eq('hello w=F6rld', c.body_encode('hello w\xf6rld')) - # Try a charset with Base64 body encoding - c = Charset('utf-8') - eq('aGVsbG8gd29ybGQ=\n', c.body_encode('hello world')) - # Try a charset with None body encoding - c = Charset('us-ascii') - eq('hello world', c.body_encode('hello world')) - # Try the convert argument, where input codec <> output codec - c = Charset('euc-jp') - # With apologies to Tokio Kikuchi ;) - try: - eq('\x1b$B5FCO;~IW\x1b(B', - c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7')) - eq('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', - c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', False)) - except LookupError: - # We probably don't have the Japanese codecs installed - pass - # Testing SF bug #625509, which we have to fake, since there are no - # built-in encodings where the header encoding is QP but the body - # encoding is not. - from email import Charset as CharsetModule - CharsetModule.add_charset('fake', CharsetModule.QP, None) - c = Charset('fake') - eq('hello w\xf6rld', c.body_encode('hello w\xf6rld')) - - def test_unicode_charset_name(self): - charset = Charset(u'us-ascii') - self.assertEqual(str(charset), 'us-ascii') - self.assertRaises(Errors.CharsetError, Charset, 'asc\xffii') - - - -# Test multilingual MIME headers. -class TestHeader(TestEmailBase): - def test_simple(self): - eq = self.ndiffAssertEqual - h = Header('Hello World!') - eq(h.encode(), 'Hello World!') - h.append(' Goodbye World!') - eq(h.encode(), 'Hello World! Goodbye World!') - - def test_simple_surprise(self): - eq = self.ndiffAssertEqual - h = Header('Hello World!') - eq(h.encode(), 'Hello World!') - h.append('Goodbye World!') - eq(h.encode(), 'Hello World! Goodbye World!') - - def test_header_needs_no_decoding(self): - h = 'no decoding needed' - self.assertEqual(decode_header(h), [(h, None)]) - - def test_long(self): - h = Header("I am the very model of a modern Major-General; I've information vegetable, animal, and mineral; I know the kings of England, and I quote the fights historical from Marathon to Waterloo, in order categorical; I'm very well acquainted, too, with matters mathematical; I understand equations, both the simple and quadratical; about binomial theorem I'm teeming with a lot o' news, with many cheerful facts about the square of the hypotenuse.", - maxlinelen=76) - for l in h.encode(splitchars=' ').split('\n '): - self.failUnless(len(l) <= 76) - - def test_multilingual(self): - eq = self.ndiffAssertEqual - g = Charset("iso-8859-1") - cz = Charset("iso-8859-2") - utf8 = Charset("utf-8") - g_head = "Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s\xfcdl\xfcndischen Wandgem\xe4lden vorbei, gegen die rotierenden Klingen bef\xf6rdert. " - cz_head = "Finan\xe8ni metropole se hroutily pod tlakem jejich d\xf9vtipu.. " - utf8_head = u"\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.\u300d\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002".encode("utf-8") - h = Header(g_head, g) - h.append(cz_head, cz) - h.append(utf8_head, utf8) - enc = h.encode() - eq(enc, """\ -=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerderband_ko?= - =?iso-8859-1?q?mfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndischen_Wan?= - =?iso-8859-1?q?dgem=E4lden_vorbei=2C_gegen_die_rotierenden_Klingen_bef=F6?= - =?iso-8859-1?q?rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se_hroutily?= - =?iso-8859-2?q?_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= =?utf-8?b?5q2j56K6?= - =?utf-8?b?44Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb44KT44CC?= - =?utf-8?b?5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go44Gv44Gn?= - =?utf-8?b?44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGFz?= - =?utf-8?q?_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das_Oder_die_Fl?= - =?utf-8?b?aXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBo+OBpuOBhOOBvuOBmQ==?= - =?utf-8?b?44CC?=""") - eq(decode_header(enc), - [(g_head, "iso-8859-1"), (cz_head, "iso-8859-2"), - (utf8_head, "utf-8")]) - ustr = unicode(h) - eq(ustr.encode('utf-8'), - 'Die Mieter treten hier ein werden mit einem Foerderband ' - 'komfortabel den Korridor entlang, an s\xc3\xbcdl\xc3\xbcndischen ' - 'Wandgem\xc3\xa4lden vorbei, gegen die rotierenden Klingen ' - 'bef\xc3\xb6rdert. Finan\xc4\x8dni metropole se hroutily pod ' - 'tlakem jejich d\xc5\xafvtipu.. \xe6\xad\xa3\xe7\xa2\xba\xe3\x81' - '\xab\xe8\xa8\x80\xe3\x81\x86\xe3\x81\xa8\xe7\xbf\xbb\xe8\xa8\xb3' - '\xe3\x81\xaf\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3' - '\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\xe4\xb8\x80\xe9\x83' - '\xa8\xe3\x81\xaf\xe3\x83\x89\xe3\x82\xa4\xe3\x83\x84\xe8\xaa\x9e' - '\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\xe3\x81\x82\xe3' - '\x81\xa8\xe3\x81\xaf\xe3\x81\xa7\xe3\x81\x9f\xe3\x82\x89\xe3\x82' - '\x81\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\xe5\xae\x9f\xe9\x9a\x9b' - '\xe3\x81\xab\xe3\x81\xaf\xe3\x80\x8cWenn ist das Nunstuck git ' - 'und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt ' - 'gersput.\xe3\x80\x8d\xe3\x81\xa8\xe8\xa8\x80\xe3\x81\xa3\xe3\x81' - '\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82') - # Test make_header() - newh = make_header(decode_header(enc)) - eq(newh, enc) - - def test_header_ctor_default_args(self): - eq = self.ndiffAssertEqual - h = Header() - eq(h, '') - h.append('foo', Charset('iso-8859-1')) - eq(h, '=?iso-8859-1?q?foo?=') - - def test_explicit_maxlinelen(self): - eq = self.ndiffAssertEqual - hstr = 'A very long line that must get split to something other than at the 76th character boundary to test the non-default behavior' - h = Header(hstr) - eq(h.encode(), '''\ -A very long line that must get split to something other than at the 76th - character boundary to test the non-default behavior''') - h = Header(hstr, header_name='Subject') - eq(h.encode(), '''\ -A very long line that must get split to something other than at the - 76th character boundary to test the non-default behavior''') - h = Header(hstr, maxlinelen=1024, header_name='Subject') - eq(h.encode(), hstr) - - def test_us_ascii_header(self): - eq = self.assertEqual - s = 'hello' - x = decode_header(s) - eq(x, [('hello', None)]) - h = make_header(x) - eq(s, h.encode()) - - def test_string_charset(self): - eq = self.assertEqual - h = Header() - h.append('hello', 'iso-8859-1') - eq(h, '=?iso-8859-1?q?hello?=') - -## def test_unicode_error(self): -## raises = self.assertRaises -## raises(UnicodeError, Header, u'[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, Header, '[P\xf6stal]', 'us-ascii') -## h = Header() -## raises(UnicodeError, h.append, u'[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, h.append, '[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, Header, u'\u83ca\u5730\u6642\u592b', 'iso-8859-1') - - def test_utf8_shortest(self): - eq = self.assertEqual - h = Header(u'p\xf6stal', 'utf-8') - eq(h.encode(), '=?utf-8?q?p=C3=B6stal?=') - h = Header(u'\u83ca\u5730\u6642\u592b', 'utf-8') - eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=') - - def test_bad_8bit_header(self): - raises = self.assertRaises - eq = self.assertEqual - x = 'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big' - raises(UnicodeError, Header, x) - h = Header() - raises(UnicodeError, h.append, x) - eq(str(Header(x, errors='replace')), x) - h.append(x, errors='replace') - eq(str(h), x) - - def test_encoded_adjacent_nonencoded(self): - eq = self.assertEqual - h = Header() - h.append('hello', 'iso-8859-1') - h.append('world') - s = h.encode() - eq(s, '=?iso-8859-1?q?hello?= world') - h = make_header(decode_header(s)) - eq(h.encode(), s) - - def test_whitespace_eater(self): - eq = self.assertEqual - s = 'Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztk=?= =?koi8-r?q?=CA?= zz.' - parts = decode_header(s) - eq(parts, [('Subject:', None), ('\xf0\xd2\xcf\xd7\xc5\xd2\xcb\xc1 \xce\xc1 \xc6\xc9\xce\xc1\xcc\xd8\xce\xd9\xca', 'koi8-r'), ('zz.', None)]) - hdr = make_header(parts) - eq(hdr.encode(), - 'Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztnK?= zz.') - - def test_broken_base64_header(self): - raises = self.assertRaises - s = 'Subject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3IQ?=' - raises(Errors.HeaderParseError, decode_header, s) - - - -# Test RFC 2231 header parameters (en/de)coding -class TestRFC2231(TestEmailBase): - def test_get_param(self): - eq = self.assertEqual - msg = self._msgobj('msg_29.txt') - eq(msg.get_param('title'), - ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) - eq(msg.get_param('title', unquote=False), - ('us-ascii', 'en', '"This is even more ***fun*** isn\'t it!"')) - - def test_set_param(self): - eq = self.assertEqual - msg = Message() - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii') - eq(msg.get_param('title'), - ('us-ascii', '', 'This is even more ***fun*** isn\'t it!')) - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - eq(msg.get_param('title'), - ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) - msg = self._msgobj('msg_01.txt') - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - eq(msg.as_string(), """\ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) -\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 -Content-Type: text/plain; charset=us-ascii; -\ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21" - - -Hi, - -Do you like this message? - --Me -""") - - def test_del_param(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_01.txt') - msg.set_param('foo', 'bar', charset='us-ascii', language='en') - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - msg.del_param('foo', header='Content-Type') - eq(msg.as_string(), """\ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) -\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 -Content-Type: text/plain; charset="us-ascii"; -\ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21" - - -Hi, - -Do you like this message? - --Me -""") - - def test_rfc2231_get_content_charset(self): - eq = self.assertEqual - msg = self._msgobj('msg_32.txt') - eq(msg.get_content_charset(), 'us-ascii') - - def test_rfc2231_no_language_or_charset(self): - m = '''\ -Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename="file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm" -Content-Type: text/html; NAME*0=file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEM; NAME*1=P_nsmail.htm - -''' - msg = email.message_from_string(m) - param = msg.get_param('NAME') - self.failIf(isinstance(param, tuple)) - self.assertEqual( - param, - 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm') - - def test_rfc2231_no_language_or_charset_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_filename_encoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_partly_encoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual( - msg.get_filename(), - 'This%20is%20even%20more%20***fun*** is it not.pdf') - - def test_rfc2231_partly_nonencoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0="This%20is%20even%20more%20"; -\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual( - msg.get_filename(), - 'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_boundary(self): - m = '''\ -Content-Type: multipart/alternative; -\tboundary*0*="''This%20is%20even%20more%20"; -\tboundary*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tboundary*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_boundary(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_charset(self): - # This is a nonsensical charset value, but tests the code anyway - m = '''\ -Content-Type: text/plain; -\tcharset*0*="This%20is%20even%20more%20"; -\tcharset*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tcharset*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_content_charset(), - 'this is even more ***fun*** is it not.pdf') - - def test_rfc2231_bad_encoding_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="bogus'xx'This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_bad_encoding_in_charset(self): - m = """\ -Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D - -""" - msg = email.message_from_string(m) - # This should return None because non-ascii characters in the charset - # are not allowed. - self.assertEqual(msg.get_content_charset(), None) - - def test_rfc2231_bad_character_in_charset(self): - m = """\ -Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D - -""" - msg = email.message_from_string(m) - # This should return None because non-ascii characters in the charset - # are not allowed. - self.assertEqual(msg.get_content_charset(), None) - - def test_rfc2231_bad_character_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="ascii'xx'This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2*="is it not.pdf%E2" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - u'This is even more ***fun*** is it not.pdf\ufffd') - - def test_rfc2231_unknown_encoding(self): - m = """\ -Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt - -""" - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), 'myfile.txt') - - def test_rfc2231_single_tick_in_filename_extended(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"Frank's\"; name*1*=\" Document\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, None) - eq(language, None) - eq(s, "Frank's Document") - - def test_rfc2231_single_tick_in_filename(self): - m = """\ -Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\" - -""" - msg = email.message_from_string(m) - param = msg.get_param('name') - self.failIf(isinstance(param, tuple)) - self.assertEqual(param, "Frank's Document") - - def test_rfc2231_tick_attack_extended(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"us-ascii'en-us'Frank's\"; name*1*=\" Document\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, "Frank's Document") - - def test_rfc2231_tick_attack(self): - m = """\ -Content-Type: application/x-foo; -\tname*0=\"us-ascii'en-us'Frank's\"; name*1=\" Document\" - -""" - msg = email.message_from_string(m) - param = msg.get_param('name') - self.failIf(isinstance(param, tuple)) - self.assertEqual(param, "us-ascii'en-us'Frank's Document") - - def test_rfc2231_no_extended_values(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; name=\"Frank's Document\" - -""" - msg = email.message_from_string(m) - eq(msg.get_param('name'), "Frank's Document") - - def test_rfc2231_encoded_then_unencoded_segments(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"us-ascii'en-us'My\"; -\tname*1=\" Document\"; -\tname*2*=\" For You\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, 'My Document For You') - - def test_rfc2231_unencoded_then_encoded_segments(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0=\"us-ascii'en-us'My\"; -\tname*1*=\" Document\"; -\tname*2*=\" For You\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, 'My Document For You') - - - -def _testclasses(): - mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite - - -def test_main(): - for testclass in _testclasses(): - run_unittest(testclass) - - - -if __name__ == '__main__': - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/email/test/test_email_codecs.py b/sys/lib/python/email/test/test_email_codecs.py deleted file mode 100644 index 38b7d9539..000000000 --- a/sys/lib/python/email/test/test_email_codecs.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2002-2006 Python Software Foundation -# Contact: email-sig@python.org -# email package unit tests for (optional) Asian codecs - -import unittest -from test.test_support import TestSkipped, run_unittest - -from email.test.test_email import TestEmailBase -from email.Charset import Charset -from email.Header import Header, decode_header -from email.Message import Message - -# We're compatible with Python 2.3, but it doesn't have the built-in Asian -# codecs, so we have to skip all these tests. -try: - unicode('foo', 'euc-jp') -except LookupError: - raise TestSkipped - - - -class TestEmailAsianCodecs(TestEmailBase): - def test_japanese_codecs(self): - eq = self.ndiffAssertEqual - j = Charset("euc-jp") - g = Charset("iso-8859-1") - h = Header("Hello World!") - jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' - ghello = 'Gr\xfc\xdf Gott!' - h.append(jhello, j) - h.append(ghello, g) - # BAW: This used to -- and maybe should -- fold the two iso-8859-1 - # chunks into a single encoded word. However it doesn't violate the - # standard to have them as two encoded chunks and maybe it's - # reasonable for each .append() call to result in a separate - # encoded word. - eq(h.encode(), """\ -Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= - =?iso-8859-1?q?Gr=FC=DF?= =?iso-8859-1?q?_Gott!?=""") - eq(decode_header(h.encode()), - [('Hello World!', None), - ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), - ('Gr\xfc\xdf Gott!', 'iso-8859-1')]) - long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' - h = Header(long, j, header_name="Subject") - # test a very long header - enc = h.encode() - # TK: splitting point may differ by codec design and/or Header encoding - eq(enc , """\ -=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= - =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") - # TK: full decode comparison - eq(h.__unicode__().encode('euc-jp'), long) - - def test_payload_encoding(self): - jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' - jcode = 'euc-jp' - msg = Message() - msg.set_payload(jhello, jcode) - ustr = unicode(msg.get_payload(), msg.get_content_charset()) - self.assertEqual(jhello, ustr.encode(jcode)) - - - -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestEmailAsianCodecs)) - return suite - - -def test_main(): - run_unittest(TestEmailAsianCodecs) - - - -if __name__ == '__main__': - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/email/test/test_email_codecs_renamed.py b/sys/lib/python/email/test/test_email_codecs_renamed.py deleted file mode 100644 index 56baccdca..000000000 --- a/sys/lib/python/email/test/test_email_codecs_renamed.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2002-2006 Python Software Foundation -# Contact: email-sig@python.org -# email package unit tests for (optional) Asian codecs - -import unittest -from test.test_support import TestSkipped, run_unittest - -from email.test.test_email import TestEmailBase -from email.charset import Charset -from email.header import Header, decode_header -from email.message import Message - -# We're compatible with Python 2.3, but it doesn't have the built-in Asian -# codecs, so we have to skip all these tests. -try: - unicode('foo', 'euc-jp') -except LookupError: - raise TestSkipped - - - -class TestEmailAsianCodecs(TestEmailBase): - def test_japanese_codecs(self): - eq = self.ndiffAssertEqual - j = Charset("euc-jp") - g = Charset("iso-8859-1") - h = Header("Hello World!") - jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' - ghello = 'Gr\xfc\xdf Gott!' - h.append(jhello, j) - h.append(ghello, g) - # BAW: This used to -- and maybe should -- fold the two iso-8859-1 - # chunks into a single encoded word. However it doesn't violate the - # standard to have them as two encoded chunks and maybe it's - # reasonable for each .append() call to result in a separate - # encoded word. - eq(h.encode(), """\ -Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= - =?iso-8859-1?q?Gr=FC=DF?= =?iso-8859-1?q?_Gott!?=""") - eq(decode_header(h.encode()), - [('Hello World!', None), - ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), - ('Gr\xfc\xdf Gott!', 'iso-8859-1')]) - long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' - h = Header(long, j, header_name="Subject") - # test a very long header - enc = h.encode() - # TK: splitting point may differ by codec design and/or Header encoding - eq(enc , """\ -=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= - =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") - # TK: full decode comparison - eq(h.__unicode__().encode('euc-jp'), long) - - def test_payload_encoding(self): - jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' - jcode = 'euc-jp' - msg = Message() - msg.set_payload(jhello, jcode) - ustr = unicode(msg.get_payload(), msg.get_content_charset()) - self.assertEqual(jhello, ustr.encode(jcode)) - - - -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestEmailAsianCodecs)) - return suite - - -def test_main(): - run_unittest(TestEmailAsianCodecs) - - - -if __name__ == '__main__': - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/email/test/test_email_renamed.py b/sys/lib/python/email/test/test_email_renamed.py deleted file mode 100644 index 44238c78f..000000000 --- a/sys/lib/python/email/test/test_email_renamed.py +++ /dev/null @@ -1,3273 +0,0 @@ -# Copyright (C) 2001-2007 Python Software Foundation -# Contact: email-sig@python.org -# email package unit tests - -import os -import sys -import time -import base64 -import difflib -import unittest -import warnings -from cStringIO import StringIO - -import email - -from email.charset import Charset -from email.header import Header, decode_header, make_header -from email.parser import Parser, HeaderParser -from email.generator import Generator, DecodedGenerator -from email.message import Message -from email.mime.application import MIMEApplication -from email.mime.audio import MIMEAudio -from email.mime.text import MIMEText -from email.mime.image import MIMEImage -from email.mime.base import MIMEBase -from email.mime.message import MIMEMessage -from email.mime.multipart import MIMEMultipart -from email import utils -from email import errors -from email import encoders -from email import iterators -from email import base64mime -from email import quoprimime - -from test.test_support import findfile, run_unittest -from email.test import __file__ as landmark - - -NL = '\n' -EMPTYSTRING = '' -SPACE = ' ' - - - -def openfile(filename, mode='r'): - path = os.path.join(os.path.dirname(landmark), 'data', filename) - return open(path, mode) - - - -# Base test class -class TestEmailBase(unittest.TestCase): - def ndiffAssertEqual(self, first, second): - """Like failUnlessEqual except use ndiff for readable output.""" - if first <> second: - sfirst = str(first) - ssecond = str(second) - diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines()) - fp = StringIO() - print >> fp, NL, NL.join(diff) - raise self.failureException, fp.getvalue() - - def _msgobj(self, filename): - fp = openfile(findfile(filename)) - try: - msg = email.message_from_file(fp) - finally: - fp.close() - return msg - - - -# Test various aspects of the Message class's API -class TestMessageAPI(TestEmailBase): - def test_get_all(self): - eq = self.assertEqual - msg = self._msgobj('msg_20.txt') - eq(msg.get_all('cc'), ['ccc@zzz.org', 'ddd@zzz.org', 'eee@zzz.org']) - eq(msg.get_all('xx', 'n/a'), 'n/a') - - def test_getset_charset(self): - eq = self.assertEqual - msg = Message() - eq(msg.get_charset(), None) - charset = Charset('iso-8859-1') - msg.set_charset(charset) - eq(msg['mime-version'], '1.0') - eq(msg.get_content_type(), 'text/plain') - eq(msg['content-type'], 'text/plain; charset="iso-8859-1"') - eq(msg.get_param('charset'), 'iso-8859-1') - eq(msg['content-transfer-encoding'], 'quoted-printable') - eq(msg.get_charset().input_charset, 'iso-8859-1') - # Remove the charset - msg.set_charset(None) - eq(msg.get_charset(), None) - eq(msg['content-type'], 'text/plain') - # Try adding a charset when there's already MIME headers present - msg = Message() - msg['MIME-Version'] = '2.0' - msg['Content-Type'] = 'text/x-weird' - msg['Content-Transfer-Encoding'] = 'quinted-puntable' - msg.set_charset(charset) - eq(msg['mime-version'], '2.0') - eq(msg['content-type'], 'text/x-weird; charset="iso-8859-1"') - eq(msg['content-transfer-encoding'], 'quinted-puntable') - - def test_set_charset_from_string(self): - eq = self.assertEqual - msg = Message() - msg.set_charset('us-ascii') - eq(msg.get_charset().input_charset, 'us-ascii') - eq(msg['content-type'], 'text/plain; charset="us-ascii"') - - def test_set_payload_with_charset(self): - msg = Message() - charset = Charset('iso-8859-1') - msg.set_payload('This is a string payload', charset) - self.assertEqual(msg.get_charset().input_charset, 'iso-8859-1') - - def test_get_charsets(self): - eq = self.assertEqual - - msg = self._msgobj('msg_08.txt') - charsets = msg.get_charsets() - eq(charsets, [None, 'us-ascii', 'iso-8859-1', 'iso-8859-2', 'koi8-r']) - - msg = self._msgobj('msg_09.txt') - charsets = msg.get_charsets('dingbat') - eq(charsets, ['dingbat', 'us-ascii', 'iso-8859-1', 'dingbat', - 'koi8-r']) - - msg = self._msgobj('msg_12.txt') - charsets = msg.get_charsets() - eq(charsets, [None, 'us-ascii', 'iso-8859-1', None, 'iso-8859-2', - 'iso-8859-3', 'us-ascii', 'koi8-r']) - - def test_get_filename(self): - eq = self.assertEqual - - msg = self._msgobj('msg_04.txt') - filenames = [p.get_filename() for p in msg.get_payload()] - eq(filenames, ['msg.txt', 'msg.txt']) - - msg = self._msgobj('msg_07.txt') - subpart = msg.get_payload(1) - eq(subpart.get_filename(), 'dingusfish.gif') - - def test_get_filename_with_name_parameter(self): - eq = self.assertEqual - - msg = self._msgobj('msg_44.txt') - filenames = [p.get_filename() for p in msg.get_payload()] - eq(filenames, ['msg.txt', 'msg.txt']) - - def test_get_boundary(self): - eq = self.assertEqual - msg = self._msgobj('msg_07.txt') - # No quotes! - eq(msg.get_boundary(), 'BOUNDARY') - - def test_set_boundary(self): - eq = self.assertEqual - # This one has no existing boundary parameter, but the Content-Type: - # header appears fifth. - msg = self._msgobj('msg_01.txt') - msg.set_boundary('BOUNDARY') - header, value = msg.items()[4] - eq(header.lower(), 'content-type') - eq(value, 'text/plain; charset="us-ascii"; boundary="BOUNDARY"') - # This one has a Content-Type: header, with a boundary, stuck in the - # middle of its headers. Make sure the order is preserved; it should - # be fifth. - msg = self._msgobj('msg_04.txt') - msg.set_boundary('BOUNDARY') - header, value = msg.items()[4] - eq(header.lower(), 'content-type') - eq(value, 'multipart/mixed; boundary="BOUNDARY"') - # And this one has no Content-Type: header at all. - msg = self._msgobj('msg_03.txt') - self.assertRaises(errors.HeaderParseError, - msg.set_boundary, 'BOUNDARY') - - def test_get_decoded_payload(self): - eq = self.assertEqual - msg = self._msgobj('msg_10.txt') - # The outer message is a multipart - eq(msg.get_payload(decode=True), None) - # Subpart 1 is 7bit encoded - eq(msg.get_payload(0).get_payload(decode=True), - 'This is a 7bit encoded message.\n') - # Subpart 2 is quopri - eq(msg.get_payload(1).get_payload(decode=True), - '\xa1This is a Quoted Printable encoded message!\n') - # Subpart 3 is base64 - eq(msg.get_payload(2).get_payload(decode=True), - 'This is a Base64 encoded message.') - # Subpart 4 has no Content-Transfer-Encoding: header. - eq(msg.get_payload(3).get_payload(decode=True), - 'This has no Content-Transfer-Encoding: header.\n') - - def test_get_decoded_uu_payload(self): - eq = self.assertEqual - msg = Message() - msg.set_payload('begin 666 -\n+:&5L;&\\@=V]R;&0 \n \nend\n') - for cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'): - msg['content-transfer-encoding'] = cte - eq(msg.get_payload(decode=True), 'hello world') - # Now try some bogus data - msg.set_payload('foo') - eq(msg.get_payload(decode=True), 'foo') - - def test_decoded_generator(self): - eq = self.assertEqual - msg = self._msgobj('msg_07.txt') - fp = openfile('msg_17.txt') - try: - text = fp.read() - finally: - fp.close() - s = StringIO() - g = DecodedGenerator(s) - g.flatten(msg) - eq(s.getvalue(), text) - - def test__contains__(self): - msg = Message() - msg['From'] = 'Me' - msg['to'] = 'You' - # Check for case insensitivity - self.failUnless('from' in msg) - self.failUnless('From' in msg) - self.failUnless('FROM' in msg) - self.failUnless('to' in msg) - self.failUnless('To' in msg) - self.failUnless('TO' in msg) - - def test_as_string(self): - eq = self.assertEqual - msg = self._msgobj('msg_01.txt') - fp = openfile('msg_01.txt') - try: - text = fp.read() - finally: - fp.close() - eq(text, msg.as_string()) - fullrepr = str(msg) - lines = fullrepr.split('\n') - self.failUnless(lines[0].startswith('From ')) - eq(text, NL.join(lines[1:])) - - def test_bad_param(self): - msg = email.message_from_string("Content-Type: blarg; baz; boo\n") - self.assertEqual(msg.get_param('baz'), '') - - def test_missing_filename(self): - msg = email.message_from_string("From: foo\n") - self.assertEqual(msg.get_filename(), None) - - def test_bogus_filename(self): - msg = email.message_from_string( - "Content-Disposition: blarg; filename\n") - self.assertEqual(msg.get_filename(), '') - - def test_missing_boundary(self): - msg = email.message_from_string("From: foo\n") - self.assertEqual(msg.get_boundary(), None) - - def test_get_params(self): - eq = self.assertEqual - msg = email.message_from_string( - 'X-Header: foo=one; bar=two; baz=three\n') - eq(msg.get_params(header='x-header'), - [('foo', 'one'), ('bar', 'two'), ('baz', 'three')]) - msg = email.message_from_string( - 'X-Header: foo; bar=one; baz=two\n') - eq(msg.get_params(header='x-header'), - [('foo', ''), ('bar', 'one'), ('baz', 'two')]) - eq(msg.get_params(), None) - msg = email.message_from_string( - 'X-Header: foo; bar="one"; baz=two\n') - eq(msg.get_params(header='x-header'), - [('foo', ''), ('bar', 'one'), ('baz', 'two')]) - - def test_get_param_liberal(self): - msg = Message() - msg['Content-Type'] = 'Content-Type: Multipart/mixed; boundary = "CPIMSSMTPC06p5f3tG"' - self.assertEqual(msg.get_param('boundary'), 'CPIMSSMTPC06p5f3tG') - - def test_get_param(self): - eq = self.assertEqual - msg = email.message_from_string( - "X-Header: foo=one; bar=two; baz=three\n") - eq(msg.get_param('bar', header='x-header'), 'two') - eq(msg.get_param('quuz', header='x-header'), None) - eq(msg.get_param('quuz'), None) - msg = email.message_from_string( - 'X-Header: foo; bar="one"; baz=two\n') - eq(msg.get_param('foo', header='x-header'), '') - eq(msg.get_param('bar', header='x-header'), 'one') - eq(msg.get_param('baz', header='x-header'), 'two') - # XXX: We are not RFC-2045 compliant! We cannot parse: - # msg["Content-Type"] = 'text/plain; weird="hey; dolly? [you] @ <\\"home\\">?"' - # msg.get_param("weird") - # yet. - - def test_get_param_funky_continuation_lines(self): - msg = self._msgobj('msg_22.txt') - self.assertEqual(msg.get_payload(1).get_param('name'), 'wibble.JPG') - - def test_get_param_with_semis_in_quotes(self): - msg = email.message_from_string( - 'Content-Type: image/pjpeg; name="Jim&&Jill"\n') - self.assertEqual(msg.get_param('name'), 'Jim&&Jill') - self.assertEqual(msg.get_param('name', unquote=False), - '"Jim&&Jill"') - - def test_has_key(self): - msg = email.message_from_string('Header: exists') - self.failUnless(msg.has_key('header')) - self.failUnless(msg.has_key('Header')) - self.failUnless(msg.has_key('HEADER')) - self.failIf(msg.has_key('headeri')) - - def test_set_param(self): - eq = self.assertEqual - msg = Message() - msg.set_param('charset', 'iso-2022-jp') - eq(msg.get_param('charset'), 'iso-2022-jp') - msg.set_param('importance', 'high value') - eq(msg.get_param('importance'), 'high value') - eq(msg.get_param('importance', unquote=False), '"high value"') - eq(msg.get_params(), [('text/plain', ''), - ('charset', 'iso-2022-jp'), - ('importance', 'high value')]) - eq(msg.get_params(unquote=False), [('text/plain', ''), - ('charset', '"iso-2022-jp"'), - ('importance', '"high value"')]) - msg.set_param('charset', 'iso-9999-xx', header='X-Jimmy') - eq(msg.get_param('charset', header='X-Jimmy'), 'iso-9999-xx') - - def test_del_param(self): - eq = self.assertEqual - msg = self._msgobj('msg_05.txt') - eq(msg.get_params(), - [('multipart/report', ''), ('report-type', 'delivery-status'), - ('boundary', 'D1690A7AC1.996856090/mail.example.com')]) - old_val = msg.get_param("report-type") - msg.del_param("report-type") - eq(msg.get_params(), - [('multipart/report', ''), - ('boundary', 'D1690A7AC1.996856090/mail.example.com')]) - msg.set_param("report-type", old_val) - eq(msg.get_params(), - [('multipart/report', ''), - ('boundary', 'D1690A7AC1.996856090/mail.example.com'), - ('report-type', old_val)]) - - def test_del_param_on_other_header(self): - msg = Message() - msg.add_header('Content-Disposition', 'attachment', filename='bud.gif') - msg.del_param('filename', 'content-disposition') - self.assertEqual(msg['content-disposition'], 'attachment') - - def test_set_type(self): - eq = self.assertEqual - msg = Message() - self.assertRaises(ValueError, msg.set_type, 'text') - msg.set_type('text/plain') - eq(msg['content-type'], 'text/plain') - msg.set_param('charset', 'us-ascii') - eq(msg['content-type'], 'text/plain; charset="us-ascii"') - msg.set_type('text/html') - eq(msg['content-type'], 'text/html; charset="us-ascii"') - - def test_set_type_on_other_header(self): - msg = Message() - msg['X-Content-Type'] = 'text/plain' - msg.set_type('application/octet-stream', 'X-Content-Type') - self.assertEqual(msg['x-content-type'], 'application/octet-stream') - - def test_get_content_type_missing(self): - msg = Message() - self.assertEqual(msg.get_content_type(), 'text/plain') - - def test_get_content_type_missing_with_default_type(self): - msg = Message() - msg.set_default_type('message/rfc822') - self.assertEqual(msg.get_content_type(), 'message/rfc822') - - def test_get_content_type_from_message_implicit(self): - msg = self._msgobj('msg_30.txt') - self.assertEqual(msg.get_payload(0).get_content_type(), - 'message/rfc822') - - def test_get_content_type_from_message_explicit(self): - msg = self._msgobj('msg_28.txt') - self.assertEqual(msg.get_payload(0).get_content_type(), - 'message/rfc822') - - def test_get_content_type_from_message_text_plain_implicit(self): - msg = self._msgobj('msg_03.txt') - self.assertEqual(msg.get_content_type(), 'text/plain') - - def test_get_content_type_from_message_text_plain_explicit(self): - msg = self._msgobj('msg_01.txt') - self.assertEqual(msg.get_content_type(), 'text/plain') - - def test_get_content_maintype_missing(self): - msg = Message() - self.assertEqual(msg.get_content_maintype(), 'text') - - def test_get_content_maintype_missing_with_default_type(self): - msg = Message() - msg.set_default_type('message/rfc822') - self.assertEqual(msg.get_content_maintype(), 'message') - - def test_get_content_maintype_from_message_implicit(self): - msg = self._msgobj('msg_30.txt') - self.assertEqual(msg.get_payload(0).get_content_maintype(), 'message') - - def test_get_content_maintype_from_message_explicit(self): - msg = self._msgobj('msg_28.txt') - self.assertEqual(msg.get_payload(0).get_content_maintype(), 'message') - - def test_get_content_maintype_from_message_text_plain_implicit(self): - msg = self._msgobj('msg_03.txt') - self.assertEqual(msg.get_content_maintype(), 'text') - - def test_get_content_maintype_from_message_text_plain_explicit(self): - msg = self._msgobj('msg_01.txt') - self.assertEqual(msg.get_content_maintype(), 'text') - - def test_get_content_subtype_missing(self): - msg = Message() - self.assertEqual(msg.get_content_subtype(), 'plain') - - def test_get_content_subtype_missing_with_default_type(self): - msg = Message() - msg.set_default_type('message/rfc822') - self.assertEqual(msg.get_content_subtype(), 'rfc822') - - def test_get_content_subtype_from_message_implicit(self): - msg = self._msgobj('msg_30.txt') - self.assertEqual(msg.get_payload(0).get_content_subtype(), 'rfc822') - - def test_get_content_subtype_from_message_explicit(self): - msg = self._msgobj('msg_28.txt') - self.assertEqual(msg.get_payload(0).get_content_subtype(), 'rfc822') - - def test_get_content_subtype_from_message_text_plain_implicit(self): - msg = self._msgobj('msg_03.txt') - self.assertEqual(msg.get_content_subtype(), 'plain') - - def test_get_content_subtype_from_message_text_plain_explicit(self): - msg = self._msgobj('msg_01.txt') - self.assertEqual(msg.get_content_subtype(), 'plain') - - def test_get_content_maintype_error(self): - msg = Message() - msg['Content-Type'] = 'no-slash-in-this-string' - self.assertEqual(msg.get_content_maintype(), 'text') - - def test_get_content_subtype_error(self): - msg = Message() - msg['Content-Type'] = 'no-slash-in-this-string' - self.assertEqual(msg.get_content_subtype(), 'plain') - - def test_replace_header(self): - eq = self.assertEqual - msg = Message() - msg.add_header('First', 'One') - msg.add_header('Second', 'Two') - msg.add_header('Third', 'Three') - eq(msg.keys(), ['First', 'Second', 'Third']) - eq(msg.values(), ['One', 'Two', 'Three']) - msg.replace_header('Second', 'Twenty') - eq(msg.keys(), ['First', 'Second', 'Third']) - eq(msg.values(), ['One', 'Twenty', 'Three']) - msg.add_header('First', 'Eleven') - msg.replace_header('First', 'One Hundred') - eq(msg.keys(), ['First', 'Second', 'Third', 'First']) - eq(msg.values(), ['One Hundred', 'Twenty', 'Three', 'Eleven']) - self.assertRaises(KeyError, msg.replace_header, 'Fourth', 'Missing') - - def test_broken_base64_payload(self): - x = 'AwDp0P7//y6LwKEAcPa/6Q=9' - msg = Message() - msg['content-type'] = 'audio/x-midi' - msg['content-transfer-encoding'] = 'base64' - msg.set_payload(x) - self.assertEqual(msg.get_payload(decode=True), x) - - - -# Test the email.encoders module -class TestEncoders(unittest.TestCase): - def test_encode_empty_payload(self): - eq = self.assertEqual - msg = Message() - msg.set_charset('us-ascii') - eq(msg['content-transfer-encoding'], '7bit') - - def test_default_cte(self): - eq = self.assertEqual - msg = MIMEText('hello world') - eq(msg['content-transfer-encoding'], '7bit') - - def test_default_cte(self): - eq = self.assertEqual - # With no explicit _charset its us-ascii, and all are 7-bit - msg = MIMEText('hello world') - eq(msg['content-transfer-encoding'], '7bit') - # Similar, but with 8-bit data - msg = MIMEText('hello \xf8 world') - eq(msg['content-transfer-encoding'], '8bit') - # And now with a different charset - msg = MIMEText('hello \xf8 world', _charset='iso-8859-1') - eq(msg['content-transfer-encoding'], 'quoted-printable') - - - -# Test long header wrapping -class TestLongHeaders(TestEmailBase): - def test_split_long_continuation(self): - eq = self.ndiffAssertEqual - msg = email.message_from_string("""\ -Subject: bug demonstration -\t12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 -\tmore text - -test -""") - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), """\ -Subject: bug demonstration -\t12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 -\tmore text - -test -""") - - def test_another_long_almost_unsplittable_header(self): - eq = self.ndiffAssertEqual - hstr = """\ -bug demonstration -\t12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 -\tmore text""" - h = Header(hstr, continuation_ws='\t') - eq(h.encode(), """\ -bug demonstration -\t12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 -\tmore text""") - h = Header(hstr) - eq(h.encode(), """\ -bug demonstration - 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 - more text""") - - def test_long_nonstring(self): - eq = self.ndiffAssertEqual - g = Charset("iso-8859-1") - cz = Charset("iso-8859-2") - utf8 = Charset("utf-8") - g_head = "Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s\xfcdl\xfcndischen Wandgem\xe4lden vorbei, gegen die rotierenden Klingen bef\xf6rdert. " - cz_head = "Finan\xe8ni metropole se hroutily pod tlakem jejich d\xf9vtipu.. " - utf8_head = u"\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.\u300d\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002".encode("utf-8") - h = Header(g_head, g, header_name='Subject') - h.append(cz_head, cz) - h.append(utf8_head, utf8) - msg = Message() - msg['Subject'] = h - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), """\ -Subject: =?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerd?= - =?iso-8859-1?q?erband_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndi?= - =?iso-8859-1?q?schen_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Kling?= - =?iso-8859-1?q?en_bef=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_met?= - =?iso-8859-2?q?ropole_se_hroutily_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= - =?utf-8?b?5q2j56K644Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE?= - =?utf-8?b?44G+44Gb44KT44CC5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB?= - =?utf-8?b?44GC44Go44Gv44Gn44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CM?= - =?utf-8?q?Wenn_ist_das_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das?= - =?utf-8?b?IE9kZXIgZGllIEZsaXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBow==?= - =?utf-8?b?44Gm44GE44G+44GZ44CC?= - -""") - eq(h.encode(), """\ -=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerd?= - =?iso-8859-1?q?erband_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndi?= - =?iso-8859-1?q?schen_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Kling?= - =?iso-8859-1?q?en_bef=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_met?= - =?iso-8859-2?q?ropole_se_hroutily_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= - =?utf-8?b?5q2j56K644Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE?= - =?utf-8?b?44G+44Gb44KT44CC5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB?= - =?utf-8?b?44GC44Go44Gv44Gn44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CM?= - =?utf-8?q?Wenn_ist_das_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das?= - =?utf-8?b?IE9kZXIgZGllIEZsaXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBow==?= - =?utf-8?b?44Gm44GE44G+44GZ44CC?=""") - - def test_long_header_encode(self): - eq = self.ndiffAssertEqual - h = Header('wasnipoop; giraffes="very-long-necked-animals"; ' - 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"', - header_name='X-Foobar-Spoink-Defrobnit') - eq(h.encode(), '''\ -wasnipoop; giraffes="very-long-necked-animals"; - spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"''') - - def test_long_header_encode_with_tab_continuation(self): - eq = self.ndiffAssertEqual - h = Header('wasnipoop; giraffes="very-long-necked-animals"; ' - 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"', - header_name='X-Foobar-Spoink-Defrobnit', - continuation_ws='\t') - eq(h.encode(), '''\ -wasnipoop; giraffes="very-long-necked-animals"; -\tspooge="yummy"; hippos="gargantuan"; marshmallows="gooey"''') - - def test_header_splitter(self): - eq = self.ndiffAssertEqual - msg = MIMEText('') - # It'd be great if we could use add_header() here, but that doesn't - # guarantee an order of the parameters. - msg['X-Foobar-Spoink-Defrobnit'] = ( - 'wasnipoop; giraffes="very-long-necked-animals"; ' - 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"') - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), '''\ -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; -\tspooge="yummy"; hippos="gargantuan"; marshmallows="gooey" - -''') - - def test_no_semis_header_splitter(self): - eq = self.ndiffAssertEqual - msg = Message() - msg['From'] = 'test@dom.ain' - msg['References'] = SPACE.join(['<%d@dom.ain>' % i for i in range(10)]) - msg.set_payload('Test') - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), """\ -From: test@dom.ain -References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain> -\t<5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain> - -Test""") - - def test_no_split_long_header(self): - eq = self.ndiffAssertEqual - hstr = 'References: ' + 'x' * 80 - h = Header(hstr, continuation_ws='\t') - eq(h.encode(), """\ -References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx""") - - def test_splitting_multiple_long_lines(self): - eq = self.ndiffAssertEqual - hstr = """\ -from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for ; Sat, 2 Feb 2002 17:00:06 -0800 (PST) -""" - h = Header(hstr, continuation_ws='\t') - eq(h.encode(), """\ -from babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST) -\tfrom babylon.socal-raves.org (localhost [127.0.0.1]); -\tby babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; -\tfor ; -\tSat, 2 Feb 2002 17:00:06 -0800 (PST)""") - - def test_splitting_first_line_only_is_long(self): - eq = self.ndiffAssertEqual - hstr = """\ -from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] helo=cthulhu.gerg.ca) -\tby kronos.mems-exchange.org with esmtp (Exim 4.05) -\tid 17k4h5-00034i-00 -\tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""" - h = Header(hstr, maxlinelen=78, header_name='Received', - continuation_ws='\t') - eq(h.encode(), """\ -from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] -\thelo=cthulhu.gerg.ca) -\tby kronos.mems-exchange.org with esmtp (Exim 4.05) -\tid 17k4h5-00034i-00 -\tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""") - - def test_long_8bit_header(self): - eq = self.ndiffAssertEqual - msg = Message() - h = Header('Britische Regierung gibt', 'iso-8859-1', - header_name='Subject') - h.append('gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte') - msg['Subject'] = h - eq(msg.as_string(), """\ -Subject: =?iso-8859-1?q?Britische_Regierung_gibt?= =?iso-8859-1?q?gr=FCnes?= - =?iso-8859-1?q?_Licht_f=FCr_Offshore-Windkraftprojekte?= - -""") - - def test_long_8bit_header_no_charset(self): - eq = self.ndiffAssertEqual - msg = Message() - msg['Reply-To'] = 'Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte ' - eq(msg.as_string(), """\ -Reply-To: Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte - -""") - - def test_long_to_header(self): - eq = self.ndiffAssertEqual - to = '"Someone Test #A" ,,"Someone Test #B" , "Someone Test #C" , "Someone Test #D" ' - msg = Message() - msg['To'] = to - eq(msg.as_string(0), '''\ -To: "Someone Test #A" , , -\t"Someone Test #B" , -\t"Someone Test #C" , -\t"Someone Test #D" - -''') - - def test_long_line_after_append(self): - eq = self.ndiffAssertEqual - s = 'This is an example of string which has almost the limit of header length.' - h = Header(s) - h.append('Add another line.') - eq(h.encode(), """\ -This is an example of string which has almost the limit of header length. - Add another line.""") - - def test_shorter_line_with_append(self): - eq = self.ndiffAssertEqual - s = 'This is a shorter line.' - h = Header(s) - h.append('Add another sentence. (Surprise?)') - eq(h.encode(), - 'This is a shorter line. Add another sentence. (Surprise?)') - - def test_long_field_name(self): - eq = self.ndiffAssertEqual - fn = 'X-Very-Very-Very-Long-Header-Name' - gs = "Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s\xfcdl\xfcndischen Wandgem\xe4lden vorbei, gegen die rotierenden Klingen bef\xf6rdert. " - h = Header(gs, 'iso-8859-1', header_name=fn) - # BAW: this seems broken because the first line is too long - eq(h.encode(), """\ -=?iso-8859-1?q?Die_Mieter_treten_hier_?= - =?iso-8859-1?q?ein_werden_mit_einem_Foerderband_komfortabel_den_Korridor_?= - =?iso-8859-1?q?entlang=2C_an_s=FCdl=FCndischen_Wandgem=E4lden_vorbei=2C_g?= - =?iso-8859-1?q?egen_die_rotierenden_Klingen_bef=F6rdert=2E_?=""") - - def test_long_received_header(self): - h = 'from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700' - msg = Message() - msg['Received-1'] = Header(h, continuation_ws='\t') - msg['Received-2'] = h - self.assertEqual(msg.as_string(), """\ -Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by -\throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; -\tWed, 05 Mar 2003 18:10:18 -0700 -Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by -\throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; -\tWed, 05 Mar 2003 18:10:18 -0700 - -""") - - def test_string_headerinst_eq(self): - h = '<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner\'s message of "Thu, 6 Mar 2003 13:58:21 +0100")' - msg = Message() - msg['Received-1'] = Header(h, header_name='Received-1', - continuation_ws='\t') - msg['Received-2'] = h - self.assertEqual(msg.as_string(), """\ -Received-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> -\t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") -Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> -\t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") - -""") - - def test_long_unbreakable_lines_with_continuation(self): - eq = self.ndiffAssertEqual - msg = Message() - t = """\ - iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 - locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp""" - msg['Face-1'] = t - msg['Face-2'] = Header(t, header_name='Face-2') - eq(msg.as_string(), """\ -Face-1: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 -\tlocQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp -Face-2: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 - locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp - -""") - - def test_another_long_multiline_header(self): - eq = self.ndiffAssertEqual - m = '''\ -Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsoft SMTPSVC(5.0.2195.4905); -\tWed, 16 Oct 2002 07:41:11 -0700''' - msg = email.message_from_string(m) - eq(msg.as_string(), '''\ -Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with -\tMicrosoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700 - -''') - - def test_long_lines_with_different_header(self): - eq = self.ndiffAssertEqual - h = """\ -List-Unsubscribe: , - """ - msg = Message() - msg['List'] = h - msg['List'] = Header(h, header_name='List') - eq(msg.as_string(), """\ -List: List-Unsubscribe: , -\t -List: List-Unsubscribe: , - - -""") - - - -# Test mangling of "From " lines in the body of a message -class TestFromMangling(unittest.TestCase): - def setUp(self): - self.msg = Message() - self.msg['From'] = 'aaa@bbb.org' - self.msg.set_payload("""\ -From the desk of A.A.A.: -Blah blah blah -""") - - def test_mangled_from(self): - s = StringIO() - g = Generator(s, mangle_from_=True) - g.flatten(self.msg) - self.assertEqual(s.getvalue(), """\ -From: aaa@bbb.org - ->From the desk of A.A.A.: -Blah blah blah -""") - - def test_dont_mangle_from(self): - s = StringIO() - g = Generator(s, mangle_from_=False) - g.flatten(self.msg) - self.assertEqual(s.getvalue(), """\ -From: aaa@bbb.org - -From the desk of A.A.A.: -Blah blah blah -""") - - - -# Test the basic MIMEAudio class -class TestMIMEAudio(unittest.TestCase): - def setUp(self): - # Make sure we pick up the audiotest.au that lives in email/test/data. - # In Python, there's an audiotest.au living in Lib/test but that isn't - # included in some binary distros that don't include the test - # package. The trailing empty string on the .join() is significant - # since findfile() will do a dirname(). - datadir = os.path.join(os.path.dirname(landmark), 'data', '') - fp = open(findfile('audiotest.au', datadir), 'rb') - try: - self._audiodata = fp.read() - finally: - fp.close() - self._au = MIMEAudio(self._audiodata) - - def test_guess_minor_type(self): - self.assertEqual(self._au.get_content_type(), 'audio/basic') - - def test_encoding(self): - payload = self._au.get_payload() - self.assertEqual(base64.decodestring(payload), self._audiodata) - - def test_checkSetMinor(self): - au = MIMEAudio(self._audiodata, 'fish') - self.assertEqual(au.get_content_type(), 'audio/fish') - - def test_add_header(self): - eq = self.assertEqual - unless = self.failUnless - self._au.add_header('Content-Disposition', 'attachment', - filename='audiotest.au') - eq(self._au['content-disposition'], - 'attachment; filename="audiotest.au"') - eq(self._au.get_params(header='content-disposition'), - [('attachment', ''), ('filename', 'audiotest.au')]) - eq(self._au.get_param('filename', header='content-disposition'), - 'audiotest.au') - missing = [] - eq(self._au.get_param('attachment', header='content-disposition'), '') - unless(self._au.get_param('foo', failobj=missing, - header='content-disposition') is missing) - # Try some missing stuff - unless(self._au.get_param('foobar', missing) is missing) - unless(self._au.get_param('attachment', missing, - header='foobar') is missing) - - - -# Test the basic MIMEImage class -class TestMIMEImage(unittest.TestCase): - def setUp(self): - fp = openfile('PyBanner048.gif') - try: - self._imgdata = fp.read() - finally: - fp.close() - self._im = MIMEImage(self._imgdata) - - def test_guess_minor_type(self): - self.assertEqual(self._im.get_content_type(), 'image/gif') - - def test_encoding(self): - payload = self._im.get_payload() - self.assertEqual(base64.decodestring(payload), self._imgdata) - - def test_checkSetMinor(self): - im = MIMEImage(self._imgdata, 'fish') - self.assertEqual(im.get_content_type(), 'image/fish') - - def test_add_header(self): - eq = self.assertEqual - unless = self.failUnless - self._im.add_header('Content-Disposition', 'attachment', - filename='dingusfish.gif') - eq(self._im['content-disposition'], - 'attachment; filename="dingusfish.gif"') - eq(self._im.get_params(header='content-disposition'), - [('attachment', ''), ('filename', 'dingusfish.gif')]) - eq(self._im.get_param('filename', header='content-disposition'), - 'dingusfish.gif') - missing = [] - eq(self._im.get_param('attachment', header='content-disposition'), '') - unless(self._im.get_param('foo', failobj=missing, - header='content-disposition') is missing) - # Try some missing stuff - unless(self._im.get_param('foobar', missing) is missing) - unless(self._im.get_param('attachment', missing, - header='foobar') is missing) - - - -# Test the basic MIMEApplication class -class TestMIMEApplication(unittest.TestCase): - def test_headers(self): - eq = self.assertEqual - msg = MIMEApplication('\xfa\xfb\xfc\xfd\xfe\xff') - eq(msg.get_content_type(), 'application/octet-stream') - eq(msg['content-transfer-encoding'], 'base64') - - def test_body(self): - eq = self.assertEqual - bytes = '\xfa\xfb\xfc\xfd\xfe\xff' - msg = MIMEApplication(bytes) - eq(msg.get_payload(), '+vv8/f7/') - eq(msg.get_payload(decode=True), bytes) - - - -# Test the basic MIMEText class -class TestMIMEText(unittest.TestCase): - def setUp(self): - self._msg = MIMEText('hello there') - - def test_types(self): - eq = self.assertEqual - unless = self.failUnless - eq(self._msg.get_content_type(), 'text/plain') - eq(self._msg.get_param('charset'), 'us-ascii') - missing = [] - unless(self._msg.get_param('foobar', missing) is missing) - unless(self._msg.get_param('charset', missing, header='foobar') - is missing) - - def test_payload(self): - self.assertEqual(self._msg.get_payload(), 'hello there') - self.failUnless(not self._msg.is_multipart()) - - def test_charset(self): - eq = self.assertEqual - msg = MIMEText('hello there', _charset='us-ascii') - eq(msg.get_charset().input_charset, 'us-ascii') - eq(msg['content-type'], 'text/plain; charset="us-ascii"') - - - -# Test complicated multipart/* messages -class TestMultipart(TestEmailBase): - def setUp(self): - fp = openfile('PyBanner048.gif') - try: - data = fp.read() - finally: - fp.close() - - container = MIMEBase('multipart', 'mixed', boundary='BOUNDARY') - image = MIMEImage(data, name='dingusfish.gif') - image.add_header('content-disposition', 'attachment', - filename='dingusfish.gif') - intro = MIMEText('''\ -Hi there, - -This is the dingus fish. -''') - container.attach(intro) - container.attach(image) - container['From'] = 'Barry ' - container['To'] = 'Dingus Lovers ' - container['Subject'] = 'Here is your dingus fish' - - now = 987809702.54848599 - timetuple = time.localtime(now) - if timetuple[-1] == 0: - tzsecs = time.timezone - else: - tzsecs = time.altzone - if tzsecs > 0: - sign = '-' - else: - sign = '+' - tzoffset = ' %s%04d' % (sign, tzsecs / 36) - container['Date'] = time.strftime( - '%a, %d %b %Y %H:%M:%S', - time.localtime(now)) + tzoffset - self._msg = container - self._im = image - self._txt = intro - - def test_hierarchy(self): - # convenience - eq = self.assertEqual - unless = self.failUnless - raises = self.assertRaises - # tests - m = self._msg - unless(m.is_multipart()) - eq(m.get_content_type(), 'multipart/mixed') - eq(len(m.get_payload()), 2) - raises(IndexError, m.get_payload, 2) - m0 = m.get_payload(0) - m1 = m.get_payload(1) - unless(m0 is self._txt) - unless(m1 is self._im) - eq(m.get_payload(), [m0, m1]) - unless(not m0.is_multipart()) - unless(not m1.is_multipart()) - - def test_empty_multipart_idempotent(self): - text = """\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY - - ---BOUNDARY-- -""" - msg = Parser().parsestr(text) - self.ndiffAssertEqual(text, msg.as_string()) - - def test_no_parts_in_a_multipart_with_none_epilogue(self): - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.set_boundary('BOUNDARY') - self.ndiffAssertEqual(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY - ---BOUNDARY--''') - - def test_no_parts_in_a_multipart_with_empty_epilogue(self): - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = '' - outer.epilogue = '' - outer.set_boundary('BOUNDARY') - self.ndiffAssertEqual(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY - ---BOUNDARY-- -''') - - def test_one_part_in_a_multipart(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.set_boundary('BOUNDARY') - msg = MIMEText('hello world') - outer.attach(msg) - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - def test_seq_parts_in_a_multipart_with_empty_preamble(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = '' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_none_preamble(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.preamble = None - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_none_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = None - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY--''') - - - def test_seq_parts_in_a_multipart_with_empty_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = '' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY-- -''') - - - def test_seq_parts_in_a_multipart_with_nl_epilogue(self): - eq = self.ndiffAssertEqual - outer = MIMEBase('multipart', 'mixed') - outer['Subject'] = 'A subject' - outer['To'] = 'aperson@dom.ain' - outer['From'] = 'bperson@dom.ain' - outer.epilogue = '\n' - msg = MIMEText('hello world') - outer.attach(msg) - outer.set_boundary('BOUNDARY') - eq(outer.as_string(), '''\ -Content-Type: multipart/mixed; boundary="BOUNDARY" -MIME-Version: 1.0 -Subject: A subject -To: aperson@dom.ain -From: bperson@dom.ain - ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -hello world ---BOUNDARY-- - -''') - - def test_message_external_body(self): - eq = self.assertEqual - msg = self._msgobj('msg_36.txt') - eq(len(msg.get_payload()), 2) - msg1 = msg.get_payload(1) - eq(msg1.get_content_type(), 'multipart/alternative') - eq(len(msg1.get_payload()), 2) - for subpart in msg1.get_payload(): - eq(subpart.get_content_type(), 'message/external-body') - eq(len(subpart.get_payload()), 1) - subsubpart = subpart.get_payload(0) - eq(subsubpart.get_content_type(), 'text/plain') - - def test_double_boundary(self): - # msg_37.txt is a multipart that contains two dash-boundary's in a - # row. Our interpretation of RFC 2046 calls for ignoring the second - # and subsequent boundaries. - msg = self._msgobj('msg_37.txt') - self.assertEqual(len(msg.get_payload()), 3) - - def test_nested_inner_contains_outer_boundary(self): - eq = self.ndiffAssertEqual - # msg_38.txt has an inner part that contains outer boundaries. My - # interpretation of RFC 2046 (based on sections 5.1 and 5.1.2) say - # these are illegal and should be interpreted as unterminated inner - # parts. - msg = self._msgobj('msg_38.txt') - sfp = StringIO() - iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/mixed - multipart/mixed - multipart/alternative - text/plain - text/plain - text/plain - text/plain -""") - - def test_nested_with_same_boundary(self): - eq = self.ndiffAssertEqual - # msg 39.txt is similarly evil in that it's got inner parts that use - # the same boundary as outer parts. Again, I believe the way this is - # parsed is closest to the spirit of RFC 2046 - msg = self._msgobj('msg_39.txt') - sfp = StringIO() - iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/mixed - multipart/mixed - multipart/alternative - application/octet-stream - application/octet-stream - text/plain -""") - - def test_boundary_in_non_multipart(self): - msg = self._msgobj('msg_40.txt') - self.assertEqual(msg.as_string(), '''\ -MIME-Version: 1.0 -Content-Type: text/html; boundary="--961284236552522269" - -----961284236552522269 -Content-Type: text/html; -Content-Transfer-Encoding: 7Bit - - - -----961284236552522269-- -''') - - def test_boundary_with_leading_space(self): - eq = self.assertEqual - msg = email.message_from_string('''\ -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary=" XXXX" - --- XXXX -Content-Type: text/plain - - --- XXXX -Content-Type: text/plain - --- XXXX-- -''') - self.failUnless(msg.is_multipart()) - eq(msg.get_boundary(), ' XXXX') - eq(len(msg.get_payload()), 2) - - def test_boundary_without_trailing_newline(self): - m = Parser().parsestr("""\ -Content-Type: multipart/mixed; boundary="===============0012394164==" -MIME-Version: 1.0 - ---===============0012394164== -Content-Type: image/file1.jpg -MIME-Version: 1.0 -Content-Transfer-Encoding: base64 - -YXNkZg== ---===============0012394164==--""") - self.assertEquals(m.get_payload(0).get_payload(), 'YXNkZg==') - - - -# Test some badly formatted messages -class TestNonConformant(TestEmailBase): - def test_parse_missing_minor_type(self): - eq = self.assertEqual - msg = self._msgobj('msg_14.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - - def test_same_boundary_inner_outer(self): - unless = self.failUnless - msg = self._msgobj('msg_15.txt') - # XXX We can probably eventually do better - inner = msg.get_payload(0) - unless(hasattr(inner, 'defects')) - self.assertEqual(len(inner.defects), 1) - unless(isinstance(inner.defects[0], - errors.StartBoundaryNotFoundDefect)) - - def test_multipart_no_boundary(self): - unless = self.failUnless - msg = self._msgobj('msg_25.txt') - unless(isinstance(msg.get_payload(), str)) - self.assertEqual(len(msg.defects), 2) - unless(isinstance(msg.defects[0], errors.NoBoundaryInMultipartDefect)) - unless(isinstance(msg.defects[1], - errors.MultipartInvariantViolationDefect)) - - def test_invalid_content_type(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - msg = Message() - # RFC 2045, $5.2 says invalid yields text/plain - msg['Content-Type'] = 'text' - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_content_type(), 'text/plain') - # Clear the old value and try something /really/ invalid - del msg['content-type'] - msg['Content-Type'] = 'foo' - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_content_type(), 'text/plain') - # Still, make sure that the message is idempotently generated - s = StringIO() - g = Generator(s) - g.flatten(msg) - neq(s.getvalue(), 'Content-Type: foo\n\n') - - def test_no_start_boundary(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_31.txt') - eq(msg.get_payload(), """\ ---BOUNDARY -Content-Type: text/plain - -message 1 - ---BOUNDARY -Content-Type: text/plain - -message 2 - ---BOUNDARY-- -""") - - def test_no_separating_blank_line(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_35.txt') - eq(msg.as_string(), """\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: here's something interesting - -counter to RFC 2822, there's no separating newline here -""") - - def test_lying_multipart(self): - unless = self.failUnless - msg = self._msgobj('msg_41.txt') - unless(hasattr(msg, 'defects')) - self.assertEqual(len(msg.defects), 2) - unless(isinstance(msg.defects[0], errors.NoBoundaryInMultipartDefect)) - unless(isinstance(msg.defects[1], - errors.MultipartInvariantViolationDefect)) - - def test_missing_start_boundary(self): - outer = self._msgobj('msg_42.txt') - # The message structure is: - # - # multipart/mixed - # text/plain - # message/rfc822 - # multipart/mixed [*] - # - # [*] This message is missing its start boundary - bad = outer.get_payload(1).get_payload(0) - self.assertEqual(len(bad.defects), 1) - self.failUnless(isinstance(bad.defects[0], - errors.StartBoundaryNotFoundDefect)) - - - -# Test RFC 2047 header encoding and decoding -class TestRFC2047(unittest.TestCase): - def test_rfc2047_multiline(self): - eq = self.assertEqual - s = """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz - foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=""" - dh = decode_header(s) - eq(dh, [ - ('Re:', None), - ('r\x8aksm\x9arg\x8cs', 'mac-iceland'), - ('baz foo bar', None), - ('r\x8aksm\x9arg\x8cs', 'mac-iceland')]) - eq(str(make_header(dh)), - """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar - =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=""") - - def test_whitespace_eater_unicode(self): - eq = self.assertEqual - s = '=?ISO-8859-1?Q?Andr=E9?= Pirard ' - dh = decode_header(s) - eq(dh, [('Andr\xe9', 'iso-8859-1'), ('Pirard ', None)]) - hu = unicode(make_header(dh)).encode('latin-1') - eq(hu, 'Andr\xe9 Pirard ') - - def test_whitespace_eater_unicode_2(self): - eq = self.assertEqual - s = 'The =?iso-8859-1?b?cXVpY2sgYnJvd24gZm94?= jumped over the =?iso-8859-1?b?bGF6eSBkb2c=?=' - dh = decode_header(s) - eq(dh, [('The', None), ('quick brown fox', 'iso-8859-1'), - ('jumped over the', None), ('lazy dog', 'iso-8859-1')]) - hu = make_header(dh).__unicode__() - eq(hu, u'The quick brown fox jumped over the lazy dog') - - def test_rfc2047_missing_whitespace(self): - s = 'Sm=?ISO-8859-1?B?9g==?=rg=?ISO-8859-1?B?5Q==?=sbord' - dh = decode_header(s) - self.assertEqual(dh, [(s, None)]) - - def test_rfc2047_with_whitespace(self): - s = 'Sm =?ISO-8859-1?B?9g==?= rg =?ISO-8859-1?B?5Q==?= sbord' - dh = decode_header(s) - self.assertEqual(dh, [('Sm', None), ('\xf6', 'iso-8859-1'), - ('rg', None), ('\xe5', 'iso-8859-1'), - ('sbord', None)]) - - - -# Test the MIMEMessage class -class TestMIMEMessage(TestEmailBase): - def setUp(self): - fp = openfile('msg_11.txt') - try: - self._text = fp.read() - finally: - fp.close() - - def test_type_error(self): - self.assertRaises(TypeError, MIMEMessage, 'a plain string') - - def test_valid_argument(self): - eq = self.assertEqual - unless = self.failUnless - subject = 'A sub-message' - m = Message() - m['Subject'] = subject - r = MIMEMessage(m) - eq(r.get_content_type(), 'message/rfc822') - payload = r.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - subpart = payload[0] - unless(subpart is m) - eq(subpart['subject'], subject) - - def test_bad_multipart(self): - eq = self.assertEqual - msg1 = Message() - msg1['Subject'] = 'subpart 1' - msg2 = Message() - msg2['Subject'] = 'subpart 2' - r = MIMEMessage(msg1) - self.assertRaises(errors.MultipartConversionError, r.attach, msg2) - - def test_generate(self): - # First craft the message to be encapsulated - m = Message() - m['Subject'] = 'An enclosed message' - m.set_payload('Here is the body of the message.\n') - r = MIMEMessage(m) - r['Subject'] = 'The enclosing message' - s = StringIO() - g = Generator(s) - g.flatten(r) - self.assertEqual(s.getvalue(), """\ -Content-Type: message/rfc822 -MIME-Version: 1.0 -Subject: The enclosing message - -Subject: An enclosed message - -Here is the body of the message. -""") - - def test_parse_message_rfc822(self): - eq = self.assertEqual - unless = self.failUnless - msg = self._msgobj('msg_11.txt') - eq(msg.get_content_type(), 'message/rfc822') - payload = msg.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - submsg = payload[0] - self.failUnless(isinstance(submsg, Message)) - eq(submsg['subject'], 'An enclosed message') - eq(submsg.get_payload(), 'Here is the body of the message.\n') - - def test_dsn(self): - eq = self.assertEqual - unless = self.failUnless - # msg 16 is a Delivery Status Notification, see RFC 1894 - msg = self._msgobj('msg_16.txt') - eq(msg.get_content_type(), 'multipart/report') - unless(msg.is_multipart()) - eq(len(msg.get_payload()), 3) - # Subpart 1 is a text/plain, human readable section - subpart = msg.get_payload(0) - eq(subpart.get_content_type(), 'text/plain') - eq(subpart.get_payload(), """\ -This report relates to a message you sent with the following header fields: - - Message-id: <002001c144a6$8752e060$56104586@oxy.edu> - Date: Sun, 23 Sep 2001 20:10:55 -0700 - From: "Ian T. Henry" - To: SoCal Raves - Subject: [scr] yeah for Ians!! - -Your message cannot be delivered to the following recipients: - - Recipient address: jangel1@cougar.noc.ucla.edu - Reason: recipient reached disk quota - -""") - # Subpart 2 contains the machine parsable DSN information. It - # consists of two blocks of headers, represented by two nested Message - # objects. - subpart = msg.get_payload(1) - eq(subpart.get_content_type(), 'message/delivery-status') - eq(len(subpart.get_payload()), 2) - # message/delivery-status should treat each block as a bunch of - # headers, i.e. a bunch of Message objects. - dsn1 = subpart.get_payload(0) - unless(isinstance(dsn1, Message)) - eq(dsn1['original-envelope-id'], '0GK500B4HD0888@cougar.noc.ucla.edu') - eq(dsn1.get_param('dns', header='reporting-mta'), '') - # Try a missing one - eq(dsn1.get_param('nsd', header='reporting-mta'), None) - dsn2 = subpart.get_payload(1) - unless(isinstance(dsn2, Message)) - eq(dsn2['action'], 'failed') - eq(dsn2.get_params(header='original-recipient'), - [('rfc822', ''), ('jangel1@cougar.noc.ucla.edu', '')]) - eq(dsn2.get_param('rfc822', header='final-recipient'), '') - # Subpart 3 is the original message - subpart = msg.get_payload(2) - eq(subpart.get_content_type(), 'message/rfc822') - payload = subpart.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - subsubpart = payload[0] - unless(isinstance(subsubpart, Message)) - eq(subsubpart.get_content_type(), 'text/plain') - eq(subsubpart['message-id'], - '<002001c144a6$8752e060$56104586@oxy.edu>') - - def test_epilogue(self): - eq = self.ndiffAssertEqual - fp = openfile('msg_21.txt') - try: - text = fp.read() - finally: - fp.close() - msg = Message() - msg['From'] = 'aperson@dom.ain' - msg['To'] = 'bperson@dom.ain' - msg['Subject'] = 'Test' - msg.preamble = 'MIME message' - msg.epilogue = 'End of MIME message\n' - msg1 = MIMEText('One') - msg2 = MIMEText('Two') - msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY') - msg.attach(msg1) - msg.attach(msg2) - sfp = StringIO() - g = Generator(sfp) - g.flatten(msg) - eq(sfp.getvalue(), text) - - def test_no_nl_preamble(self): - eq = self.ndiffAssertEqual - msg = Message() - msg['From'] = 'aperson@dom.ain' - msg['To'] = 'bperson@dom.ain' - msg['Subject'] = 'Test' - msg.preamble = 'MIME message' - msg.epilogue = '' - msg1 = MIMEText('One') - msg2 = MIMEText('Two') - msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY') - msg.attach(msg1) - msg.attach(msg2) - eq(msg.as_string(), """\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: Test -Content-Type: multipart/mixed; boundary="BOUNDARY" - -MIME message ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -One ---BOUNDARY -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -Two ---BOUNDARY-- -""") - - def test_default_type(self): - eq = self.assertEqual - fp = openfile('msg_30.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - container1 = msg.get_payload(0) - eq(container1.get_default_type(), 'message/rfc822') - eq(container1.get_content_type(), 'message/rfc822') - container2 = msg.get_payload(1) - eq(container2.get_default_type(), 'message/rfc822') - eq(container2.get_content_type(), 'message/rfc822') - container1a = container1.get_payload(0) - eq(container1a.get_default_type(), 'text/plain') - eq(container1a.get_content_type(), 'text/plain') - container2a = container2.get_payload(0) - eq(container2a.get_default_type(), 'text/plain') - eq(container2a.get_content_type(), 'text/plain') - - def test_default_type_with_explicit_container_type(self): - eq = self.assertEqual - fp = openfile('msg_28.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - container1 = msg.get_payload(0) - eq(container1.get_default_type(), 'message/rfc822') - eq(container1.get_content_type(), 'message/rfc822') - container2 = msg.get_payload(1) - eq(container2.get_default_type(), 'message/rfc822') - eq(container2.get_content_type(), 'message/rfc822') - container1a = container1.get_payload(0) - eq(container1a.get_default_type(), 'text/plain') - eq(container1a.get_content_type(), 'text/plain') - container2a = container2.get_payload(0) - eq(container2a.get_default_type(), 'text/plain') - eq(container2a.get_content_type(), 'text/plain') - - def test_default_type_non_parsed(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - # Set up container - container = MIMEMultipart('digest', 'BOUNDARY') - container.epilogue = '' - # Set up subparts - subpart1a = MIMEText('message 1\n') - subpart2a = MIMEText('message 2\n') - subpart1 = MIMEMessage(subpart1a) - subpart2 = MIMEMessage(subpart2a) - container.attach(subpart1) - container.attach(subpart2) - eq(subpart1.get_content_type(), 'message/rfc822') - eq(subpart1.get_default_type(), 'message/rfc822') - eq(subpart2.get_content_type(), 'message/rfc822') - eq(subpart2.get_default_type(), 'message/rfc822') - neq(container.as_string(0), '''\ -Content-Type: multipart/digest; boundary="BOUNDARY" -MIME-Version: 1.0 - ---BOUNDARY -Content-Type: message/rfc822 -MIME-Version: 1.0 - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 1 - ---BOUNDARY -Content-Type: message/rfc822 -MIME-Version: 1.0 - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 2 - ---BOUNDARY-- -''') - del subpart1['content-type'] - del subpart1['mime-version'] - del subpart2['content-type'] - del subpart2['mime-version'] - eq(subpart1.get_content_type(), 'message/rfc822') - eq(subpart1.get_default_type(), 'message/rfc822') - eq(subpart2.get_content_type(), 'message/rfc822') - eq(subpart2.get_default_type(), 'message/rfc822') - neq(container.as_string(0), '''\ -Content-Type: multipart/digest; boundary="BOUNDARY" -MIME-Version: 1.0 - ---BOUNDARY - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 1 - ---BOUNDARY - -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit - -message 2 - ---BOUNDARY-- -''') - - def test_mime_attachments_in_constructor(self): - eq = self.assertEqual - text1 = MIMEText('') - text2 = MIMEText('') - msg = MIMEMultipart(_subparts=(text1, text2)) - eq(len(msg.get_payload()), 2) - eq(msg.get_payload(0), text1) - eq(msg.get_payload(1), text2) - - - -# A general test of parser->model->generator idempotency. IOW, read a message -# in, parse it into a message object tree, then without touching the tree, -# regenerate the plain text. The original text and the transformed text -# should be identical. Note: that we ignore the Unix-From since that may -# contain a changed date. -class TestIdempotent(TestEmailBase): - def _msgobj(self, filename): - fp = openfile(filename) - try: - data = fp.read() - finally: - fp.close() - msg = email.message_from_string(data) - return msg, data - - def _idempotent(self, msg, text): - eq = self.ndiffAssertEqual - s = StringIO() - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - eq(text, s.getvalue()) - - def test_parse_text_message(self): - eq = self.assertEquals - msg, text = self._msgobj('msg_01.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_content_maintype(), 'text') - eq(msg.get_content_subtype(), 'plain') - eq(msg.get_params()[1], ('charset', 'us-ascii')) - eq(msg.get_param('charset'), 'us-ascii') - eq(msg.preamble, None) - eq(msg.epilogue, None) - self._idempotent(msg, text) - - def test_parse_untyped_message(self): - eq = self.assertEquals - msg, text = self._msgobj('msg_03.txt') - eq(msg.get_content_type(), 'text/plain') - eq(msg.get_params(), None) - eq(msg.get_param('charset'), None) - self._idempotent(msg, text) - - def test_simple_multipart(self): - msg, text = self._msgobj('msg_04.txt') - self._idempotent(msg, text) - - def test_MIME_digest(self): - msg, text = self._msgobj('msg_02.txt') - self._idempotent(msg, text) - - def test_long_header(self): - msg, text = self._msgobj('msg_27.txt') - self._idempotent(msg, text) - - def test_MIME_digest_with_part_headers(self): - msg, text = self._msgobj('msg_28.txt') - self._idempotent(msg, text) - - def test_mixed_with_image(self): - msg, text = self._msgobj('msg_06.txt') - self._idempotent(msg, text) - - def test_multipart_report(self): - msg, text = self._msgobj('msg_05.txt') - self._idempotent(msg, text) - - def test_dsn(self): - msg, text = self._msgobj('msg_16.txt') - self._idempotent(msg, text) - - def test_preamble_epilogue(self): - msg, text = self._msgobj('msg_21.txt') - self._idempotent(msg, text) - - def test_multipart_one_part(self): - msg, text = self._msgobj('msg_23.txt') - self._idempotent(msg, text) - - def test_multipart_no_parts(self): - msg, text = self._msgobj('msg_24.txt') - self._idempotent(msg, text) - - def test_no_start_boundary(self): - msg, text = self._msgobj('msg_31.txt') - self._idempotent(msg, text) - - def test_rfc2231_charset(self): - msg, text = self._msgobj('msg_32.txt') - self._idempotent(msg, text) - - def test_more_rfc2231_parameters(self): - msg, text = self._msgobj('msg_33.txt') - self._idempotent(msg, text) - - def test_text_plain_in_a_multipart_digest(self): - msg, text = self._msgobj('msg_34.txt') - self._idempotent(msg, text) - - def test_nested_multipart_mixeds(self): - msg, text = self._msgobj('msg_12a.txt') - self._idempotent(msg, text) - - def test_message_external_body_idempotent(self): - msg, text = self._msgobj('msg_36.txt') - self._idempotent(msg, text) - - def test_content_type(self): - eq = self.assertEquals - unless = self.failUnless - # Get a message object and reset the seek pointer for other tests - msg, text = self._msgobj('msg_05.txt') - eq(msg.get_content_type(), 'multipart/report') - # Test the Content-Type: parameters - params = {} - for pk, pv in msg.get_params(): - params[pk] = pv - eq(params['report-type'], 'delivery-status') - eq(params['boundary'], 'D1690A7AC1.996856090/mail.example.com') - eq(msg.preamble, 'This is a MIME-encapsulated message.\n') - eq(msg.epilogue, '\n') - eq(len(msg.get_payload()), 3) - # Make sure the subparts are what we expect - msg1 = msg.get_payload(0) - eq(msg1.get_content_type(), 'text/plain') - eq(msg1.get_payload(), 'Yadda yadda yadda\n') - msg2 = msg.get_payload(1) - eq(msg2.get_content_type(), 'text/plain') - eq(msg2.get_payload(), 'Yadda yadda yadda\n') - msg3 = msg.get_payload(2) - eq(msg3.get_content_type(), 'message/rfc822') - self.failUnless(isinstance(msg3, Message)) - payload = msg3.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - msg4 = payload[0] - unless(isinstance(msg4, Message)) - eq(msg4.get_payload(), 'Yadda yadda yadda\n') - - def test_parser(self): - eq = self.assertEquals - unless = self.failUnless - msg, text = self._msgobj('msg_06.txt') - # Check some of the outer headers - eq(msg.get_content_type(), 'message/rfc822') - # Make sure the payload is a list of exactly one sub-Message, and that - # that submessage has a type of text/plain - payload = msg.get_payload() - unless(isinstance(payload, list)) - eq(len(payload), 1) - msg1 = payload[0] - self.failUnless(isinstance(msg1, Message)) - eq(msg1.get_content_type(), 'text/plain') - self.failUnless(isinstance(msg1.get_payload(), str)) - eq(msg1.get_payload(), '\n') - - - -# Test various other bits of the package's functionality -class TestMiscellaneous(TestEmailBase): - def test_message_from_string(self): - fp = openfile('msg_01.txt') - try: - text = fp.read() - finally: - fp.close() - msg = email.message_from_string(text) - s = StringIO() - # Don't wrap/continue long headers since we're trying to test - # idempotency. - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - self.assertEqual(text, s.getvalue()) - - def test_message_from_file(self): - fp = openfile('msg_01.txt') - try: - text = fp.read() - fp.seek(0) - msg = email.message_from_file(fp) - s = StringIO() - # Don't wrap/continue long headers since we're trying to test - # idempotency. - g = Generator(s, maxheaderlen=0) - g.flatten(msg) - self.assertEqual(text, s.getvalue()) - finally: - fp.close() - - def test_message_from_string_with_class(self): - unless = self.failUnless - fp = openfile('msg_01.txt') - try: - text = fp.read() - finally: - fp.close() - # Create a subclass - class MyMessage(Message): - pass - - msg = email.message_from_string(text, MyMessage) - unless(isinstance(msg, MyMessage)) - # Try something more complicated - fp = openfile('msg_02.txt') - try: - text = fp.read() - finally: - fp.close() - msg = email.message_from_string(text, MyMessage) - for subpart in msg.walk(): - unless(isinstance(subpart, MyMessage)) - - def test_message_from_file_with_class(self): - unless = self.failUnless - # Create a subclass - class MyMessage(Message): - pass - - fp = openfile('msg_01.txt') - try: - msg = email.message_from_file(fp, MyMessage) - finally: - fp.close() - unless(isinstance(msg, MyMessage)) - # Try something more complicated - fp = openfile('msg_02.txt') - try: - msg = email.message_from_file(fp, MyMessage) - finally: - fp.close() - for subpart in msg.walk(): - unless(isinstance(subpart, MyMessage)) - - def test__all__(self): - module = __import__('email') - # Can't use sorted() here due to Python 2.3 compatibility - all = module.__all__[:] - all.sort() - self.assertEqual(all, [ - # Old names - 'Charset', 'Encoders', 'Errors', 'Generator', - 'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', - 'MIMEImage', 'MIMEMessage', 'MIMEMultipart', - 'MIMENonMultipart', 'MIMEText', 'Message', - 'Parser', 'Utils', 'base64MIME', - # new names - 'base64mime', 'charset', 'encoders', 'errors', 'generator', - 'header', 'iterators', 'message', 'message_from_file', - 'message_from_string', 'mime', 'parser', - 'quopriMIME', 'quoprimime', 'utils', - ]) - - def test_formatdate(self): - now = time.time() - self.assertEqual(utils.parsedate(utils.formatdate(now))[:6], - time.gmtime(now)[:6]) - - def test_formatdate_localtime(self): - now = time.time() - self.assertEqual( - utils.parsedate(utils.formatdate(now, localtime=True))[:6], - time.localtime(now)[:6]) - - def test_formatdate_usegmt(self): - now = time.time() - self.assertEqual( - utils.formatdate(now, localtime=False), - time.strftime('%a, %d %b %Y %H:%M:%S -0000', time.gmtime(now))) - self.assertEqual( - utils.formatdate(now, localtime=False, usegmt=True), - time.strftime('%a, %d %b %Y %H:%M:%S GMT', time.gmtime(now))) - - def test_parsedate_none(self): - self.assertEqual(utils.parsedate(''), None) - - def test_parsedate_compact(self): - # The FWS after the comma is optional - self.assertEqual(utils.parsedate('Wed,3 Apr 2002 14:58:26 +0800'), - utils.parsedate('Wed, 3 Apr 2002 14:58:26 +0800')) - - def test_parsedate_no_dayofweek(self): - eq = self.assertEqual - eq(utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'), - (2003, 2, 25, 13, 47, 26, 0, 1, -1, -28800)) - - def test_parsedate_compact_no_dayofweek(self): - eq = self.assertEqual - eq(utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'), - (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800)) - - def test_parsedate_acceptable_to_time_functions(self): - eq = self.assertEqual - timetup = utils.parsedate('5 Feb 2003 13:47:26 -0800') - t = int(time.mktime(timetup)) - eq(time.localtime(t)[:6], timetup[:6]) - eq(int(time.strftime('%Y', timetup)), 2003) - timetup = utils.parsedate_tz('5 Feb 2003 13:47:26 -0800') - t = int(time.mktime(timetup[:9])) - eq(time.localtime(t)[:6], timetup[:6]) - eq(int(time.strftime('%Y', timetup[:9])), 2003) - - def test_parseaddr_empty(self): - self.assertEqual(utils.parseaddr('<>'), ('', '')) - self.assertEqual(utils.formataddr(utils.parseaddr('<>')), '') - - def test_noquote_dump(self): - self.assertEqual( - utils.formataddr(('A Silly Person', 'person@dom.ain')), - 'A Silly Person ') - - def test_escape_dump(self): - self.assertEqual( - utils.formataddr(('A (Very) Silly Person', 'person@dom.ain')), - r'"A \(Very\) Silly Person" ') - a = r'A \(Special\) Person' - b = 'person@dom.ain' - self.assertEqual(utils.parseaddr(utils.formataddr((a, b))), (a, b)) - - def test_escape_backslashes(self): - self.assertEqual( - utils.formataddr(('Arthur \Backslash\ Foobar', 'person@dom.ain')), - r'"Arthur \\Backslash\\ Foobar" ') - a = r'Arthur \Backslash\ Foobar' - b = 'person@dom.ain' - self.assertEqual(utils.parseaddr(utils.formataddr((a, b))), (a, b)) - - def test_name_with_dot(self): - x = 'John X. Doe ' - y = '"John X. Doe" ' - a, b = ('John X. Doe', 'jxd@example.com') - self.assertEqual(utils.parseaddr(x), (a, b)) - self.assertEqual(utils.parseaddr(y), (a, b)) - # formataddr() quotes the name if there's a dot in it - self.assertEqual(utils.formataddr((a, b)), y) - - def test_multiline_from_comment(self): - x = """\ -Foo -\tBar """ - self.assertEqual(utils.parseaddr(x), ('Foo Bar', 'foo@example.com')) - - def test_quote_dump(self): - self.assertEqual( - utils.formataddr(('A Silly; Person', 'person@dom.ain')), - r'"A Silly; Person" ') - - def test_fix_eols(self): - eq = self.assertEqual - eq(utils.fix_eols('hello'), 'hello') - eq(utils.fix_eols('hello\n'), 'hello\r\n') - eq(utils.fix_eols('hello\r'), 'hello\r\n') - eq(utils.fix_eols('hello\r\n'), 'hello\r\n') - eq(utils.fix_eols('hello\n\r'), 'hello\r\n\r\n') - - def test_charset_richcomparisons(self): - eq = self.assertEqual - ne = self.failIfEqual - cset1 = Charset() - cset2 = Charset() - eq(cset1, 'us-ascii') - eq(cset1, 'US-ASCII') - eq(cset1, 'Us-AsCiI') - eq('us-ascii', cset1) - eq('US-ASCII', cset1) - eq('Us-AsCiI', cset1) - ne(cset1, 'usascii') - ne(cset1, 'USASCII') - ne(cset1, 'UsAsCiI') - ne('usascii', cset1) - ne('USASCII', cset1) - ne('UsAsCiI', cset1) - eq(cset1, cset2) - eq(cset2, cset1) - - def test_getaddresses(self): - eq = self.assertEqual - eq(utils.getaddresses(['aperson@dom.ain (Al Person)', - 'Bud Person ']), - [('Al Person', 'aperson@dom.ain'), - ('Bud Person', 'bperson@dom.ain')]) - - def test_getaddresses_nasty(self): - eq = self.assertEqual - eq(utils.getaddresses(['foo: ;']), [('', '')]) - eq(utils.getaddresses( - ['[]*-- =~$']), - [('', ''), ('', ''), ('', '*--')]) - eq(utils.getaddresses( - ['foo: ;', '"Jason R. Mastaler" ']), - [('', ''), ('Jason R. Mastaler', 'jason@dom.ain')]) - - def test_getaddresses_embedded_comment(self): - """Test proper handling of a nested comment""" - eq = self.assertEqual - addrs = utils.getaddresses(['User ((nested comment)) ']) - eq(addrs[0][1], 'foo@bar.com') - - def test_utils_quote_unquote(self): - eq = self.assertEqual - msg = Message() - msg.add_header('content-disposition', 'attachment', - filename='foo\\wacky"name') - eq(msg.get_filename(), 'foo\\wacky"name') - - def test_get_body_encoding_with_bogus_charset(self): - charset = Charset('not a charset') - self.assertEqual(charset.get_body_encoding(), 'base64') - - def test_get_body_encoding_with_uppercase_charset(self): - eq = self.assertEqual - msg = Message() - msg['Content-Type'] = 'text/plain; charset=UTF-8' - eq(msg['content-type'], 'text/plain; charset=UTF-8') - charsets = msg.get_charsets() - eq(len(charsets), 1) - eq(charsets[0], 'utf-8') - charset = Charset(charsets[0]) - eq(charset.get_body_encoding(), 'base64') - msg.set_payload('hello world', charset=charset) - eq(msg.get_payload(), 'aGVsbG8gd29ybGQ=\n') - eq(msg.get_payload(decode=True), 'hello world') - eq(msg['content-transfer-encoding'], 'base64') - # Try another one - msg = Message() - msg['Content-Type'] = 'text/plain; charset="US-ASCII"' - charsets = msg.get_charsets() - eq(len(charsets), 1) - eq(charsets[0], 'us-ascii') - charset = Charset(charsets[0]) - eq(charset.get_body_encoding(), encoders.encode_7or8bit) - msg.set_payload('hello world', charset=charset) - eq(msg.get_payload(), 'hello world') - eq(msg['content-transfer-encoding'], '7bit') - - def test_charsets_case_insensitive(self): - lc = Charset('us-ascii') - uc = Charset('US-ASCII') - self.assertEqual(lc.get_body_encoding(), uc.get_body_encoding()) - - def test_partial_falls_inside_message_delivery_status(self): - eq = self.ndiffAssertEqual - # The Parser interface provides chunks of data to FeedParser in 8192 - # byte gulps. SF bug #1076485 found one of those chunks inside - # message/delivery-status header block, which triggered an - # unreadline() of NeedMoreData. - msg = self._msgobj('msg_43.txt') - sfp = StringIO() - iterators._structure(msg, sfp) - eq(sfp.getvalue(), """\ -multipart/report - text/plain - message/delivery-status - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/plain - text/rfc822-headers -""") - - - -# Test the iterator/generators -class TestIterators(TestEmailBase): - def test_body_line_iterator(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - # First a simple non-multipart message - msg = self._msgobj('msg_01.txt') - it = iterators.body_line_iterator(msg) - lines = list(it) - eq(len(lines), 6) - neq(EMPTYSTRING.join(lines), msg.get_payload()) - # Now a more complicated multipart - msg = self._msgobj('msg_02.txt') - it = iterators.body_line_iterator(msg) - lines = list(it) - eq(len(lines), 43) - fp = openfile('msg_19.txt') - try: - neq(EMPTYSTRING.join(lines), fp.read()) - finally: - fp.close() - - def test_typed_subpart_iterator(self): - eq = self.assertEqual - msg = self._msgobj('msg_04.txt') - it = iterators.typed_subpart_iterator(msg, 'text') - lines = [] - subparts = 0 - for subpart in it: - subparts += 1 - lines.append(subpart.get_payload()) - eq(subparts, 2) - eq(EMPTYSTRING.join(lines), """\ -a simple kind of mirror -to reflect upon our own -a simple kind of mirror -to reflect upon our own -""") - - def test_typed_subpart_iterator_default_type(self): - eq = self.assertEqual - msg = self._msgobj('msg_03.txt') - it = iterators.typed_subpart_iterator(msg, 'text', 'plain') - lines = [] - subparts = 0 - for subpart in it: - subparts += 1 - lines.append(subpart.get_payload()) - eq(subparts, 1) - eq(EMPTYSTRING.join(lines), """\ - -Hi, - -Do you like this message? - --Me -""") - - - -class TestParsers(TestEmailBase): - def test_header_parser(self): - eq = self.assertEqual - # Parse only the headers of a complex multipart MIME document - fp = openfile('msg_02.txt') - try: - msg = HeaderParser().parse(fp) - finally: - fp.close() - eq(msg['from'], 'ppp-request@zzz.org') - eq(msg['to'], 'ppp@zzz.org') - eq(msg.get_content_type(), 'multipart/mixed') - self.failIf(msg.is_multipart()) - self.failUnless(isinstance(msg.get_payload(), str)) - - def test_whitespace_continuation(self): - eq = self.assertEqual - # This message contains a line after the Subject: header that has only - # whitespace, but it is not empty! - msg = email.message_from_string("""\ -From: aperson@dom.ain -To: bperson@dom.ain -Subject: the next line has a space on it -\x20 -Date: Mon, 8 Apr 2002 15:09:19 -0400 -Message-ID: spam - -Here's the message body -""") - eq(msg['subject'], 'the next line has a space on it\n ') - eq(msg['message-id'], 'spam') - eq(msg.get_payload(), "Here's the message body\n") - - def test_whitespace_continuation_last_header(self): - eq = self.assertEqual - # Like the previous test, but the subject line is the last - # header. - msg = email.message_from_string("""\ -From: aperson@dom.ain -To: bperson@dom.ain -Date: Mon, 8 Apr 2002 15:09:19 -0400 -Message-ID: spam -Subject: the next line has a space on it -\x20 - -Here's the message body -""") - eq(msg['subject'], 'the next line has a space on it\n ') - eq(msg['message-id'], 'spam') - eq(msg.get_payload(), "Here's the message body\n") - - def test_crlf_separation(self): - eq = self.assertEqual - fp = openfile('msg_26.txt', mode='rb') - try: - msg = Parser().parse(fp) - finally: - fp.close() - eq(len(msg.get_payload()), 2) - part1 = msg.get_payload(0) - eq(part1.get_content_type(), 'text/plain') - eq(part1.get_payload(), 'Simple email with attachment.\r\n\r\n') - part2 = msg.get_payload(1) - eq(part2.get_content_type(), 'application/riscos') - - def test_multipart_digest_with_extra_mime_headers(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - fp = openfile('msg_28.txt') - try: - msg = email.message_from_file(fp) - finally: - fp.close() - # Structure is: - # multipart/digest - # message/rfc822 - # text/plain - # message/rfc822 - # text/plain - eq(msg.is_multipart(), 1) - eq(len(msg.get_payload()), 2) - part1 = msg.get_payload(0) - eq(part1.get_content_type(), 'message/rfc822') - eq(part1.is_multipart(), 1) - eq(len(part1.get_payload()), 1) - part1a = part1.get_payload(0) - eq(part1a.is_multipart(), 0) - eq(part1a.get_content_type(), 'text/plain') - neq(part1a.get_payload(), 'message 1\n') - # next message/rfc822 - part2 = msg.get_payload(1) - eq(part2.get_content_type(), 'message/rfc822') - eq(part2.is_multipart(), 1) - eq(len(part2.get_payload()), 1) - part2a = part2.get_payload(0) - eq(part2a.is_multipart(), 0) - eq(part2a.get_content_type(), 'text/plain') - neq(part2a.get_payload(), 'message 2\n') - - def test_three_lines(self): - # A bug report by Andrew McNamara - lines = ['From: Andrew Person From', 'From']) - eq(msg.get_payload(), 'body') - - def test_rfc2822_space_not_allowed_in_header(self): - eq = self.assertEqual - m = '>From foo@example.com 11:25:53\nFrom: bar\n!"#QUX;~: zoo\n\nbody' - msg = email.message_from_string(m) - eq(len(msg.keys()), 0) - - def test_rfc2822_one_character_header(self): - eq = self.assertEqual - m = 'A: first header\nB: second header\nCC: third header\n\nbody' - msg = email.message_from_string(m) - headers = msg.keys() - headers.sort() - eq(headers, ['A', 'B', 'CC']) - eq(msg.get_payload(), 'body') - - - -class TestBase64(unittest.TestCase): - def test_len(self): - eq = self.assertEqual - eq(base64mime.base64_len('hello'), - len(base64mime.encode('hello', eol=''))) - for size in range(15): - if size == 0 : bsize = 0 - elif size <= 3 : bsize = 4 - elif size <= 6 : bsize = 8 - elif size <= 9 : bsize = 12 - elif size <= 12: bsize = 16 - else : bsize = 20 - eq(base64mime.base64_len('x'*size), bsize) - - def test_decode(self): - eq = self.assertEqual - eq(base64mime.decode(''), '') - eq(base64mime.decode('aGVsbG8='), 'hello') - eq(base64mime.decode('aGVsbG8=', 'X'), 'hello') - eq(base64mime.decode('aGVsbG8NCndvcmxk\n', 'X'), 'helloXworld') - - def test_encode(self): - eq = self.assertEqual - eq(base64mime.encode(''), '') - eq(base64mime.encode('hello'), 'aGVsbG8=\n') - # Test the binary flag - eq(base64mime.encode('hello\n'), 'aGVsbG8K\n') - eq(base64mime.encode('hello\n', 0), 'aGVsbG8NCg==\n') - # Test the maxlinelen arg - eq(base64mime.encode('xxxx ' * 20, maxlinelen=40), """\ -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg -eHh4eCB4eHh4IA== -""") - # Test the eol argument - eq(base64mime.encode('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r -eHh4eCB4eHh4IA==\r -""") - - def test_header_encode(self): - eq = self.assertEqual - he = base64mime.header_encode - eq(he('hello'), '=?iso-8859-1?b?aGVsbG8=?=') - eq(he('hello\nworld'), '=?iso-8859-1?b?aGVsbG8NCndvcmxk?=') - # Test the charset option - eq(he('hello', charset='iso-8859-2'), '=?iso-8859-2?b?aGVsbG8=?=') - # Test the keep_eols flag - eq(he('hello\nworld', keep_eols=True), - '=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=') - # Test the maxlinelen argument - eq(he('xxxx ' * 20, maxlinelen=40), """\ -=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?= - =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?= - =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?= - =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?= - =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?= - =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=""") - # Test the eol argument - eq(he('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?=\r - =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?=\r - =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?=\r - =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?=\r - =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?=\r - =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=""") - - - -class TestQuopri(unittest.TestCase): - def setUp(self): - self.hlit = [chr(x) for x in range(ord('a'), ord('z')+1)] + \ - [chr(x) for x in range(ord('A'), ord('Z')+1)] + \ - [chr(x) for x in range(ord('0'), ord('9')+1)] + \ - ['!', '*', '+', '-', '/', ' '] - self.hnon = [chr(x) for x in range(256) if chr(x) not in self.hlit] - assert len(self.hlit) + len(self.hnon) == 256 - self.blit = [chr(x) for x in range(ord(' '), ord('~')+1)] + ['\t'] - self.blit.remove('=') - self.bnon = [chr(x) for x in range(256) if chr(x) not in self.blit] - assert len(self.blit) + len(self.bnon) == 256 - - def test_header_quopri_check(self): - for c in self.hlit: - self.failIf(quoprimime.header_quopri_check(c)) - for c in self.hnon: - self.failUnless(quoprimime.header_quopri_check(c)) - - def test_body_quopri_check(self): - for c in self.blit: - self.failIf(quoprimime.body_quopri_check(c)) - for c in self.bnon: - self.failUnless(quoprimime.body_quopri_check(c)) - - def test_header_quopri_len(self): - eq = self.assertEqual - hql = quoprimime.header_quopri_len - enc = quoprimime.header_encode - for s in ('hello', 'h@e@l@l@o@'): - # Empty charset and no line-endings. 7 == RFC chrome - eq(hql(s), len(enc(s, charset='', eol=''))-7) - for c in self.hlit: - eq(hql(c), 1) - for c in self.hnon: - eq(hql(c), 3) - - def test_body_quopri_len(self): - eq = self.assertEqual - bql = quoprimime.body_quopri_len - for c in self.blit: - eq(bql(c), 1) - for c in self.bnon: - eq(bql(c), 3) - - def test_quote_unquote_idempotent(self): - for x in range(256): - c = chr(x) - self.assertEqual(quoprimime.unquote(quoprimime.quote(c)), c) - - def test_header_encode(self): - eq = self.assertEqual - he = quoprimime.header_encode - eq(he('hello'), '=?iso-8859-1?q?hello?=') - eq(he('hello\nworld'), '=?iso-8859-1?q?hello=0D=0Aworld?=') - # Test the charset option - eq(he('hello', charset='iso-8859-2'), '=?iso-8859-2?q?hello?=') - # Test the keep_eols flag - eq(he('hello\nworld', keep_eols=True), '=?iso-8859-1?q?hello=0Aworld?=') - # Test a non-ASCII character - eq(he('hello\xc7there'), '=?iso-8859-1?q?hello=C7there?=') - # Test the maxlinelen argument - eq(he('xxxx ' * 20, maxlinelen=40), """\ -=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?= - =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?= - =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?= - =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?= - =?iso-8859-1?q?x_xxxx_xxxx_?=""") - # Test the eol argument - eq(he('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?=\r - =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?=\r - =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?=\r - =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?=\r - =?iso-8859-1?q?x_xxxx_xxxx_?=""") - - def test_decode(self): - eq = self.assertEqual - eq(quoprimime.decode(''), '') - eq(quoprimime.decode('hello'), 'hello') - eq(quoprimime.decode('hello', 'X'), 'hello') - eq(quoprimime.decode('hello\nworld', 'X'), 'helloXworld') - - def test_encode(self): - eq = self.assertEqual - eq(quoprimime.encode(''), '') - eq(quoprimime.encode('hello'), 'hello') - # Test the binary flag - eq(quoprimime.encode('hello\r\nworld'), 'hello\nworld') - eq(quoprimime.encode('hello\r\nworld', 0), 'hello\nworld') - # Test the maxlinelen arg - eq(quoprimime.encode('xxxx ' * 20, maxlinelen=40), """\ -xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx= - xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx= -x xxxx xxxx xxxx xxxx=20""") - # Test the eol argument - eq(quoprimime.encode('xxxx ' * 20, maxlinelen=40, eol='\r\n'), """\ -xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=\r - xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=\r -x xxxx xxxx xxxx xxxx=20""") - eq(quoprimime.encode("""\ -one line - -two line"""), """\ -one line - -two line""") - - - -# Test the Charset class -class TestCharset(unittest.TestCase): - def tearDown(self): - from email import charset as CharsetModule - try: - del CharsetModule.CHARSETS['fake'] - except KeyError: - pass - - def test_idempotent(self): - eq = self.assertEqual - # Make sure us-ascii = no Unicode conversion - c = Charset('us-ascii') - s = 'Hello World!' - sp = c.to_splittable(s) - eq(s, c.from_splittable(sp)) - # test 8-bit idempotency with us-ascii - s = '\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa' - sp = c.to_splittable(s) - eq(s, c.from_splittable(sp)) - - def test_body_encode(self): - eq = self.assertEqual - # Try a charset with QP body encoding - c = Charset('iso-8859-1') - eq('hello w=F6rld', c.body_encode('hello w\xf6rld')) - # Try a charset with Base64 body encoding - c = Charset('utf-8') - eq('aGVsbG8gd29ybGQ=\n', c.body_encode('hello world')) - # Try a charset with None body encoding - c = Charset('us-ascii') - eq('hello world', c.body_encode('hello world')) - # Try the convert argument, where input codec <> output codec - c = Charset('euc-jp') - # With apologies to Tokio Kikuchi ;) - try: - eq('\x1b$B5FCO;~IW\x1b(B', - c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7')) - eq('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', - c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', False)) - except LookupError: - # We probably don't have the Japanese codecs installed - pass - # Testing SF bug #625509, which we have to fake, since there are no - # built-in encodings where the header encoding is QP but the body - # encoding is not. - from email import charset as CharsetModule - CharsetModule.add_charset('fake', CharsetModule.QP, None) - c = Charset('fake') - eq('hello w\xf6rld', c.body_encode('hello w\xf6rld')) - - def test_unicode_charset_name(self): - charset = Charset(u'us-ascii') - self.assertEqual(str(charset), 'us-ascii') - self.assertRaises(errors.CharsetError, Charset, 'asc\xffii') - - - -# Test multilingual MIME headers. -class TestHeader(TestEmailBase): - def test_simple(self): - eq = self.ndiffAssertEqual - h = Header('Hello World!') - eq(h.encode(), 'Hello World!') - h.append(' Goodbye World!') - eq(h.encode(), 'Hello World! Goodbye World!') - - def test_simple_surprise(self): - eq = self.ndiffAssertEqual - h = Header('Hello World!') - eq(h.encode(), 'Hello World!') - h.append('Goodbye World!') - eq(h.encode(), 'Hello World! Goodbye World!') - - def test_header_needs_no_decoding(self): - h = 'no decoding needed' - self.assertEqual(decode_header(h), [(h, None)]) - - def test_long(self): - h = Header("I am the very model of a modern Major-General; I've information vegetable, animal, and mineral; I know the kings of England, and I quote the fights historical from Marathon to Waterloo, in order categorical; I'm very well acquainted, too, with matters mathematical; I understand equations, both the simple and quadratical; about binomial theorem I'm teeming with a lot o' news, with many cheerful facts about the square of the hypotenuse.", - maxlinelen=76) - for l in h.encode(splitchars=' ').split('\n '): - self.failUnless(len(l) <= 76) - - def test_multilingual(self): - eq = self.ndiffAssertEqual - g = Charset("iso-8859-1") - cz = Charset("iso-8859-2") - utf8 = Charset("utf-8") - g_head = "Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s\xfcdl\xfcndischen Wandgem\xe4lden vorbei, gegen die rotierenden Klingen bef\xf6rdert. " - cz_head = "Finan\xe8ni metropole se hroutily pod tlakem jejich d\xf9vtipu.. " - utf8_head = u"\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.\u300d\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002".encode("utf-8") - h = Header(g_head, g) - h.append(cz_head, cz) - h.append(utf8_head, utf8) - enc = h.encode() - eq(enc, """\ -=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerderband_ko?= - =?iso-8859-1?q?mfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndischen_Wan?= - =?iso-8859-1?q?dgem=E4lden_vorbei=2C_gegen_die_rotierenden_Klingen_bef=F6?= - =?iso-8859-1?q?rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se_hroutily?= - =?iso-8859-2?q?_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= =?utf-8?b?5q2j56K6?= - =?utf-8?b?44Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb44KT44CC?= - =?utf-8?b?5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go44Gv44Gn?= - =?utf-8?b?44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGFz?= - =?utf-8?q?_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das_Oder_die_Fl?= - =?utf-8?b?aXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBo+OBpuOBhOOBvuOBmQ==?= - =?utf-8?b?44CC?=""") - eq(decode_header(enc), - [(g_head, "iso-8859-1"), (cz_head, "iso-8859-2"), - (utf8_head, "utf-8")]) - ustr = unicode(h) - eq(ustr.encode('utf-8'), - 'Die Mieter treten hier ein werden mit einem Foerderband ' - 'komfortabel den Korridor entlang, an s\xc3\xbcdl\xc3\xbcndischen ' - 'Wandgem\xc3\xa4lden vorbei, gegen die rotierenden Klingen ' - 'bef\xc3\xb6rdert. Finan\xc4\x8dni metropole se hroutily pod ' - 'tlakem jejich d\xc5\xafvtipu.. \xe6\xad\xa3\xe7\xa2\xba\xe3\x81' - '\xab\xe8\xa8\x80\xe3\x81\x86\xe3\x81\xa8\xe7\xbf\xbb\xe8\xa8\xb3' - '\xe3\x81\xaf\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3' - '\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\xe4\xb8\x80\xe9\x83' - '\xa8\xe3\x81\xaf\xe3\x83\x89\xe3\x82\xa4\xe3\x83\x84\xe8\xaa\x9e' - '\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\xe3\x81\x82\xe3' - '\x81\xa8\xe3\x81\xaf\xe3\x81\xa7\xe3\x81\x9f\xe3\x82\x89\xe3\x82' - '\x81\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\xe5\xae\x9f\xe9\x9a\x9b' - '\xe3\x81\xab\xe3\x81\xaf\xe3\x80\x8cWenn ist das Nunstuck git ' - 'und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt ' - 'gersput.\xe3\x80\x8d\xe3\x81\xa8\xe8\xa8\x80\xe3\x81\xa3\xe3\x81' - '\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82') - # Test make_header() - newh = make_header(decode_header(enc)) - eq(newh, enc) - - def test_header_ctor_default_args(self): - eq = self.ndiffAssertEqual - h = Header() - eq(h, '') - h.append('foo', Charset('iso-8859-1')) - eq(h, '=?iso-8859-1?q?foo?=') - - def test_explicit_maxlinelen(self): - eq = self.ndiffAssertEqual - hstr = 'A very long line that must get split to something other than at the 76th character boundary to test the non-default behavior' - h = Header(hstr) - eq(h.encode(), '''\ -A very long line that must get split to something other than at the 76th - character boundary to test the non-default behavior''') - h = Header(hstr, header_name='Subject') - eq(h.encode(), '''\ -A very long line that must get split to something other than at the - 76th character boundary to test the non-default behavior''') - h = Header(hstr, maxlinelen=1024, header_name='Subject') - eq(h.encode(), hstr) - - def test_us_ascii_header(self): - eq = self.assertEqual - s = 'hello' - x = decode_header(s) - eq(x, [('hello', None)]) - h = make_header(x) - eq(s, h.encode()) - - def test_string_charset(self): - eq = self.assertEqual - h = Header() - h.append('hello', 'iso-8859-1') - eq(h, '=?iso-8859-1?q?hello?=') - -## def test_unicode_error(self): -## raises = self.assertRaises -## raises(UnicodeError, Header, u'[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, Header, '[P\xf6stal]', 'us-ascii') -## h = Header() -## raises(UnicodeError, h.append, u'[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, h.append, '[P\xf6stal]', 'us-ascii') -## raises(UnicodeError, Header, u'\u83ca\u5730\u6642\u592b', 'iso-8859-1') - - def test_utf8_shortest(self): - eq = self.assertEqual - h = Header(u'p\xf6stal', 'utf-8') - eq(h.encode(), '=?utf-8?q?p=C3=B6stal?=') - h = Header(u'\u83ca\u5730\u6642\u592b', 'utf-8') - eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=') - - def test_bad_8bit_header(self): - raises = self.assertRaises - eq = self.assertEqual - x = 'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big' - raises(UnicodeError, Header, x) - h = Header() - raises(UnicodeError, h.append, x) - eq(str(Header(x, errors='replace')), x) - h.append(x, errors='replace') - eq(str(h), x) - - def test_encoded_adjacent_nonencoded(self): - eq = self.assertEqual - h = Header() - h.append('hello', 'iso-8859-1') - h.append('world') - s = h.encode() - eq(s, '=?iso-8859-1?q?hello?= world') - h = make_header(decode_header(s)) - eq(h.encode(), s) - - def test_whitespace_eater(self): - eq = self.assertEqual - s = 'Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztk=?= =?koi8-r?q?=CA?= zz.' - parts = decode_header(s) - eq(parts, [('Subject:', None), ('\xf0\xd2\xcf\xd7\xc5\xd2\xcb\xc1 \xce\xc1 \xc6\xc9\xce\xc1\xcc\xd8\xce\xd9\xca', 'koi8-r'), ('zz.', None)]) - hdr = make_header(parts) - eq(hdr.encode(), - 'Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztnK?= zz.') - - def test_broken_base64_header(self): - raises = self.assertRaises - s = 'Subject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3IQ?=' - raises(errors.HeaderParseError, decode_header, s) - - - -# Test RFC 2231 header parameters (en/de)coding -class TestRFC2231(TestEmailBase): - def test_get_param(self): - eq = self.assertEqual - msg = self._msgobj('msg_29.txt') - eq(msg.get_param('title'), - ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) - eq(msg.get_param('title', unquote=False), - ('us-ascii', 'en', '"This is even more ***fun*** isn\'t it!"')) - - def test_set_param(self): - eq = self.assertEqual - msg = Message() - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii') - eq(msg.get_param('title'), - ('us-ascii', '', 'This is even more ***fun*** isn\'t it!')) - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - eq(msg.get_param('title'), - ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) - msg = self._msgobj('msg_01.txt') - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - eq(msg.as_string(), """\ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) -\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 -Content-Type: text/plain; charset=us-ascii; -\ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21" - - -Hi, - -Do you like this message? - --Me -""") - - def test_del_param(self): - eq = self.ndiffAssertEqual - msg = self._msgobj('msg_01.txt') - msg.set_param('foo', 'bar', charset='us-ascii', language='en') - msg.set_param('title', 'This is even more ***fun*** isn\'t it!', - charset='us-ascii', language='en') - msg.del_param('foo', header='Content-Type') - eq(msg.as_string(), """\ -Return-Path: -Delivered-To: bbb@zzz.org -Received: by mail.zzz.org (Postfix, from userid 889) -\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Message-ID: <15090.61304.110929.45684@aaa.zzz.org> -From: bbb@ddd.com (John X. Doe) -To: bbb@zzz.org -Subject: This is a test message -Date: Fri, 4 May 2001 14:05:44 -0400 -Content-Type: text/plain; charset="us-ascii"; -\ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21" - - -Hi, - -Do you like this message? - --Me -""") - - def test_rfc2231_get_content_charset(self): - eq = self.assertEqual - msg = self._msgobj('msg_32.txt') - eq(msg.get_content_charset(), 'us-ascii') - - def test_rfc2231_no_language_or_charset(self): - m = '''\ -Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename="file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm" -Content-Type: text/html; NAME*0=file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEM; NAME*1=P_nsmail.htm - -''' - msg = email.message_from_string(m) - param = msg.get_param('NAME') - self.failIf(isinstance(param, tuple)) - self.assertEqual( - param, - 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm') - - def test_rfc2231_no_language_or_charset_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_filename_encoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_partly_encoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0="''This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual( - msg.get_filename(), - 'This%20is%20even%20more%20***fun*** is it not.pdf') - - def test_rfc2231_partly_nonencoded(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0="This%20is%20even%20more%20"; -\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual( - msg.get_filename(), - 'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_boundary(self): - m = '''\ -Content-Type: multipart/alternative; -\tboundary*0*="''This%20is%20even%20more%20"; -\tboundary*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tboundary*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_boundary(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_no_language_or_charset_in_charset(self): - # This is a nonsensical charset value, but tests the code anyway - m = '''\ -Content-Type: text/plain; -\tcharset*0*="This%20is%20even%20more%20"; -\tcharset*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tcharset*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_content_charset(), - 'this is even more ***fun*** is it not.pdf') - - def test_rfc2231_bad_encoding_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="bogus'xx'This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2="is it not.pdf" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - 'This is even more ***fun*** is it not.pdf') - - def test_rfc2231_bad_encoding_in_charset(self): - m = """\ -Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D - -""" - msg = email.message_from_string(m) - # This should return None because non-ascii characters in the charset - # are not allowed. - self.assertEqual(msg.get_content_charset(), None) - - def test_rfc2231_bad_character_in_charset(self): - m = """\ -Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D - -""" - msg = email.message_from_string(m) - # This should return None because non-ascii characters in the charset - # are not allowed. - self.assertEqual(msg.get_content_charset(), None) - - def test_rfc2231_bad_character_in_filename(self): - m = '''\ -Content-Disposition: inline; -\tfilename*0*="ascii'xx'This%20is%20even%20more%20"; -\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; -\tfilename*2*="is it not.pdf%E2" - -''' - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), - u'This is even more ***fun*** is it not.pdf\ufffd') - - def test_rfc2231_unknown_encoding(self): - m = """\ -Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt - -""" - msg = email.message_from_string(m) - self.assertEqual(msg.get_filename(), 'myfile.txt') - - def test_rfc2231_single_tick_in_filename_extended(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"Frank's\"; name*1*=\" Document\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, None) - eq(language, None) - eq(s, "Frank's Document") - - def test_rfc2231_single_tick_in_filename(self): - m = """\ -Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\" - -""" - msg = email.message_from_string(m) - param = msg.get_param('name') - self.failIf(isinstance(param, tuple)) - self.assertEqual(param, "Frank's Document") - - def test_rfc2231_tick_attack_extended(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"us-ascii'en-us'Frank's\"; name*1*=\" Document\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, "Frank's Document") - - def test_rfc2231_tick_attack(self): - m = """\ -Content-Type: application/x-foo; -\tname*0=\"us-ascii'en-us'Frank's\"; name*1=\" Document\" - -""" - msg = email.message_from_string(m) - param = msg.get_param('name') - self.failIf(isinstance(param, tuple)) - self.assertEqual(param, "us-ascii'en-us'Frank's Document") - - def test_rfc2231_no_extended_values(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; name=\"Frank's Document\" - -""" - msg = email.message_from_string(m) - eq(msg.get_param('name'), "Frank's Document") - - def test_rfc2231_encoded_then_unencoded_segments(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0*=\"us-ascii'en-us'My\"; -\tname*1=\" Document\"; -\tname*2*=\" For You\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, 'My Document For You') - - def test_rfc2231_unencoded_then_encoded_segments(self): - eq = self.assertEqual - m = """\ -Content-Type: application/x-foo; -\tname*0=\"us-ascii'en-us'My\"; -\tname*1*=\" Document\"; -\tname*2*=\" For You\" - -""" - msg = email.message_from_string(m) - charset, language, s = msg.get_param('name') - eq(charset, 'us-ascii') - eq(language, 'en-us') - eq(s, 'My Document For You') - - - -def _testclasses(): - mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite - - -def test_main(): - for testclass in _testclasses(): - run_unittest(testclass) - - - -if __name__ == '__main__': - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/email/test/test_email_torture.py b/sys/lib/python/email/test/test_email_torture.py deleted file mode 100644 index d708b74f9..000000000 --- a/sys/lib/python/email/test/test_email_torture.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (C) 2002-2004 Python Software Foundation -# -# A torture test of the email package. This should not be run as part of the -# standard Python test suite since it requires several meg of email messages -# collected in the wild. These source messages are not checked into the -# Python distro, but are available as part of the standalone email package at -# http://sf.net/projects/mimelib - -import sys -import os -import unittest -from cStringIO import StringIO -from types import ListType - -from email.test.test_email import TestEmailBase -from test.test_support import TestSkipped - -import email -from email import __file__ as testfile -from email.Iterators import _structure - -def openfile(filename): - from os.path import join, dirname, abspath - path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) - return open(path, 'r') - -# Prevent this test from running in the Python distro -try: - openfile('crispin-torture.txt') -except IOError: - raise TestSkipped - - - -class TortureBase(TestEmailBase): - def _msgobj(self, filename): - fp = openfile(filename) - try: - msg = email.message_from_file(fp) - finally: - fp.close() - return msg - - - -class TestCrispinTorture(TortureBase): - # Mark Crispin's torture test from the SquirrelMail project - def test_mondo_message(self): - eq = self.assertEqual - neq = self.ndiffAssertEqual - msg = self._msgobj('crispin-torture.txt') - payload = msg.get_payload() - eq(type(payload), ListType) - eq(len(payload), 12) - eq(msg.preamble, None) - eq(msg.epilogue, '\n') - # Probably the best way to verify the message is parsed correctly is to - # dump its structure and compare it against the known structure. - fp = StringIO() - _structure(msg, fp=fp) - neq(fp.getvalue(), """\ -multipart/mixed - text/plain - message/rfc822 - multipart/alternative - text/plain - multipart/mixed - text/richtext - application/andrew-inset - message/rfc822 - audio/basic - audio/basic - image/pbm - message/rfc822 - multipart/mixed - multipart/mixed - text/plain - audio/x-sun - multipart/mixed - image/gif - image/gif - application/x-be2 - application/atomicmail - audio/x-sun - message/rfc822 - multipart/mixed - text/plain - image/pgm - text/plain - message/rfc822 - multipart/mixed - text/plain - image/pbm - message/rfc822 - application/postscript - image/gif - message/rfc822 - multipart/mixed - audio/basic - audio/basic - message/rfc822 - multipart/mixed - application/postscript - text/plain - message/rfc822 - multipart/mixed - text/plain - multipart/parallel - image/gif - audio/basic - application/atomicmail - message/rfc822 - audio/x-sun -""") - - -def _testclasses(): - mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite - - -def test_main(): - for testclass in _testclasses(): - test_support.run_unittest(testclass) - - - -if __name__ == '__main__': - unittest.main(defaultTest='suite') diff --git a/sys/lib/python/plat-mac/Audio_mac.py b/sys/lib/python/plat-mac/Audio_mac.py deleted file mode 100644 index fd96095ad..000000000 --- a/sys/lib/python/plat-mac/Audio_mac.py +++ /dev/null @@ -1,121 +0,0 @@ -QSIZE = 100000 -error='Audio_mac.error' - -class Play_Audio_mac: - - def __init__(self, qsize=QSIZE): - self._chan = None - self._qsize = qsize - self._outrate = 22254 - self._sampwidth = 1 - self._nchannels = 1 - self._gc = [] - self._usercallback = None - - def __del__(self): - self.stop() - self._usercallback = None - - def wait(self): - import time - while self.getfilled(): - time.sleep(0.1) - self._chan = None - self._gc = [] - - def stop(self, quietNow = 1): - ##chan = self._chan - self._chan = None - ##chan.SndDisposeChannel(1) - self._gc = [] - - def setoutrate(self, outrate): - self._outrate = outrate - - def setsampwidth(self, sampwidth): - self._sampwidth = sampwidth - - def setnchannels(self, nchannels): - self._nchannels = nchannels - - def writeframes(self, data): - import time - from Carbon.Sound import bufferCmd, callBackCmd, extSH - import struct - import MacOS - if not self._chan: - from Carbon import Snd - self._chan = Snd.SndNewChannel(5, 0, self._callback) - nframes = len(data) / self._nchannels / self._sampwidth - if len(data) != nframes * self._nchannels * self._sampwidth: - raise error, 'data is not a whole number of frames' - while self._gc and \ - self.getfilled() + nframes > \ - self._qsize / self._nchannels / self._sampwidth: - time.sleep(0.1) - if self._sampwidth == 1: - import audioop - data = audioop.add(data, '\x80'*len(data), 1) - h1 = struct.pack('llHhllbbl', - id(data)+MacOS.string_id_to_buffer, - self._nchannels, - self._outrate, 0, - 0, - 0, - extSH, - 60, - nframes) - h2 = 22*'\0' - h3 = struct.pack('hhlll', - self._sampwidth*8, - 0, - 0, - 0, - 0) - header = h1+h2+h3 - self._gc.append((header, data)) - self._chan.SndDoCommand((bufferCmd, 0, header), 0) - self._chan.SndDoCommand((callBackCmd, 0, 0), 0) - - def _callback(self, *args): - del self._gc[0] - if self._usercallback: - self._usercallback() - - def setcallback(self, callback): - self._usercallback = callback - - def getfilled(self): - filled = 0 - for header, data in self._gc: - filled = filled + len(data) - return filled / self._nchannels / self._sampwidth - - def getfillable(self): - return (self._qsize / self._nchannels / self._sampwidth) - self.getfilled() - - def ulaw2lin(self, data): - import audioop - return audioop.ulaw2lin(data, 2) - -def test(): - import aifc - import EasyDialogs - fn = EasyDialogs.AskFileForOpen(message="Select an AIFF soundfile", typeList=("AIFF",)) - if not fn: return - af = aifc.open(fn, 'r') - print af.getparams() - p = Play_Audio_mac() - p.setoutrate(af.getframerate()) - p.setsampwidth(af.getsampwidth()) - p.setnchannels(af.getnchannels()) - BUFSIZ = 10000 - while 1: - data = af.readframes(BUFSIZ) - if not data: break - p.writeframes(data) - print 'wrote', len(data), 'space', p.getfillable() - p.wait() - -if __name__ == '__main__': - test() diff --git a/sys/lib/python/plat-mac/Carbon/AE.py b/sys/lib/python/plat-mac/Carbon/AE.py deleted file mode 100644 index 0f4601773..000000000 --- a/sys/lib/python/plat-mac/Carbon/AE.py +++ /dev/null @@ -1 +0,0 @@ -from _AE import * diff --git a/sys/lib/python/plat-mac/Carbon/AH.py b/sys/lib/python/plat-mac/Carbon/AH.py deleted file mode 100644 index 0701e7bd8..000000000 --- a/sys/lib/python/plat-mac/Carbon/AH.py +++ /dev/null @@ -1 +0,0 @@ -from _AH import * diff --git a/sys/lib/python/plat-mac/Carbon/Alias.py b/sys/lib/python/plat-mac/Carbon/Alias.py deleted file mode 100644 index cb612a66b..000000000 --- a/sys/lib/python/plat-mac/Carbon/Alias.py +++ /dev/null @@ -1 +0,0 @@ -from _Alias import * diff --git a/sys/lib/python/plat-mac/Carbon/Aliases.py b/sys/lib/python/plat-mac/Carbon/Aliases.py deleted file mode 100644 index 55e1a1f5a..000000000 --- a/sys/lib/python/plat-mac/Carbon/Aliases.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated from 'Aliases.h' - -def FOUR_CHAR_CODE(x): return x -true = True -false = False -rAliasType = FOUR_CHAR_CODE('alis') -kARMMountVol = 0x00000001 -kARMNoUI = 0x00000002 -kARMMultVols = 0x00000008 -kARMSearch = 0x00000100 -kARMSearchMore = 0x00000200 -kARMSearchRelFirst = 0x00000400 -asiZoneName = -3 -asiServerName = -2 -asiVolumeName = -1 -asiAliasName = 0 -asiParentName = 1 -kResolveAliasFileNoUI = 0x00000001 diff --git a/sys/lib/python/plat-mac/Carbon/App.py b/sys/lib/python/plat-mac/Carbon/App.py deleted file mode 100644 index cc0d46d5d..000000000 --- a/sys/lib/python/plat-mac/Carbon/App.py +++ /dev/null @@ -1 +0,0 @@ -from _App import * diff --git a/sys/lib/python/plat-mac/Carbon/Appearance.py b/sys/lib/python/plat-mac/Carbon/Appearance.py deleted file mode 100644 index d99c6dce0..000000000 --- a/sys/lib/python/plat-mac/Carbon/Appearance.py +++ /dev/null @@ -1,648 +0,0 @@ -# Generated from 'Appearance.h' - -def FOUR_CHAR_CODE(x): return x -kAppearanceEventClass = FOUR_CHAR_CODE('appr') -kAEAppearanceChanged = FOUR_CHAR_CODE('thme') -kAESystemFontChanged = FOUR_CHAR_CODE('sysf') -kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') -kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') -kThemeDataFileType = FOUR_CHAR_CODE('thme') -kThemePlatinumFileType = FOUR_CHAR_CODE('pltn') -kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen') -kThemeSoundTrackFileType = FOUR_CHAR_CODE('tsnd') -kThemeBrushDialogBackgroundActive = 1 -kThemeBrushDialogBackgroundInactive = 2 -kThemeBrushAlertBackgroundActive = 3 -kThemeBrushAlertBackgroundInactive = 4 -kThemeBrushModelessDialogBackgroundActive = 5 -kThemeBrushModelessDialogBackgroundInactive = 6 -kThemeBrushUtilityWindowBackgroundActive = 7 -kThemeBrushUtilityWindowBackgroundInactive = 8 -kThemeBrushListViewSortColumnBackground = 9 -kThemeBrushListViewBackground = 10 -kThemeBrushIconLabelBackground = 11 -kThemeBrushListViewSeparator = 12 -kThemeBrushChasingArrows = 13 -kThemeBrushDragHilite = 14 -kThemeBrushDocumentWindowBackground = 15 -kThemeBrushFinderWindowBackground = 16 -kThemeBrushScrollBarDelimiterActive = 17 -kThemeBrushScrollBarDelimiterInactive = 18 -kThemeBrushFocusHighlight = 19 -kThemeBrushPopupArrowActive = 20 -kThemeBrushPopupArrowPressed = 21 -kThemeBrushPopupArrowInactive = 22 -kThemeBrushAppleGuideCoachmark = 23 -kThemeBrushIconLabelBackgroundSelected = 24 -kThemeBrushStaticAreaFill = 25 -kThemeBrushActiveAreaFill = 26 -kThemeBrushButtonFrameActive = 27 -kThemeBrushButtonFrameInactive = 28 -kThemeBrushButtonFaceActive = 29 -kThemeBrushButtonFaceInactive = 30 -kThemeBrushButtonFacePressed = 31 -kThemeBrushButtonActiveDarkShadow = 32 -kThemeBrushButtonActiveDarkHighlight = 33 -kThemeBrushButtonActiveLightShadow = 34 -kThemeBrushButtonActiveLightHighlight = 35 -kThemeBrushButtonInactiveDarkShadow = 36 -kThemeBrushButtonInactiveDarkHighlight = 37 -kThemeBrushButtonInactiveLightShadow = 38 -kThemeBrushButtonInactiveLightHighlight = 39 -kThemeBrushButtonPressedDarkShadow = 40 -kThemeBrushButtonPressedDarkHighlight = 41 -kThemeBrushButtonPressedLightShadow = 42 -kThemeBrushButtonPressedLightHighlight = 43 -kThemeBrushBevelActiveLight = 44 -kThemeBrushBevelActiveDark = 45 -kThemeBrushBevelInactiveLight = 46 -kThemeBrushBevelInactiveDark = 47 -kThemeBrushNotificationWindowBackground = 48 -kThemeBrushMovableModalBackground = 49 -kThemeBrushSheetBackgroundOpaque = 50 -kThemeBrushDrawerBackground = 51 -kThemeBrushToolbarBackground = 52 -kThemeBrushSheetBackgroundTransparent = 53 -kThemeBrushMenuBackground = 54 -kThemeBrushMenuBackgroundSelected = 55 -kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque -kThemeBrushBlack = -1 -kThemeBrushWhite = -2 -kThemeBrushPrimaryHighlightColor = -3 -kThemeBrushSecondaryHighlightColor = -4 -kThemeTextColorDialogActive = 1 -kThemeTextColorDialogInactive = 2 -kThemeTextColorAlertActive = 3 -kThemeTextColorAlertInactive = 4 -kThemeTextColorModelessDialogActive = 5 -kThemeTextColorModelessDialogInactive = 6 -kThemeTextColorWindowHeaderActive = 7 -kThemeTextColorWindowHeaderInactive = 8 -kThemeTextColorPlacardActive = 9 -kThemeTextColorPlacardInactive = 10 -kThemeTextColorPlacardPressed = 11 -kThemeTextColorPushButtonActive = 12 -kThemeTextColorPushButtonInactive = 13 -kThemeTextColorPushButtonPressed = 14 -kThemeTextColorBevelButtonActive = 15 -kThemeTextColorBevelButtonInactive = 16 -kThemeTextColorBevelButtonPressed = 17 -kThemeTextColorPopupButtonActive = 18 -kThemeTextColorPopupButtonInactive = 19 -kThemeTextColorPopupButtonPressed = 20 -kThemeTextColorIconLabel = 21 -kThemeTextColorListView = 22 -kThemeTextColorDocumentWindowTitleActive = 23 -kThemeTextColorDocumentWindowTitleInactive = 24 -kThemeTextColorMovableModalWindowTitleActive = 25 -kThemeTextColorMovableModalWindowTitleInactive = 26 -kThemeTextColorUtilityWindowTitleActive = 27 -kThemeTextColorUtilityWindowTitleInactive = 28 -kThemeTextColorPopupWindowTitleActive = 29 -kThemeTextColorPopupWindowTitleInactive = 30 -kThemeTextColorRootMenuActive = 31 -kThemeTextColorRootMenuSelected = 32 -kThemeTextColorRootMenuDisabled = 33 -kThemeTextColorMenuItemActive = 34 -kThemeTextColorMenuItemSelected = 35 -kThemeTextColorMenuItemDisabled = 36 -kThemeTextColorPopupLabelActive = 37 -kThemeTextColorPopupLabelInactive = 38 -kThemeTextColorTabFrontActive = 39 -kThemeTextColorTabNonFrontActive = 40 -kThemeTextColorTabNonFrontPressed = 41 -kThemeTextColorTabFrontInactive = 42 -kThemeTextColorTabNonFrontInactive = 43 -kThemeTextColorIconLabelSelected = 44 -kThemeTextColorBevelButtonStickyActive = 45 -kThemeTextColorBevelButtonStickyInactive = 46 -kThemeTextColorNotification = 47 -kThemeTextColorBlack = -1 -kThemeTextColorWhite = -2 -kThemeStateInactive = 0 -kThemeStateActive = 1 -kThemeStatePressed = 2 -kThemeStateRollover = 6 -kThemeStateUnavailable = 7 -kThemeStateUnavailableInactive = 8 -kThemeStateDisabled = 0 -kThemeStatePressedUp = 2 -kThemeStatePressedDown = 3 -kThemeArrowCursor = 0 -kThemeCopyArrowCursor = 1 -kThemeAliasArrowCursor = 2 -kThemeContextualMenuArrowCursor = 3 -kThemeIBeamCursor = 4 -kThemeCrossCursor = 5 -kThemePlusCursor = 6 -kThemeWatchCursor = 7 -kThemeClosedHandCursor = 8 -kThemeOpenHandCursor = 9 -kThemePointingHandCursor = 10 -kThemeCountingUpHandCursor = 11 -kThemeCountingDownHandCursor = 12 -kThemeCountingUpAndDownHandCursor = 13 -kThemeSpinningCursor = 14 -kThemeResizeLeftCursor = 15 -kThemeResizeRightCursor = 16 -kThemeResizeLeftRightCursor = 17 -kThemeMenuBarNormal = 0 -kThemeMenuBarSelected = 1 -kThemeMenuSquareMenuBar = (1 << 0) -kThemeMenuActive = 0 -kThemeMenuSelected = 1 -kThemeMenuDisabled = 3 -kThemeMenuTypePullDown = 0 -kThemeMenuTypePopUp = 1 -kThemeMenuTypeHierarchical = 2 -kThemeMenuTypeInactive = 0x0100 -kThemeMenuItemPlain = 0 -kThemeMenuItemHierarchical = 1 -kThemeMenuItemScrollUpArrow = 2 -kThemeMenuItemScrollDownArrow = 3 -kThemeMenuItemAtTop = 0x0100 -kThemeMenuItemAtBottom = 0x0200 -kThemeMenuItemHierBackground = 0x0400 -kThemeMenuItemPopUpBackground = 0x0800 -kThemeMenuItemHasIcon = 0x8000 -kThemeMenuItemNoBackground = 0x4000 -kThemeBackgroundTabPane = 1 -kThemeBackgroundPlacard = 2 -kThemeBackgroundWindowHeader = 3 -kThemeBackgroundListViewWindowHeader = 4 -kThemeBackgroundSecondaryGroupBox = 5 -kThemeNameTag = FOUR_CHAR_CODE('name') -kThemeVariantNameTag = FOUR_CHAR_CODE('varn') -kThemeVariantBaseTintTag = FOUR_CHAR_CODE('tint') -kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol') -kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar') -kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth') -kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds') -kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll') -kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme') -kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf') -kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf') -kThemeViewsFontTag = FOUR_CHAR_CODE('vfnt') -kThemeViewsFontSizeTag = FOUR_CHAR_CODE('vfsz') -kThemeDesktopPatternNameTag = FOUR_CHAR_CODE('patn') -kThemeDesktopPatternTag = FOUR_CHAR_CODE('patt') -kThemeDesktopPictureNameTag = FOUR_CHAR_CODE('dpnm') -kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal') -kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan') -kThemeHighlightColorNameTag = FOUR_CHAR_CODE('hcnm') -kThemeExamplePictureIDTag = FOUR_CHAR_CODE('epic') -kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt') -kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk') -kThemeUserDefinedTag = FOUR_CHAR_CODE('user') -kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo') -kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos') -kTiledOnScreen = 1 -kCenterOnScreen = 2 -kFitToScreen = 3 -kFillScreen = 4 -kUseBestGuess = 5 -kThemeCheckBoxClassicX = 0 -kThemeCheckBoxCheckMark = 1 -kThemeScrollBarArrowsSingle = 0 -kThemeScrollBarArrowsLowerRight = 1 -kThemeScrollBarThumbNormal = 0 -kThemeScrollBarThumbProportional = 1 -kThemeSystemFont = 0 -kThemeSmallSystemFont = 1 -kThemeSmallEmphasizedSystemFont = 2 -kThemeViewsFont = 3 -kThemeEmphasizedSystemFont = 4 -kThemeApplicationFont = 5 -kThemeLabelFont = 6 -kThemeMenuTitleFont = 100 -kThemeMenuItemFont = 101 -kThemeMenuItemMarkFont = 102 -kThemeMenuItemCmdKeyFont = 103 -kThemeWindowTitleFont = 104 -kThemePushButtonFont = 105 -kThemeUtilityWindowTitleFont = 106 -kThemeAlertHeaderFont = 107 -kThemeCurrentPortFont = 200 -kThemeTabNonFront = 0 -kThemeTabNonFrontPressed = 1 -kThemeTabNonFrontInactive = 2 -kThemeTabFront = 3 -kThemeTabFrontInactive = 4 -kThemeTabNonFrontUnavailable = 5 -kThemeTabFrontUnavailable = 6 -kThemeTabNorth = 0 -kThemeTabSouth = 1 -kThemeTabEast = 2 -kThemeTabWest = 3 -kThemeSmallTabHeight = 16 -kThemeLargeTabHeight = 21 -kThemeTabPaneOverlap = 3 -kThemeSmallTabHeightMax = 19 -kThemeLargeTabHeightMax = 24 -kThemeMediumScrollBar = 0 -kThemeSmallScrollBar = 1 -kThemeMediumSlider = 2 -kThemeMediumProgressBar = 3 -kThemeMediumIndeterminateBar = 4 -kThemeRelevanceBar = 5 -kThemeSmallSlider = 6 -kThemeLargeProgressBar = 7 -kThemeLargeIndeterminateBar = 8 -kThemeTrackActive = 0 -kThemeTrackDisabled = 1 -kThemeTrackNothingToScroll = 2 -kThemeTrackInactive = 3 -kThemeLeftOutsideArrowPressed = 0x01 -kThemeLeftInsideArrowPressed = 0x02 -kThemeLeftTrackPressed = 0x04 -kThemeThumbPressed = 0x08 -kThemeRightTrackPressed = 0x10 -kThemeRightInsideArrowPressed = 0x20 -kThemeRightOutsideArrowPressed = 0x40 -kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed -kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed -kThemeTopTrackPressed = kThemeLeftTrackPressed -kThemeBottomTrackPressed = kThemeRightTrackPressed -kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed -kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed -kThemeThumbPlain = 0 -kThemeThumbUpward = 1 -kThemeThumbDownward = 2 -kThemeTrackHorizontal = (1 << 0) -kThemeTrackRightToLeft = (1 << 1) -kThemeTrackShowThumb = (1 << 2) -kThemeTrackThumbRgnIsNotGhost = (1 << 3) -kThemeTrackNoScrollBarArrows = (1 << 4) -kThemeWindowHasGrow = (1 << 0) -kThemeWindowHasHorizontalZoom = (1 << 3) -kThemeWindowHasVerticalZoom = (1 << 4) -kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom -kThemeWindowHasCloseBox = (1 << 5) -kThemeWindowHasCollapseBox = (1 << 6) -kThemeWindowHasTitleText = (1 << 7) -kThemeWindowIsCollapsed = (1 << 8) -kThemeWindowHasDirty = (1 << 9) -kThemeDocumentWindow = 0 -kThemeDialogWindow = 1 -kThemeMovableDialogWindow = 2 -kThemeAlertWindow = 3 -kThemeMovableAlertWindow = 4 -kThemePlainDialogWindow = 5 -kThemeShadowDialogWindow = 6 -kThemePopupWindow = 7 -kThemeUtilityWindow = 8 -kThemeUtilitySideWindow = 9 -kThemeSheetWindow = 10 -kThemeDrawerWindow = 11 -kThemeWidgetCloseBox = 0 -kThemeWidgetZoomBox = 1 -kThemeWidgetCollapseBox = 2 -kThemeWidgetDirtyCloseBox = 6 -kThemeArrowLeft = 0 -kThemeArrowDown = 1 -kThemeArrowRight = 2 -kThemeArrowUp = 3 -kThemeArrow3pt = 0 -kThemeArrow5pt = 1 -kThemeArrow7pt = 2 -kThemeArrow9pt = 3 -kThemeGrowLeft = (1 << 0) -kThemeGrowRight = (1 << 1) -kThemeGrowUp = (1 << 2) -kThemeGrowDown = (1 << 3) -kThemePushButton = 0 -kThemeCheckBox = 1 -kThemeRadioButton = 2 -kThemeBevelButton = 3 -kThemeArrowButton = 4 -kThemePopupButton = 5 -kThemeDisclosureButton = 6 -kThemeIncDecButton = 7 -kThemeSmallBevelButton = 8 -kThemeMediumBevelButton = 3 -kThemeLargeBevelButton = 9 -kThemeListHeaderButton = 10 -kThemeRoundButton = 11 -kThemeLargeRoundButton = 12 -kThemeSmallCheckBox = 13 -kThemeSmallRadioButton = 14 -kThemeRoundedBevelButton = 15 -kThemeNormalCheckBox = kThemeCheckBox -kThemeNormalRadioButton = kThemeRadioButton -kThemeButtonOff = 0 -kThemeButtonOn = 1 -kThemeButtonMixed = 2 -kThemeDisclosureRight = 0 -kThemeDisclosureDown = 1 -kThemeDisclosureLeft = 2 -kThemeAdornmentNone = 0 -kThemeAdornmentDefault = (1 << 0) -kThemeAdornmentFocus = (1 << 2) -kThemeAdornmentRightToLeft = (1 << 4) -kThemeAdornmentDrawIndicatorOnly = (1 << 5) -kThemeAdornmentHeaderButtonLeftNeighborSelected = (1 << 6) -kThemeAdornmentHeaderButtonRightNeighborSelected = (1 << 7) -kThemeAdornmentHeaderButtonSortUp = (1 << 8) -kThemeAdornmentHeaderMenuButton = (1 << 9) -kThemeAdornmentHeaderButtonNoShadow = (1 << 10) -kThemeAdornmentHeaderButtonShadowOnly = (1 << 11) -kThemeAdornmentNoShadow = kThemeAdornmentHeaderButtonNoShadow -kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly -kThemeAdornmentArrowLeftArrow = (1 << 6) -kThemeAdornmentArrowDownArrow = (1 << 7) -kThemeAdornmentArrowDoubleArrow = (1 << 8) -kThemeAdornmentArrowUpArrow = (1 << 9) -kThemeNoSounds = 0 -kThemeWindowSoundsMask = (1 << 0) -kThemeMenuSoundsMask = (1 << 1) -kThemeControlSoundsMask = (1 << 2) -kThemeFinderSoundsMask = (1 << 3) -kThemeDragSoundNone = 0 -kThemeDragSoundMoveWindow = FOUR_CHAR_CODE('wmov') -kThemeDragSoundGrowWindow = FOUR_CHAR_CODE('wgro') -kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov') -kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro') -kThemeDragSoundMoveDialog = FOUR_CHAR_CODE('dmov') -kThemeDragSoundMoveAlert = FOUR_CHAR_CODE('amov') -kThemeDragSoundMoveIcon = FOUR_CHAR_CODE('imov') -kThemeDragSoundSliderThumb = FOUR_CHAR_CODE('slth') -kThemeDragSoundSliderGhost = FOUR_CHAR_CODE('slgh') -kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth') -kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh') -kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad') -kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai') -kThemeDragSoundDragging = FOUR_CHAR_CODE('drag') -kThemeSoundNone = 0 -kThemeSoundMenuOpen = FOUR_CHAR_CODE('mnuo') -kThemeSoundMenuClose = FOUR_CHAR_CODE('mnuc') -kThemeSoundMenuItemHilite = FOUR_CHAR_CODE('mnui') -kThemeSoundMenuItemRelease = FOUR_CHAR_CODE('mnus') -kThemeSoundWindowClosePress = FOUR_CHAR_CODE('wclp') -kThemeSoundWindowCloseEnter = FOUR_CHAR_CODE('wcle') -kThemeSoundWindowCloseExit = FOUR_CHAR_CODE('wclx') -kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr') -kThemeSoundWindowZoomPress = FOUR_CHAR_CODE('wzmp') -kThemeSoundWindowZoomEnter = FOUR_CHAR_CODE('wzme') -kThemeSoundWindowZoomExit = FOUR_CHAR_CODE('wzmx') -kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr') -kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop') -kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe') -kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox') -kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor') -kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd') -kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp') -kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle') -kThemeSoundUtilWinCloseExit = FOUR_CHAR_CODE('uclx') -kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr') -kThemeSoundUtilWinZoomPress = FOUR_CHAR_CODE('uzmp') -kThemeSoundUtilWinZoomEnter = FOUR_CHAR_CODE('uzme') -kThemeSoundUtilWinZoomExit = FOUR_CHAR_CODE('uzmx') -kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr') -kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop') -kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe') -kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox') -kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor') -kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd') -kThemeSoundWindowOpen = FOUR_CHAR_CODE('wopn') -kThemeSoundWindowClose = FOUR_CHAR_CODE('wcls') -kThemeSoundWindowZoomIn = FOUR_CHAR_CODE('wzmi') -kThemeSoundWindowZoomOut = FOUR_CHAR_CODE('wzmo') -kThemeSoundWindowCollapseUp = FOUR_CHAR_CODE('wcol') -kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp') -kThemeSoundWindowActivate = FOUR_CHAR_CODE('wact') -kThemeSoundUtilWindowOpen = FOUR_CHAR_CODE('uopn') -kThemeSoundUtilWindowClose = FOUR_CHAR_CODE('ucls') -kThemeSoundUtilWindowZoomIn = FOUR_CHAR_CODE('uzmi') -kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo') -kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol') -kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp') -kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact') -kThemeSoundDialogOpen = FOUR_CHAR_CODE('dopn') -kThemeSoundDialogClose = FOUR_CHAR_CODE('dlgc') -kThemeSoundAlertOpen = FOUR_CHAR_CODE('aopn') -kThemeSoundAlertClose = FOUR_CHAR_CODE('altc') -kThemeSoundPopupWindowOpen = FOUR_CHAR_CODE('pwop') -kThemeSoundPopupWindowClose = FOUR_CHAR_CODE('pwcl') -kThemeSoundButtonPress = FOUR_CHAR_CODE('btnp') -kThemeSoundButtonEnter = FOUR_CHAR_CODE('btne') -kThemeSoundButtonExit = FOUR_CHAR_CODE('btnx') -kThemeSoundButtonRelease = FOUR_CHAR_CODE('btnr') -kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp') -kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte') -kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx') -kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr') -kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp') -kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte') -kThemeSoundCancelButtonExit = FOUR_CHAR_CODE('cbtx') -kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr') -kThemeSoundCheckboxPress = FOUR_CHAR_CODE('chkp') -kThemeSoundCheckboxEnter = FOUR_CHAR_CODE('chke') -kThemeSoundCheckboxExit = FOUR_CHAR_CODE('chkx') -kThemeSoundCheckboxRelease = FOUR_CHAR_CODE('chkr') -kThemeSoundRadioPress = FOUR_CHAR_CODE('radp') -kThemeSoundRadioEnter = FOUR_CHAR_CODE('rade') -kThemeSoundRadioExit = FOUR_CHAR_CODE('radx') -kThemeSoundRadioRelease = FOUR_CHAR_CODE('radr') -kThemeSoundScrollArrowPress = FOUR_CHAR_CODE('sbap') -kThemeSoundScrollArrowEnter = FOUR_CHAR_CODE('sbae') -kThemeSoundScrollArrowExit = FOUR_CHAR_CODE('sbax') -kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar') -kThemeSoundScrollEndOfTrack = FOUR_CHAR_CODE('sbte') -kThemeSoundScrollTrackPress = FOUR_CHAR_CODE('sbtp') -kThemeSoundSliderEndOfTrack = FOUR_CHAR_CODE('slte') -kThemeSoundSliderTrackPress = FOUR_CHAR_CODE('sltp') -kThemeSoundBalloonOpen = FOUR_CHAR_CODE('blno') -kThemeSoundBalloonClose = FOUR_CHAR_CODE('blnc') -kThemeSoundBevelPress = FOUR_CHAR_CODE('bevp') -kThemeSoundBevelEnter = FOUR_CHAR_CODE('beve') -kThemeSoundBevelExit = FOUR_CHAR_CODE('bevx') -kThemeSoundBevelRelease = FOUR_CHAR_CODE('bevr') -kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup') -kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp') -kThemeSoundLittleArrowEnter = FOUR_CHAR_CODE('lare') -kThemeSoundLittleArrowExit = FOUR_CHAR_CODE('larx') -kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur') -kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr') -kThemeSoundPopupPress = FOUR_CHAR_CODE('popp') -kThemeSoundPopupEnter = FOUR_CHAR_CODE('pope') -kThemeSoundPopupExit = FOUR_CHAR_CODE('popx') -kThemeSoundPopupRelease = FOUR_CHAR_CODE('popr') -kThemeSoundDisclosurePress = FOUR_CHAR_CODE('dscp') -kThemeSoundDisclosureEnter = FOUR_CHAR_CODE('dsce') -kThemeSoundDisclosureExit = FOUR_CHAR_CODE('dscx') -kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr') -kThemeSoundTabPressed = FOUR_CHAR_CODE('tabp') -kThemeSoundTabEnter = FOUR_CHAR_CODE('tabe') -kThemeSoundTabExit = FOUR_CHAR_CODE('tabx') -kThemeSoundTabRelease = FOUR_CHAR_CODE('tabr') -kThemeSoundDragTargetHilite = FOUR_CHAR_CODE('dthi') -kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh') -kThemeSoundDragTargetDrop = FOUR_CHAR_CODE('dtdr') -kThemeSoundEmptyTrash = FOUR_CHAR_CODE('ftrs') -kThemeSoundSelectItem = FOUR_CHAR_CODE('fsel') -kThemeSoundNewItem = FOUR_CHAR_CODE('fnew') -kThemeSoundReceiveDrop = FOUR_CHAR_CODE('fdrp') -kThemeSoundCopyDone = FOUR_CHAR_CODE('fcpd') -kThemeSoundResolveAlias = FOUR_CHAR_CODE('fral') -kThemeSoundLaunchApp = FOUR_CHAR_CODE('flap') -kThemeSoundDiskInsert = FOUR_CHAR_CODE('dski') -kThemeSoundDiskEject = FOUR_CHAR_CODE('dske') -kThemeSoundFinderDragOnIcon = FOUR_CHAR_CODE('fdon') -kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof') -kThemePopupTabNormalPosition = 0 -kThemePopupTabCenterOnWindow = 1 -kThemePopupTabCenterOnOffset = 2 -kThemeMetricScrollBarWidth = 0 -kThemeMetricSmallScrollBarWidth = 1 -kThemeMetricCheckBoxHeight = 2 -kThemeMetricRadioButtonHeight = 3 -kThemeMetricEditTextWhitespace = 4 -kThemeMetricEditTextFrameOutset = 5 -kThemeMetricListBoxFrameOutset = 6 -kThemeMetricFocusRectOutset = 7 -kThemeMetricImageWellThickness = 8 -kThemeMetricScrollBarOverlap = 9 -kThemeMetricLargeTabHeight = 10 -kThemeMetricLargeTabCapsWidth = 11 -kThemeMetricTabFrameOverlap = 12 -kThemeMetricTabIndentOrStyle = 13 -kThemeMetricTabOverlap = 14 -kThemeMetricSmallTabHeight = 15 -kThemeMetricSmallTabCapsWidth = 16 -kThemeMetricDisclosureButtonHeight = 17 -kThemeMetricRoundButtonSize = 18 -kThemeMetricPushButtonHeight = 19 -kThemeMetricListHeaderHeight = 20 -kThemeMetricSmallCheckBoxHeight = 21 -kThemeMetricDisclosureButtonWidth = 22 -kThemeMetricSmallDisclosureButtonHeight = 23 -kThemeMetricSmallDisclosureButtonWidth = 24 -kThemeMetricDisclosureTriangleHeight = 25 -kThemeMetricDisclosureTriangleWidth = 26 -kThemeMetricLittleArrowsHeight = 27 -kThemeMetricLittleArrowsWidth = 28 -kThemeMetricPaneSplitterHeight = 29 -kThemeMetricPopupButtonHeight = 30 -kThemeMetricSmallPopupButtonHeight = 31 -kThemeMetricLargeProgressBarThickness = 32 -kThemeMetricPullDownHeight = 33 -kThemeMetricSmallPullDownHeight = 34 -kThemeMetricSmallPushButtonHeight = 35 -kThemeMetricSmallRadioButtonHeight = 36 -kThemeMetricRelevanceIndicatorHeight = 37 -kThemeMetricResizeControlHeight = 38 -kThemeMetricSmallResizeControlHeight = 39 -kThemeMetricLargeRoundButtonSize = 40 -kThemeMetricHSliderHeight = 41 -kThemeMetricHSliderTickHeight = 42 -kThemeMetricSmallHSliderHeight = 43 -kThemeMetricSmallHSliderTickHeight = 44 -kThemeMetricVSliderWidth = 45 -kThemeMetricVSliderTickWidth = 46 -kThemeMetricSmallVSliderWidth = 47 -kThemeMetricSmallVSliderTickWidth = 48 -kThemeMetricTitleBarControlsHeight = 49 -kThemeMetricCheckBoxWidth = 50 -kThemeMetricSmallCheckBoxWidth = 51 -kThemeMetricRadioButtonWidth = 52 -kThemeMetricSmallRadioButtonWidth = 53 -kThemeMetricSmallHSliderMinThumbWidth = 54 -kThemeMetricSmallVSliderMinThumbHeight = 55 -kThemeMetricSmallHSliderTickOffset = 56 -kThemeMetricSmallVSliderTickOffset = 57 -kThemeMetricNormalProgressBarThickness = 58 -kThemeMetricProgressBarShadowOutset = 59 -kThemeMetricSmallProgressBarShadowOutset = 60 -kThemeMetricPrimaryGroupBoxContentInset = 61 -kThemeMetricSecondaryGroupBoxContentInset = 62 -kThemeMetricMenuMarkColumnWidth = 63 -kThemeMetricMenuExcludedMarkColumnWidth = 64 -kThemeMetricMenuMarkIndent = 65 -kThemeMetricMenuTextLeadingEdgeMargin = 66 -kThemeMetricMenuTextTrailingEdgeMargin = 67 -kThemeMetricMenuIndentWidth = 68 -kThemeMetricMenuIconTrailingEdgeMargin = 69 -# appearanceBadBrushIndexErr = themeInvalidBrushErr -# appearanceProcessRegisteredErr = themeProcessRegisteredErr -# appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr -# appearanceBadTextColorIndexErr = themeBadTextColorErr -# appearanceThemeHasNoAccents = themeHasNoAccentsErr -# appearanceBadCursorIndexErr = themeBadCursorIndexErr -kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive -kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive -kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive -kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive -kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive -kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive -kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive -kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive -kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground -kThemeListViewBackgroundBrush = kThemeBrushListViewBackground -kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground -kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator -kThemeChasingArrowsBrush = kThemeBrushChasingArrows -kThemeDragHiliteBrush = kThemeBrushDragHilite -kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground -kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground -kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive -kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive -kThemeFocusHighlightBrush = kThemeBrushFocusHighlight -kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive -kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed -kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive -kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark -kThemeActiveDialogTextColor = kThemeTextColorDialogActive -kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive -kThemeActiveAlertTextColor = kThemeTextColorAlertActive -kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive -kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive -kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive -kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive -kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive -kThemeActivePlacardTextColor = kThemeTextColorPlacardActive -kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive -kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed -kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive -kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive -kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed -kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive -kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive -kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed -kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive -kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive -kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed -kThemeIconLabelTextColor = kThemeTextColorIconLabel -kThemeListViewTextColor = kThemeTextColorListView -kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive -kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive -kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive -kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive -kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive -kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive -kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive -kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive -kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive -kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected -kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled -kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive -kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected -kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled -kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive -kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive -kAEThemeSwitch = kAEAppearanceChanged -kThemeNoAdornment = kThemeAdornmentNone -kThemeDefaultAdornment = kThemeAdornmentDefault -kThemeFocusAdornment = kThemeAdornmentFocus -kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft -kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly -kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill -kThemeMetricCheckBoxGlyphHeight = kThemeMetricCheckBoxHeight -kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight -kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight -kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight -kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness -kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness -kThemeScrollBar = kThemeMediumScrollBar -kThemeSlider = kThemeMediumSlider -kThemeProgressBar = kThemeMediumProgressBar -kThemeIndeterminateBar = kThemeMediumIndeterminateBar diff --git a/sys/lib/python/plat-mac/Carbon/AppleEvents.py b/sys/lib/python/plat-mac/Carbon/AppleEvents.py deleted file mode 100644 index e23c0797a..000000000 --- a/sys/lib/python/plat-mac/Carbon/AppleEvents.py +++ /dev/null @@ -1,960 +0,0 @@ -# Generated from 'AEDataModel.h' - -def FOUR_CHAR_CODE(x): return x -typeBoolean = FOUR_CHAR_CODE('bool') -typeChar = FOUR_CHAR_CODE('TEXT') -typeSInt16 = FOUR_CHAR_CODE('shor') -typeSInt32 = FOUR_CHAR_CODE('long') -typeUInt32 = FOUR_CHAR_CODE('magn') -typeSInt64 = FOUR_CHAR_CODE('comp') -typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing') -typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub') -type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl') -typeDecimalStruct = FOUR_CHAR_CODE('decm') -typeSMInt = typeSInt16 -typeShortInteger = typeSInt16 -typeInteger = typeSInt32 -typeLongInteger = typeSInt32 -typeMagnitude = typeUInt32 -typeComp = typeSInt64 -typeSMFloat = typeIEEE32BitFloatingPoint -typeShortFloat = typeIEEE32BitFloatingPoint -typeFloat = typeIEEE64BitFloatingPoint -typeLongFloat = typeIEEE64BitFloatingPoint -typeExtended = FOUR_CHAR_CODE('exte') -typeAEList = FOUR_CHAR_CODE('list') -typeAERecord = FOUR_CHAR_CODE('reco') -typeAppleEvent = FOUR_CHAR_CODE('aevt') -typeEventRecord = FOUR_CHAR_CODE('evrc') -typeTrue = FOUR_CHAR_CODE('true') -typeFalse = FOUR_CHAR_CODE('fals') -typeAlias = FOUR_CHAR_CODE('alis') -typeEnumerated = FOUR_CHAR_CODE('enum') -typeType = FOUR_CHAR_CODE('type') -typeAppParameters = FOUR_CHAR_CODE('appa') -typeProperty = FOUR_CHAR_CODE('prop') -typeFSS = FOUR_CHAR_CODE('fss ') -typeFSRef = FOUR_CHAR_CODE('fsrf') -typeFileURL = FOUR_CHAR_CODE('furl') -typeKeyword = FOUR_CHAR_CODE('keyw') -typeSectionH = FOUR_CHAR_CODE('sect') -typeWildCard = FOUR_CHAR_CODE('****') -typeApplSignature = FOUR_CHAR_CODE('sign') -typeQDRectangle = FOUR_CHAR_CODE('qdrt') -typeFixed = FOUR_CHAR_CODE('fixd') -typeProcessSerialNumber = FOUR_CHAR_CODE('psn ') -typeApplicationURL = FOUR_CHAR_CODE('aprl') -typeNull = FOUR_CHAR_CODE('null') -typeSessionID = FOUR_CHAR_CODE('ssid') -typeTargetID = FOUR_CHAR_CODE('targ') -typeDispatcherID = FOUR_CHAR_CODE('dspt') -keyTransactionIDAttr = FOUR_CHAR_CODE('tran') -keyReturnIDAttr = FOUR_CHAR_CODE('rtid') -keyEventClassAttr = FOUR_CHAR_CODE('evcl') -keyEventIDAttr = FOUR_CHAR_CODE('evid') -keyAddressAttr = FOUR_CHAR_CODE('addr') -keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk') -keyTimeoutAttr = FOUR_CHAR_CODE('timo') -keyInteractLevelAttr = FOUR_CHAR_CODE('inte') -keyEventSourceAttr = FOUR_CHAR_CODE('esrc') -keyMissedKeywordAttr = FOUR_CHAR_CODE('miss') -keyOriginalAddressAttr = FOUR_CHAR_CODE('from') -keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm') -kAEDescListFactorNone = 0 -kAEDescListFactorType = 4 -kAEDescListFactorTypeAndSize = 8 -kAutoGenerateReturnID = -1 -kAnyTransactionID = 0 -kAEDataArray = 0 -kAEPackedArray = 1 -kAEDescArray = 3 -kAEKeyDescArray = 4 -kAEHandleArray = 2 -kAENormalPriority = 0x00000000 -kAEHighPriority = 0x00000001 -kAENoReply = 0x00000001 -kAEQueueReply = 0x00000002 -kAEWaitReply = 0x00000003 -kAEDontReconnect = 0x00000080 -kAEWantReceipt = 0x00000200 -kAENeverInteract = 0x00000010 -kAECanInteract = 0x00000020 -kAEAlwaysInteract = 0x00000030 -kAECanSwitchLayer = 0x00000040 -kAEDontRecord = 0x00001000 -kAEDontExecute = 0x00002000 -kAEProcessNonReplyEvents = 0x00008000 -kAEDefaultTimeout = -1 -kNoTimeOut = -2 -kAEInteractWithSelf = 0 -kAEInteractWithLocal = 1 -kAEInteractWithAll = 2 -kAEDoNotIgnoreHandler = 0x00000000 -kAEIgnoreAppPhacHandler = 0x00000001 -kAEIgnoreAppEventHandler = 0x00000002 -kAEIgnoreSysPhacHandler = 0x00000004 -kAEIgnoreSysEventHandler = 0x00000008 -kAEIngoreBuiltInEventHandler = 0x00000010 -# kAEDontDisposeOnResume = (long)0x80000000 -kAENoDispatch = 0 -# kAEUseStandardDispatch = (long)0xFFFFFFFF -keyDirectObject = FOUR_CHAR_CODE('----') -keyErrorNumber = FOUR_CHAR_CODE('errn') -keyErrorString = FOUR_CHAR_CODE('errs') -keyProcessSerialNumber = FOUR_CHAR_CODE('psn ') -keyPreDispatch = FOUR_CHAR_CODE('phac') -keySelectProc = FOUR_CHAR_CODE('selh') -keyAERecorderCount = FOUR_CHAR_CODE('recr') -keyAEVersion = FOUR_CHAR_CODE('vers') -kCoreEventClass = FOUR_CHAR_CODE('aevt') -kAEOpenApplication = FOUR_CHAR_CODE('oapp') -kAEOpenDocuments = FOUR_CHAR_CODE('odoc') -kAEPrintDocuments = FOUR_CHAR_CODE('pdoc') -kAEQuitApplication = FOUR_CHAR_CODE('quit') -kAEAnswer = FOUR_CHAR_CODE('ansr') -kAEApplicationDied = FOUR_CHAR_CODE('obit') -kAEShowPreferences = FOUR_CHAR_CODE('pref') -kAEStartRecording = FOUR_CHAR_CODE('reca') -kAEStopRecording = FOUR_CHAR_CODE('recc') -kAENotifyStartRecording = FOUR_CHAR_CODE('rec1') -kAENotifyStopRecording = FOUR_CHAR_CODE('rec0') -kAENotifyRecording = FOUR_CHAR_CODE('recr') -kAEUnknownSource = 0 -kAEDirectCall = 1 -kAESameProcess = 2 -kAELocalProcess = 3 -kAERemoteProcess = 4 -cAEList = FOUR_CHAR_CODE('list') -cApplication = FOUR_CHAR_CODE('capp') -cArc = FOUR_CHAR_CODE('carc') -cBoolean = FOUR_CHAR_CODE('bool') -cCell = FOUR_CHAR_CODE('ccel') -cChar = FOUR_CHAR_CODE('cha ') -cColorTable = FOUR_CHAR_CODE('clrt') -cColumn = FOUR_CHAR_CODE('ccol') -cDocument = FOUR_CHAR_CODE('docu') -cDrawingArea = FOUR_CHAR_CODE('cdrw') -cEnumeration = FOUR_CHAR_CODE('enum') -cFile = FOUR_CHAR_CODE('file') -cFixed = FOUR_CHAR_CODE('fixd') -cFixedPoint = FOUR_CHAR_CODE('fpnt') -cFixedRectangle = FOUR_CHAR_CODE('frct') -cGraphicLine = FOUR_CHAR_CODE('glin') -cGraphicObject = FOUR_CHAR_CODE('cgob') -cGraphicShape = FOUR_CHAR_CODE('cgsh') -cGraphicText = FOUR_CHAR_CODE('cgtx') -cGroupedGraphic = FOUR_CHAR_CODE('cpic') -cInsertionLoc = FOUR_CHAR_CODE('insl') -cInsertionPoint = FOUR_CHAR_CODE('cins') -cIntlText = FOUR_CHAR_CODE('itxt') -cIntlWritingCode = FOUR_CHAR_CODE('intl') -cItem = FOUR_CHAR_CODE('citm') -cLine = FOUR_CHAR_CODE('clin') -cLongDateTime = FOUR_CHAR_CODE('ldt ') -cLongFixed = FOUR_CHAR_CODE('lfxd') -cLongFixedPoint = FOUR_CHAR_CODE('lfpt') -cLongFixedRectangle = FOUR_CHAR_CODE('lfrc') -cLongInteger = FOUR_CHAR_CODE('long') -cLongPoint = FOUR_CHAR_CODE('lpnt') -cLongRectangle = FOUR_CHAR_CODE('lrct') -cMachineLoc = FOUR_CHAR_CODE('mLoc') -cMenu = FOUR_CHAR_CODE('cmnu') -cMenuItem = FOUR_CHAR_CODE('cmen') -cObject = FOUR_CHAR_CODE('cobj') -cObjectSpecifier = FOUR_CHAR_CODE('obj ') -cOpenableObject = FOUR_CHAR_CODE('coob') -cOval = FOUR_CHAR_CODE('covl') -cParagraph = FOUR_CHAR_CODE('cpar') -cPICT = FOUR_CHAR_CODE('PICT') -cPixel = FOUR_CHAR_CODE('cpxl') -cPixelMap = FOUR_CHAR_CODE('cpix') -cPolygon = FOUR_CHAR_CODE('cpgn') -cProperty = FOUR_CHAR_CODE('prop') -cQDPoint = FOUR_CHAR_CODE('QDpt') -cQDRectangle = FOUR_CHAR_CODE('qdrt') -cRectangle = FOUR_CHAR_CODE('crec') -cRGBColor = FOUR_CHAR_CODE('cRGB') -cRotation = FOUR_CHAR_CODE('trot') -cRoundedRectangle = FOUR_CHAR_CODE('crrc') -cRow = FOUR_CHAR_CODE('crow') -cSelection = FOUR_CHAR_CODE('csel') -cShortInteger = FOUR_CHAR_CODE('shor') -cTable = FOUR_CHAR_CODE('ctbl') -cText = FOUR_CHAR_CODE('ctxt') -cTextFlow = FOUR_CHAR_CODE('cflo') -cTextStyles = FOUR_CHAR_CODE('tsty') -cType = FOUR_CHAR_CODE('type') -cVersion = FOUR_CHAR_CODE('vers') -cWindow = FOUR_CHAR_CODE('cwin') -cWord = FOUR_CHAR_CODE('cwor') -enumArrows = FOUR_CHAR_CODE('arro') -enumJustification = FOUR_CHAR_CODE('just') -enumKeyForm = FOUR_CHAR_CODE('kfrm') -enumPosition = FOUR_CHAR_CODE('posi') -enumProtection = FOUR_CHAR_CODE('prtn') -enumQuality = FOUR_CHAR_CODE('qual') -enumSaveOptions = FOUR_CHAR_CODE('savo') -enumStyle = FOUR_CHAR_CODE('styl') -enumTransferMode = FOUR_CHAR_CODE('tran') -formUniqueID = FOUR_CHAR_CODE('ID ') -kAEAbout = FOUR_CHAR_CODE('abou') -kAEAfter = FOUR_CHAR_CODE('afte') -kAEAliasSelection = FOUR_CHAR_CODE('sali') -kAEAllCaps = FOUR_CHAR_CODE('alcp') -kAEArrowAtEnd = FOUR_CHAR_CODE('aren') -kAEArrowAtStart = FOUR_CHAR_CODE('arst') -kAEArrowBothEnds = FOUR_CHAR_CODE('arbo') -kAEAsk = FOUR_CHAR_CODE('ask ') -kAEBefore = FOUR_CHAR_CODE('befo') -kAEBeginning = FOUR_CHAR_CODE('bgng') -kAEBeginsWith = FOUR_CHAR_CODE('bgwt') -kAEBeginTransaction = FOUR_CHAR_CODE('begi') -kAEBold = FOUR_CHAR_CODE('bold') -kAECaseSensEquals = FOUR_CHAR_CODE('cseq') -kAECentered = FOUR_CHAR_CODE('cent') -kAEChangeView = FOUR_CHAR_CODE('view') -kAEClone = FOUR_CHAR_CODE('clon') -kAEClose = FOUR_CHAR_CODE('clos') -kAECondensed = FOUR_CHAR_CODE('cond') -kAEContains = FOUR_CHAR_CODE('cont') -kAECopy = FOUR_CHAR_CODE('copy') -kAECoreSuite = FOUR_CHAR_CODE('core') -kAECountElements = FOUR_CHAR_CODE('cnte') -kAECreateElement = FOUR_CHAR_CODE('crel') -kAECreatePublisher = FOUR_CHAR_CODE('cpub') -kAECut = FOUR_CHAR_CODE('cut ') -kAEDelete = FOUR_CHAR_CODE('delo') -kAEDoObjectsExist = FOUR_CHAR_CODE('doex') -kAEDoScript = FOUR_CHAR_CODE('dosc') -kAEDrag = FOUR_CHAR_CODE('drag') -kAEDuplicateSelection = FOUR_CHAR_CODE('sdup') -kAEEditGraphic = FOUR_CHAR_CODE('edit') -kAEEmptyTrash = FOUR_CHAR_CODE('empt') -kAEEnd = FOUR_CHAR_CODE('end ') -kAEEndsWith = FOUR_CHAR_CODE('ends') -kAEEndTransaction = FOUR_CHAR_CODE('endt') -kAEEquals = FOUR_CHAR_CODE('= ') -kAEExpanded = FOUR_CHAR_CODE('pexp') -kAEFast = FOUR_CHAR_CODE('fast') -kAEFinderEvents = FOUR_CHAR_CODE('FNDR') -kAEFormulaProtect = FOUR_CHAR_CODE('fpro') -kAEFullyJustified = FOUR_CHAR_CODE('full') -kAEGetClassInfo = FOUR_CHAR_CODE('qobj') -kAEGetData = FOUR_CHAR_CODE('getd') -kAEGetDataSize = FOUR_CHAR_CODE('dsiz') -kAEGetEventInfo = FOUR_CHAR_CODE('gtei') -kAEGetInfoSelection = FOUR_CHAR_CODE('sinf') -kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv') -kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi') -kAEGreaterThan = FOUR_CHAR_CODE('> ') -kAEGreaterThanEquals = FOUR_CHAR_CODE('>= ') -kAEGrow = FOUR_CHAR_CODE('grow') -kAEHidden = FOUR_CHAR_CODE('hidn') -kAEHiQuality = FOUR_CHAR_CODE('hiqu') -kAEImageGraphic = FOUR_CHAR_CODE('imgr') -kAEIsUniform = FOUR_CHAR_CODE('isun') -kAEItalic = FOUR_CHAR_CODE('ital') -kAELeftJustified = FOUR_CHAR_CODE('left') -kAELessThan = FOUR_CHAR_CODE('< ') -kAELessThanEquals = FOUR_CHAR_CODE('<= ') -kAELowercase = FOUR_CHAR_CODE('lowc') -kAEMakeObjectsVisible = FOUR_CHAR_CODE('mvis') -kAEMiscStandards = FOUR_CHAR_CODE('misc') -kAEModifiable = FOUR_CHAR_CODE('modf') -kAEMove = FOUR_CHAR_CODE('move') -kAENo = FOUR_CHAR_CODE('no ') -kAENoArrow = FOUR_CHAR_CODE('arno') -kAENonmodifiable = FOUR_CHAR_CODE('nmod') -kAEOpen = FOUR_CHAR_CODE('odoc') -kAEOpenSelection = FOUR_CHAR_CODE('sope') -kAEOutline = FOUR_CHAR_CODE('outl') -kAEPageSetup = FOUR_CHAR_CODE('pgsu') -kAEPaste = FOUR_CHAR_CODE('past') -kAEPlain = FOUR_CHAR_CODE('plan') -kAEPrint = FOUR_CHAR_CODE('pdoc') -kAEPrintSelection = FOUR_CHAR_CODE('spri') -kAEPrintWindow = FOUR_CHAR_CODE('pwin') -kAEPutAwaySelection = FOUR_CHAR_CODE('sput') -kAEQDAddOver = FOUR_CHAR_CODE('addo') -kAEQDAddPin = FOUR_CHAR_CODE('addp') -kAEQDAdMax = FOUR_CHAR_CODE('admx') -kAEQDAdMin = FOUR_CHAR_CODE('admn') -kAEQDBic = FOUR_CHAR_CODE('bic ') -kAEQDBlend = FOUR_CHAR_CODE('blnd') -kAEQDCopy = FOUR_CHAR_CODE('cpy ') -kAEQDNotBic = FOUR_CHAR_CODE('nbic') -kAEQDNotCopy = FOUR_CHAR_CODE('ncpy') -kAEQDNotOr = FOUR_CHAR_CODE('ntor') -kAEQDNotXor = FOUR_CHAR_CODE('nxor') -kAEQDOr = FOUR_CHAR_CODE('or ') -kAEQDSubOver = FOUR_CHAR_CODE('subo') -kAEQDSubPin = FOUR_CHAR_CODE('subp') -kAEQDSupplementalSuite = FOUR_CHAR_CODE('qdsp') -kAEQDXor = FOUR_CHAR_CODE('xor ') -kAEQuickdrawSuite = FOUR_CHAR_CODE('qdrw') -kAEQuitAll = FOUR_CHAR_CODE('quia') -kAERedo = FOUR_CHAR_CODE('redo') -kAERegular = FOUR_CHAR_CODE('regl') -kAEReopenApplication = FOUR_CHAR_CODE('rapp') -kAEReplace = FOUR_CHAR_CODE('rplc') -kAERequiredSuite = FOUR_CHAR_CODE('reqd') -kAERestart = FOUR_CHAR_CODE('rest') -kAERevealSelection = FOUR_CHAR_CODE('srev') -kAERevert = FOUR_CHAR_CODE('rvrt') -kAERightJustified = FOUR_CHAR_CODE('rght') -kAESave = FOUR_CHAR_CODE('save') -kAESelect = FOUR_CHAR_CODE('slct') -kAESetData = FOUR_CHAR_CODE('setd') -kAESetPosition = FOUR_CHAR_CODE('posn') -kAEShadow = FOUR_CHAR_CODE('shad') -kAEShowClipboard = FOUR_CHAR_CODE('shcl') -kAEShutDown = FOUR_CHAR_CODE('shut') -kAESleep = FOUR_CHAR_CODE('slep') -kAESmallCaps = FOUR_CHAR_CODE('smcp') -kAESpecialClassProperties = FOUR_CHAR_CODE('c@#!') -kAEStrikethrough = FOUR_CHAR_CODE('strk') -kAESubscript = FOUR_CHAR_CODE('sbsc') -kAESuperscript = FOUR_CHAR_CODE('spsc') -kAETableSuite = FOUR_CHAR_CODE('tbls') -kAETextSuite = FOUR_CHAR_CODE('TEXT') -kAETransactionTerminated = FOUR_CHAR_CODE('ttrm') -kAEUnderline = FOUR_CHAR_CODE('undl') -kAEUndo = FOUR_CHAR_CODE('undo') -kAEWholeWordEquals = FOUR_CHAR_CODE('wweq') -kAEYes = FOUR_CHAR_CODE('yes ') -kAEZoom = FOUR_CHAR_CODE('zoom') -kAEMouseClass = FOUR_CHAR_CODE('mous') -kAEDown = FOUR_CHAR_CODE('down') -kAEUp = FOUR_CHAR_CODE('up ') -kAEMoved = FOUR_CHAR_CODE('move') -kAEStoppedMoving = FOUR_CHAR_CODE('stop') -kAEWindowClass = FOUR_CHAR_CODE('wind') -kAEUpdate = FOUR_CHAR_CODE('updt') -kAEActivate = FOUR_CHAR_CODE('actv') -kAEDeactivate = FOUR_CHAR_CODE('dact') -kAECommandClass = FOUR_CHAR_CODE('cmnd') -kAEKeyClass = FOUR_CHAR_CODE('keyc') -kAERawKey = FOUR_CHAR_CODE('rkey') -kAEVirtualKey = FOUR_CHAR_CODE('keyc') -kAENavigationKey = FOUR_CHAR_CODE('nave') -kAEAutoDown = FOUR_CHAR_CODE('auto') -kAEApplicationClass = FOUR_CHAR_CODE('appl') -kAESuspend = FOUR_CHAR_CODE('susp') -kAEResume = FOUR_CHAR_CODE('rsme') -kAEDiskEvent = FOUR_CHAR_CODE('disk') -kAENullEvent = FOUR_CHAR_CODE('null') -kAEWakeUpEvent = FOUR_CHAR_CODE('wake') -kAEScrapEvent = FOUR_CHAR_CODE('scrp') -kAEHighLevel = FOUR_CHAR_CODE('high') -keyAEAngle = FOUR_CHAR_CODE('kang') -keyAEArcAngle = FOUR_CHAR_CODE('parc') -keyAEBaseAddr = FOUR_CHAR_CODE('badd') -keyAEBestType = FOUR_CHAR_CODE('pbst') -keyAEBgndColor = FOUR_CHAR_CODE('kbcl') -keyAEBgndPattern = FOUR_CHAR_CODE('kbpt') -keyAEBounds = FOUR_CHAR_CODE('pbnd') -keyAECellList = FOUR_CHAR_CODE('kclt') -keyAEClassID = FOUR_CHAR_CODE('clID') -keyAEColor = FOUR_CHAR_CODE('colr') -keyAEColorTable = FOUR_CHAR_CODE('cltb') -keyAECurveHeight = FOUR_CHAR_CODE('kchd') -keyAECurveWidth = FOUR_CHAR_CODE('kcwd') -keyAEDashStyle = FOUR_CHAR_CODE('pdst') -keyAEData = FOUR_CHAR_CODE('data') -keyAEDefaultType = FOUR_CHAR_CODE('deft') -keyAEDefinitionRect = FOUR_CHAR_CODE('pdrt') -keyAEDescType = FOUR_CHAR_CODE('dstp') -keyAEDestination = FOUR_CHAR_CODE('dest') -keyAEDoAntiAlias = FOUR_CHAR_CODE('anta') -keyAEDoDithered = FOUR_CHAR_CODE('gdit') -keyAEDoRotate = FOUR_CHAR_CODE('kdrt') -keyAEDoScale = FOUR_CHAR_CODE('ksca') -keyAEDoTranslate = FOUR_CHAR_CODE('ktra') -keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc') -keyAEElements = FOUR_CHAR_CODE('elms') -keyAEEndPoint = FOUR_CHAR_CODE('pend') -keyAEEventClass = FOUR_CHAR_CODE('evcl') -keyAEEventID = FOUR_CHAR_CODE('evti') -keyAEFile = FOUR_CHAR_CODE('kfil') -keyAEFileType = FOUR_CHAR_CODE('fltp') -keyAEFillColor = FOUR_CHAR_CODE('flcl') -keyAEFillPattern = FOUR_CHAR_CODE('flpt') -keyAEFlipHorizontal = FOUR_CHAR_CODE('kfho') -keyAEFlipVertical = FOUR_CHAR_CODE('kfvt') -keyAEFont = FOUR_CHAR_CODE('font') -keyAEFormula = FOUR_CHAR_CODE('pfor') -keyAEGraphicObjects = FOUR_CHAR_CODE('gobs') -keyAEID = FOUR_CHAR_CODE('ID ') -keyAEImageQuality = FOUR_CHAR_CODE('gqua') -keyAEInsertHere = FOUR_CHAR_CODE('insh') -keyAEKeyForms = FOUR_CHAR_CODE('keyf') -keyAEKeyword = FOUR_CHAR_CODE('kywd') -keyAELevel = FOUR_CHAR_CODE('levl') -keyAELineArrow = FOUR_CHAR_CODE('arro') -keyAEName = FOUR_CHAR_CODE('pnam') -keyAENewElementLoc = FOUR_CHAR_CODE('pnel') -keyAEObject = FOUR_CHAR_CODE('kobj') -keyAEObjectClass = FOUR_CHAR_CODE('kocl') -keyAEOffStyles = FOUR_CHAR_CODE('ofst') -keyAEOnStyles = FOUR_CHAR_CODE('onst') -keyAEParameters = FOUR_CHAR_CODE('prms') -keyAEParamFlags = FOUR_CHAR_CODE('pmfg') -keyAEPenColor = FOUR_CHAR_CODE('ppcl') -keyAEPenPattern = FOUR_CHAR_CODE('pppa') -keyAEPenWidth = FOUR_CHAR_CODE('ppwd') -keyAEPixelDepth = FOUR_CHAR_CODE('pdpt') -keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm') -keyAEPMTable = FOUR_CHAR_CODE('kpmt') -keyAEPointList = FOUR_CHAR_CODE('ptlt') -keyAEPointSize = FOUR_CHAR_CODE('ptsz') -keyAEPosition = FOUR_CHAR_CODE('kpos') -keyAEPropData = FOUR_CHAR_CODE('prdt') -keyAEProperties = FOUR_CHAR_CODE('qpro') -keyAEProperty = FOUR_CHAR_CODE('kprp') -keyAEPropFlags = FOUR_CHAR_CODE('prfg') -keyAEPropID = FOUR_CHAR_CODE('prop') -keyAEProtection = FOUR_CHAR_CODE('ppro') -keyAERenderAs = FOUR_CHAR_CODE('kren') -keyAERequestedType = FOUR_CHAR_CODE('rtyp') -keyAEResult = FOUR_CHAR_CODE('----') -keyAEResultInfo = FOUR_CHAR_CODE('rsin') -keyAERotation = FOUR_CHAR_CODE('prot') -keyAERotPoint = FOUR_CHAR_CODE('krtp') -keyAERowList = FOUR_CHAR_CODE('krls') -keyAESaveOptions = FOUR_CHAR_CODE('savo') -keyAEScale = FOUR_CHAR_CODE('pscl') -keyAEScriptTag = FOUR_CHAR_CODE('psct') -keyAEShowWhere = FOUR_CHAR_CODE('show') -keyAEStartAngle = FOUR_CHAR_CODE('pang') -keyAEStartPoint = FOUR_CHAR_CODE('pstp') -keyAEStyles = FOUR_CHAR_CODE('ksty') -keyAESuiteID = FOUR_CHAR_CODE('suit') -keyAEText = FOUR_CHAR_CODE('ktxt') -keyAETextColor = FOUR_CHAR_CODE('ptxc') -keyAETextFont = FOUR_CHAR_CODE('ptxf') -keyAETextPointSize = FOUR_CHAR_CODE('ptps') -keyAETextStyles = FOUR_CHAR_CODE('txst') -keyAETextLineHeight = FOUR_CHAR_CODE('ktlh') -keyAETextLineAscent = FOUR_CHAR_CODE('ktas') -keyAETheText = FOUR_CHAR_CODE('thtx') -keyAETransferMode = FOUR_CHAR_CODE('pptm') -keyAETranslation = FOUR_CHAR_CODE('ptrs') -keyAETryAsStructGraf = FOUR_CHAR_CODE('toog') -keyAEUniformStyles = FOUR_CHAR_CODE('ustl') -keyAEUpdateOn = FOUR_CHAR_CODE('pupd') -keyAEUserTerm = FOUR_CHAR_CODE('utrm') -keyAEWindow = FOUR_CHAR_CODE('wndw') -keyAEWritingCode = FOUR_CHAR_CODE('wrcd') -keyMiscellaneous = FOUR_CHAR_CODE('fmsc') -keySelection = FOUR_CHAR_CODE('fsel') -keyWindow = FOUR_CHAR_CODE('kwnd') -keyWhen = FOUR_CHAR_CODE('when') -keyWhere = FOUR_CHAR_CODE('wher') -keyModifiers = FOUR_CHAR_CODE('mods') -keyKey = FOUR_CHAR_CODE('key ') -keyKeyCode = FOUR_CHAR_CODE('code') -keyKeyboard = FOUR_CHAR_CODE('keyb') -keyDriveNumber = FOUR_CHAR_CODE('drv#') -keyErrorCode = FOUR_CHAR_CODE('err#') -keyHighLevelClass = FOUR_CHAR_CODE('hcls') -keyHighLevelID = FOUR_CHAR_CODE('hid ') -pArcAngle = FOUR_CHAR_CODE('parc') -pBackgroundColor = FOUR_CHAR_CODE('pbcl') -pBackgroundPattern = FOUR_CHAR_CODE('pbpt') -pBestType = FOUR_CHAR_CODE('pbst') -pBounds = FOUR_CHAR_CODE('pbnd') -pClass = FOUR_CHAR_CODE('pcls') -pClipboard = FOUR_CHAR_CODE('pcli') -pColor = FOUR_CHAR_CODE('colr') -pColorTable = FOUR_CHAR_CODE('cltb') -pContents = FOUR_CHAR_CODE('pcnt') -pCornerCurveHeight = FOUR_CHAR_CODE('pchd') -pCornerCurveWidth = FOUR_CHAR_CODE('pcwd') -pDashStyle = FOUR_CHAR_CODE('pdst') -pDefaultType = FOUR_CHAR_CODE('deft') -pDefinitionRect = FOUR_CHAR_CODE('pdrt') -pEnabled = FOUR_CHAR_CODE('enbl') -pEndPoint = FOUR_CHAR_CODE('pend') -pFillColor = FOUR_CHAR_CODE('flcl') -pFillPattern = FOUR_CHAR_CODE('flpt') -pFont = FOUR_CHAR_CODE('font') -pFormula = FOUR_CHAR_CODE('pfor') -pGraphicObjects = FOUR_CHAR_CODE('gobs') -pHasCloseBox = FOUR_CHAR_CODE('hclb') -pHasTitleBar = FOUR_CHAR_CODE('ptit') -pID = FOUR_CHAR_CODE('ID ') -pIndex = FOUR_CHAR_CODE('pidx') -pInsertionLoc = FOUR_CHAR_CODE('pins') -pIsFloating = FOUR_CHAR_CODE('isfl') -pIsFrontProcess = FOUR_CHAR_CODE('pisf') -pIsModal = FOUR_CHAR_CODE('pmod') -pIsModified = FOUR_CHAR_CODE('imod') -pIsResizable = FOUR_CHAR_CODE('prsz') -pIsStationeryPad = FOUR_CHAR_CODE('pspd') -pIsZoomable = FOUR_CHAR_CODE('iszm') -pIsZoomed = FOUR_CHAR_CODE('pzum') -pItemNumber = FOUR_CHAR_CODE('itmn') -pJustification = FOUR_CHAR_CODE('pjst') -pLineArrow = FOUR_CHAR_CODE('arro') -pMenuID = FOUR_CHAR_CODE('mnid') -pName = FOUR_CHAR_CODE('pnam') -pNewElementLoc = FOUR_CHAR_CODE('pnel') -pPenColor = FOUR_CHAR_CODE('ppcl') -pPenPattern = FOUR_CHAR_CODE('pppa') -pPenWidth = FOUR_CHAR_CODE('ppwd') -pPixelDepth = FOUR_CHAR_CODE('pdpt') -pPointList = FOUR_CHAR_CODE('ptlt') -pPointSize = FOUR_CHAR_CODE('ptsz') -pProtection = FOUR_CHAR_CODE('ppro') -pRotation = FOUR_CHAR_CODE('prot') -pScale = FOUR_CHAR_CODE('pscl') -pScript = FOUR_CHAR_CODE('scpt') -pScriptTag = FOUR_CHAR_CODE('psct') -pSelected = FOUR_CHAR_CODE('selc') -pSelection = FOUR_CHAR_CODE('sele') -pStartAngle = FOUR_CHAR_CODE('pang') -pStartPoint = FOUR_CHAR_CODE('pstp') -pTextColor = FOUR_CHAR_CODE('ptxc') -pTextFont = FOUR_CHAR_CODE('ptxf') -pTextItemDelimiters = FOUR_CHAR_CODE('txdl') -pTextPointSize = FOUR_CHAR_CODE('ptps') -pTextStyles = FOUR_CHAR_CODE('txst') -pTransferMode = FOUR_CHAR_CODE('pptm') -pTranslation = FOUR_CHAR_CODE('ptrs') -pUniformStyles = FOUR_CHAR_CODE('ustl') -pUpdateOn = FOUR_CHAR_CODE('pupd') -pUserSelection = FOUR_CHAR_CODE('pusl') -pVersion = FOUR_CHAR_CODE('vers') -pVisible = FOUR_CHAR_CODE('pvis') -typeAEText = FOUR_CHAR_CODE('tTXT') -typeArc = FOUR_CHAR_CODE('carc') -typeBest = FOUR_CHAR_CODE('best') -typeCell = FOUR_CHAR_CODE('ccel') -typeClassInfo = FOUR_CHAR_CODE('gcli') -typeColorTable = FOUR_CHAR_CODE('clrt') -typeColumn = FOUR_CHAR_CODE('ccol') -typeDashStyle = FOUR_CHAR_CODE('tdas') -typeData = FOUR_CHAR_CODE('tdta') -typeDrawingArea = FOUR_CHAR_CODE('cdrw') -typeElemInfo = FOUR_CHAR_CODE('elin') -typeEnumeration = FOUR_CHAR_CODE('enum') -typeEPS = FOUR_CHAR_CODE('EPS ') -typeEventInfo = FOUR_CHAR_CODE('evin') -typeFinderWindow = FOUR_CHAR_CODE('fwin') -typeFixedPoint = FOUR_CHAR_CODE('fpnt') -typeFixedRectangle = FOUR_CHAR_CODE('frct') -typeGraphicLine = FOUR_CHAR_CODE('glin') -typeGraphicText = FOUR_CHAR_CODE('cgtx') -typeGroupedGraphic = FOUR_CHAR_CODE('cpic') -typeInsertionLoc = FOUR_CHAR_CODE('insl') -typeIntlText = FOUR_CHAR_CODE('itxt') -typeIntlWritingCode = FOUR_CHAR_CODE('intl') -typeLongDateTime = FOUR_CHAR_CODE('ldt ') -typeLongFixed = FOUR_CHAR_CODE('lfxd') -typeLongFixedPoint = FOUR_CHAR_CODE('lfpt') -typeLongFixedRectangle = FOUR_CHAR_CODE('lfrc') -typeLongPoint = FOUR_CHAR_CODE('lpnt') -typeLongRectangle = FOUR_CHAR_CODE('lrct') -typeMachineLoc = FOUR_CHAR_CODE('mLoc') -typeOval = FOUR_CHAR_CODE('covl') -typeParamInfo = FOUR_CHAR_CODE('pmin') -typePict = FOUR_CHAR_CODE('PICT') -typePixelMap = FOUR_CHAR_CODE('cpix') -typePixMapMinus = FOUR_CHAR_CODE('tpmm') -typePolygon = FOUR_CHAR_CODE('cpgn') -typePropInfo = FOUR_CHAR_CODE('pinf') -typePtr = FOUR_CHAR_CODE('ptr ') -typeQDPoint = FOUR_CHAR_CODE('QDpt') -typeQDRegion = FOUR_CHAR_CODE('Qrgn') -typeRectangle = FOUR_CHAR_CODE('crec') -typeRGB16 = FOUR_CHAR_CODE('tr16') -typeRGB96 = FOUR_CHAR_CODE('tr96') -typeRGBColor = FOUR_CHAR_CODE('cRGB') -typeRotation = FOUR_CHAR_CODE('trot') -typeRoundedRectangle = FOUR_CHAR_CODE('crrc') -typeRow = FOUR_CHAR_CODE('crow') -typeScrapStyles = FOUR_CHAR_CODE('styl') -typeScript = FOUR_CHAR_CODE('scpt') -typeStyledText = FOUR_CHAR_CODE('STXT') -typeSuiteInfo = FOUR_CHAR_CODE('suin') -typeTable = FOUR_CHAR_CODE('ctbl') -typeTextStyles = FOUR_CHAR_CODE('tsty') -typeTIFF = FOUR_CHAR_CODE('TIFF') -typeVersion = FOUR_CHAR_CODE('vers') -kAEMenuClass = FOUR_CHAR_CODE('menu') -kAEMenuSelect = FOUR_CHAR_CODE('mhit') -kAEMouseDown = FOUR_CHAR_CODE('mdwn') -kAEMouseDownInBack = FOUR_CHAR_CODE('mdbk') -kAEKeyDown = FOUR_CHAR_CODE('kdwn') -kAEResized = FOUR_CHAR_CODE('rsiz') -kAEPromise = FOUR_CHAR_CODE('prom') -keyMenuID = FOUR_CHAR_CODE('mid ') -keyMenuItem = FOUR_CHAR_CODE('mitm') -keyCloseAllWindows = FOUR_CHAR_CODE('caw ') -keyOriginalBounds = FOUR_CHAR_CODE('obnd') -keyNewBounds = FOUR_CHAR_CODE('nbnd') -keyLocalWhere = FOUR_CHAR_CODE('lwhr') -typeHIMenu = FOUR_CHAR_CODE('mobj') -typeHIWindow = FOUR_CHAR_CODE('wobj') -kBySmallIcon = 0 -kByIconView = 1 -kByNameView = 2 -kByDateView = 3 -kBySizeView = 4 -kByKindView = 5 -kByCommentView = 6 -kByLabelView = 7 -kByVersionView = 8 -kAEInfo = 11 -kAEMain = 0 -kAESharing = 13 -kAEZoomIn = 7 -kAEZoomOut = 8 -kTextServiceClass = FOUR_CHAR_CODE('tsvc') -kUpdateActiveInputArea = FOUR_CHAR_CODE('updt') -kShowHideInputWindow = FOUR_CHAR_CODE('shiw') -kPos2Offset = FOUR_CHAR_CODE('p2st') -kOffset2Pos = FOUR_CHAR_CODE('st2p') -kUnicodeNotFromInputMethod = FOUR_CHAR_CODE('unim') -kGetSelectedText = FOUR_CHAR_CODE('gtxt') -keyAETSMDocumentRefcon = FOUR_CHAR_CODE('refc') -keyAEServerInstance = FOUR_CHAR_CODE('srvi') -keyAETheData = FOUR_CHAR_CODE('kdat') -keyAEFixLength = FOUR_CHAR_CODE('fixl') -keyAEUpdateRange = FOUR_CHAR_CODE('udng') -keyAECurrentPoint = FOUR_CHAR_CODE('cpos') -keyAEBufferSize = FOUR_CHAR_CODE('buff') -keyAEMoveView = FOUR_CHAR_CODE('mvvw') -keyAENextBody = FOUR_CHAR_CODE('nxbd') -keyAETSMScriptTag = FOUR_CHAR_CODE('sclg') -keyAETSMTextFont = FOUR_CHAR_CODE('ktxf') -keyAETSMTextFMFont = FOUR_CHAR_CODE('ktxm') -keyAETSMTextPointSize = FOUR_CHAR_CODE('ktps') -keyAETSMEventRecord = FOUR_CHAR_CODE('tevt') -keyAETSMEventRef = FOUR_CHAR_CODE('tevr') -keyAETextServiceEncoding = FOUR_CHAR_CODE('tsen') -keyAETextServiceMacEncoding = FOUR_CHAR_CODE('tmen') -typeTextRange = FOUR_CHAR_CODE('txrn') -typeComponentInstance = FOUR_CHAR_CODE('cmpi') -typeOffsetArray = FOUR_CHAR_CODE('ofay') -typeTextRangeArray = FOUR_CHAR_CODE('tray') -typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr') -typeEventRef = FOUR_CHAR_CODE('evrf') -typeText = typeChar -kTSMOutsideOfBody = 1 -kTSMInsideOfBody = 2 -kTSMInsideOfActiveInputArea = 3 -kNextBody = 1 -kPreviousBody = 2 -kCaretPosition = 1 -kRawText = 2 -kSelectedRawText = 3 -kConvertedText = 4 -kSelectedConvertedText = 5 -kBlockFillText = 6 -kOutlineText = 7 -kSelectedText = 8 -keyAEHiliteRange = FOUR_CHAR_CODE('hrng') -keyAEPinRange = FOUR_CHAR_CODE('pnrg') -keyAEClauseOffsets = FOUR_CHAR_CODE('clau') -keyAEOffset = FOUR_CHAR_CODE('ofst') -keyAEPoint = FOUR_CHAR_CODE('gpos') -keyAELeftSide = FOUR_CHAR_CODE('klef') -keyAERegionClass = FOUR_CHAR_CODE('rgnc') -keyAEDragging = FOUR_CHAR_CODE('bool') -keyAELeadingEdge = keyAELeftSide -typeUnicodeText = FOUR_CHAR_CODE('utxt') -typeStyledUnicodeText = FOUR_CHAR_CODE('sutx') -typeEncodedString = FOUR_CHAR_CODE('encs') -typeCString = FOUR_CHAR_CODE('cstr') -typePString = FOUR_CHAR_CODE('pstr') -typeMeters = FOUR_CHAR_CODE('metr') -typeInches = FOUR_CHAR_CODE('inch') -typeFeet = FOUR_CHAR_CODE('feet') -typeYards = FOUR_CHAR_CODE('yard') -typeMiles = FOUR_CHAR_CODE('mile') -typeKilometers = FOUR_CHAR_CODE('kmtr') -typeCentimeters = FOUR_CHAR_CODE('cmtr') -typeSquareMeters = FOUR_CHAR_CODE('sqrm') -typeSquareFeet = FOUR_CHAR_CODE('sqft') -typeSquareYards = FOUR_CHAR_CODE('sqyd') -typeSquareMiles = FOUR_CHAR_CODE('sqmi') -typeSquareKilometers = FOUR_CHAR_CODE('sqkm') -typeLiters = FOUR_CHAR_CODE('litr') -typeQuarts = FOUR_CHAR_CODE('qrts') -typeGallons = FOUR_CHAR_CODE('galn') -typeCubicMeters = FOUR_CHAR_CODE('cmet') -typeCubicFeet = FOUR_CHAR_CODE('cfet') -typeCubicInches = FOUR_CHAR_CODE('cuin') -typeCubicCentimeter = FOUR_CHAR_CODE('ccmt') -typeCubicYards = FOUR_CHAR_CODE('cyrd') -typeKilograms = FOUR_CHAR_CODE('kgrm') -typeGrams = FOUR_CHAR_CODE('gram') -typeOunces = FOUR_CHAR_CODE('ozs ') -typePounds = FOUR_CHAR_CODE('lbs ') -typeDegreesC = FOUR_CHAR_CODE('degc') -typeDegreesF = FOUR_CHAR_CODE('degf') -typeDegreesK = FOUR_CHAR_CODE('degk') -kFAServerApp = FOUR_CHAR_CODE('ssrv') -kDoFolderActionEvent = FOUR_CHAR_CODE('fola') -kFolderActionCode = FOUR_CHAR_CODE('actn') -kFolderOpenedEvent = FOUR_CHAR_CODE('fopn') -kFolderClosedEvent = FOUR_CHAR_CODE('fclo') -kFolderWindowMovedEvent = FOUR_CHAR_CODE('fsiz') -kFolderItemsAddedEvent = FOUR_CHAR_CODE('fget') -kFolderItemsRemovedEvent = FOUR_CHAR_CODE('flos') -kItemList = FOUR_CHAR_CODE('flst') -kNewSizeParameter = FOUR_CHAR_CODE('fnsz') -kFASuiteCode = FOUR_CHAR_CODE('faco') -kFAAttachCommand = FOUR_CHAR_CODE('atfa') -kFARemoveCommand = FOUR_CHAR_CODE('rmfa') -kFAEditCommand = FOUR_CHAR_CODE('edfa') -kFAFileParam = FOUR_CHAR_CODE('faal') -kFAIndexParam = FOUR_CHAR_CODE('indx') -kAEInternetSuite = FOUR_CHAR_CODE('gurl') -kAEISWebStarSuite = FOUR_CHAR_CODE('WWW\xbd') -kAEISGetURL = FOUR_CHAR_CODE('gurl') -KAEISHandleCGI = FOUR_CHAR_CODE('sdoc') -cURL = FOUR_CHAR_CODE('url ') -cInternetAddress = FOUR_CHAR_CODE('IPAD') -cHTML = FOUR_CHAR_CODE('html') -cFTPItem = FOUR_CHAR_CODE('ftp ') -kAEISHTTPSearchArgs = FOUR_CHAR_CODE('kfor') -kAEISPostArgs = FOUR_CHAR_CODE('post') -kAEISMethod = FOUR_CHAR_CODE('meth') -kAEISClientAddress = FOUR_CHAR_CODE('addr') -kAEISUserName = FOUR_CHAR_CODE('user') -kAEISPassword = FOUR_CHAR_CODE('pass') -kAEISFromUser = FOUR_CHAR_CODE('frmu') -kAEISServerName = FOUR_CHAR_CODE('svnm') -kAEISServerPort = FOUR_CHAR_CODE('svpt') -kAEISScriptName = FOUR_CHAR_CODE('scnm') -kAEISContentType = FOUR_CHAR_CODE('ctyp') -kAEISReferrer = FOUR_CHAR_CODE('refr') -kAEISUserAgent = FOUR_CHAR_CODE('Agnt') -kAEISAction = FOUR_CHAR_CODE('Kact') -kAEISActionPath = FOUR_CHAR_CODE('Kapt') -kAEISClientIP = FOUR_CHAR_CODE('Kcip') -kAEISFullRequest = FOUR_CHAR_CODE('Kfrq') -pScheme = FOUR_CHAR_CODE('pusc') -pHost = FOUR_CHAR_CODE('HOST') -pPath = FOUR_CHAR_CODE('FTPc') -pUserName = FOUR_CHAR_CODE('RAun') -pUserPassword = FOUR_CHAR_CODE('RApw') -pDNSForm = FOUR_CHAR_CODE('pDNS') -pURL = FOUR_CHAR_CODE('pURL') -pTextEncoding = FOUR_CHAR_CODE('ptxe') -pFTPKind = FOUR_CHAR_CODE('kind') -eScheme = FOUR_CHAR_CODE('esch') -eurlHTTP = FOUR_CHAR_CODE('http') -eurlHTTPS = FOUR_CHAR_CODE('htps') -eurlFTP = FOUR_CHAR_CODE('ftp ') -eurlMail = FOUR_CHAR_CODE('mail') -eurlFile = FOUR_CHAR_CODE('file') -eurlGopher = FOUR_CHAR_CODE('gphr') -eurlTelnet = FOUR_CHAR_CODE('tlnt') -eurlNews = FOUR_CHAR_CODE('news') -eurlSNews = FOUR_CHAR_CODE('snws') -eurlNNTP = FOUR_CHAR_CODE('nntp') -eurlMessage = FOUR_CHAR_CODE('mess') -eurlMailbox = FOUR_CHAR_CODE('mbox') -eurlMulti = FOUR_CHAR_CODE('mult') -eurlLaunch = FOUR_CHAR_CODE('laun') -eurlAFP = FOUR_CHAR_CODE('afp ') -eurlAT = FOUR_CHAR_CODE('at ') -eurlEPPC = FOUR_CHAR_CODE('eppc') -eurlRTSP = FOUR_CHAR_CODE('rtsp') -eurlIMAP = FOUR_CHAR_CODE('imap') -eurlNFS = FOUR_CHAR_CODE('unfs') -eurlPOP = FOUR_CHAR_CODE('upop') -eurlLDAP = FOUR_CHAR_CODE('uldp') -eurlUnknown = FOUR_CHAR_CODE('url?') -kConnSuite = FOUR_CHAR_CODE('macc') -cDevSpec = FOUR_CHAR_CODE('cdev') -cAddressSpec = FOUR_CHAR_CODE('cadr') -cADBAddress = FOUR_CHAR_CODE('cadb') -cAppleTalkAddress = FOUR_CHAR_CODE('cat ') -cBusAddress = FOUR_CHAR_CODE('cbus') -cEthernetAddress = FOUR_CHAR_CODE('cen ') -cFireWireAddress = FOUR_CHAR_CODE('cfw ') -cIPAddress = FOUR_CHAR_CODE('cip ') -cLocalTalkAddress = FOUR_CHAR_CODE('clt ') -cSCSIAddress = FOUR_CHAR_CODE('cscs') -cTokenRingAddress = FOUR_CHAR_CODE('ctok') -cUSBAddress = FOUR_CHAR_CODE('cusb') -pDeviceType = FOUR_CHAR_CODE('pdvt') -pDeviceAddress = FOUR_CHAR_CODE('pdva') -pConduit = FOUR_CHAR_CODE('pcon') -pProtocol = FOUR_CHAR_CODE('pprt') -pATMachine = FOUR_CHAR_CODE('patm') -pATZone = FOUR_CHAR_CODE('patz') -pATType = FOUR_CHAR_CODE('patt') -pDottedDecimal = FOUR_CHAR_CODE('pipd') -pDNS = FOUR_CHAR_CODE('pdns') -pPort = FOUR_CHAR_CODE('ppor') -pNetwork = FOUR_CHAR_CODE('pnet') -pNode = FOUR_CHAR_CODE('pnod') -pSocket = FOUR_CHAR_CODE('psoc') -pSCSIBus = FOUR_CHAR_CODE('pscb') -pSCSILUN = FOUR_CHAR_CODE('pslu') -eDeviceType = FOUR_CHAR_CODE('edvt') -eAddressSpec = FOUR_CHAR_CODE('eads') -eConduit = FOUR_CHAR_CODE('econ') -eProtocol = FOUR_CHAR_CODE('epro') -eADB = FOUR_CHAR_CODE('eadb') -eAnalogAudio = FOUR_CHAR_CODE('epau') -eAppleTalk = FOUR_CHAR_CODE('epat') -eAudioLineIn = FOUR_CHAR_CODE('ecai') -eAudioLineOut = FOUR_CHAR_CODE('ecal') -eAudioOut = FOUR_CHAR_CODE('ecao') -eBus = FOUR_CHAR_CODE('ebus') -eCDROM = FOUR_CHAR_CODE('ecd ') -eCommSlot = FOUR_CHAR_CODE('eccm') -eDigitalAudio = FOUR_CHAR_CODE('epda') -eDisplay = FOUR_CHAR_CODE('edds') -eDVD = FOUR_CHAR_CODE('edvd') -eEthernet = FOUR_CHAR_CODE('ecen') -eFireWire = FOUR_CHAR_CODE('ecfw') -eFloppy = FOUR_CHAR_CODE('efd ') -eHD = FOUR_CHAR_CODE('ehd ') -eInfrared = FOUR_CHAR_CODE('ecir') -eIP = FOUR_CHAR_CODE('epip') -eIrDA = FOUR_CHAR_CODE('epir') -eIRTalk = FOUR_CHAR_CODE('epit') -eKeyboard = FOUR_CHAR_CODE('ekbd') -eLCD = FOUR_CHAR_CODE('edlc') -eLocalTalk = FOUR_CHAR_CODE('eclt') -eMacIP = FOUR_CHAR_CODE('epmi') -eMacVideo = FOUR_CHAR_CODE('epmv') -eMicrophone = FOUR_CHAR_CODE('ecmi') -eModemPort = FOUR_CHAR_CODE('ecmp') -eModemPrinterPort = FOUR_CHAR_CODE('empp') -eModem = FOUR_CHAR_CODE('edmm') -eMonitorOut = FOUR_CHAR_CODE('ecmn') -eMouse = FOUR_CHAR_CODE('emou') -eNuBusCard = FOUR_CHAR_CODE('ednb') -eNuBus = FOUR_CHAR_CODE('enub') -ePCcard = FOUR_CHAR_CODE('ecpc') -ePCIbus = FOUR_CHAR_CODE('ecpi') -ePCIcard = FOUR_CHAR_CODE('edpi') -ePDSslot = FOUR_CHAR_CODE('ecpd') -ePDScard = FOUR_CHAR_CODE('epds') -ePointingDevice = FOUR_CHAR_CODE('edpd') -ePostScript = FOUR_CHAR_CODE('epps') -ePPP = FOUR_CHAR_CODE('eppp') -ePrinterPort = FOUR_CHAR_CODE('ecpp') -ePrinter = FOUR_CHAR_CODE('edpr') -eSvideo = FOUR_CHAR_CODE('epsv') -eSCSI = FOUR_CHAR_CODE('ecsc') -eSerial = FOUR_CHAR_CODE('epsr') -eSpeakers = FOUR_CHAR_CODE('edsp') -eStorageDevice = FOUR_CHAR_CODE('edst') -eSVGA = FOUR_CHAR_CODE('epsg') -eTokenRing = FOUR_CHAR_CODE('etok') -eTrackball = FOUR_CHAR_CODE('etrk') -eTrackpad = FOUR_CHAR_CODE('edtp') -eUSB = FOUR_CHAR_CODE('ecus') -eVideoIn = FOUR_CHAR_CODE('ecvi') -eVideoMonitor = FOUR_CHAR_CODE('edvm') -eVideoOut = FOUR_CHAR_CODE('ecvo') -cKeystroke = FOUR_CHAR_CODE('kprs') -pKeystrokeKey = FOUR_CHAR_CODE('kMsg') -pModifiers = FOUR_CHAR_CODE('kMod') -pKeyKind = FOUR_CHAR_CODE('kknd') -eModifiers = FOUR_CHAR_CODE('eMds') -eOptionDown = FOUR_CHAR_CODE('Kopt') -eCommandDown = FOUR_CHAR_CODE('Kcmd') -eControlDown = FOUR_CHAR_CODE('Kctl') -eShiftDown = FOUR_CHAR_CODE('Ksft') -eCapsLockDown = FOUR_CHAR_CODE('Kclk') -eKeyKind = FOUR_CHAR_CODE('ekst') -eEscapeKey = 0x6B733500 -eDeleteKey = 0x6B733300 -eTabKey = 0x6B733000 -eReturnKey = 0x6B732400 -eClearKey = 0x6B734700 -eEnterKey = 0x6B734C00 -eUpArrowKey = 0x6B737E00 -eDownArrowKey = 0x6B737D00 -eLeftArrowKey = 0x6B737B00 -eRightArrowKey = 0x6B737C00 -eHelpKey = 0x6B737200 -eHomeKey = 0x6B737300 -ePageUpKey = 0x6B737400 -ePageDownKey = 0x6B737900 -eForwardDelKey = 0x6B737500 -eEndKey = 0x6B737700 -eF1Key = 0x6B737A00 -eF2Key = 0x6B737800 -eF3Key = 0x6B736300 -eF4Key = 0x6B737600 -eF5Key = 0x6B736000 -eF6Key = 0x6B736100 -eF7Key = 0x6B736200 -eF8Key = 0x6B736400 -eF9Key = 0x6B736500 -eF10Key = 0x6B736D00 -eF11Key = 0x6B736700 -eF12Key = 0x6B736F00 -eF13Key = 0x6B736900 -eF14Key = 0x6B736B00 -eF15Key = 0x6B737100 -kAEAND = FOUR_CHAR_CODE('AND ') -kAEOR = FOUR_CHAR_CODE('OR ') -kAENOT = FOUR_CHAR_CODE('NOT ') -kAEFirst = FOUR_CHAR_CODE('firs') -kAELast = FOUR_CHAR_CODE('last') -kAEMiddle = FOUR_CHAR_CODE('midd') -kAEAny = FOUR_CHAR_CODE('any ') -kAEAll = FOUR_CHAR_CODE('all ') -kAENext = FOUR_CHAR_CODE('next') -kAEPrevious = FOUR_CHAR_CODE('prev') -keyAECompOperator = FOUR_CHAR_CODE('relo') -keyAELogicalTerms = FOUR_CHAR_CODE('term') -keyAELogicalOperator = FOUR_CHAR_CODE('logc') -keyAEObject1 = FOUR_CHAR_CODE('obj1') -keyAEObject2 = FOUR_CHAR_CODE('obj2') -keyAEDesiredClass = FOUR_CHAR_CODE('want') -keyAEContainer = FOUR_CHAR_CODE('from') -keyAEKeyForm = FOUR_CHAR_CODE('form') -keyAEKeyData = FOUR_CHAR_CODE('seld') -keyAERangeStart = FOUR_CHAR_CODE('star') -keyAERangeStop = FOUR_CHAR_CODE('stop') -keyDisposeTokenProc = FOUR_CHAR_CODE('xtok') -keyAECompareProc = FOUR_CHAR_CODE('cmpr') -keyAECountProc = FOUR_CHAR_CODE('cont') -keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid') -keyAEMarkProc = FOUR_CHAR_CODE('mark') -keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm') -keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') -formAbsolutePosition = FOUR_CHAR_CODE('indx') -formRelativePosition = FOUR_CHAR_CODE('rele') -formTest = FOUR_CHAR_CODE('test') -formRange = FOUR_CHAR_CODE('rang') -formPropertyID = FOUR_CHAR_CODE('prop') -formName = FOUR_CHAR_CODE('name') -typeObjectSpecifier = FOUR_CHAR_CODE('obj ') -typeObjectBeingExamined = FOUR_CHAR_CODE('exmn') -typeCurrentContainer = FOUR_CHAR_CODE('ccnt') -typeToken = FOUR_CHAR_CODE('toke') -typeRelativeDescriptor = FOUR_CHAR_CODE('rel ') -typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso') -typeIndexDescriptor = FOUR_CHAR_CODE('inde') -typeRangeDescriptor = FOUR_CHAR_CODE('rang') -typeLogicalDescriptor = FOUR_CHAR_CODE('logi') -typeCompDescriptor = FOUR_CHAR_CODE('cmpd') -typeOSLTokenList = FOUR_CHAR_CODE('ostl') -kAEIDoMinimum = 0x0000 -kAEIDoWhose = 0x0001 -kAEIDoMarking = 0x0004 -kAEPassSubDescs = 0x0008 -kAEResolveNestedLists = 0x0010 -kAEHandleSimpleRanges = 0x0020 -kAEUseRelativeIterators = 0x0040 -typeWhoseDescriptor = FOUR_CHAR_CODE('whos') -formWhose = FOUR_CHAR_CODE('whos') -typeWhoseRange = FOUR_CHAR_CODE('wrng') -keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr') -keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp') -keyAEIndex = FOUR_CHAR_CODE('kidx') -keyAETest = FOUR_CHAR_CODE('ktst') diff --git a/sys/lib/python/plat-mac/Carbon/AppleHelp.py b/sys/lib/python/plat-mac/Carbon/AppleHelp.py deleted file mode 100644 index 3496d5926..000000000 --- a/sys/lib/python/plat-mac/Carbon/AppleHelp.py +++ /dev/null @@ -1,6 +0,0 @@ -# Generated from 'AppleHelp.h' - -kAHInternalErr = -10790 -kAHInternetConfigPrefErr = -10791 -kAHTOCTypeUser = 0 -kAHTOCTypeDeveloper = 1 diff --git a/sys/lib/python/plat-mac/Carbon/CF.py b/sys/lib/python/plat-mac/Carbon/CF.py deleted file mode 100644 index 4a784c0f8..000000000 --- a/sys/lib/python/plat-mac/Carbon/CF.py +++ /dev/null @@ -1 +0,0 @@ -from _CF import * diff --git a/sys/lib/python/plat-mac/Carbon/CG.py b/sys/lib/python/plat-mac/Carbon/CG.py deleted file mode 100755 index 96f577232..000000000 --- a/sys/lib/python/plat-mac/Carbon/CG.py +++ /dev/null @@ -1 +0,0 @@ -from _CG import * diff --git a/sys/lib/python/plat-mac/Carbon/CarbonEvents.py b/sys/lib/python/plat-mac/Carbon/CarbonEvents.py deleted file mode 100755 index 357ee5d38..000000000 --- a/sys/lib/python/plat-mac/Carbon/CarbonEvents.py +++ /dev/null @@ -1,451 +0,0 @@ -# Generated from 'CarbonEvents.h' - -def FOUR_CHAR_CODE(x): return x -def FOUR_CHAR_CODE(x): return x -false = 0 -true = 1 -keyAEEventClass = FOUR_CHAR_CODE('evcl') -keyAEEventID = FOUR_CHAR_CODE('evti') -eventAlreadyPostedErr = -9860 -eventTargetBusyErr = -9861 -eventClassInvalidErr = -9862 -eventClassIncorrectErr = -9864 -eventHandlerAlreadyInstalledErr = -9866 -eventInternalErr = -9868 -eventKindIncorrectErr = -9869 -eventParameterNotFoundErr = -9870 -eventNotHandledErr = -9874 -eventLoopTimedOutErr = -9875 -eventLoopQuitErr = -9876 -eventNotInQueueErr = -9877 -eventHotKeyExistsErr = -9878 -eventHotKeyInvalidErr = -9879 -kEventPriorityLow = 0 -kEventPriorityStandard = 1 -kEventPriorityHigh = 2 -kEventLeaveInQueue = false -kEventRemoveFromQueue = true -kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0) -kMouseTrackingMouseDown = 1 -kMouseTrackingMouseUp = 2 -kMouseTrackingMouseExited = 3 -kMouseTrackingMouseEntered = 4 -kMouseTrackingMouseDragged = 5 -kMouseTrackingKeyModifiersChanged = 6 -kMouseTrackingUserCancelled = 7 -kMouseTrackingTimedOut = 8 -kMouseTrackingMouseMoved = 9 -kEventAttributeNone = 0 -kEventAttributeUserEvent = (1 << 0) -kEventClassMouse = FOUR_CHAR_CODE('mous') -kEventClassKeyboard = FOUR_CHAR_CODE('keyb') -kEventClassTextInput = FOUR_CHAR_CODE('text') -kEventClassApplication = FOUR_CHAR_CODE('appl') -kEventClassAppleEvent = FOUR_CHAR_CODE('eppc') -kEventClassMenu = FOUR_CHAR_CODE('menu') -kEventClassWindow = FOUR_CHAR_CODE('wind') -kEventClassControl = FOUR_CHAR_CODE('cntl') -kEventClassCommand = FOUR_CHAR_CODE('cmds') -kEventClassTablet = FOUR_CHAR_CODE('tblt') -kEventClassVolume = FOUR_CHAR_CODE('vol ') -kEventClassAppearance = FOUR_CHAR_CODE('appm') -kEventClassService = FOUR_CHAR_CODE('serv') -kEventMouseDown = 1 -kEventMouseUp = 2 -kEventMouseMoved = 5 -kEventMouseDragged = 6 -kEventMouseWheelMoved = 10 -kEventMouseButtonPrimary = 1 -kEventMouseButtonSecondary = 2 -kEventMouseButtonTertiary = 3 -kEventMouseWheelAxisX = 0 -kEventMouseWheelAxisY = 1 -kEventTextInputUpdateActiveInputArea = 1 -kEventTextInputUnicodeForKeyEvent = 2 -kEventTextInputOffsetToPos = 3 -kEventTextInputPosToOffset = 4 -kEventTextInputShowHideBottomWindow = 5 -kEventTextInputGetSelectedText = 6 -kEventRawKeyDown = 1 -kEventRawKeyRepeat = 2 -kEventRawKeyUp = 3 -kEventRawKeyModifiersChanged = 4 -kEventHotKeyPressed = 5 -kEventHotKeyReleased = 6 -kEventKeyModifierNumLockBit = 16 -kEventKeyModifierFnBit = 17 -kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit -kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit -kEventAppActivated = 1 -kEventAppDeactivated = 2 -kEventAppQuit = 3 -kEventAppLaunchNotification = 4 -kEventAppLaunched = 5 -kEventAppTerminated = 6 -kEventAppFrontSwitched = 7 -kEventAppGetDockTileMenu = 20 -kEventAppleEvent = 1 -kEventWindowUpdate = 1 -kEventWindowDrawContent = 2 -kEventWindowActivated = 5 -kEventWindowDeactivated = 6 -kEventWindowGetClickActivation = 7 -kEventWindowShowing = 22 -kEventWindowHiding = 23 -kEventWindowShown = 24 -kEventWindowHidden = 25 -kEventWindowCollapsing = 86 -kEventWindowCollapsed = 67 -kEventWindowExpanding = 87 -kEventWindowExpanded = 70 -kEventWindowZoomed = 76 -kEventWindowBoundsChanging = 26 -kEventWindowBoundsChanged = 27 -kEventWindowResizeStarted = 28 -kEventWindowResizeCompleted = 29 -kEventWindowDragStarted = 30 -kEventWindowDragCompleted = 31 -kEventWindowClosed = 73 -kWindowBoundsChangeUserDrag = (1 << 0) -kWindowBoundsChangeUserResize = (1 << 1) -kWindowBoundsChangeSizeChanged = (1 << 2) -kWindowBoundsChangeOriginChanged = (1 << 3) -kWindowBoundsChangeZoom = (1 << 4) -kEventWindowClickDragRgn = 32 -kEventWindowClickResizeRgn = 33 -kEventWindowClickCollapseRgn = 34 -kEventWindowClickCloseRgn = 35 -kEventWindowClickZoomRgn = 36 -kEventWindowClickContentRgn = 37 -kEventWindowClickProxyIconRgn = 38 -kEventWindowClickToolbarButtonRgn = 41 -kEventWindowClickStructureRgn = 42 -kEventWindowCursorChange = 40 -kEventWindowCollapse = 66 -kEventWindowCollapseAll = 68 -kEventWindowExpand = 69 -kEventWindowExpandAll = 71 -kEventWindowClose = 72 -kEventWindowCloseAll = 74 -kEventWindowZoom = 75 -kEventWindowZoomAll = 77 -kEventWindowContextualMenuSelect = 78 -kEventWindowPathSelect = 79 -kEventWindowGetIdealSize = 80 -kEventWindowGetMinimumSize = 81 -kEventWindowGetMaximumSize = 82 -kEventWindowConstrain = 83 -kEventWindowHandleContentClick = 85 -kEventWindowProxyBeginDrag = 128 -kEventWindowProxyEndDrag = 129 -kEventWindowToolbarSwitchMode = 150 -kDockChangedUser = 1 -kDockChangedOrientation = 2 -kDockChangedAutohide = 3 -kDockChangedDisplay = 4 -kDockChangedItems = 5 -kDockChangedUnknown = 6 -kEventWindowFocusAcquired = 200 -kEventWindowFocusRelinquish = 201 -kEventWindowDrawFrame = 1000 -kEventWindowDrawPart = 1001 -kEventWindowGetRegion = 1002 -kEventWindowHitTest = 1003 -kEventWindowInit = 1004 -kEventWindowDispose = 1005 -kEventWindowDragHilite = 1006 -kEventWindowModified = 1007 -kEventWindowSetupProxyDragImage = 1008 -kEventWindowStateChanged = 1009 -kEventWindowMeasureTitle = 1010 -kEventWindowDrawGrowBox = 1011 -kEventWindowGetGrowImageRegion = 1012 -kEventWindowPaint = 1013 -kEventMenuBeginTracking = 1 -kEventMenuEndTracking = 2 -kEventMenuChangeTrackingMode = 3 -kEventMenuOpening = 4 -kEventMenuClosed = 5 -kEventMenuTargetItem = 6 -kEventMenuMatchKey = 7 -kEventMenuEnableItems = 8 -kEventMenuPopulate = 9 -kEventMenuMeasureItemWidth = 100 -kEventMenuMeasureItemHeight = 101 -kEventMenuDrawItem = 102 -kEventMenuDrawItemContent = 103 -kEventMenuDispose = 1001 -kMenuContextMenuBar = 1 << 0 -kMenuContextPullDown = 1 << 8 -kMenuContextPopUp = 1 << 9 -kMenuContextSubmenu = 1 << 10 -kMenuContextMenuBarTracking = 1 << 16 -kMenuContextPopUpTracking = 1 << 17 -kMenuContextKeyMatching = 1 << 18 -kMenuContextMenuEnabling = 1 << 19 -kMenuContextCommandIDSearch = 1 << 20 -kEventProcessCommand = 1 -kEventCommandProcess = 1 -kEventCommandUpdateStatus = 2 -kHICommandOK = FOUR_CHAR_CODE('ok ') -kHICommandCancel = FOUR_CHAR_CODE('not!') -kHICommandQuit = FOUR_CHAR_CODE('quit') -kHICommandUndo = FOUR_CHAR_CODE('undo') -kHICommandRedo = FOUR_CHAR_CODE('redo') -kHICommandCut = FOUR_CHAR_CODE('cut ') -kHICommandCopy = FOUR_CHAR_CODE('copy') -kHICommandPaste = FOUR_CHAR_CODE('past') -kHICommandClear = FOUR_CHAR_CODE('clea') -kHICommandSelectAll = FOUR_CHAR_CODE('sall') -kHICommandHide = FOUR_CHAR_CODE('hide') -kHICommandHideOthers = FOUR_CHAR_CODE('hido') -kHICommandShowAll = FOUR_CHAR_CODE('shal') -kHICommandPreferences = FOUR_CHAR_CODE('pref') -kHICommandZoomWindow = FOUR_CHAR_CODE('zoom') -kHICommandMinimizeWindow = FOUR_CHAR_CODE('mini') -kHICommandMinimizeAll = FOUR_CHAR_CODE('mina') -kHICommandMaximizeWindow = FOUR_CHAR_CODE('maxi') -kHICommandMaximizeAll = FOUR_CHAR_CODE('maxa') -kHICommandArrangeInFront = FOUR_CHAR_CODE('frnt') -kHICommandBringAllToFront = FOUR_CHAR_CODE('bfrt') -kHICommandWindowListSeparator = FOUR_CHAR_CODE('wldv') -kHICommandWindowListTerminator = FOUR_CHAR_CODE('wlst') -kHICommandSelectWindow = FOUR_CHAR_CODE('swin') -kHICommandAbout = FOUR_CHAR_CODE('abou') -kHICommandNew = FOUR_CHAR_CODE('new ') -kHICommandOpen = FOUR_CHAR_CODE('open') -kHICommandClose = FOUR_CHAR_CODE('clos') -kHICommandSave = FOUR_CHAR_CODE('save') -kHICommandSaveAs = FOUR_CHAR_CODE('svas') -kHICommandRevert = FOUR_CHAR_CODE('rvrt') -kHICommandPrint = FOUR_CHAR_CODE('prnt') -kHICommandPageSetup = FOUR_CHAR_CODE('page') -kHICommandAppHelp = FOUR_CHAR_CODE('ahlp') -kHICommandFromMenu = (1L << 0) -kHICommandFromControl = (1L << 1) -kHICommandFromWindow = (1L << 2) -kEventControlInitialize = 1000 -kEventControlDispose = 1001 -kEventControlGetOptimalBounds = 1003 -kEventControlDefInitialize = kEventControlInitialize -kEventControlDefDispose = kEventControlDispose -kEventControlHit = 1 -kEventControlSimulateHit = 2 -kEventControlHitTest = 3 -kEventControlDraw = 4 -kEventControlApplyBackground = 5 -kEventControlApplyTextColor = 6 -kEventControlSetFocusPart = 7 -kEventControlGetFocusPart = 8 -kEventControlActivate = 9 -kEventControlDeactivate = 10 -kEventControlSetCursor = 11 -kEventControlContextualMenuClick = 12 -kEventControlClick = 13 -kEventControlTrack = 51 -kEventControlGetScrollToHereStartPoint = 52 -kEventControlGetIndicatorDragConstraint = 53 -kEventControlIndicatorMoved = 54 -kEventControlGhostingFinished = 55 -kEventControlGetActionProcPart = 56 -kEventControlGetPartRegion = 101 -kEventControlGetPartBounds = 102 -kEventControlSetData = 103 -kEventControlGetData = 104 -kEventControlValueFieldChanged = 151 -kEventControlAddedSubControl = 152 -kEventControlRemovingSubControl = 153 -kEventControlBoundsChanged = 154 -kEventControlOwningWindowChanged = 159 -kEventControlArbitraryMessage = 201 -kControlBoundsChangeSizeChanged = (1 << 2) -kControlBoundsChangePositionChanged = (1 << 3) -kEventTabletPoint = 1 -kEventTabletProximity = 2 -kEventTabletPointer = 1 -kEventVolumeMounted = 1 -kEventVolumeUnmounted = 2 -typeFSVolumeRefNum = FOUR_CHAR_CODE('voln') -kEventAppearanceScrollBarVariantChanged = 1 -kEventServiceCopy = 1 -kEventServicePaste = 2 -kEventServiceGetTypes = 3 -kEventServicePerform = 4 -kEventParamDirectObject = FOUR_CHAR_CODE('----') -kEventParamPostTarget = FOUR_CHAR_CODE('ptrg') -typeEventTargetRef = FOUR_CHAR_CODE('etrg') -kEventParamWindowRef = FOUR_CHAR_CODE('wind') -kEventParamGrafPort = FOUR_CHAR_CODE('graf') -kEventParamDragRef = FOUR_CHAR_CODE('drag') -kEventParamMenuRef = FOUR_CHAR_CODE('menu') -kEventParamEventRef = FOUR_CHAR_CODE('evnt') -kEventParamControlRef = FOUR_CHAR_CODE('ctrl') -kEventParamRgnHandle = FOUR_CHAR_CODE('rgnh') -kEventParamEnabled = FOUR_CHAR_CODE('enab') -kEventParamDimensions = FOUR_CHAR_CODE('dims') -kEventParamAvailableBounds = FOUR_CHAR_CODE('avlb') -kEventParamAEEventID = keyAEEventID -kEventParamAEEventClass = keyAEEventClass -kEventParamCGContextRef = FOUR_CHAR_CODE('cntx') -kEventParamDeviceDepth = FOUR_CHAR_CODE('devd') -kEventParamDeviceColor = FOUR_CHAR_CODE('devc') -typeWindowRef = FOUR_CHAR_CODE('wind') -typeGrafPtr = FOUR_CHAR_CODE('graf') -typeGWorldPtr = FOUR_CHAR_CODE('gwld') -typeDragRef = FOUR_CHAR_CODE('drag') -typeMenuRef = FOUR_CHAR_CODE('menu') -typeControlRef = FOUR_CHAR_CODE('ctrl') -typeCollection = FOUR_CHAR_CODE('cltn') -typeQDRgnHandle = FOUR_CHAR_CODE('rgnh') -typeOSStatus = FOUR_CHAR_CODE('osst') -typeCFStringRef = FOUR_CHAR_CODE('cfst') -typeCFIndex = FOUR_CHAR_CODE('cfix') -typeCFTypeRef = FOUR_CHAR_CODE('cfty') -typeCGContextRef = FOUR_CHAR_CODE('cntx') -typeHIPoint = FOUR_CHAR_CODE('hipt') -typeHISize = FOUR_CHAR_CODE('hisz') -typeHIRect = FOUR_CHAR_CODE('hirc') -kEventParamMouseLocation = FOUR_CHAR_CODE('mloc') -kEventParamMouseButton = FOUR_CHAR_CODE('mbtn') -kEventParamClickCount = FOUR_CHAR_CODE('ccnt') -kEventParamMouseWheelAxis = FOUR_CHAR_CODE('mwax') -kEventParamMouseWheelDelta = FOUR_CHAR_CODE('mwdl') -kEventParamMouseDelta = FOUR_CHAR_CODE('mdta') -kEventParamMouseChord = FOUR_CHAR_CODE('chor') -kEventParamTabletEventType = FOUR_CHAR_CODE('tblt') -typeMouseButton = FOUR_CHAR_CODE('mbtn') -typeMouseWheelAxis = FOUR_CHAR_CODE('mwax') -kEventParamKeyCode = FOUR_CHAR_CODE('kcod') -kEventParamKeyMacCharCodes = FOUR_CHAR_CODE('kchr') -kEventParamKeyModifiers = FOUR_CHAR_CODE('kmod') -kEventParamKeyUnicodes = FOUR_CHAR_CODE('kuni') -kEventParamKeyboardType = FOUR_CHAR_CODE('kbdt') -typeEventHotKeyID = FOUR_CHAR_CODE('hkid') -kEventParamTextInputSendRefCon = FOUR_CHAR_CODE('tsrc') -kEventParamTextInputSendComponentInstance = FOUR_CHAR_CODE('tsci') -kEventParamTextInputSendSLRec = FOUR_CHAR_CODE('tssl') -kEventParamTextInputReplySLRec = FOUR_CHAR_CODE('trsl') -kEventParamTextInputSendText = FOUR_CHAR_CODE('tstx') -kEventParamTextInputReplyText = FOUR_CHAR_CODE('trtx') -kEventParamTextInputSendUpdateRng = FOUR_CHAR_CODE('tsup') -kEventParamTextInputSendHiliteRng = FOUR_CHAR_CODE('tshi') -kEventParamTextInputSendClauseRng = FOUR_CHAR_CODE('tscl') -kEventParamTextInputSendPinRng = FOUR_CHAR_CODE('tspn') -kEventParamTextInputSendFixLen = FOUR_CHAR_CODE('tsfx') -kEventParamTextInputSendLeadingEdge = FOUR_CHAR_CODE('tsle') -kEventParamTextInputReplyLeadingEdge = FOUR_CHAR_CODE('trle') -kEventParamTextInputSendTextOffset = FOUR_CHAR_CODE('tsto') -kEventParamTextInputReplyTextOffset = FOUR_CHAR_CODE('trto') -kEventParamTextInputReplyRegionClass = FOUR_CHAR_CODE('trrg') -kEventParamTextInputSendCurrentPoint = FOUR_CHAR_CODE('tscp') -kEventParamTextInputSendDraggingMode = FOUR_CHAR_CODE('tsdm') -kEventParamTextInputReplyPoint = FOUR_CHAR_CODE('trpt') -kEventParamTextInputReplyFont = FOUR_CHAR_CODE('trft') -kEventParamTextInputReplyFMFont = FOUR_CHAR_CODE('trfm') -kEventParamTextInputReplyPointSize = FOUR_CHAR_CODE('trpz') -kEventParamTextInputReplyLineHeight = FOUR_CHAR_CODE('trlh') -kEventParamTextInputReplyLineAscent = FOUR_CHAR_CODE('trla') -kEventParamTextInputReplyTextAngle = FOUR_CHAR_CODE('trta') -kEventParamTextInputSendShowHide = FOUR_CHAR_CODE('tssh') -kEventParamTextInputReplyShowHide = FOUR_CHAR_CODE('trsh') -kEventParamTextInputSendKeyboardEvent = FOUR_CHAR_CODE('tske') -kEventParamTextInputSendTextServiceEncoding = FOUR_CHAR_CODE('tsse') -kEventParamTextInputSendTextServiceMacEncoding = FOUR_CHAR_CODE('tssm') -kEventParamHICommand = FOUR_CHAR_CODE('hcmd') -typeHICommand = FOUR_CHAR_CODE('hcmd') -kEventParamWindowFeatures = FOUR_CHAR_CODE('wftr') -kEventParamWindowDefPart = FOUR_CHAR_CODE('wdpc') -kEventParamCurrentBounds = FOUR_CHAR_CODE('crct') -kEventParamOriginalBounds = FOUR_CHAR_CODE('orct') -kEventParamPreviousBounds = FOUR_CHAR_CODE('prct') -kEventParamClickActivation = FOUR_CHAR_CODE('clac') -kEventParamWindowRegionCode = FOUR_CHAR_CODE('wshp') -kEventParamWindowDragHiliteFlag = FOUR_CHAR_CODE('wdhf') -kEventParamWindowModifiedFlag = FOUR_CHAR_CODE('wmff') -kEventParamWindowProxyGWorldPtr = FOUR_CHAR_CODE('wpgw') -kEventParamWindowProxyImageRgn = FOUR_CHAR_CODE('wpir') -kEventParamWindowProxyOutlineRgn = FOUR_CHAR_CODE('wpor') -kEventParamWindowStateChangedFlags = FOUR_CHAR_CODE('wscf') -kEventParamWindowTitleFullWidth = FOUR_CHAR_CODE('wtfw') -kEventParamWindowTitleTextWidth = FOUR_CHAR_CODE('wttw') -kEventParamWindowGrowRect = FOUR_CHAR_CODE('grct') -kEventParamAttributes = FOUR_CHAR_CODE('attr') -kEventParamDockChangedReason = FOUR_CHAR_CODE('dcrs') -kEventParamPreviousDockRect = FOUR_CHAR_CODE('pdrc') -kEventParamCurrentDockRect = FOUR_CHAR_CODE('cdrc') -typeWindowRegionCode = FOUR_CHAR_CODE('wshp') -typeWindowDefPartCode = FOUR_CHAR_CODE('wdpt') -typeClickActivationResult = FOUR_CHAR_CODE('clac') -kEventParamControlPart = FOUR_CHAR_CODE('cprt') -kEventParamInitCollection = FOUR_CHAR_CODE('icol') -kEventParamControlMessage = FOUR_CHAR_CODE('cmsg') -kEventParamControlParam = FOUR_CHAR_CODE('cprm') -kEventParamControlResult = FOUR_CHAR_CODE('crsl') -kEventParamControlRegion = FOUR_CHAR_CODE('crgn') -kEventParamControlAction = FOUR_CHAR_CODE('caup') -kEventParamControlIndicatorDragConstraint = FOUR_CHAR_CODE('cidc') -kEventParamControlIndicatorRegion = FOUR_CHAR_CODE('cirn') -kEventParamControlIsGhosting = FOUR_CHAR_CODE('cgst') -kEventParamControlIndicatorOffset = FOUR_CHAR_CODE('ciof') -kEventParamControlClickActivationResult = FOUR_CHAR_CODE('ccar') -kEventParamControlSubControl = FOUR_CHAR_CODE('csub') -kEventParamControlOptimalBounds = FOUR_CHAR_CODE('cobn') -kEventParamControlOptimalBaselineOffset = FOUR_CHAR_CODE('cobo') -kEventParamControlDataTag = FOUR_CHAR_CODE('cdtg') -kEventParamControlDataBuffer = FOUR_CHAR_CODE('cdbf') -kEventParamControlDataBufferSize = FOUR_CHAR_CODE('cdbs') -kEventParamControlDrawDepth = FOUR_CHAR_CODE('cddp') -kEventParamControlDrawInColor = FOUR_CHAR_CODE('cdic') -kEventParamControlFeatures = FOUR_CHAR_CODE('cftr') -kEventParamControlPartBounds = FOUR_CHAR_CODE('cpbd') -kEventParamControlOriginalOwningWindow = FOUR_CHAR_CODE('coow') -kEventParamControlCurrentOwningWindow = FOUR_CHAR_CODE('ccow') -typeControlActionUPP = FOUR_CHAR_CODE('caup') -typeIndicatorDragConstraint = FOUR_CHAR_CODE('cidc') -typeControlPartCode = FOUR_CHAR_CODE('cprt') -kEventParamCurrentMenuTrackingMode = FOUR_CHAR_CODE('cmtm') -kEventParamNewMenuTrackingMode = FOUR_CHAR_CODE('nmtm') -kEventParamMenuFirstOpen = FOUR_CHAR_CODE('1sto') -kEventParamMenuItemIndex = FOUR_CHAR_CODE('item') -kEventParamMenuCommand = FOUR_CHAR_CODE('mcmd') -kEventParamEnableMenuForKeyEvent = FOUR_CHAR_CODE('fork') -kEventParamMenuEventOptions = FOUR_CHAR_CODE('meop') -kEventParamMenuContext = FOUR_CHAR_CODE('mctx') -kEventParamMenuItemBounds = FOUR_CHAR_CODE('mitb') -kEventParamMenuMarkBounds = FOUR_CHAR_CODE('mmkb') -kEventParamMenuIconBounds = FOUR_CHAR_CODE('micb') -kEventParamMenuTextBounds = FOUR_CHAR_CODE('mtxb') -kEventParamMenuTextBaseline = FOUR_CHAR_CODE('mtbl') -kEventParamMenuCommandKeyBounds = FOUR_CHAR_CODE('mcmb') -kEventParamMenuVirtualTop = FOUR_CHAR_CODE('mvrt') -kEventParamMenuVirtualBottom = FOUR_CHAR_CODE('mvrb') -kEventParamMenuDrawState = FOUR_CHAR_CODE('mdrs') -kEventParamMenuItemType = FOUR_CHAR_CODE('mitp') -kEventParamMenuItemWidth = FOUR_CHAR_CODE('mitw') -kEventParamMenuItemHeight = FOUR_CHAR_CODE('mith') -typeMenuItemIndex = FOUR_CHAR_CODE('midx') -typeMenuCommand = FOUR_CHAR_CODE('mcmd') -typeMenuTrackingMode = FOUR_CHAR_CODE('mtmd') -typeMenuEventOptions = FOUR_CHAR_CODE('meop') -typeThemeMenuState = FOUR_CHAR_CODE('tmns') -typeThemeMenuItemType = FOUR_CHAR_CODE('tmit') -kEventParamProcessID = FOUR_CHAR_CODE('psn ') -kEventParamLaunchRefCon = FOUR_CHAR_CODE('lref') -kEventParamLaunchErr = FOUR_CHAR_CODE('err ') -kEventParamTabletPointRec = FOUR_CHAR_CODE('tbrc') -kEventParamTabletProximityRec = FOUR_CHAR_CODE('tbpx') -typeTabletPointRec = FOUR_CHAR_CODE('tbrc') -typeTabletProximityRec = FOUR_CHAR_CODE('tbpx') -kEventParamTabletPointerRec = FOUR_CHAR_CODE('tbrc') -typeTabletPointerRec = FOUR_CHAR_CODE('tbrc') -kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv') -kEventParamScrapRef = FOUR_CHAR_CODE('scrp') -kEventParamServiceCopyTypes = FOUR_CHAR_CODE('svsd') -kEventParamServicePasteTypes = FOUR_CHAR_CODE('svpt') -kEventParamServiceMessageName = FOUR_CHAR_CODE('svmg') -kEventParamServiceUserData = FOUR_CHAR_CODE('svud') -typeScrapRef = FOUR_CHAR_CODE('scrp') -typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma') -# sHandler = NewEventHandlerUPP( x ) -kMouseTrackingMousePressed = kMouseTrackingMouseDown -kMouseTrackingMouseReleased = kMouseTrackingMouseUp diff --git a/sys/lib/python/plat-mac/Carbon/CarbonEvt.py b/sys/lib/python/plat-mac/Carbon/CarbonEvt.py deleted file mode 100755 index 63a779299..000000000 --- a/sys/lib/python/plat-mac/Carbon/CarbonEvt.py +++ /dev/null @@ -1 +0,0 @@ -from _CarbonEvt import * diff --git a/sys/lib/python/plat-mac/Carbon/Cm.py b/sys/lib/python/plat-mac/Carbon/Cm.py deleted file mode 100644 index 3c8bc331b..000000000 --- a/sys/lib/python/plat-mac/Carbon/Cm.py +++ /dev/null @@ -1 +0,0 @@ -from _Cm import * diff --git a/sys/lib/python/plat-mac/Carbon/Components.py b/sys/lib/python/plat-mac/Carbon/Components.py deleted file mode 100644 index 75574cf6d..000000000 --- a/sys/lib/python/plat-mac/Carbon/Components.py +++ /dev/null @@ -1,62 +0,0 @@ -# Generated from 'Components.h' - -def FOUR_CHAR_CODE(x): return x -kAppleManufacturer = FOUR_CHAR_CODE('appl') -kComponentResourceType = FOUR_CHAR_CODE('thng') -kComponentAliasResourceType = FOUR_CHAR_CODE('thga') -kAnyComponentType = 0 -kAnyComponentSubType = 0 -kAnyComponentManufacturer = 0 -kAnyComponentFlagsMask = 0 -cmpIsMissing = 1L << 29 -cmpWantsRegisterMessage = 1L << 31 -kComponentOpenSelect = -1 -kComponentCloseSelect = -2 -kComponentCanDoSelect = -3 -kComponentVersionSelect = -4 -kComponentRegisterSelect = -5 -kComponentTargetSelect = -6 -kComponentUnregisterSelect = -7 -kComponentGetMPWorkFunctionSelect = -8 -kComponentExecuteWiredActionSelect = -9 -kComponentGetPublicResourceSelect = -10 -componentDoAutoVersion = (1 << 0) -componentWantsUnregister = (1 << 1) -componentAutoVersionIncludeFlags = (1 << 2) -componentHasMultiplePlatforms = (1 << 3) -componentLoadResident = (1 << 4) -defaultComponentIdentical = 0 -defaultComponentAnyFlags = 1 -defaultComponentAnyManufacturer = 2 -defaultComponentAnySubType = 4 -defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer) -defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType) -registerComponentGlobal = 1 -registerComponentNoDuplicates = 2 -registerComponentAfterExisting = 4 -registerComponentAliasesOnly = 8 -platform68k = 1 -platformPowerPC = 2 -platformInterpreted = 3 -platformWin32 = 4 -platformPowerPCNativeEntryPoint = 5 -mpWorkFlagDoWork = (1 << 0) -mpWorkFlagDoCompletion = (1 << 1) -mpWorkFlagCopyWorkBlock = (1 << 2) -mpWorkFlagDontBlock = (1 << 3) -mpWorkFlagGetProcessorCount = (1 << 4) -mpWorkFlagGetIsRunning = (1 << 6) -cmpAliasNoFlags = 0 -cmpAliasOnlyThisFile = 1 -uppComponentFunctionImplementedProcInfo = 0x000002F0 -uppGetComponentVersionProcInfo = 0x000000F0 -uppComponentSetTargetProcInfo = 0x000003F0 -uppCallComponentOpenProcInfo = 0x000003F0 -uppCallComponentCloseProcInfo = 0x000003F0 -uppCallComponentCanDoProcInfo = 0x000002F0 -uppCallComponentVersionProcInfo = 0x000000F0 -uppCallComponentRegisterProcInfo = 0x000000F0 -uppCallComponentTargetProcInfo = 0x000003F0 -uppCallComponentUnregisterProcInfo = 0x000000F0 -uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0 -uppCallComponentGetPublicResourceProcInfo = 0x00003BF0 diff --git a/sys/lib/python/plat-mac/Carbon/ControlAccessor.py b/sys/lib/python/plat-mac/Carbon/ControlAccessor.py deleted file mode 100644 index 099892538..000000000 --- a/sys/lib/python/plat-mac/Carbon/ControlAccessor.py +++ /dev/null @@ -1,56 +0,0 @@ -# Accessor functions for control properties - -from Controls import * -import struct - -# These needn't go through this module, but are here for completeness -def SetControlData_Handle(control, part, selector, data): - control.SetControlData_Handle(part, selector, data) - -def GetControlData_Handle(control, part, selector): - return control.GetControlData_Handle(part, selector) - -_accessdict = { - kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle), -} - -_codingdict = { - kControlPushButtonDefaultTag : ("b", None, None), - - kControlEditTextTextTag: (None, None, None), - kControlEditTextPasswordTag: (None, None, None), - - kControlPopupButtonMenuIDTag: ("h", None, None), - - kControlListBoxDoubleClickTag: ("b", None, None), -} - -def SetControlData(control, part, selector, data): - if _accessdict.has_key(selector): - setfunc, getfunc = _accessdict[selector] - setfunc(control, part, selector, data) - return - if not _codingdict.has_key(selector): - raise KeyError, ('Unknown control selector', selector) - structfmt, coder, decoder = _codingdict[selector] - if coder: - data = coder(data) - if structfmt: - data = struct.pack(structfmt, data) - control.SetControlData(part, selector, data) - -def GetControlData(control, part, selector): - if _accessdict.has_key(selector): - setfunc, getfunc = _accessdict[selector] - return getfunc(control, part, selector, data) - if not _codingdict.has_key(selector): - raise KeyError, ('Unknown control selector', selector) - structfmt, coder, decoder = _codingdict[selector] - data = control.GetControlData(part, selector) - if structfmt: - data = struct.unpack(structfmt, data) - if decoder: - data = decoder(data) - if type(data) == type(()) and len(data) == 1: - data = data[0] - return data diff --git a/sys/lib/python/plat-mac/Carbon/Controls.py b/sys/lib/python/plat-mac/Carbon/Controls.py deleted file mode 100644 index 6e5d8ea7f..000000000 --- a/sys/lib/python/plat-mac/Carbon/Controls.py +++ /dev/null @@ -1,668 +0,0 @@ -# Generated from 'Controls.h' - -def FOUR_CHAR_CODE(x): return x -from Carbon.TextEdit import * -from Carbon.QuickDraw import * -from Carbon.Dragconst import * -from Carbon.CarbonEvents import * -from Carbon.Appearance import * -kDataBrowserItemAnyState = -1 -kControlBevelButtonCenterPopupGlyphTag = -1 -kDataBrowserClientPropertyFlagsMask = 0xFF000000 - -kControlDefProcType = FOUR_CHAR_CODE('CDEF') -kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL') -kControlColorTableResourceType = FOUR_CHAR_CODE('cctb') -kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF') -controlNotifyNothing = FOUR_CHAR_CODE('nada') -controlNotifyClick = FOUR_CHAR_CODE('clik') -controlNotifyFocus = FOUR_CHAR_CODE('focu') -controlNotifyKey = FOUR_CHAR_CODE('key ') -kControlCanAutoInvalidate = 1L << 0 -staticTextProc = 256 -editTextProc = 272 -iconProc = 288 -userItemProc = 304 -pictItemProc = 320 -cFrameColor = 0 -cBodyColor = 1 -cTextColor = 2 -cThumbColor = 3 -kNumberCtlCTabEntries = 4 -kControlNoVariant = 0 -kControlUsesOwningWindowsFontVariant = 1 << 3 -kControlNoPart = 0 -kControlIndicatorPart = 129 -kControlDisabledPart = 254 -kControlInactivePart = 255 -kControlEntireControl = 0 -kControlStructureMetaPart = -1 -kControlContentMetaPart = -2 -kControlFocusNoPart = 0 -kControlFocusNextPart = -1 -kControlFocusPrevPart = -2 -kControlCollectionTagBounds = FOUR_CHAR_CODE('boun') -kControlCollectionTagValue = FOUR_CHAR_CODE('valu') -kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ') -kControlCollectionTagMaximum = FOUR_CHAR_CODE('max ') -kControlCollectionTagViewSize = FOUR_CHAR_CODE('view') -kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi') -kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc') -kControlCollectionTagTitle = FOUR_CHAR_CODE('titl') -kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE('uttl') -kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi') -kControlCollectionTagIDID = FOUR_CHAR_CODE('idid') -kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ') -kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc') -kControlContentTextOnly = 0 -kControlNoContent = 0 -kControlContentIconSuiteRes = 1 -kControlContentCIconRes = 2 -kControlContentPictRes = 3 -kControlContentICONRes = 4 -kControlContentIconSuiteHandle = 129 -kControlContentCIconHandle = 130 -kControlContentPictHandle = 131 -kControlContentIconRef = 132 -kControlContentICON = 133 -kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ') -kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn') -kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') -kControlFontBigSystemFont = -1 -kControlFontSmallSystemFont = -2 -kControlFontSmallBoldSystemFont = -3 -kControlFontViewSystemFont = -4 -kControlUseFontMask = 0x0001 -kControlUseFaceMask = 0x0002 -kControlUseSizeMask = 0x0004 -kControlUseForeColorMask = 0x0008 -kControlUseBackColorMask = 0x0010 -kControlUseModeMask = 0x0020 -kControlUseJustMask = 0x0040 -kControlUseAllMask = 0x00FF -kControlAddFontSizeMask = 0x0100 -kControlAddToMetaFontMask = 0x0200 -kControlUseThemeFontIDMask = 0x0080 -kDoNotActivateAndIgnoreClick = 0 -kDoNotActivateAndHandleClick = 1 -kActivateAndIgnoreClick = 2 -kActivateAndHandleClick = 3 -kControlFontStyleTag = FOUR_CHAR_CODE('font') -kControlKeyFilterTag = FOUR_CHAR_CODE('fltr') -kControlKindTag = FOUR_CHAR_CODE('kind') -kControlSizeTag = FOUR_CHAR_CODE('size') -kControlSupportsGhosting = 1 << 0 -kControlSupportsEmbedding = 1 << 1 -kControlSupportsFocus = 1 << 2 -kControlWantsIdle = 1 << 3 -kControlWantsActivate = 1 << 4 -kControlHandlesTracking = 1 << 5 -kControlSupportsDataAccess = 1 << 6 -kControlHasSpecialBackground = 1 << 7 -kControlGetsFocusOnClick = 1 << 8 -kControlSupportsCalcBestRect = 1 << 9 -kControlSupportsLiveFeedback = 1 << 10 -kControlHasRadioBehavior = 1 << 11 -kControlSupportsDragAndDrop = 1 << 12 -kControlAutoToggles = 1 << 14 -kControlSupportsGetRegion = 1 << 17 -kControlSupportsFlattening = 1 << 19 -kControlSupportsSetCursor = 1 << 20 -kControlSupportsContextualMenus = 1 << 21 -kControlSupportsClickActivation = 1 << 22 -kControlIdlesWithTimer = 1 << 23 -drawCntl = 0 -testCntl = 1 -calcCRgns = 2 -initCntl = 3 -dispCntl = 4 -posCntl = 5 -thumbCntl = 6 -dragCntl = 7 -autoTrack = 8 -calcCntlRgn = 10 -calcThumbRgn = 11 -drawThumbOutline = 12 -kControlMsgDrawGhost = 13 -kControlMsgCalcBestRect = 14 -kControlMsgHandleTracking = 15 -kControlMsgFocus = 16 -kControlMsgKeyDown = 17 -kControlMsgIdle = 18 -kControlMsgGetFeatures = 19 -kControlMsgSetData = 20 -kControlMsgGetData = 21 -kControlMsgActivate = 22 -kControlMsgSetUpBackground = 23 -kControlMsgCalcValueFromPos = 26 -kControlMsgTestNewMsgSupport = 27 -kControlMsgSubValueChanged = 25 -kControlMsgSubControlAdded = 28 -kControlMsgSubControlRemoved = 29 -kControlMsgApplyTextColor = 30 -kControlMsgGetRegion = 31 -kControlMsgFlatten = 32 -kControlMsgSetCursor = 33 -kControlMsgDragEnter = 38 -kControlMsgDragLeave = 39 -kControlMsgDragWithin = 40 -kControlMsgDragReceive = 41 -kControlMsgDisplayDebugInfo = 46 -kControlMsgContextualMenuClick = 47 -kControlMsgGetClickActivation = 48 -kControlSizeNormal = 0 -kControlSizeSmall = 1 -kControlSizeLarge = 2 -kControlSizeAuto = 0xFFFF -kDrawControlEntireControl = 0 -kDrawControlIndicatorOnly = 129 -kDragControlEntireControl = 0 -kDragControlIndicator = 1 -kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ') -kControlKeyFilterBlockKey = 0 -kControlKeyFilterPassKey = 1 -noConstraint = kNoConstraint -hAxisOnly = 1 -vAxisOnly = 2 -kControlDefProcPtr = 0 -kControlDefObjectClass = 1 -kControlKindSignatureApple = FOUR_CHAR_CODE('appl') -kControlPropertyPersistent = 0x00000001 -kDragTrackingEnterControl = 2 -kDragTrackingInControl = 3 -kDragTrackingLeaveControl = 4 -useWFont = kControlUsesOwningWindowsFontVariant -inThumb = kControlIndicatorPart -kNoHiliteControlPart = kControlNoPart -kInIndicatorControlPart = kControlIndicatorPart -kReservedControlPart = kControlDisabledPart -kControlInactiveControlPart = kControlInactivePart -kControlTabListResType = FOUR_CHAR_CODE('tab#') -kControlListDescResType = FOUR_CHAR_CODE('ldes') -kControlCheckBoxUncheckedValue = 0 -kControlCheckBoxCheckedValue = 1 -kControlCheckBoxMixedValue = 2 -kControlRadioButtonUncheckedValue = 0 -kControlRadioButtonCheckedValue = 1 -kControlRadioButtonMixedValue = 2 -popupFixedWidth = 1 << 0 -popupVariableWidth = 1 << 1 -popupUseAddResMenu = 1 << 2 -popupUseWFont = 1 << 3 -popupTitleBold = 1 << 8 -popupTitleItalic = 1 << 9 -popupTitleUnderline = 1 << 10 -popupTitleOutline = 1 << 11 -popupTitleShadow = 1 << 12 -popupTitleCondense = 1 << 13 -popupTitleExtend = 1 << 14 -popupTitleNoStyle = 1 << 15 -popupTitleLeftJust = 0x00000000 -popupTitleCenterJust = 0x00000001 -popupTitleRightJust = 0x000000FF -pushButProc = 0 -checkBoxProc = 1 -radioButProc = 2 -scrollBarProc = 16 -popupMenuProc = 1008 -kControlLabelPart = 1 -kControlMenuPart = 2 -kControlTrianglePart = 4 -kControlEditTextPart = 5 -kControlPicturePart = 6 -kControlIconPart = 7 -kControlClockPart = 8 -kControlListBoxPart = 24 -kControlListBoxDoubleClickPart = 25 -kControlImageWellPart = 26 -kControlRadioGroupPart = 27 -kControlButtonPart = 10 -kControlCheckBoxPart = 11 -kControlRadioButtonPart = 11 -kControlUpButtonPart = 20 -kControlDownButtonPart = 21 -kControlPageUpPart = 22 -kControlPageDownPart = 23 -kControlClockHourDayPart = 9 -kControlClockMinuteMonthPart = 10 -kControlClockSecondYearPart = 11 -kControlClockAMPMPart = 12 -kControlDataBrowserPart = 24 -kControlDataBrowserDraggedPart = 25 -kControlBevelButtonSmallBevelProc = 32 -kControlBevelButtonNormalBevelProc = 33 -kControlBevelButtonLargeBevelProc = 34 -kControlBevelButtonSmallBevelVariant = 0 -kControlBevelButtonNormalBevelVariant = (1 << 0) -kControlBevelButtonLargeBevelVariant = (1 << 1) -kControlBevelButtonMenuOnRightVariant = (1 << 2) -kControlBevelButtonSmallBevel = 0 -kControlBevelButtonNormalBevel = 1 -kControlBevelButtonLargeBevel = 2 -kControlBehaviorPushbutton = 0 -kControlBehaviorToggles = 0x0100 -kControlBehaviorSticky = 0x0200 -kControlBehaviorSingleValueMenu = 0 -kControlBehaviorMultiValueMenu = 0x4000 -kControlBehaviorOffsetContents = 0x8000 -kControlBehaviorCommandMenu = 0x2000 -kControlBevelButtonMenuOnBottom = 0 -kControlBevelButtonMenuOnRight = (1 << 2) -kControlKindBevelButton = FOUR_CHAR_CODE('bevl') -kControlBevelButtonAlignSysDirection = -1 -kControlBevelButtonAlignCenter = 0 -kControlBevelButtonAlignLeft = 1 -kControlBevelButtonAlignRight = 2 -kControlBevelButtonAlignTop = 3 -kControlBevelButtonAlignBottom = 4 -kControlBevelButtonAlignTopLeft = 5 -kControlBevelButtonAlignBottomLeft = 6 -kControlBevelButtonAlignTopRight = 7 -kControlBevelButtonAlignBottomRight = 8 -kControlBevelButtonAlignTextSysDirection = teFlushDefault -kControlBevelButtonAlignTextCenter = teCenter -kControlBevelButtonAlignTextFlushRight = teFlushRight -kControlBevelButtonAlignTextFlushLeft = teFlushLeft -kControlBevelButtonPlaceSysDirection = -1 -kControlBevelButtonPlaceNormally = 0 -kControlBevelButtonPlaceToRightOfGraphic = 1 -kControlBevelButtonPlaceToLeftOfGraphic = 2 -kControlBevelButtonPlaceBelowGraphic = 3 -kControlBevelButtonPlaceAboveGraphic = 4 -kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont') -kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran') -kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali') -kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff') -kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali') -kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff') -kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc') -kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval') -kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd') -kControlBevelButtonMenuRefTag = FOUR_CHAR_CODE('mhnd') -# kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') -kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu') -kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') -kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') -kControlBevelButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') -kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk') -kControlSliderProc = 48 -kControlSliderLiveFeedback = (1 << 0) -kControlSliderHasTickMarks = (1 << 1) -kControlSliderReverseDirection = (1 << 2) -kControlSliderNonDirectional = (1 << 3) -kControlSliderPointsDownOrRight = 0 -kControlSliderPointsUpOrLeft = 1 -kControlSliderDoesNotPoint = 2 -kControlKindSlider = FOUR_CHAR_CODE('sldr') -kControlTriangleProc = 64 -kControlTriangleLeftFacingProc = 65 -kControlTriangleAutoToggleProc = 66 -kControlTriangleLeftFacingAutoToggleProc = 67 -kControlDisclosureTrianglePointDefault = 0 -kControlDisclosureTrianglePointRight = 1 -kControlDisclosureTrianglePointLeft = 2 -kControlKindDisclosureTriangle = FOUR_CHAR_CODE('dist') -kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') -kControlProgressBarProc = 80 -kControlRelevanceBarProc = 81 -kControlKindProgressBar = FOUR_CHAR_CODE('prgb') -kControlKindRelevanceBar = FOUR_CHAR_CODE('relb') -kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde') -kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim') -kControlLittleArrowsProc = 96 -kControlKindLittleArrows = FOUR_CHAR_CODE('larr') -kControlChasingArrowsProc = 112 -kControlKindChasingArrows = FOUR_CHAR_CODE('carr') -kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim') -kControlTabLargeProc = 128 -kControlTabSmallProc = 129 -kControlTabLargeNorthProc = 128 -kControlTabSmallNorthProc = 129 -kControlTabLargeSouthProc = 130 -kControlTabSmallSouthProc = 131 -kControlTabLargeEastProc = 132 -kControlTabSmallEastProc = 133 -kControlTabLargeWestProc = 134 -kControlTabSmallWestProc = 135 -kControlTabDirectionNorth = 0 -kControlTabDirectionSouth = 1 -kControlTabDirectionEast = 2 -kControlTabDirectionWest = 3 -kControlTabSizeLarge = kControlSizeNormal -kControlTabSizeSmall = kControlSizeSmall -kControlKindTabs = FOUR_CHAR_CODE('tabs') -kControlTabContentRectTag = FOUR_CHAR_CODE('rect') -kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab') -kControlTabFontStyleTag = kControlFontStyleTag -kControlTabInfoTag = FOUR_CHAR_CODE('tabi') -kControlTabImageContentTag = FOUR_CHAR_CODE('cont') -kControlTabInfoVersionZero = 0 -kControlTabInfoVersionOne = 1 -kControlSeparatorLineProc = 144 -kControlKindSeparator = FOUR_CHAR_CODE('sepa') -kControlGroupBoxTextTitleProc = 160 -kControlGroupBoxCheckBoxProc = 161 -kControlGroupBoxPopupButtonProc = 162 -kControlGroupBoxSecondaryTextTitleProc = 164 -kControlGroupBoxSecondaryCheckBoxProc = 165 -kControlGroupBoxSecondaryPopupButtonProc = 166 -kControlKindGroupBox = FOUR_CHAR_CODE('grpb') -kControlKindCheckGroupBox = FOUR_CHAR_CODE('cgrp') -kControlKindPopupGroupBox = FOUR_CHAR_CODE('pgrp') -kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan') -kControlGroupBoxMenuRefTag = FOUR_CHAR_CODE('mhan') -kControlGroupBoxFontStyleTag = kControlFontStyleTag -kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') -kControlImageWellProc = 176 -kControlKindImageWell = FOUR_CHAR_CODE('well') -kControlImageWellContentTag = FOUR_CHAR_CODE('cont') -kControlImageWellTransformTag = FOUR_CHAR_CODE('tran') -kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag') -kControlPopupArrowEastProc = 192 -kControlPopupArrowWestProc = 193 -kControlPopupArrowNorthProc = 194 -kControlPopupArrowSouthProc = 195 -kControlPopupArrowSmallEastProc = 196 -kControlPopupArrowSmallWestProc = 197 -kControlPopupArrowSmallNorthProc = 198 -kControlPopupArrowSmallSouthProc = 199 -kControlPopupArrowOrientationEast = 0 -kControlPopupArrowOrientationWest = 1 -kControlPopupArrowOrientationNorth = 2 -kControlPopupArrowOrientationSouth = 3 -kControlPopupArrowSizeNormal = 0 -kControlPopupArrowSizeSmall = 1 -kControlKindPopupArrow = FOUR_CHAR_CODE('parr') -kControlPlacardProc = 224 -kControlKindPlacard = FOUR_CHAR_CODE('plac') -kControlClockTimeProc = 240 -kControlClockTimeSecondsProc = 241 -kControlClockDateProc = 242 -kControlClockMonthYearProc = 243 -kControlClockTypeHourMinute = 0 -kControlClockTypeHourMinuteSecond = 1 -kControlClockTypeMonthDayYear = 2 -kControlClockTypeMonthYear = 3 -kControlClockFlagStandard = 0 -kControlClockNoFlags = 0 -kControlClockFlagDisplayOnly = 1 -kControlClockIsDisplayOnly = 1 -kControlClockFlagLive = 2 -kControlClockIsLive = 2 -kControlKindClock = FOUR_CHAR_CODE('clck') -kControlClockLongDateTag = FOUR_CHAR_CODE('date') -kControlClockFontStyleTag = kControlFontStyleTag -kControlClockAnimatingTag = FOUR_CHAR_CODE('anim') -kControlUserPaneProc = 256 -kControlKindUserPane = FOUR_CHAR_CODE('upan') -kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp') -kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw') -kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt') -kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak') -kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle') -kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd') -kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti') -kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci') -kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') -kControlEditTextProc = 272 -kControlEditTextPasswordProc = 274 -kControlEditTextInlineInputProc = 276 -kControlKindEditText = FOUR_CHAR_CODE('etxt') -kControlEditTextStyleTag = kControlFontStyleTag -kControlEditTextTextTag = FOUR_CHAR_CODE('text') -kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than') -kControlEditTextKeyFilterTag = kControlKeyFilterTag -kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele') -kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') -kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr') -kControlEditTextLockedTag = FOUR_CHAR_CODE('lock') -kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt') -kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali') -kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup') -kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') -kControlEditTextCFStringTag = FOUR_CHAR_CODE('cfst') -kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf') -kControlStaticTextProc = 288 -kControlKindStaticText = FOUR_CHAR_CODE('stxt') -kControlStaticTextStyleTag = kControlFontStyleTag -kControlStaticTextTextTag = FOUR_CHAR_CODE('text') -kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') -kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') -kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst') -kControlPictureProc = 304 -kControlPictureNoTrackProc = 305 -kControlKindPicture = FOUR_CHAR_CODE('pict') -kControlPictureHandleTag = FOUR_CHAR_CODE('pich') -kControlIconProc = 320 -kControlIconNoTrackProc = 321 -kControlIconSuiteProc = 322 -kControlIconSuiteNoTrackProc = 323 -kControlIconRefProc = 324 -kControlIconRefNoTrackProc = 325 -kControlKindIcon = FOUR_CHAR_CODE('icon') -kControlIconTransformTag = FOUR_CHAR_CODE('trfm') -kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') -kControlIconResourceIDTag = FOUR_CHAR_CODE('ires') -kControlIconContentTag = FOUR_CHAR_CODE('cont') -kControlWindowHeaderProc = 336 -kControlWindowListViewHeaderProc = 337 -kControlKindWindowHeader = FOUR_CHAR_CODE('whed') -kControlListBoxProc = 352 -kControlListBoxAutoSizeProc = 353 -kControlKindListBox = FOUR_CHAR_CODE('lbox') -kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan') -kControlListBoxKeyFilterTag = kControlKeyFilterTag -kControlListBoxFontStyleTag = kControlFontStyleTag -kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc') -kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') -kControlPushButtonProc = 368 -kControlCheckBoxProc = 369 -kControlRadioButtonProc = 370 -kControlPushButLeftIconProc = 374 -kControlPushButRightIconProc = 375 -kControlCheckBoxAutoToggleProc = 371 -kControlRadioButtonAutoToggleProc = 372 -kControlPushButtonIconOnLeft = 6 -kControlPushButtonIconOnRight = 7 -kControlKindPushButton = FOUR_CHAR_CODE('push') -kControlKindPushIconButton = FOUR_CHAR_CODE('picn') -kControlKindRadioButton = FOUR_CHAR_CODE('rdio') -kControlKindCheckBox = FOUR_CHAR_CODE('cbox') -kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt') -kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') -kControlScrollBarProc = 384 -kControlScrollBarLiveProc = 386 -kControlKindScrollBar = FOUR_CHAR_CODE('sbar') -kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro') -kControlPopupButtonProc = 400 -kControlPopupFixedWidthVariant = 1 << 0 -kControlPopupVariableWidthVariant = 1 << 1 -kControlPopupUseAddResMenuVariant = 1 << 2 -kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant -kControlKindPopupButton = FOUR_CHAR_CODE('popb') -kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan') -kControlPopupButtonMenuRefTag = FOUR_CHAR_CODE('mhan') -kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') -kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht') -kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') -kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck') -kControlRadioGroupProc = 416 -kControlKindRadioGroup = FOUR_CHAR_CODE('rgrp') -kControlScrollTextBoxProc = 432 -kControlScrollTextBoxAutoScrollProc = 433 -kControlKindScrollingTextBox = FOUR_CHAR_CODE('stbx') -kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl') -kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl') -kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt') -kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres') -kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim') -kControlKindDisclosureButton = FOUR_CHAR_CODE('disb') -kControlDisclosureButtonClosed = 0 -kControlDisclosureButtonDisclosed = 1 -kControlRoundButtonNormalSize = kControlSizeNormal -kControlRoundButtonLargeSize = kControlSizeLarge -kControlRoundButtonContentTag = FOUR_CHAR_CODE('cont') -kControlRoundButtonSizeTag = kControlSizeTag -kControlKindRoundButton = FOUR_CHAR_CODE('rndb') -kControlKindDataBrowser = FOUR_CHAR_CODE('datb') -errDataBrowserNotConfigured = -4970 -errDataBrowserItemNotFound = -4971 -errDataBrowserItemNotAdded = -4975 -errDataBrowserPropertyNotFound = -4972 -errDataBrowserInvalidPropertyPart = -4973 -errDataBrowserInvalidPropertyData = -4974 -errDataBrowserPropertyNotSupported = -4979 -kControlDataBrowserIncludesFrameAndFocusTag = FOUR_CHAR_CODE('brdr') -kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag -kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag -kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag -kDataBrowserNoView = 0x3F3F3F3F -kDataBrowserListView = FOUR_CHAR_CODE('lstv') -kDataBrowserColumnView = FOUR_CHAR_CODE('clmv') -kDataBrowserDragSelect = 1 << 0 -kDataBrowserSelectOnlyOne = 1 << 1 -kDataBrowserResetSelection = 1 << 2 -kDataBrowserCmdTogglesSelection = 1 << 3 -kDataBrowserNoDisjointSelection = 1 << 4 -kDataBrowserAlwaysExtendSelection = 1 << 5 -kDataBrowserNeverEmptySelectionSet = 1 << 6 -kDataBrowserOrderUndefined = 0 -kDataBrowserOrderIncreasing = 1 -kDataBrowserOrderDecreasing = 2 -kDataBrowserNoItem = 0L -kDataBrowserItemNoState = 0 -# kDataBrowserItemAnyState = (unsigned long)(-1) -kDataBrowserItemIsSelected = 1 << 0 -kDataBrowserContainerIsOpen = 1 << 1 -kDataBrowserItemIsDragTarget = 1 << 2 -kDataBrowserRevealOnly = 0 -kDataBrowserRevealAndCenterInView = 1 << 0 -kDataBrowserRevealWithoutSelecting = 1 << 1 -kDataBrowserItemsAdd = 0 -kDataBrowserItemsAssign = 1 -kDataBrowserItemsToggle = 2 -kDataBrowserItemsRemove = 3 -kDataBrowserSelectionAnchorUp = 0 -kDataBrowserSelectionAnchorDown = 1 -kDataBrowserSelectionAnchorLeft = 2 -kDataBrowserSelectionAnchorRight = 3 -kDataBrowserEditMsgUndo = kHICommandUndo -kDataBrowserEditMsgRedo = kHICommandRedo -kDataBrowserEditMsgCut = kHICommandCut -kDataBrowserEditMsgCopy = kHICommandCopy -kDataBrowserEditMsgPaste = kHICommandPaste -kDataBrowserEditMsgClear = kHICommandClear -kDataBrowserEditMsgSelectAll = kHICommandSelectAll -kDataBrowserItemAdded = 1 -kDataBrowserItemRemoved = 2 -kDataBrowserEditStarted = 3 -kDataBrowserEditStopped = 4 -kDataBrowserItemSelected = 5 -kDataBrowserItemDeselected = 6 -kDataBrowserItemDoubleClicked = 7 -kDataBrowserContainerOpened = 8 -kDataBrowserContainerClosing = 9 -kDataBrowserContainerClosed = 10 -kDataBrowserContainerSorting = 11 -kDataBrowserContainerSorted = 12 -kDataBrowserUserToggledContainer = 16 -kDataBrowserTargetChanged = 15 -kDataBrowserUserStateChanged = 13 -kDataBrowserSelectionSetChanged = 14 -kDataBrowserItemNoProperty = 0L -kDataBrowserItemIsActiveProperty = 1L -kDataBrowserItemIsSelectableProperty = 2L -kDataBrowserItemIsEditableProperty = 3L -kDataBrowserItemIsContainerProperty = 4L -kDataBrowserContainerIsOpenableProperty = 5L -kDataBrowserContainerIsClosableProperty = 6L -kDataBrowserContainerIsSortableProperty = 7L -kDataBrowserItemSelfIdentityProperty = 8L -kDataBrowserContainerAliasIDProperty = 9L -kDataBrowserColumnViewPreviewProperty = 10L -kDataBrowserItemParentContainerProperty = 11L -kDataBrowserCustomType = 0x3F3F3F3F -kDataBrowserIconType = FOUR_CHAR_CODE('icnr') -kDataBrowserTextType = FOUR_CHAR_CODE('text') -kDataBrowserDateTimeType = FOUR_CHAR_CODE('date') -kDataBrowserSliderType = FOUR_CHAR_CODE('sldr') -kDataBrowserCheckboxType = FOUR_CHAR_CODE('chbx') -kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog') -kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank') -kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu') -kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') -kDataBrowserPropertyEnclosingPart = 0L -kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----') -kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc') -kDataBrowserPropertyTextPart = kDataBrowserTextType -kDataBrowserPropertyIconPart = kDataBrowserIconType -kDataBrowserPropertySliderPart = kDataBrowserSliderType -kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType -kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType -kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType -kDataBrowserUniversalPropertyFlagsMask = 0xFF -kDataBrowserPropertyIsMutable = 1 << 0 -kDataBrowserDefaultPropertyFlags = 0 << 0 -kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask -kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable -kDataBrowserPropertyFlagsOffset = 8 -kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset -kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset -kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset) -kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1) -kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2) -kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3) -kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset -kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset -kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset -kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset -kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset -kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset -kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset -kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask -kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative -kDataBrowserViewSpecificFlagsOffset = 16 -kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset -kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask -kDataBrowserClientPropertyFlagsOffset = 24 -# kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset) -kDataBrowserLatestCallbacks = 0 -kDataBrowserContentHit = 1 -kDataBrowserNothingHit = 0 -kDataBrowserStopTracking = -1 -kDataBrowserLatestCustomCallbacks = 0 -kDataBrowserTableViewMinimalHilite = 0 -kDataBrowserTableViewFillHilite = 1 -kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset -kDataBrowserTableViewLastColumn = -1 -kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1) -kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2) -kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn -kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn -kDataBrowserListViewLatestHeaderDesc = 0 -kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn -kControlEditUnicodeTextPostUpdateProcTag = FOUR_CHAR_CODE('upup') -kControlEditUnicodeTextProc = 912 -kControlEditUnicodeTextPasswordProc = 914 -kControlKindEditUnicodeText = FOUR_CHAR_CODE('eutx') -kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue -kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue -kControlCheckboxMixedValue = kControlCheckBoxMixedValue -inLabel = kControlLabelPart -inMenu = kControlMenuPart -inTriangle = kControlTrianglePart -inButton = kControlButtonPart -inCheckBox = kControlCheckBoxPart -inUpButton = kControlUpButtonPart -inDownButton = kControlDownButtonPart -inPageUp = kControlPageUpPart -inPageDown = kControlPageDownPart -kInLabelControlPart = kControlLabelPart -kInMenuControlPart = kControlMenuPart -kInTriangleControlPart = kControlTrianglePart -kInButtonControlPart = kControlButtonPart -kInCheckBoxControlPart = kControlCheckBoxPart -kInUpButtonControlPart = kControlUpButtonPart -kInDownButtonControlPart = kControlDownButtonPart -kInPageUpControlPart = kControlPageUpPart -kInPageDownControlPart = kControlPageDownPart diff --git a/sys/lib/python/plat-mac/Carbon/CoreFoundation.py b/sys/lib/python/plat-mac/Carbon/CoreFoundation.py deleted file mode 100644 index 8d9c89464..000000000 --- a/sys/lib/python/plat-mac/Carbon/CoreFoundation.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated from 'CFBase.h' - -def FOUR_CHAR_CODE(x): return x -kCFCompareLessThan = -1 -kCFCompareEqualTo = 0 -kCFCompareGreaterThan = 1 -kCFNotFound = -1 -kCFPropertyListImmutable = 0 -kCFPropertyListMutableContainers = 1 -kCFPropertyListMutableContainersAndLeaves = 2 -# kCFStringEncodingInvalidId = (long)0xFFFFFFFF -kCFStringEncodingMacRoman = 0 -kCFStringEncodingWindowsLatin1 = 0x0500 -kCFStringEncodingISOLatin1 = 0x0201 -kCFStringEncodingNextStepLatin = 0x0B01 -kCFStringEncodingASCII = 0x0600 -kCFStringEncodingUnicode = 0x0100 -kCFStringEncodingUTF8 = 0x08000100 -kCFStringEncodingNonLossyASCII = 0x0BFF -kCFCompareCaseInsensitive = 1 -kCFCompareBackwards = 4 -kCFCompareAnchored = 8 -kCFCompareNonliteral = 16 -kCFCompareLocalized = 32 -kCFCompareNumerically = 64 -kCFURLPOSIXPathStyle = 0 -kCFURLHFSPathStyle = 1 -kCFURLWindowsPathStyle = 2 diff --git a/sys/lib/python/plat-mac/Carbon/CoreGraphics.py b/sys/lib/python/plat-mac/Carbon/CoreGraphics.py deleted file mode 100755 index f4cb0b944..000000000 --- a/sys/lib/python/plat-mac/Carbon/CoreGraphics.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated from 'CGContext.h' - -def FOUR_CHAR_CODE(x): return x -kCGLineJoinMiter = 0 -kCGLineJoinRound = 1 -kCGLineJoinBevel = 2 -kCGLineCapButt = 0 -kCGLineCapRound = 1 -kCGLineCapSquare = 2 -kCGPathFill = 0 -kCGPathEOFill = 1 -kCGPathStroke = 2 -kCGPathFillStroke = 3 -kCGPathEOFillStroke = 4 -kCGTextFill = 0 -kCGTextStroke = 1 -kCGTextFillStroke = 2 -kCGTextInvisible = 3 -kCGTextFillClip = 4 -kCGTextStrokeClip = 5 -kCGTextFillStrokeClip = 6 -kCGTextClip = 7 -kCGEncodingFontSpecific = 0 -kCGEncodingMacRoman = 1 -kCGInterpolationDefault = 0 -kCGInterpolationNone = 1 -kCGInterpolationLow = 2 -kCGInterpolationHigh = 3 diff --git a/sys/lib/python/plat-mac/Carbon/Ctl.py b/sys/lib/python/plat-mac/Carbon/Ctl.py deleted file mode 100644 index b9dc3ef1c..000000000 --- a/sys/lib/python/plat-mac/Carbon/Ctl.py +++ /dev/null @@ -1 +0,0 @@ -from _Ctl import * diff --git a/sys/lib/python/plat-mac/Carbon/Dialogs.py b/sys/lib/python/plat-mac/Carbon/Dialogs.py deleted file mode 100644 index f846d7c39..000000000 --- a/sys/lib/python/plat-mac/Carbon/Dialogs.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated from 'Dialogs.h' - -def FOUR_CHAR_CODE(x): return x -kControlDialogItem = 4 -kButtonDialogItem = kControlDialogItem | 0 -kCheckBoxDialogItem = kControlDialogItem | 1 -kRadioButtonDialogItem = kControlDialogItem | 2 -kResourceControlDialogItem = kControlDialogItem | 3 -kStaticTextDialogItem = 8 -kEditTextDialogItem = 16 -kIconDialogItem = 32 -kPictureDialogItem = 64 -kUserDialogItem = 0 -kHelpDialogItem = 1 -kItemDisableBit = 128 -ctrlItem = 4 -btnCtrl = 0 -chkCtrl = 1 -radCtrl = 2 -resCtrl = 3 -statText = 8 -editText = 16 -iconItem = 32 -picItem = 64 -userItem = 0 -itemDisable = 128 -kStdOkItemIndex = 1 -kStdCancelItemIndex = 2 -ok = kStdOkItemIndex -cancel = kStdCancelItemIndex -kStopIcon = 0 -kNoteIcon = 1 -kCautionIcon = 2 -stopIcon = kStopIcon -noteIcon = kNoteIcon -cautionIcon = kCautionIcon -kOkItemIndex = 1 -kCancelItemIndex = 2 -overlayDITL = 0 -appendDITLRight = 1 -appendDITLBottom = 2 -kAlertStopAlert = 0 -kAlertNoteAlert = 1 -kAlertCautionAlert = 2 -kAlertPlainAlert = 3 -kAlertDefaultOKText = -1 -kAlertDefaultCancelText = -1 -kAlertDefaultOtherText = -1 -kAlertStdAlertOKButton = 1 -kAlertStdAlertCancelButton = 2 -kAlertStdAlertOtherButton = 3 -kAlertStdAlertHelpButton = 4 -kDialogFlagsUseThemeBackground = (1 << 0) -kDialogFlagsUseControlHierarchy = (1 << 1) -kDialogFlagsHandleMovableModal = (1 << 2) -kDialogFlagsUseThemeControls = (1 << 3) -kAlertFlagsUseThemeBackground = (1 << 0) -kAlertFlagsUseControlHierarchy = (1 << 1) -kAlertFlagsAlertIsMovable = (1 << 2) -kAlertFlagsUseThemeControls = (1 << 3) -kDialogFontNoFontStyle = 0 -kDialogFontUseFontMask = 0x0001 -kDialogFontUseFaceMask = 0x0002 -kDialogFontUseSizeMask = 0x0004 -kDialogFontUseForeColorMask = 0x0008 -kDialogFontUseBackColorMask = 0x0010 -kDialogFontUseModeMask = 0x0020 -kDialogFontUseJustMask = 0x0040 -kDialogFontUseAllMask = 0x00FF -kDialogFontAddFontSizeMask = 0x0100 -kDialogFontUseFontNameMask = 0x0200 -kDialogFontAddToMetaFontMask = 0x0400 -kDialogFontUseThemeFontIDMask = 0x0080 -kHICommandOther = FOUR_CHAR_CODE('othr') -kStdCFStringAlertVersionOne = 1 -kStdAlertDoNotDisposeSheet = 1 << 0 -kStdAlertDoNotAnimateOnDefault = 1 << 1 -kStdAlertDoNotAnimateOnCancel = 1 << 2 -kStdAlertDoNotAnimateOnOther = 1 << 3 diff --git a/sys/lib/python/plat-mac/Carbon/Dlg.py b/sys/lib/python/plat-mac/Carbon/Dlg.py deleted file mode 100644 index 7b22d8498..000000000 --- a/sys/lib/python/plat-mac/Carbon/Dlg.py +++ /dev/null @@ -1 +0,0 @@ -from _Dlg import * diff --git a/sys/lib/python/plat-mac/Carbon/Drag.py b/sys/lib/python/plat-mac/Carbon/Drag.py deleted file mode 100644 index a2349d714..000000000 --- a/sys/lib/python/plat-mac/Carbon/Drag.py +++ /dev/null @@ -1 +0,0 @@ -from _Drag import * diff --git a/sys/lib/python/plat-mac/Carbon/Dragconst.py b/sys/lib/python/plat-mac/Carbon/Dragconst.py deleted file mode 100644 index 38e12be7a..000000000 --- a/sys/lib/python/plat-mac/Carbon/Dragconst.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated from 'Drag.h' - -def FOUR_CHAR_CODE(x): return x -from Carbon.TextEdit import * -from Carbon.QuickDraw import * -fkDragActionAll = -1 - - -kDragHasLeftSenderWindow = (1 << 0) -kDragInsideSenderApplication = (1 << 1) -kDragInsideSenderWindow = (1 << 2) -kDragRegionAndImage = (1 << 4) -flavorSenderOnly = (1 << 0) -flavorSenderTranslated = (1 << 1) -flavorNotSaved = (1 << 2) -flavorSystemTranslated = (1 << 8) -kDragHasLeftSenderWindow = (1L << 0) -kDragInsideSenderApplication = (1L << 1) -kDragInsideSenderWindow = (1L << 2) -kDragBehaviorNone = 0 -kDragBehaviorZoomBackAnimation = (1L << 0) -kDragRegionAndImage = (1L << 4) -kDragStandardTranslucency = 0L -kDragDarkTranslucency = 1L -kDragDarkerTranslucency = 2L -kDragOpaqueTranslucency = 3L -kDragRegionBegin = 1 -kDragRegionDraw = 2 -kDragRegionHide = 3 -kDragRegionIdle = 4 -kDragRegionEnd = 5 -kZoomNoAcceleration = 0 -kZoomAccelerate = 1 -kZoomDecelerate = 2 -flavorSenderOnly = (1 << 0) -flavorSenderTranslated = (1 << 1) -flavorNotSaved = (1 << 2) -flavorSystemTranslated = (1 << 8) -flavorDataPromised = (1 << 9) -kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ') -kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs') -flavorTypeHFS = kDragFlavorTypeHFS -flavorTypePromiseHFS = kDragFlavorTypePromiseHFS -kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1') -kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') -kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS') -kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk') -kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') -flavorTypeDirectory = FOUR_CHAR_CODE('diry') -kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm') -kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn') -kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt') -kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') -kDragTrackingEnterHandler = 1 -kDragTrackingEnterWindow = 2 -kDragTrackingInWindow = 3 -kDragTrackingLeaveWindow = 4 -kDragTrackingLeaveHandler = 5 -kDragActionNothing = 0L -kDragActionCopy = 1L -kDragActionAlias = (1L << 1) -kDragActionGeneric = (1L << 2) -kDragActionPrivate = (1L << 3) -kDragActionMove = (1L << 4) -kDragActionDelete = (1L << 5) -# kDragActionAll = (long)0xFFFFFFFF -dragHasLeftSenderWindow = kDragHasLeftSenderWindow -dragInsideSenderApplication = kDragInsideSenderApplication -dragInsideSenderWindow = kDragInsideSenderWindow -dragTrackingEnterHandler = kDragTrackingEnterHandler -dragTrackingEnterWindow = kDragTrackingEnterWindow -dragTrackingInWindow = kDragTrackingInWindow -dragTrackingLeaveWindow = kDragTrackingLeaveWindow -dragTrackingLeaveHandler = kDragTrackingLeaveHandler -dragRegionBegin = kDragRegionBegin -dragRegionDraw = kDragRegionDraw -dragRegionHide = kDragRegionHide -dragRegionIdle = kDragRegionIdle -dragRegionEnd = kDragRegionEnd -zoomNoAcceleration = kZoomNoAcceleration -zoomAccelerate = kZoomAccelerate -zoomDecelerate = kZoomDecelerate -kDragStandardImage = kDragStandardTranslucency -kDragDarkImage = kDragDarkTranslucency -kDragDarkerImage = kDragDarkerTranslucency -kDragOpaqueImage = kDragOpaqueTranslucency diff --git a/sys/lib/python/plat-mac/Carbon/Events.py b/sys/lib/python/plat-mac/Carbon/Events.py deleted file mode 100644 index 269f4f144..000000000 --- a/sys/lib/python/plat-mac/Carbon/Events.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated from 'Events.h' - -nullEvent = 0 -mouseDown = 1 -mouseUp = 2 -keyDown = 3 -keyUp = 4 -autoKey = 5 -updateEvt = 6 -diskEvt = 7 -activateEvt = 8 -osEvt = 15 -kHighLevelEvent = 23 -mDownMask = 1 << mouseDown -mUpMask = 1 << mouseUp -keyDownMask = 1 << keyDown -keyUpMask = 1 << keyUp -autoKeyMask = 1 << autoKey -updateMask = 1 << updateEvt -diskMask = 1 << diskEvt -activMask = 1 << activateEvt -highLevelEventMask = 0x0400 -osMask = 1 << osEvt -everyEvent = 0xFFFF -charCodeMask = 0x000000FF -keyCodeMask = 0x0000FF00 -adbAddrMask = 0x00FF0000 -# osEvtMessageMask = (unsigned long)0xFF000000 -mouseMovedMessage = 0x00FA -suspendResumeMessage = 0x0001 -resumeFlag = 1 -convertClipboardFlag = 2 -activeFlagBit = 0 -btnStateBit = 7 -cmdKeyBit = 8 -shiftKeyBit = 9 -alphaLockBit = 10 -optionKeyBit = 11 -controlKeyBit = 12 -rightShiftKeyBit = 13 -rightOptionKeyBit = 14 -rightControlKeyBit = 15 -activeFlag = 1 << activeFlagBit -btnState = 1 << btnStateBit -cmdKey = 1 << cmdKeyBit -shiftKey = 1 << shiftKeyBit -alphaLock = 1 << alphaLockBit -optionKey = 1 << optionKeyBit -controlKey = 1 << controlKeyBit -rightShiftKey = 1 << rightShiftKeyBit -rightOptionKey = 1 << rightOptionKeyBit -rightControlKey = 1 << rightControlKeyBit -kNullCharCode = 0 -kHomeCharCode = 1 -kEnterCharCode = 3 -kEndCharCode = 4 -kHelpCharCode = 5 -kBellCharCode = 7 -kBackspaceCharCode = 8 -kTabCharCode = 9 -kLineFeedCharCode = 10 -kVerticalTabCharCode = 11 -kPageUpCharCode = 11 -kFormFeedCharCode = 12 -kPageDownCharCode = 12 -kReturnCharCode = 13 -kFunctionKeyCharCode = 16 -kCommandCharCode = 17 -kCheckCharCode = 18 -kDiamondCharCode = 19 -kAppleLogoCharCode = 20 -kEscapeCharCode = 27 -kClearCharCode = 27 -kLeftArrowCharCode = 28 -kRightArrowCharCode = 29 -kUpArrowCharCode = 30 -kDownArrowCharCode = 31 -kSpaceCharCode = 32 -kDeleteCharCode = 127 -kBulletCharCode = 165 -kNonBreakingSpaceCharCode = 202 -kShiftUnicode = 0x21E7 -kControlUnicode = 0x2303 -kOptionUnicode = 0x2325 -kCommandUnicode = 0x2318 -kPencilUnicode = 0x270E -kCheckUnicode = 0x2713 -kDiamondUnicode = 0x25C6 -kBulletUnicode = 0x2022 -kAppleLogoUnicode = 0xF8FF -networkEvt = 10 -driverEvt = 11 -app1Evt = 12 -app2Evt = 13 -app3Evt = 14 -app4Evt = 15 -networkMask = 0x0400 -driverMask = 0x0800 -app1Mask = 0x1000 -app2Mask = 0x2000 -app3Mask = 0x4000 -app4Mask = 0x8000 diff --git a/sys/lib/python/plat-mac/Carbon/Evt.py b/sys/lib/python/plat-mac/Carbon/Evt.py deleted file mode 100644 index 7a5ffa699..000000000 --- a/sys/lib/python/plat-mac/Carbon/Evt.py +++ /dev/null @@ -1 +0,0 @@ -from _Evt import * diff --git a/sys/lib/python/plat-mac/Carbon/File.py b/sys/lib/python/plat-mac/Carbon/File.py deleted file mode 100644 index 58c28574c..000000000 --- a/sys/lib/python/plat-mac/Carbon/File.py +++ /dev/null @@ -1 +0,0 @@ -from _File import * diff --git a/sys/lib/python/plat-mac/Carbon/Files.py b/sys/lib/python/plat-mac/Carbon/Files.py deleted file mode 100644 index 678bbc794..000000000 --- a/sys/lib/python/plat-mac/Carbon/Files.py +++ /dev/null @@ -1,426 +0,0 @@ -# Generated from 'Files.h' - -def FOUR_CHAR_CODE(x): return x -true = True -false = False -fsCurPerm = 0x00 -fsRdPerm = 0x01 -fsWrPerm = 0x02 -fsRdWrPerm = 0x03 -fsRdWrShPerm = 0x04 -fsRdDenyPerm = 0x10 -fsWrDenyPerm = 0x20 -fsRtParID = 1 -fsRtDirID = 2 -fsAtMark = 0 -fsFromStart = 1 -fsFromLEOF = 2 -fsFromMark = 3 -pleaseCacheBit = 4 -pleaseCacheMask = 0x0010 -noCacheBit = 5 -noCacheMask = 0x0020 -rdVerifyBit = 6 -rdVerifyMask = 0x0040 -rdVerify = 64 -forceReadBit = 6 -forceReadMask = 0x0040 -newLineBit = 7 -newLineMask = 0x0080 -newLineCharMask = 0xFF00 -fsSBPartialName = 1 -fsSBFullName = 2 -fsSBFlAttrib = 4 -fsSBFlFndrInfo = 8 -fsSBFlLgLen = 32 -fsSBFlPyLen = 64 -fsSBFlRLgLen = 128 -fsSBFlRPyLen = 256 -fsSBFlCrDat = 512 -fsSBFlMdDat = 1024 -fsSBFlBkDat = 2048 -fsSBFlXFndrInfo = 4096 -fsSBFlParID = 8192 -fsSBNegate = 16384 -fsSBDrUsrWds = 8 -fsSBDrNmFls = 16 -fsSBDrCrDat = 512 -fsSBDrMdDat = 1024 -fsSBDrBkDat = 2048 -fsSBDrFndrInfo = 4096 -fsSBDrParID = 8192 -fsSBPartialNameBit = 0 -fsSBFullNameBit = 1 -fsSBFlAttribBit = 2 -fsSBFlFndrInfoBit = 3 -fsSBFlLgLenBit = 5 -fsSBFlPyLenBit = 6 -fsSBFlRLgLenBit = 7 -fsSBFlRPyLenBit = 8 -fsSBFlCrDatBit = 9 -fsSBFlMdDatBit = 10 -fsSBFlBkDatBit = 11 -fsSBFlXFndrInfoBit = 12 -fsSBFlParIDBit = 13 -fsSBNegateBit = 14 -fsSBDrUsrWdsBit = 3 -fsSBDrNmFlsBit = 4 -fsSBDrCrDatBit = 9 -fsSBDrMdDatBit = 10 -fsSBDrBkDatBit = 11 -fsSBDrFndrInfoBit = 12 -fsSBDrParIDBit = 13 -bLimitFCBs = 31 -bLocalWList = 30 -bNoMiniFndr = 29 -bNoVNEdit = 28 -bNoLclSync = 27 -bTrshOffLine = 26 -bNoSwitchTo = 25 -bDontShareIt = 21 -bNoDeskItems = 20 -bNoBootBlks = 19 -bAccessCntl = 18 -bNoSysDir = 17 -bHasExtFSVol = 16 -bHasOpenDeny = 15 -bHasCopyFile = 14 -bHasMoveRename = 13 -bHasDesktopMgr = 12 -bHasShortName = 11 -bHasFolderLock = 10 -bHasPersonalAccessPrivileges = 9 -bHasUserGroupList = 8 -bHasCatSearch = 7 -bHasFileIDs = 6 -bHasBTreeMgr = 5 -bHasBlankAccessPrivileges = 4 -bSupportsAsyncRequests = 3 -bSupportsTrashVolumeCache = 2 -bIsEjectable = 0 -bSupportsHFSPlusAPIs = 1 -bSupportsFSCatalogSearch = 2 -bSupportsFSExchangeObjects = 3 -bSupports2TBFiles = 4 -bSupportsLongNames = 5 -bSupportsMultiScriptNames = 6 -bSupportsNamedForks = 7 -bSupportsSubtreeIterators = 8 -bL2PCanMapFileBlocks = 9 -bParentModDateChanges = 10 -bAncestorModDateChanges = 11 -bSupportsSymbolicLinks = 13 -bIsAutoMounted = 14 -bAllowCDiDataHandler = 17 -kLargeIcon = 1 -kLarge4BitIcon = 2 -kLarge8BitIcon = 3 -kSmallIcon = 4 -kSmall4BitIcon = 5 -kSmall8BitIcon = 6 -kicnsIconFamily = 239 -kLargeIconSize = 256 -kLarge4BitIconSize = 512 -kLarge8BitIconSize = 1024 -kSmallIconSize = 64 -kSmall4BitIconSize = 128 -kSmall8BitIconSize = 256 -kWidePosOffsetBit = 8 -kUseWidePositioning = (1 << kWidePosOffsetBit) -kMaximumBlocksIn4GB = 0x007FFFFF -fsUnixPriv = 1 -kNoUserAuthentication = 1 -kPassword = 2 -kEncryptPassword = 3 -kTwoWayEncryptPassword = 6 -kOwnerID2Name = 1 -kGroupID2Name = 2 -kOwnerName2ID = 3 -kGroupName2ID = 4 -kReturnNextUser = 1 -kReturnNextGroup = 2 -kReturnNextUG = 3 -kVCBFlagsIdleFlushBit = 3 -kVCBFlagsIdleFlushMask = 0x0008 -kVCBFlagsHFSPlusAPIsBit = 4 -kVCBFlagsHFSPlusAPIsMask = 0x0010 -kVCBFlagsHardwareGoneBit = 5 -kVCBFlagsHardwareGoneMask = 0x0020 -kVCBFlagsVolumeDirtyBit = 15 -kVCBFlagsVolumeDirtyMask = 0x8000 -kioVAtrbDefaultVolumeBit = 5 -kioVAtrbDefaultVolumeMask = 0x0020 -kioVAtrbFilesOpenBit = 6 -kioVAtrbFilesOpenMask = 0x0040 -kioVAtrbHardwareLockedBit = 7 -kioVAtrbHardwareLockedMask = 0x0080 -kioVAtrbSoftwareLockedBit = 15 -kioVAtrbSoftwareLockedMask = 0x8000 -kioFlAttribLockedBit = 0 -kioFlAttribLockedMask = 0x01 -kioFlAttribResOpenBit = 2 -kioFlAttribResOpenMask = 0x04 -kioFlAttribDataOpenBit = 3 -kioFlAttribDataOpenMask = 0x08 -kioFlAttribDirBit = 4 -kioFlAttribDirMask = 0x10 -ioDirFlg = 4 -ioDirMask = 0x10 -kioFlAttribCopyProtBit = 6 -kioFlAttribCopyProtMask = 0x40 -kioFlAttribFileOpenBit = 7 -kioFlAttribFileOpenMask = 0x80 -kioFlAttribInSharedBit = 2 -kioFlAttribInSharedMask = 0x04 -kioFlAttribMountedBit = 3 -kioFlAttribMountedMask = 0x08 -kioFlAttribSharePointBit = 5 -kioFlAttribSharePointMask = 0x20 -kioFCBWriteBit = 8 -kioFCBWriteMask = 0x0100 -kioFCBResourceBit = 9 -kioFCBResourceMask = 0x0200 -kioFCBWriteLockedBit = 10 -kioFCBWriteLockedMask = 0x0400 -kioFCBLargeFileBit = 11 -kioFCBLargeFileMask = 0x0800 -kioFCBSharedWriteBit = 12 -kioFCBSharedWriteMask = 0x1000 -kioFCBFileLockedBit = 13 -kioFCBFileLockedMask = 0x2000 -kioFCBOwnClumpBit = 14 -kioFCBOwnClumpMask = 0x4000 -kioFCBModifiedBit = 15 -kioFCBModifiedMask = 0x8000 -kioACUserNoSeeFolderBit = 0 -kioACUserNoSeeFolderMask = 0x01 -kioACUserNoSeeFilesBit = 1 -kioACUserNoSeeFilesMask = 0x02 -kioACUserNoMakeChangesBit = 2 -kioACUserNoMakeChangesMask = 0x04 -kioACUserNotOwnerBit = 7 -kioACUserNotOwnerMask = 0x80 -kioACAccessOwnerBit = 31 -# kioACAccessOwnerMask = (long)0x80000000 -kioACAccessBlankAccessBit = 28 -kioACAccessBlankAccessMask = 0x10000000 -kioACAccessUserWriteBit = 26 -kioACAccessUserWriteMask = 0x04000000 -kioACAccessUserReadBit = 25 -kioACAccessUserReadMask = 0x02000000 -kioACAccessUserSearchBit = 24 -kioACAccessUserSearchMask = 0x01000000 -kioACAccessEveryoneWriteBit = 18 -kioACAccessEveryoneWriteMask = 0x00040000 -kioACAccessEveryoneReadBit = 17 -kioACAccessEveryoneReadMask = 0x00020000 -kioACAccessEveryoneSearchBit = 16 -kioACAccessEveryoneSearchMask = 0x00010000 -kioACAccessGroupWriteBit = 10 -kioACAccessGroupWriteMask = 0x00000400 -kioACAccessGroupReadBit = 9 -kioACAccessGroupReadMask = 0x00000200 -kioACAccessGroupSearchBit = 8 -kioACAccessGroupSearchMask = 0x00000100 -kioACAccessOwnerWriteBit = 2 -kioACAccessOwnerWriteMask = 0x00000004 -kioACAccessOwnerReadBit = 1 -kioACAccessOwnerReadMask = 0x00000002 -kioACAccessOwnerSearchBit = 0 -kioACAccessOwnerSearchMask = 0x00000001 -kfullPrivileges = 0x00070007 -kownerPrivileges = 0x00000007 -knoUser = 0 -kadministratorUser = 1 -knoGroup = 0 -AppleShareMediaType = FOUR_CHAR_CODE('afpm') -volMountNoLoginMsgFlagBit = 0 -volMountNoLoginMsgFlagMask = 0x0001 -volMountExtendedFlagsBit = 7 -volMountExtendedFlagsMask = 0x0080 -volMountInteractBit = 15 -volMountInteractMask = 0x8000 -volMountChangedBit = 14 -volMountChangedMask = 0x4000 -volMountFSReservedMask = 0x00FF -volMountSysReservedMask = 0xFF00 -kAFPExtendedFlagsAlternateAddressMask = 1 -kAFPTagTypeIP = 0x01 -kAFPTagTypeIPPort = 0x02 -kAFPTagTypeDDP = 0x03 -kAFPTagTypeDNS = 0x04 -kAFPTagLengthIP = 0x06 -kAFPTagLengthIPPort = 0x08 -kAFPTagLengthDDP = 0x06 -kFSInvalidVolumeRefNum = 0 -kFSCatInfoNone = 0x00000000 -kFSCatInfoTextEncoding = 0x00000001 -kFSCatInfoNodeFlags = 0x00000002 -kFSCatInfoVolume = 0x00000004 -kFSCatInfoParentDirID = 0x00000008 -kFSCatInfoNodeID = 0x00000010 -kFSCatInfoCreateDate = 0x00000020 -kFSCatInfoContentMod = 0x00000040 -kFSCatInfoAttrMod = 0x00000080 -kFSCatInfoAccessDate = 0x00000100 -kFSCatInfoBackupDate = 0x00000200 -kFSCatInfoPermissions = 0x00000400 -kFSCatInfoFinderInfo = 0x00000800 -kFSCatInfoFinderXInfo = 0x00001000 -kFSCatInfoValence = 0x00002000 -kFSCatInfoDataSizes = 0x00004000 -kFSCatInfoRsrcSizes = 0x00008000 -kFSCatInfoSharingFlags = 0x00010000 -kFSCatInfoUserPrivs = 0x00020000 -kFSCatInfoUserAccess = 0x00080000 -kFSCatInfoAllDates = 0x000003E0 -kFSCatInfoGettableInfo = 0x0003FFFF -kFSCatInfoSettableInfo = 0x00001FE3 -# kFSCatInfoReserved = (long)0xFFFC0000 -kFSNodeLockedBit = 0 -kFSNodeLockedMask = 0x0001 -kFSNodeResOpenBit = 2 -kFSNodeResOpenMask = 0x0004 -kFSNodeDataOpenBit = 3 -kFSNodeDataOpenMask = 0x0008 -kFSNodeIsDirectoryBit = 4 -kFSNodeIsDirectoryMask = 0x0010 -kFSNodeCopyProtectBit = 6 -kFSNodeCopyProtectMask = 0x0040 -kFSNodeForkOpenBit = 7 -kFSNodeForkOpenMask = 0x0080 -kFSNodeInSharedBit = 2 -kFSNodeInSharedMask = 0x0004 -kFSNodeIsMountedBit = 3 -kFSNodeIsMountedMask = 0x0008 -kFSNodeIsSharePointBit = 5 -kFSNodeIsSharePointMask = 0x0020 -kFSIterateFlat = 0 -kFSIterateSubtree = 1 -kFSIterateDelete = 2 -# kFSIterateReserved = (long)0xFFFFFFFC -fsSBNodeID = 0x00008000 -fsSBAttributeModDate = 0x00010000 -fsSBAccessDate = 0x00020000 -fsSBPermissions = 0x00040000 -fsSBNodeIDBit = 15 -fsSBAttributeModDateBit = 16 -fsSBAccessDateBit = 17 -fsSBPermissionsBit = 18 -kFSAllocDefaultFlags = 0x0000 -kFSAllocAllOrNothingMask = 0x0001 -kFSAllocContiguousMask = 0x0002 -kFSAllocNoRoundUpMask = 0x0004 -kFSAllocReservedMask = 0xFFF8 -kFSVolInfoNone = 0x0000 -kFSVolInfoCreateDate = 0x0001 -kFSVolInfoModDate = 0x0002 -kFSVolInfoBackupDate = 0x0004 -kFSVolInfoCheckedDate = 0x0008 -kFSVolInfoFileCount = 0x0010 -kFSVolInfoDirCount = 0x0020 -kFSVolInfoSizes = 0x0040 -kFSVolInfoBlocks = 0x0080 -kFSVolInfoNextAlloc = 0x0100 -kFSVolInfoRsrcClump = 0x0200 -kFSVolInfoDataClump = 0x0400 -kFSVolInfoNextID = 0x0800 -kFSVolInfoFinderInfo = 0x1000 -kFSVolInfoFlags = 0x2000 -kFSVolInfoFSInfo = 0x4000 -kFSVolInfoDriveInfo = 0x8000 -kFSVolInfoGettableInfo = 0xFFFF -kFSVolInfoSettableInfo = 0x3004 -kFSVolFlagDefaultVolumeBit = 5 -kFSVolFlagDefaultVolumeMask = 0x0020 -kFSVolFlagFilesOpenBit = 6 -kFSVolFlagFilesOpenMask = 0x0040 -kFSVolFlagHardwareLockedBit = 7 -kFSVolFlagHardwareLockedMask = 0x0080 -kFSVolFlagSoftwareLockedBit = 15 -kFSVolFlagSoftwareLockedMask = 0x8000 -kFNDirectoryModifiedMessage = 1 -kFNNoImplicitAllSubscription = (1 << 0) -rAliasType = FOUR_CHAR_CODE('alis') -kARMMountVol = 0x00000001 -kARMNoUI = 0x00000002 -kARMMultVols = 0x00000008 -kARMSearch = 0x00000100 -kARMSearchMore = 0x00000200 -kARMSearchRelFirst = 0x00000400 -asiZoneName = -3 -asiServerName = -2 -asiVolumeName = -1 -asiAliasName = 0 -asiParentName = 1 -kResolveAliasFileNoUI = 0x00000001 -kClippingCreator = FOUR_CHAR_CODE('drag') -kClippingPictureType = FOUR_CHAR_CODE('clpp') -kClippingTextType = FOUR_CHAR_CODE('clpt') -kClippingSoundType = FOUR_CHAR_CODE('clps') -kClippingUnknownType = FOUR_CHAR_CODE('clpu') -kInternetLocationCreator = FOUR_CHAR_CODE('drag') -kInternetLocationHTTP = FOUR_CHAR_CODE('ilht') -kInternetLocationFTP = FOUR_CHAR_CODE('ilft') -kInternetLocationFile = FOUR_CHAR_CODE('ilfi') -kInternetLocationMail = FOUR_CHAR_CODE('ilma') -kInternetLocationNNTP = FOUR_CHAR_CODE('ilnw') -kInternetLocationAFP = FOUR_CHAR_CODE('ilaf') -kInternetLocationAppleTalk = FOUR_CHAR_CODE('ilat') -kInternetLocationNSL = FOUR_CHAR_CODE('ilns') -kInternetLocationGeneric = FOUR_CHAR_CODE('ilge') -kCustomIconResource = -16455 -kCustomBadgeResourceType = FOUR_CHAR_CODE('badg') -kCustomBadgeResourceID = kCustomIconResource -kCustomBadgeResourceVersion = 0 -# kSystemFolderType = 'macs'. -kRoutingResourceType = FOUR_CHAR_CODE('rout') -kRoutingResourceID = 0 -kContainerFolderAliasType = FOUR_CHAR_CODE('fdrp') -kContainerTrashAliasType = FOUR_CHAR_CODE('trsh') -kContainerHardDiskAliasType = FOUR_CHAR_CODE('hdsk') -kContainerFloppyAliasType = FOUR_CHAR_CODE('flpy') -kContainerServerAliasType = FOUR_CHAR_CODE('srvr') -kApplicationAliasType = FOUR_CHAR_CODE('adrp') -kContainerAliasType = FOUR_CHAR_CODE('drop') -kDesktopPrinterAliasType = FOUR_CHAR_CODE('dtpa') -kContainerCDROMAliasType = FOUR_CHAR_CODE('cddr') -kApplicationCPAliasType = FOUR_CHAR_CODE('acdp') -kApplicationDAAliasType = FOUR_CHAR_CODE('addp') -kPackageAliasType = FOUR_CHAR_CODE('fpka') -kAppPackageAliasType = FOUR_CHAR_CODE('fapa') -kSystemFolderAliasType = FOUR_CHAR_CODE('fasy') -kAppleMenuFolderAliasType = FOUR_CHAR_CODE('faam') -kStartupFolderAliasType = FOUR_CHAR_CODE('fast') -kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn') -kPreferencesFolderAliasType = FOUR_CHAR_CODE('fapf') -kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact') -kExtensionFolderAliasType = FOUR_CHAR_CODE('faex') -kExportedFolderAliasType = FOUR_CHAR_CODE('faet') -kDropFolderAliasType = FOUR_CHAR_CODE('fadr') -kSharedFolderAliasType = FOUR_CHAR_CODE('fash') -kMountedFolderAliasType = FOUR_CHAR_CODE('famn') -kIsOnDesk = 0x0001 -kColor = 0x000E -kIsShared = 0x0040 -kHasNoINITs = 0x0080 -kHasBeenInited = 0x0100 -kHasCustomIcon = 0x0400 -kIsStationery = 0x0800 -kNameLocked = 0x1000 -kHasBundle = 0x2000 -kIsInvisible = 0x4000 -kIsAlias = 0x8000 -fOnDesk = kIsOnDesk -fHasBundle = kHasBundle -fInvisible = kIsInvisible -fTrash = -3 -fDesktop = -2 -fDisk = 0 -kIsStationary = kIsStationery -kExtendedFlagsAreInvalid = 0x8000 -kExtendedFlagHasCustomBadge = 0x0100 -kExtendedFlagHasRoutingInfo = 0x0004 -kFirstMagicBusyFiletype = FOUR_CHAR_CODE('bzy ') -kLastMagicBusyFiletype = FOUR_CHAR_CODE('bzy?') -kMagicBusyCreationDate = 0x4F3AFDB0 diff --git a/sys/lib/python/plat-mac/Carbon/Fm.py b/sys/lib/python/plat-mac/Carbon/Fm.py deleted file mode 100644 index 0f42fdcd9..000000000 --- a/sys/lib/python/plat-mac/Carbon/Fm.py +++ /dev/null @@ -1 +0,0 @@ -from _Fm import * diff --git a/sys/lib/python/plat-mac/Carbon/Folder.py b/sys/lib/python/plat-mac/Carbon/Folder.py deleted file mode 100644 index a4e490289..000000000 --- a/sys/lib/python/plat-mac/Carbon/Folder.py +++ /dev/null @@ -1 +0,0 @@ -from _Folder import * diff --git a/sys/lib/python/plat-mac/Carbon/Folders.py b/sys/lib/python/plat-mac/Carbon/Folders.py deleted file mode 100644 index 52cf15808..000000000 --- a/sys/lib/python/plat-mac/Carbon/Folders.py +++ /dev/null @@ -1,190 +0,0 @@ -# Generated from 'Folders.h' - -def FOUR_CHAR_CODE(x): return x -true = True -false = False -kOnSystemDisk = -32768L -kOnAppropriateDisk = -32767 -kSystemDomain = -32766 -kLocalDomain = -32765 -kNetworkDomain = -32764 -kUserDomain = -32763 -kClassicDomain = -32762 -kCreateFolder = true -kDontCreateFolder = false -kSystemFolderType = FOUR_CHAR_CODE('macs') -kDesktopFolderType = FOUR_CHAR_CODE('desk') -kSystemDesktopFolderType = FOUR_CHAR_CODE('sdsk') -kTrashFolderType = FOUR_CHAR_CODE('trsh') -kSystemTrashFolderType = FOUR_CHAR_CODE('strs') -kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt') -kPrintMonitorDocsFolderType = FOUR_CHAR_CODE('prnt') -kStartupFolderType = FOUR_CHAR_CODE('strt') -kShutdownFolderType = FOUR_CHAR_CODE('shdf') -kAppleMenuFolderType = FOUR_CHAR_CODE('amnu') -kControlPanelFolderType = FOUR_CHAR_CODE('ctrl') -kSystemControlPanelFolderType = FOUR_CHAR_CODE('sctl') -kExtensionFolderType = FOUR_CHAR_CODE('extn') -kFontsFolderType = FOUR_CHAR_CODE('font') -kPreferencesFolderType = FOUR_CHAR_CODE('pref') -kSystemPreferencesFolderType = FOUR_CHAR_CODE('sprf') -kTemporaryFolderType = FOUR_CHAR_CODE('temp') -kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD') -kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD') -kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD') -kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD') -kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD') -kApplicationsFolderType = FOUR_CHAR_CODE('apps') -kDocumentsFolderType = FOUR_CHAR_CODE('docs') -kVolumeRootFolderType = FOUR_CHAR_CODE('root') -kChewableItemsFolderType = FOUR_CHAR_CODE('flnt') -kApplicationSupportFolderType = FOUR_CHAR_CODE('asup') -kTextEncodingsFolderType = FOUR_CHAR_CODE('\xc4tex') -kStationeryFolderType = FOUR_CHAR_CODE('odst') -kOpenDocFolderType = FOUR_CHAR_CODE('odod') -kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp') -kEditorsFolderType = FOUR_CHAR_CODE('oded') -kOpenDocEditorsFolderType = FOUR_CHAR_CODE('\xc4odf') -kOpenDocLibrariesFolderType = FOUR_CHAR_CODE('odlb') -kGenEditorsFolderType = FOUR_CHAR_CODE('\xc4edi') -kHelpFolderType = FOUR_CHAR_CODE('\xc4hlp') -kInternetPlugInFolderType = FOUR_CHAR_CODE('\xc4net') -kModemScriptsFolderType = FOUR_CHAR_CODE('\xc4mod') -kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf') -kPrinterDriverFolderType = FOUR_CHAR_CODE('\xc4prd') -kScriptingAdditionsFolderType = FOUR_CHAR_CODE('\xc4scr') -kSharedLibrariesFolderType = FOUR_CHAR_CODE('\xc4lib') -kVoicesFolderType = FOUR_CHAR_CODE('fvoc') -kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev') -kAssistantsFolderType = FOUR_CHAR_CODE('ast\xc4') -kUtilitiesFolderType = FOUR_CHAR_CODE('uti\xc4') -kAppleExtrasFolderType = FOUR_CHAR_CODE('aex\xc4') -kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu') -kMacOSReadMesFolderType = FOUR_CHAR_CODE('mor\xc4') -kALMModulesFolderType = FOUR_CHAR_CODE('walk') -kALMPreferencesFolderType = FOUR_CHAR_CODE('trip') -kALMLocationsFolderType = FOUR_CHAR_CODE('fall') -kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof') -kThemesFolderType = FOUR_CHAR_CODE('thme') -kFavoritesFolderType = FOUR_CHAR_CODE('favs') -kInternetFolderType = FOUR_CHAR_CODE('int\xc4') -kAppearanceFolderType = FOUR_CHAR_CODE('appr') -kSoundSetsFolderType = FOUR_CHAR_CODE('snds') -kDesktopPicturesFolderType = FOUR_CHAR_CODE('dtp\xc4') -kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf') -kFindSupportFolderType = FOUR_CHAR_CODE('fnds') -kFindByContentFolderType = FOUR_CHAR_CODE('fbcf') -kInstallerLogsFolderType = FOUR_CHAR_CODE('ilgf') -kScriptsFolderType = FOUR_CHAR_CODE('scr\xc4') -kFolderActionsFolderType = FOUR_CHAR_CODE('fasf') -kLauncherItemsFolderType = FOUR_CHAR_CODE('laun') -kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp') -kRecentDocumentsFolderType = FOUR_CHAR_CODE('rdoc') -kRecentServersFolderType = FOUR_CHAR_CODE('rsvr') -kSpeakableItemsFolderType = FOUR_CHAR_CODE('spki') -kKeychainFolderType = FOUR_CHAR_CODE('kchn') -kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex') -kDisplayExtensionsFolderType = FOUR_CHAR_CODE('dspl') -kMultiprocessingFolderType = FOUR_CHAR_CODE('mpxf') -kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg') -kDomainTopLevelFolderType = FOUR_CHAR_CODE('dtop') -kDomainLibraryFolderType = FOUR_CHAR_CODE('dlib') -kColorSyncFolderType = FOUR_CHAR_CODE('sync') -kColorSyncCMMFolderType = FOUR_CHAR_CODE('ccmm') -kColorSyncScriptingFolderType = FOUR_CHAR_CODE('cscr') -kPrintersFolderType = FOUR_CHAR_CODE('impr') -kSpeechFolderType = FOUR_CHAR_CODE('spch') -kCarbonLibraryFolderType = FOUR_CHAR_CODE('carb') -kDocumentationFolderType = FOUR_CHAR_CODE('info') -kDeveloperDocsFolderType = FOUR_CHAR_CODE('ddoc') -kDeveloperHelpFolderType = FOUR_CHAR_CODE('devh') -kISSDownloadsFolderType = FOUR_CHAR_CODE('issd') -kUserSpecificTmpFolderType = FOUR_CHAR_CODE('utmp') -kCachedDataFolderType = FOUR_CHAR_CODE('cach') -kFrameworksFolderType = FOUR_CHAR_CODE('fram') -kPrivateFrameworksFolderType = FOUR_CHAR_CODE('pfrm') -kClassicDesktopFolderType = FOUR_CHAR_CODE('sdsk') -kDeveloperFolderType = FOUR_CHAR_CODE('devf') -kSystemSoundsFolderType = FOUR_CHAR_CODE('ssnd') -kComponentsFolderType = FOUR_CHAR_CODE('cmpd') -kQuickTimeComponentsFolderType = FOUR_CHAR_CODE('wcmp') -kCoreServicesFolderType = FOUR_CHAR_CODE('csrv') -kPictureDocumentsFolderType = FOUR_CHAR_CODE('pdoc') -kMovieDocumentsFolderType = FOUR_CHAR_CODE('mdoc') -kMusicDocumentsFolderType = FOUR_CHAR_CODE('\xb5doc') -kInternetSitesFolderType = FOUR_CHAR_CODE('site') -kPublicFolderType = FOUR_CHAR_CODE('pubb') -kAudioSupportFolderType = FOUR_CHAR_CODE('adio') -kAudioSoundsFolderType = FOUR_CHAR_CODE('asnd') -kAudioSoundBanksFolderType = FOUR_CHAR_CODE('bank') -kAudioAlertSoundsFolderType = FOUR_CHAR_CODE('alrt') -kAudioPlugInsFolderType = FOUR_CHAR_CODE('aplg') -kAudioComponentsFolderType = FOUR_CHAR_CODE('acmp') -kKernelExtensionsFolderType = FOUR_CHAR_CODE('kext') -kDirectoryServicesFolderType = FOUR_CHAR_CODE('dsrv') -kDirectoryServicesPlugInsFolderType = FOUR_CHAR_CODE('dplg') -kInstallerReceiptsFolderType = FOUR_CHAR_CODE('rcpt') -kFileSystemSupportFolderType = FOUR_CHAR_CODE('fsys') -kAppleShareSupportFolderType = FOUR_CHAR_CODE('shar') -kAppleShareAuthenticationFolderType = FOUR_CHAR_CODE('auth') -kMIDIDriversFolderType = FOUR_CHAR_CODE('midi') -kLocalesFolderType = FOUR_CHAR_CODE('\xc4loc') -kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp') -kUsersFolderType = FOUR_CHAR_CODE('usrs') -kCurrentUserFolderType = FOUR_CHAR_CODE('cusr') -kCurrentUserRemoteFolderLocation = FOUR_CHAR_CODE('rusf') -kCurrentUserRemoteFolderType = FOUR_CHAR_CODE('rusr') -kSharedUserDataFolderType = FOUR_CHAR_CODE('sdat') -kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd') -kAppleshareAutomountServerAliasesFolderType = FOUR_CHAR_CODE('srv\xc4') -kPreMacOS91ApplicationsFolderType = FOUR_CHAR_CODE('\x8cpps') -kPreMacOS91InstallerLogsFolderType = FOUR_CHAR_CODE('\x94lgf') -kPreMacOS91AssistantsFolderType = FOUR_CHAR_CODE('\x8cst\xc4') -kPreMacOS91UtilitiesFolderType = FOUR_CHAR_CODE('\x9fti\xc4') -kPreMacOS91AppleExtrasFolderType = FOUR_CHAR_CODE('\x8cex\xc4') -kPreMacOS91MacOSReadMesFolderType = FOUR_CHAR_CODE('\xb5or\xc4') -kPreMacOS91InternetFolderType = FOUR_CHAR_CODE('\x94nt\xc4') -kPreMacOS91AutomountedServersFolderType = FOUR_CHAR_CODE('\xa7rv\xc4') -kPreMacOS91StationeryFolderType = FOUR_CHAR_CODE('\xbfdst') -kCreateFolderAtBoot = 0x00000002 -kCreateFolderAtBootBit = 1 -kFolderCreatedInvisible = 0x00000004 -kFolderCreatedInvisibleBit = 2 -kFolderCreatedNameLocked = 0x00000008 -kFolderCreatedNameLockedBit = 3 -kFolderCreatedAdminPrivs = 0x00000010 -kFolderCreatedAdminPrivsBit = 4 -kFolderInUserFolder = 0x00000020 -kFolderInUserFolderBit = 5 -kFolderTrackedByAlias = 0x00000040 -kFolderTrackedByAliasBit = 6 -kFolderInRemoteUserFolderIfAvailable = 0x00000080 -kFolderInRemoteUserFolderIfAvailableBit = 7 -kFolderNeverMatchedInIdentifyFolder = 0x00000100 -kFolderNeverMatchedInIdentifyFolderBit = 8 -kFolderMustStayOnSameVolume = 0x00000200 -kFolderMustStayOnSameVolumeBit = 9 -kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400 -kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10 -kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable -kRelativeFolder = FOUR_CHAR_CODE('relf') -kSpecialFolder = FOUR_CHAR_CODE('spcf') -kBlessedFolder = FOUR_CHAR_CODE('blsf') -kRootFolder = FOUR_CHAR_CODE('rotf') -kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf') -kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0 -kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1 -kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2 -kFolderManagerUserRedirectionGlobalsCurrentVersion = 1 -kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0 -kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1 -kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000 -kFolderManagerNotificationMessageUserLogIn = FOUR_CHAR_CODE('log+') -kFolderManagerNotificationMessagePreUserLogIn = FOUR_CHAR_CODE('logj') -kFolderManagerNotificationMessageUserLogOut = FOUR_CHAR_CODE('log-') -kFolderManagerNotificationMessagePostUserLogOut = FOUR_CHAR_CODE('logp') -kFolderManagerNotificationDiscardCachedData = FOUR_CHAR_CODE('dche') -kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup') -kDoNotRemoveWhenCurrentApplicationQuitsBit = 0 -kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit -kStopIfAnyNotificationProcReturnsErrorBit = 31 diff --git a/sys/lib/python/plat-mac/Carbon/Fonts.py b/sys/lib/python/plat-mac/Carbon/Fonts.py deleted file mode 100644 index 8be7e7a41..000000000 --- a/sys/lib/python/plat-mac/Carbon/Fonts.py +++ /dev/null @@ -1,59 +0,0 @@ -# Generated from 'Fonts.h' - -def FOUR_CHAR_CODE(x): return x -kNilOptions = 0 -systemFont = 0 -applFont = 1 -kFMDefaultOptions = kNilOptions -kFMDefaultActivationContext = kFMDefaultOptions -kFMGlobalActivationContext = 0x00000001 -kFMLocalActivationContext = kFMDefaultActivationContext -kFMDefaultIterationScope = kFMDefaultOptions -kFMGlobalIterationScope = 0x00000001 -kFMLocalIterationScope = kFMDefaultIterationScope -kPlatformDefaultGuiFontID = applFont -kPlatformDefaultGuiFontID = -1 -commandMark = 17 -checkMark = 18 -diamondMark = 19 -appleMark = 20 -propFont = 36864L -prpFntH = 36865L -prpFntW = 36866L -prpFntHW = 36867L -fixedFont = 45056L -fxdFntH = 45057L -fxdFntW = 45058L -fxdFntHW = 45059L -fontWid = 44208L -kFMUseGlobalScopeOption = 0x00000001 -kFontIDNewYork = 2 -kFontIDGeneva = 3 -kFontIDMonaco = 4 -kFontIDVenice = 5 -kFontIDLondon = 6 -kFontIDAthens = 7 -kFontIDSanFrancisco = 8 -kFontIDToronto = 9 -kFontIDCairo = 11 -kFontIDLosAngeles = 12 -kFontIDTimes = 20 -kFontIDHelvetica = 21 -kFontIDCourier = 22 -kFontIDSymbol = 23 -kFontIDMobile = 24 -newYork = kFontIDNewYork -geneva = kFontIDGeneva -monaco = kFontIDMonaco -venice = kFontIDVenice -london = kFontIDLondon -athens = kFontIDAthens -sanFran = kFontIDSanFrancisco -toronto = kFontIDToronto -cairo = kFontIDCairo -losAngeles = kFontIDLosAngeles -times = kFontIDTimes -helvetica = kFontIDHelvetica -courier = kFontIDCourier -symbol = kFontIDSymbol -mobile = kFontIDMobile diff --git a/sys/lib/python/plat-mac/Carbon/Help.py b/sys/lib/python/plat-mac/Carbon/Help.py deleted file mode 100644 index 5fca0d7fd..000000000 --- a/sys/lib/python/plat-mac/Carbon/Help.py +++ /dev/null @@ -1 +0,0 @@ -from _Help import * diff --git a/sys/lib/python/plat-mac/Carbon/IBCarbon.py b/sys/lib/python/plat-mac/Carbon/IBCarbon.py deleted file mode 100644 index 60f0e74ca..000000000 --- a/sys/lib/python/plat-mac/Carbon/IBCarbon.py +++ /dev/null @@ -1 +0,0 @@ -from _IBCarbon import * diff --git a/sys/lib/python/plat-mac/Carbon/IBCarbonRuntime.py b/sys/lib/python/plat-mac/Carbon/IBCarbonRuntime.py deleted file mode 100644 index 46780187d..000000000 --- a/sys/lib/python/plat-mac/Carbon/IBCarbonRuntime.py +++ /dev/null @@ -1,5 +0,0 @@ -# Generated from 'IBCarbonRuntime.h' - -kIBCarbonRuntimeCantFindNibFile = -10960 -kIBCarbonRuntimeObjectNotOfRequestedType = -10961 -kIBCarbonRuntimeCantFindObject = -10962 diff --git a/sys/lib/python/plat-mac/Carbon/Icn.py b/sys/lib/python/plat-mac/Carbon/Icn.py deleted file mode 100644 index b04134c8e..000000000 --- a/sys/lib/python/plat-mac/Carbon/Icn.py +++ /dev/null @@ -1 +0,0 @@ -from _Icn import * diff --git a/sys/lib/python/plat-mac/Carbon/Icons.py b/sys/lib/python/plat-mac/Carbon/Icons.py deleted file mode 100644 index 86dae632d..000000000 --- a/sys/lib/python/plat-mac/Carbon/Icons.py +++ /dev/null @@ -1,381 +0,0 @@ -# Generated from 'Icons.h' - -def FOUR_CHAR_CODE(x): return x -from Carbon.Files import * -kGenericDocumentIconResource = -4000 -kGenericStationeryIconResource = -3985 -kGenericEditionFileIconResource = -3989 -kGenericApplicationIconResource = -3996 -kGenericDeskAccessoryIconResource = -3991 -kGenericFolderIconResource = -3999 -kPrivateFolderIconResource = -3994 -kFloppyIconResource = -3998 -kTrashIconResource = -3993 -kGenericRAMDiskIconResource = -3988 -kGenericCDROMIconResource = -3987 -kDesktopIconResource = -3992 -kOpenFolderIconResource = -3997 -kGenericHardDiskIconResource = -3995 -kGenericFileServerIconResource = -3972 -kGenericSuitcaseIconResource = -3970 -kGenericMoverObjectIconResource = -3969 -kGenericPreferencesIconResource = -3971 -kGenericQueryDocumentIconResource = -16506 -kGenericExtensionIconResource = -16415 -kSystemFolderIconResource = -3983 -kHelpIconResource = -20271 -kAppleMenuFolderIconResource = -3982 -genericDocumentIconResource = kGenericDocumentIconResource -genericStationeryIconResource = kGenericStationeryIconResource -genericEditionFileIconResource = kGenericEditionFileIconResource -genericApplicationIconResource = kGenericApplicationIconResource -genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource -genericFolderIconResource = kGenericFolderIconResource -privateFolderIconResource = kPrivateFolderIconResource -floppyIconResource = kFloppyIconResource -trashIconResource = kTrashIconResource -genericRAMDiskIconResource = kGenericRAMDiskIconResource -genericCDROMIconResource = kGenericCDROMIconResource -desktopIconResource = kDesktopIconResource -openFolderIconResource = kOpenFolderIconResource -genericHardDiskIconResource = kGenericHardDiskIconResource -genericFileServerIconResource = kGenericFileServerIconResource -genericSuitcaseIconResource = kGenericSuitcaseIconResource -genericMoverObjectIconResource = kGenericMoverObjectIconResource -genericPreferencesIconResource = kGenericPreferencesIconResource -genericQueryDocumentIconResource = kGenericQueryDocumentIconResource -genericExtensionIconResource = kGenericExtensionIconResource -systemFolderIconResource = kSystemFolderIconResource -appleMenuFolderIconResource = kAppleMenuFolderIconResource -kStartupFolderIconResource = -3981 -kOwnedFolderIconResource = -3980 -kDropFolderIconResource = -3979 -kSharedFolderIconResource = -3978 -kMountedFolderIconResource = -3977 -kControlPanelFolderIconResource = -3976 -kPrintMonitorFolderIconResource = -3975 -kPreferencesFolderIconResource = -3974 -kExtensionsFolderIconResource = -3973 -kFontsFolderIconResource = -3968 -kFullTrashIconResource = -3984 -startupFolderIconResource = kStartupFolderIconResource -ownedFolderIconResource = kOwnedFolderIconResource -dropFolderIconResource = kDropFolderIconResource -sharedFolderIconResource = kSharedFolderIconResource -mountedFolderIconResource = kMountedFolderIconResource -controlPanelFolderIconResource = kControlPanelFolderIconResource -printMonitorFolderIconResource = kPrintMonitorFolderIconResource -preferencesFolderIconResource = kPreferencesFolderIconResource -extensionsFolderIconResource = kExtensionsFolderIconResource -fontsFolderIconResource = kFontsFolderIconResource -fullTrashIconResource = kFullTrashIconResource -kThumbnail32BitData = FOUR_CHAR_CODE('it32') -kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk') -kHuge1BitMask = FOUR_CHAR_CODE('ich#') -kHuge4BitData = FOUR_CHAR_CODE('ich4') -kHuge8BitData = FOUR_CHAR_CODE('ich8') -kHuge32BitData = FOUR_CHAR_CODE('ih32') -kHuge8BitMask = FOUR_CHAR_CODE('h8mk') -kLarge1BitMask = FOUR_CHAR_CODE('ICN#') -kLarge4BitData = FOUR_CHAR_CODE('icl4') -kLarge8BitData = FOUR_CHAR_CODE('icl8') -kLarge32BitData = FOUR_CHAR_CODE('il32') -kLarge8BitMask = FOUR_CHAR_CODE('l8mk') -kSmall1BitMask = FOUR_CHAR_CODE('ics#') -kSmall4BitData = FOUR_CHAR_CODE('ics4') -kSmall8BitData = FOUR_CHAR_CODE('ics8') -kSmall32BitData = FOUR_CHAR_CODE('is32') -kSmall8BitMask = FOUR_CHAR_CODE('s8mk') -kMini1BitMask = FOUR_CHAR_CODE('icm#') -kMini4BitData = FOUR_CHAR_CODE('icm4') -kMini8BitData = FOUR_CHAR_CODE('icm8') -kTileIconVariant = FOUR_CHAR_CODE('tile') -kRolloverIconVariant = FOUR_CHAR_CODE('over') -kDropIconVariant = FOUR_CHAR_CODE('drop') -kOpenIconVariant = FOUR_CHAR_CODE('open') -kOpenDropIconVariant = FOUR_CHAR_CODE('odrp') -large1BitMask = kLarge1BitMask -large4BitData = kLarge4BitData -large8BitData = kLarge8BitData -small1BitMask = kSmall1BitMask -small4BitData = kSmall4BitData -small8BitData = kSmall8BitData -mini1BitMask = kMini1BitMask -mini4BitData = kMini4BitData -mini8BitData = kMini8BitData -kAlignNone = 0x00 -kAlignVerticalCenter = 0x01 -kAlignTop = 0x02 -kAlignBottom = 0x03 -kAlignHorizontalCenter = 0x04 -kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter -kAlignCenterTop = kAlignTop | kAlignHorizontalCenter -kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter -kAlignLeft = 0x08 -kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft -kAlignTopLeft = kAlignTop | kAlignLeft -kAlignBottomLeft = kAlignBottom | kAlignLeft -kAlignRight = 0x0C -kAlignCenterRight = kAlignVerticalCenter | kAlignRight -kAlignTopRight = kAlignTop | kAlignRight -kAlignBottomRight = kAlignBottom | kAlignRight -atNone = kAlignNone -atVerticalCenter = kAlignVerticalCenter -atTop = kAlignTop -atBottom = kAlignBottom -atHorizontalCenter = kAlignHorizontalCenter -atAbsoluteCenter = kAlignAbsoluteCenter -atCenterTop = kAlignCenterTop -atCenterBottom = kAlignCenterBottom -atLeft = kAlignLeft -atCenterLeft = kAlignCenterLeft -atTopLeft = kAlignTopLeft -atBottomLeft = kAlignBottomLeft -atRight = kAlignRight -atCenterRight = kAlignCenterRight -atTopRight = kAlignTopRight -atBottomRight = kAlignBottomRight -kTransformNone = 0x00 -kTransformDisabled = 0x01 -kTransformOffline = 0x02 -kTransformOpen = 0x03 -kTransformLabel1 = 0x0100 -kTransformLabel2 = 0x0200 -kTransformLabel3 = 0x0300 -kTransformLabel4 = 0x0400 -kTransformLabel5 = 0x0500 -kTransformLabel6 = 0x0600 -kTransformLabel7 = 0x0700 -kTransformSelected = 0x4000 -kTransformSelectedDisabled = kTransformSelected | kTransformDisabled -kTransformSelectedOffline = kTransformSelected | kTransformOffline -kTransformSelectedOpen = kTransformSelected | kTransformOpen -ttNone = kTransformNone -ttDisabled = kTransformDisabled -ttOffline = kTransformOffline -ttOpen = kTransformOpen -ttLabel1 = kTransformLabel1 -ttLabel2 = kTransformLabel2 -ttLabel3 = kTransformLabel3 -ttLabel4 = kTransformLabel4 -ttLabel5 = kTransformLabel5 -ttLabel6 = kTransformLabel6 -ttLabel7 = kTransformLabel7 -ttSelected = kTransformSelected -ttSelectedDisabled = kTransformSelectedDisabled -ttSelectedOffline = kTransformSelectedOffline -ttSelectedOpen = kTransformSelectedOpen -kSelectorLarge1Bit = 0x00000001 -kSelectorLarge4Bit = 0x00000002 -kSelectorLarge8Bit = 0x00000004 -kSelectorLarge32Bit = 0x00000008 -kSelectorLarge8BitMask = 0x00000010 -kSelectorSmall1Bit = 0x00000100 -kSelectorSmall4Bit = 0x00000200 -kSelectorSmall8Bit = 0x00000400 -kSelectorSmall32Bit = 0x00000800 -kSelectorSmall8BitMask = 0x00001000 -kSelectorMini1Bit = 0x00010000 -kSelectorMini4Bit = 0x00020000 -kSelectorMini8Bit = 0x00040000 -kSelectorHuge1Bit = 0x01000000 -kSelectorHuge4Bit = 0x02000000 -kSelectorHuge8Bit = 0x04000000 -kSelectorHuge32Bit = 0x08000000 -kSelectorHuge8BitMask = 0x10000000 -kSelectorAllLargeData = 0x000000FF -kSelectorAllSmallData = 0x0000FF00 -kSelectorAllMiniData = 0x00FF0000 -# kSelectorAllHugeData = (long)0xFF000000 -kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit -kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit -kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit -kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit -# kSelectorAllAvailableData = (long)0xFFFFFFFF -svLarge1Bit = kSelectorLarge1Bit -svLarge4Bit = kSelectorLarge4Bit -svLarge8Bit = kSelectorLarge8Bit -svSmall1Bit = kSelectorSmall1Bit -svSmall4Bit = kSelectorSmall4Bit -svSmall8Bit = kSelectorSmall8Bit -svMini1Bit = kSelectorMini1Bit -svMini4Bit = kSelectorMini4Bit -svMini8Bit = kSelectorMini8Bit -svAllLargeData = kSelectorAllLargeData -svAllSmallData = kSelectorAllSmallData -svAllMiniData = kSelectorAllMiniData -svAll1BitData = kSelectorAll1BitData -svAll4BitData = kSelectorAll4BitData -svAll8BitData = kSelectorAll8BitData -# svAllAvailableData = kSelectorAllAvailableData -kSystemIconsCreator = FOUR_CHAR_CODE('macs') -# err = GetIconRef(kOnSystemDisk -kClipboardIcon = FOUR_CHAR_CODE('CLIP') -kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu') -kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp') -kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt') -kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps') -kDesktopIcon = FOUR_CHAR_CODE('desk') -kFinderIcon = FOUR_CHAR_CODE('FNDR') -kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL') -kFullTrashIcon = FOUR_CHAR_CODE('ftrh') -kGenericApplicationIcon = FOUR_CHAR_CODE('APPL') -kGenericCDROMIcon = FOUR_CHAR_CODE('cddr') -kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC') -kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev') -kGenericComponentIcon = FOUR_CHAR_CODE('thng') -kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD') -kGenericDocumentIcon = FOUR_CHAR_CODE('docu') -kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf') -kGenericExtensionIcon = FOUR_CHAR_CODE('INIT') -kGenericFileServerIcon = FOUR_CHAR_CODE('srvr') -kGenericFontIcon = FOUR_CHAR_CODE('ffil') -kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr') -kGenericFloppyIcon = FOUR_CHAR_CODE('flpy') -kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk') -kGenericIDiskIcon = FOUR_CHAR_CODE('idsk') -kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov') -kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr') -kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc') -kGenericPreferencesIcon = FOUR_CHAR_CODE('pref') -kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery') -kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd') -kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb') -kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc') -kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit') -kGenericURLIcon = FOUR_CHAR_CODE('gurl') -kGenericWORMIcon = FOUR_CHAR_CODE('worm') -kInternationalResourcesIcon = FOUR_CHAR_CODE('ifil') -kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil') -kSoundFileIcon = FOUR_CHAR_CODE('sfil') -kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys') -kTrashIcon = FOUR_CHAR_CODE('trsh') -kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil') -kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt') -kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf') -kUserIDiskIcon = FOUR_CHAR_CODE('udsk') -kInternationResourcesIcon = kInternationalResourcesIcon -kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht') -kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft') -kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf') -kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat') -kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi') -kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma') -kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw') -kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns') -kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge') -kGenericFolderIcon = FOUR_CHAR_CODE('fldr') -kDropFolderIcon = FOUR_CHAR_CODE('dbox') -kMountedFolderIcon = FOUR_CHAR_CODE('mntd') -kOpenFolderIcon = FOUR_CHAR_CODE('ofld') -kOwnedFolderIcon = FOUR_CHAR_CODE('ownd') -kPrivateFolderIcon = FOUR_CHAR_CODE('prvf') -kSharedFolderIcon = FOUR_CHAR_CODE('shfl') -kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna') -kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro') -kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw') -kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk') -kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ') -kUserFolderIcon = FOUR_CHAR_CODE('ufld') -kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld') -kGuestUserIcon = FOUR_CHAR_CODE('gusr') -kUserIcon = FOUR_CHAR_CODE('user') -kOwnerIcon = FOUR_CHAR_CODE('susr') -kGroupIcon = FOUR_CHAR_CODE('grup') -kAppearanceFolderIcon = FOUR_CHAR_CODE('appr') -kAppleExtrasFolderIcon = FOUR_CHAR_CODE('aex\xc4') -kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu') -kApplicationsFolderIcon = FOUR_CHAR_CODE('apps') -kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup') -kAssistantsFolderIcon = FOUR_CHAR_CODE('ast\xc4') -kColorSyncFolderIcon = FOUR_CHAR_CODE('prof') -kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu') -kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD') -kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl') -kControlStripModulesFolderIcon = FOUR_CHAR_CODE('sdv\xc4') -kDocumentsFolderIcon = FOUR_CHAR_CODE('docs') -kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD') -kExtensionsFolderIcon = FOUR_CHAR_CODE('extn') -kFavoritesFolderIcon = FOUR_CHAR_CODE('favs') -kFontsFolderIcon = FOUR_CHAR_CODE('font') -kHelpFolderIcon = FOUR_CHAR_CODE('\xc4hlp') -kInternetFolderIcon = FOUR_CHAR_CODE('int\xc4') -kInternetPlugInFolderIcon = FOUR_CHAR_CODE('\xc4net') -kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf') -kLocalesFolderIcon = FOUR_CHAR_CODE('\xc4loc') -kMacOSReadMeFolderIcon = FOUR_CHAR_CODE('mor\xc4') -kPublicFolderIcon = FOUR_CHAR_CODE('pubf') -kPreferencesFolderIcon = FOUR_CHAR_CODE('prf\xc4') -kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf') -kPrinterDriverFolderIcon = FOUR_CHAR_CODE('\xc4prd') -kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt') -kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp') -kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc') -kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv') -kScriptingAdditionsFolderIcon = FOUR_CHAR_CODE('\xc4scr') -kSharedLibrariesFolderIcon = FOUR_CHAR_CODE('\xc4lib') -kScriptsFolderIcon = FOUR_CHAR_CODE('scr\xc4') -kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD') -kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf') -kSpeakableItemsFolder = FOUR_CHAR_CODE('spki') -kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD') -kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt') -kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD') -kSystemFolderIcon = FOUR_CHAR_CODE('macs') -kTextEncodingsFolderIcon = FOUR_CHAR_CODE('\xc4tex') -kUsersFolderIcon = FOUR_CHAR_CODE('usr\xc4') -kUtilitiesFolderIcon = FOUR_CHAR_CODE('uti\xc4') -kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc') -kSystemFolderXIcon = FOUR_CHAR_CODE('macx') -kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp') -kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg') -kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg') -kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg') -kAliasBadgeIcon = FOUR_CHAR_CODE('abdg') -kAlertCautionBadgeIcon = FOUR_CHAR_CODE('cbdg') -kAlertNoteIcon = FOUR_CHAR_CODE('note') -kAlertCautionIcon = FOUR_CHAR_CODE('caut') -kAlertStopIcon = FOUR_CHAR_CODE('stop') -kAppleTalkIcon = FOUR_CHAR_CODE('atlk') -kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn') -kAFPServerIcon = FOUR_CHAR_CODE('afps') -kFTPServerIcon = FOUR_CHAR_CODE('ftps') -kHTTPServerIcon = FOUR_CHAR_CODE('htps') -kGenericNetworkIcon = FOUR_CHAR_CODE('gnet') -kIPFileServerIcon = FOUR_CHAR_CODE('isrv') -kToolbarCustomizeIcon = FOUR_CHAR_CODE('tcus') -kToolbarDeleteIcon = FOUR_CHAR_CODE('tdel') -kToolbarFavoritesIcon = FOUR_CHAR_CODE('tfav') -kToolbarHomeIcon = FOUR_CHAR_CODE('thom') -kAppleLogoIcon = FOUR_CHAR_CODE('capl') -kAppleMenuIcon = FOUR_CHAR_CODE('sapl') -kBackwardArrowIcon = FOUR_CHAR_CODE('baro') -kFavoriteItemsIcon = FOUR_CHAR_CODE('favr') -kForwardArrowIcon = FOUR_CHAR_CODE('faro') -kGridIcon = FOUR_CHAR_CODE('grid') -kHelpIcon = FOUR_CHAR_CODE('help') -kKeepArrangedIcon = FOUR_CHAR_CODE('arng') -kLockedIcon = FOUR_CHAR_CODE('lock') -kNoFilesIcon = FOUR_CHAR_CODE('nfil') -kNoFolderIcon = FOUR_CHAR_CODE('nfld') -kNoWriteIcon = FOUR_CHAR_CODE('nwrt') -kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp') -kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys') -kRecentItemsIcon = FOUR_CHAR_CODE('rcnt') -kShortcutIcon = FOUR_CHAR_CODE('shrt') -kSortAscendingIcon = FOUR_CHAR_CODE('asnd') -kSortDescendingIcon = FOUR_CHAR_CODE('dsnd') -kUnlockedIcon = FOUR_CHAR_CODE('ulck') -kConnectToIcon = FOUR_CHAR_CODE('cnct') -kGenericWindowIcon = FOUR_CHAR_CODE('gwin') -kQuestionMarkIcon = FOUR_CHAR_CODE('ques') -kDeleteAliasIcon = FOUR_CHAR_CODE('dali') -kEjectMediaIcon = FOUR_CHAR_CODE('ejec') -kBurningIcon = FOUR_CHAR_CODE('burn') -kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar') -kIconServicesNormalUsageFlag = 0 -kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess) -kPlotIconRefNormalFlags = 0L -kPlotIconRefNoImage = (1 << 1) -kPlotIconRefNoMask = (1 << 2) -kIconFamilyType = FOUR_CHAR_CODE('icns') diff --git a/sys/lib/python/plat-mac/Carbon/Launch.py b/sys/lib/python/plat-mac/Carbon/Launch.py deleted file mode 100644 index e553f8f4e..000000000 --- a/sys/lib/python/plat-mac/Carbon/Launch.py +++ /dev/null @@ -1 +0,0 @@ -from _Launch import * diff --git a/sys/lib/python/plat-mac/Carbon/LaunchServices.py b/sys/lib/python/plat-mac/Carbon/LaunchServices.py deleted file mode 100644 index daff44693..000000000 --- a/sys/lib/python/plat-mac/Carbon/LaunchServices.py +++ /dev/null @@ -1,74 +0,0 @@ -# Generated from 'LaunchServices.h' - -def FOUR_CHAR_CODE(x): return x -from Carbon.Files import * -kLSRequestAllInfo = -1 -kLSRolesAll = -1 -kLSUnknownType = FOUR_CHAR_CODE('\0\0\0\0') -kLSUnknownCreator = FOUR_CHAR_CODE('\0\0\0\0') -kLSInvalidExtensionIndex = -1 -kLSUnknownErr = -10810 -kLSNotAnApplicationErr = -10811 -kLSNotInitializedErr = -10812 -kLSDataUnavailableErr = -10813 -kLSApplicationNotFoundErr = -10814 -kLSUnknownTypeErr = -10815 -kLSDataTooOldErr = -10816 -kLSDataErr = -10817 -kLSLaunchInProgressErr = -10818 -kLSNotRegisteredErr = -10819 -kLSAppDoesNotClaimTypeErr = -10820 -kLSAppDoesNotSupportSchemeWarning = -10821 -kLSServerCommunicationErr = -10822 -kLSCannotSetInfoErr = -10823 -kLSInitializeDefaults = 0x00000001 -kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo) -# kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF -kLSRequestExtension = 0x00000001 -kLSRequestTypeCreator = 0x00000002 -kLSRequestBasicFlagsOnly = 0x00000004 -kLSRequestAppTypeFlags = 0x00000008 -kLSRequestAllFlags = 0x00000010 -kLSRequestIconAndKind = 0x00000020 -kLSRequestExtensionFlagsOnly = 0x00000040 -# kLSRequestAllInfo = (unsigned long)0xFFFFFFFF -kLSItemInfoIsPlainFile = 0x00000001 -kLSItemInfoIsPackage = 0x00000002 -kLSItemInfoIsApplication = 0x00000004 -kLSItemInfoIsContainer = 0x00000008 -kLSItemInfoIsAliasFile = 0x00000010 -kLSItemInfoIsSymlink = 0x00000020 -kLSItemInfoIsInvisible = 0x00000040 -kLSItemInfoIsNativeApp = 0x00000080 -kLSItemInfoIsClassicApp = 0x00000100 -kLSItemInfoAppPrefersNative = 0x00000200 -kLSItemInfoAppPrefersClassic = 0x00000400 -kLSItemInfoAppIsScriptable = 0x00000800 -kLSItemInfoIsVolume = 0x00001000 -kLSItemInfoExtensionIsHidden = 0x00100000 -kLSRolesNone = 0x00000001 -kLSRolesViewer = 0x00000002 -kLSRolesEditor = 0x00000004 -# kLSRolesAll = (unsigned long)0xFFFFFFFF -kLSUnknownKindID = 0 -# kLSUnknownType = 0 -# kLSUnknownCreator = 0 -kLSAcceptDefault = 0x00000001 -kLSAcceptAllowLoginUI = 0x00000002 -kLSLaunchDefaults = 0x00000001 -kLSLaunchAndPrint = 0x00000002 -kLSLaunchReserved2 = 0x00000004 -kLSLaunchReserved3 = 0x00000008 -kLSLaunchReserved4 = 0x00000010 -kLSLaunchReserved5 = 0x00000020 -kLSLaunchReserved6 = 0x00000040 -kLSLaunchInhibitBGOnly = 0x00000080 -kLSLaunchDontAddToRecents = 0x00000100 -kLSLaunchDontSwitch = 0x00000200 -kLSLaunchNoParams = 0x00000800 -kLSLaunchAsync = 0x00010000 -kLSLaunchStartClassic = 0x00020000 -kLSLaunchInClassic = 0x00040000 -kLSLaunchNewInstance = 0x00080000 -kLSLaunchAndHide = 0x00100000 -kLSLaunchAndHideOthers = 0x00200000 diff --git a/sys/lib/python/plat-mac/Carbon/List.py b/sys/lib/python/plat-mac/Carbon/List.py deleted file mode 100644 index b0d6e2273..000000000 --- a/sys/lib/python/plat-mac/Carbon/List.py +++ /dev/null @@ -1 +0,0 @@ -from _List import * diff --git a/sys/lib/python/plat-mac/Carbon/Lists.py b/sys/lib/python/plat-mac/Carbon/Lists.py deleted file mode 100644 index 723294c61..000000000 --- a/sys/lib/python/plat-mac/Carbon/Lists.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated from 'Lists.h' - -def FOUR_CHAR_CODE(x): return x -listNotifyNothing = FOUR_CHAR_CODE('nada') -listNotifyClick = FOUR_CHAR_CODE('clik') -listNotifyDoubleClick = FOUR_CHAR_CODE('dblc') -listNotifyPreClick = FOUR_CHAR_CODE('pclk') -lDrawingModeOffBit = 3 -lDoVAutoscrollBit = 1 -lDoHAutoscrollBit = 0 -lDrawingModeOff = 8 -lDoVAutoscroll = 2 -lDoHAutoscroll = 1 -lOnlyOneBit = 7 -lExtendDragBit = 6 -lNoDisjointBit = 5 -lNoExtendBit = 4 -lNoRectBit = 3 -lUseSenseBit = 2 -lNoNilHiliteBit = 1 -lOnlyOne = -128 -lExtendDrag = 64 -lNoDisjoint = 32 -lNoExtend = 16 -lNoRect = 8 -lUseSense = 4 -lNoNilHilite = 2 -lInitMsg = 0 -lDrawMsg = 1 -lHiliteMsg = 2 -lCloseMsg = 3 -kListDefProcPtr = 0 -kListDefUserProcType = kListDefProcPtr -kListDefStandardTextType = 1 -kListDefStandardIconType = 2 diff --git a/sys/lib/python/plat-mac/Carbon/MacHelp.py b/sys/lib/python/plat-mac/Carbon/MacHelp.py deleted file mode 100644 index 06b9912bf..000000000 --- a/sys/lib/python/plat-mac/Carbon/MacHelp.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated from 'MacHelp.h' - -def FOUR_CHAR_CODE(x): return x -kMacHelpVersion = 0x0003 -kHMSupplyContent = 0 -kHMDisposeContent = 1 -kHMNoContent = FOUR_CHAR_CODE('none') -kHMCFStringContent = FOUR_CHAR_CODE('cfst') -kHMPascalStrContent = FOUR_CHAR_CODE('pstr') -kHMStringResContent = FOUR_CHAR_CODE('str#') -kHMTEHandleContent = FOUR_CHAR_CODE('txth') -kHMTextResContent = FOUR_CHAR_CODE('text') -kHMStrResContent = FOUR_CHAR_CODE('str ') -kHMDefaultSide = 0 -kHMOutsideTopScriptAligned = 1 -kHMOutsideLeftCenterAligned = 2 -kHMOutsideBottomScriptAligned = 3 -kHMOutsideRightCenterAligned = 4 -kHMOutsideTopLeftAligned = 5 -kHMOutsideTopRightAligned = 6 -kHMOutsideLeftTopAligned = 7 -kHMOutsideLeftBottomAligned = 8 -kHMOutsideBottomLeftAligned = 9 -kHMOutsideBottomRightAligned = 10 -kHMOutsideRightTopAligned = 11 -kHMOutsideRightBottomAligned = 12 -kHMOutsideTopCenterAligned = 13 -kHMOutsideBottomCenterAligned = 14 -kHMInsideRightCenterAligned = 15 -kHMInsideLeftCenterAligned = 16 -kHMInsideBottomCenterAligned = 17 -kHMInsideTopCenterAligned = 18 -kHMInsideTopLeftCorner = 19 -kHMInsideTopRightCorner = 20 -kHMInsideBottomLeftCorner = 21 -kHMInsideBottomRightCorner = 22 -kHMAbsoluteCenterAligned = 23 -kHMTopSide = kHMOutsideTopScriptAligned -kHMLeftSide = kHMOutsideLeftCenterAligned -kHMBottomSide = kHMOutsideBottomScriptAligned -kHMRightSide = kHMOutsideRightCenterAligned -kHMTopLeftCorner = kHMOutsideTopLeftAligned -kHMTopRightCorner = kHMOutsideTopRightAligned -kHMLeftTopCorner = kHMOutsideLeftTopAligned -kHMLeftBottomCorner = kHMOutsideLeftBottomAligned -kHMBottomLeftCorner = kHMOutsideBottomLeftAligned -kHMBottomRightCorner = kHMOutsideBottomRightAligned -kHMRightTopCorner = kHMOutsideRightTopAligned -kHMRightBottomCorner = kHMOutsideRightBottomAligned -kHMContentProvided = 0 -kHMContentNotProvided = 1 -kHMContentNotProvidedDontPropagate = 2 -kHMMinimumContentIndex = 0 -kHMMaximumContentIndex = 1 -errHMIllegalContentForMinimumState = -10980 -errHMIllegalContentForMaximumState = -10981 -kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState -kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt') diff --git a/sys/lib/python/plat-mac/Carbon/MacTextEditor.py b/sys/lib/python/plat-mac/Carbon/MacTextEditor.py deleted file mode 100644 index 4609d8db8..000000000 --- a/sys/lib/python/plat-mac/Carbon/MacTextEditor.py +++ /dev/null @@ -1,226 +0,0 @@ -# Generated from 'MacTextEditor.h' - - -def FOUR_CHAR_CODE(x): return x -false = 0 -true = 1 -kTXNClearThisControl = 0xFFFFFFFF -kTXNClearTheseFontFeatures = 0x80000000 -kTXNDontCareTypeSize = 0xFFFFFFFF -kTXNDecrementTypeSize = 0x80000000 -kTXNUseCurrentSelection = 0xFFFFFFFF -kTXNStartOffset = 0 -kTXNEndOffset = 0x7FFFFFFF -MovieFileType = FOUR_CHAR_CODE('moov') -kTXNUseEncodingWordRulesMask = 0x80000000 -kTXNFontSizeAttributeSize = 4 -normal = 0 -kTXNWillDefaultToATSUIBit = 0 -kTXNWillDefaultToCarbonEventBit = 1 -kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit -kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit -kTXNWantMoviesBit = 0 -kTXNWantSoundBit = 1 -kTXNWantGraphicsBit = 2 -kTXNAlwaysUseQuickDrawTextBit = 3 -kTXNUseTemporaryMemoryBit = 4 -kTXNWantMoviesMask = 1L << kTXNWantMoviesBit -kTXNWantSoundMask = 1L << kTXNWantSoundBit -kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit -kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit -kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit -kTXNDrawGrowIconBit = 0 -kTXNShowWindowBit = 1 -kTXNWantHScrollBarBit = 2 -kTXNWantVScrollBarBit = 3 -kTXNNoTSMEverBit = 4 -kTXNReadOnlyBit = 5 -kTXNNoKeyboardSyncBit = 6 -kTXNNoSelectionBit = 7 -kTXNSaveStylesAsSTYLResourceBit = 8 -kOutputTextInUnicodeEncodingBit = 9 -kTXNDoNotInstallDragProcsBit = 10 -kTXNAlwaysWrapAtViewEdgeBit = 11 -kTXNDontDrawCaretWhenInactiveBit = 12 -kTXNDontDrawSelectionWhenInactiveBit = 13 -kTXNSingleLineOnlyBit = 14 -kTXNDisableDragAndDropBit = 15 -kTXNUseQDforImagingBit = 16 -kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit -kTXNShowWindowMask = 1L << kTXNShowWindowBit -kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit -kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit -kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit -kTXNReadOnlyMask = 1L << kTXNReadOnlyBit -kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit -kTXNNoSelectionMask = 1L << kTXNNoSelectionBit -kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit -kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit -kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit -kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit -kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit -kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit -kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit -kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit -kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit -kTXNSetFlushnessBit = 0 -kTXNSetJustificationBit = 1 -kTXNUseFontFallBackBit = 2 -kTXNRotateTextBit = 3 -kTXNUseVerticalTextBit = 4 -kTXNDontUpdateBoxRectBit = 5 -kTXNDontDrawTextBit = 6 -kTXNUseCGContextRefBit = 7 -kTXNImageWithQDBit = 8 -kTXNDontWrapTextBit = 9 -kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit -kTXNSetJustificationMask = 1L << kTXNSetJustificationBit -kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit -kTXNRotateTextMask = 1L << kTXNRotateTextBit -kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit -kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit -kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit -kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit -kTXNImageWithQDMask = 1L << kTXNImageWithQDBit -kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit -kTXNFontContinuousBit = 0 -kTXNSizeContinuousBit = 1 -kTXNStyleContinuousBit = 2 -kTXNColorContinuousBit = 3 -kTXNFontContinuousMask = 1L << kTXNFontContinuousBit -kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit -kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit -kTXNColorContinuousMask = 1L << kTXNColorContinuousBit -kTXNIgnoreCaseBit = 0 -kTXNEntireWordBit = 1 -kTXNUseEncodingWordRulesBit = 31 -kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit -kTXNEntireWordMask = 1L << kTXNEntireWordBit -# kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit) -kTXNTextensionFile = FOUR_CHAR_CODE('txtn') -kTXNTextFile = FOUR_CHAR_CODE('TEXT') -kTXNPictureFile = FOUR_CHAR_CODE('PICT') -kTXNMovieFile = FOUR_CHAR_CODE('MooV') -kTXNSoundFile = FOUR_CHAR_CODE('sfil') -kTXNAIFFFile = FOUR_CHAR_CODE('AIFF') -kTXNUnicodeTextFile = FOUR_CHAR_CODE('utxt') -kTXNTextEditStyleFrameType = 1 -kTXNPageFrameType = 2 -kTXNMultipleFrameType = 3 -kTXNTextData = FOUR_CHAR_CODE('TEXT') -kTXNPictureData = FOUR_CHAR_CODE('PICT') -kTXNMovieData = FOUR_CHAR_CODE('moov') -kTXNSoundData = FOUR_CHAR_CODE('snd ') -kTXNUnicodeTextData = FOUR_CHAR_CODE('utxt') -kTXNLineDirectionTag = FOUR_CHAR_CODE('lndr') -kTXNJustificationTag = FOUR_CHAR_CODE('just') -kTXNIOPrivilegesTag = FOUR_CHAR_CODE('iopv') -kTXNSelectionStateTag = FOUR_CHAR_CODE('slst') -kTXNInlineStateTag = FOUR_CHAR_CODE('inst') -kTXNWordWrapStateTag = FOUR_CHAR_CODE('wwrs') -kTXNKeyboardSyncStateTag = FOUR_CHAR_CODE('kbsy') -kTXNAutoIndentStateTag = FOUR_CHAR_CODE('auin') -kTXNTabSettingsTag = FOUR_CHAR_CODE('tabs') -kTXNRefConTag = FOUR_CHAR_CODE('rfcn') -kTXNMarginsTag = FOUR_CHAR_CODE('marg') -kTXNFlattenMoviesTag = FOUR_CHAR_CODE('flat') -kTXNDoFontSubstitution = FOUR_CHAR_CODE('fSub') -kTXNNoUserIOTag = FOUR_CHAR_CODE('nuio') -kTXNUseCarbonEvents = FOUR_CHAR_CODE('cbcb') -kTXNDrawCaretWhenInactiveTag = FOUR_CHAR_CODE('dcrt') -kTXNDrawSelectionWhenInactiveTag = FOUR_CHAR_CODE('dsln') -kTXNDisableDragAndDropTag = FOUR_CHAR_CODE('drag') -kTXNTypingAction = 0 -kTXNCutAction = 1 -kTXNPasteAction = 2 -kTXNClearAction = 3 -kTXNChangeFontAction = 4 -kTXNChangeFontColorAction = 5 -kTXNChangeFontSizeAction = 6 -kTXNChangeStyleAction = 7 -kTXNAlignLeftAction = 8 -kTXNAlignCenterAction = 9 -kTXNAlignRightAction = 10 -kTXNDropAction = 11 -kTXNMoveAction = 12 -kTXNFontFeatureAction = 13 -kTXNFontVariationAction = 14 -kTXNUndoLastAction = 1024 -# kTXNClearThisControl = (long)0xFFFFFFFF -# kTXNClearTheseFontFeatures = (long)0x80000000 -kTXNReadWrite = false -kTXNReadOnly = true -kTXNSelectionOn = true -kTXNSelectionOff = false -kTXNUseInline = false -kTXNUseBottomline = true -kTXNAutoWrap = false -kTXNNoAutoWrap = true -kTXNSyncKeyboard = false -kTXNNoSyncKeyboard = true -kTXNAutoIndentOff = false -kTXNAutoIndentOn = true -kTXNDontDrawCaretWhenInactive = false -kTXNDrawCaretWhenInactive = true -kTXNDontDrawSelectionWhenInactive = false -kTXNDrawSelectionWhenInactive = true -kTXNEnableDragAndDrop = false -kTXNDisableDragAndDrop = true -kTXNRightTab = -1 -kTXNLeftTab = 0 -kTXNCenterTab = 1 -kTXNLeftToRight = 0 -kTXNRightToLeft = 1 -kTXNFlushDefault = 0 -kTXNFlushLeft = 1 -kTXNFlushRight = 2 -kTXNCenter = 4 -kTXNFullJust = 8 -kTXNForceFullJust = 16 -kScrollBarsAlwaysActive = true -kScrollBarsSyncWithFocus = false -# kTXNDontCareTypeSize = (long)0xFFFFFFFF -kTXNDontCareTypeStyle = 0xFF -kTXNIncrementTypeSize = 0x00000001 -# kTXNDecrementTypeSize = (long)0x80000000 -kTXNUseScriptDefaultValue = -1 -kTXNNoFontVariations = 0x7FFF -# kTXNUseCurrentSelection = (unsigned long)0xFFFFFFFF -# kTXNStartOffset = 0 -# kTXNEndOffset = 0x7FFFFFFF -kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR') -kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl') -kTXNShowStart = false -kTXNShowEnd = true -kTXNDefaultFontName = 0 -kTXNDefaultFontSize = 0x000C0000 -kTXNDefaultFontStyle = normal -kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn') -kTXNQDFontFamilyIDAttribute = FOUR_CHAR_CODE('font') -kTXNQDFontSizeAttribute = FOUR_CHAR_CODE('size') -kTXNQDFontStyleAttribute = FOUR_CHAR_CODE('face') -kTXNQDFontColorAttribute = FOUR_CHAR_CODE('klor') -kTXNTextEncodingAttribute = FOUR_CHAR_CODE('encd') -kTXNATSUIFontFeaturesAttribute = FOUR_CHAR_CODE('atfe') -kTXNATSUIFontVariationsAttribute = FOUR_CHAR_CODE('atva') -# kTXNQDFontNameAttributeSize = sizeof(Str255) -# kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16) -# kTXNQDFontSizeAttributeSize = sizeof(SInt16) -# kTXNQDFontStyleAttributeSize = sizeof(Style) -# kTXNQDFontColorAttributeSize = sizeof(RGBColor) -# kTXNTextEncodingAttributeSize = sizeof(TextEncoding) -# kTXNFontSizeAttributeSize = sizeof(Fixed) -kTXNSystemDefaultEncoding = 0 -kTXNMacOSEncoding = 1 -kTXNUnicodeEncoding = 2 -kTXNBackgroundTypeRGB = 1 -kTXNTextInputCountBit = 0 -kTXNRunCountBit = 1 -kTXNTextInputCountMask = 1L << kTXNTextInputCountBit -kTXNRunCountMask = 1L << kTXNRunCountBit -kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask -kTXNNoAppleEventHandlersBit = 0 -kTXNRestartAppleEventHandlersBit = 1 -kTXNNoAppleEventHandlersMask = 1 << kTXNNoAppleEventHandlersBit -kTXNRestartAppleEventHandlersMask = 1 << kTXNRestartAppleEventHandlersBit -# status = TXNInitTextension( &defaults diff --git a/sys/lib/python/plat-mac/Carbon/MediaDescr.py b/sys/lib/python/plat-mac/Carbon/MediaDescr.py deleted file mode 100644 index 254634bb2..000000000 --- a/sys/lib/python/plat-mac/Carbon/MediaDescr.py +++ /dev/null @@ -1,97 +0,0 @@ -# Parsers/generators for QuickTime media descriptions -import struct - -Error = 'MediaDescr.Error' - -class _MediaDescriptionCodec: - def __init__(self, trunc, size, names, fmt): - self.trunc = trunc - self.size = size - self.names = names - self.fmt = fmt - - def decode(self, data): - if self.trunc: - data = data[:self.size] - values = struct.unpack(self.fmt, data) - if len(values) != len(self.names): - raise Error, ('Format length does not match number of names', descr) - rv = {} - for i in range(len(values)): - name = self.names[i] - value = values[i] - if type(name) == type(()): - name, cod, dec = name - value = dec(value) - rv[name] = value - return rv - - def encode(dict): - list = [self.fmt] - for name in self.names: - if type(name) == type(()): - name, cod, dec = name - else: - cod = dec = None - value = dict[name] - if cod: - value = cod(value) - list.append(value) - rv = struct.pack(*list) - return rv - -# Helper functions -def _tofixed(float): - hi = int(float) - lo = int(float*0x10000) & 0xffff - return (hi<<16)|lo - -def _fromfixed(fixed): - hi = (fixed >> 16) & 0xffff - lo = (fixed & 0xffff) - return hi + (lo / float(0x10000)) - -def _tostr31(str): - return chr(len(str)) + str + '\0'*(31-len(str)) - -def _fromstr31(str31): - return str31[1:1+ord(str31[0])] - -SampleDescription = _MediaDescriptionCodec( - 1, # May be longer, truncate - 16, # size - ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex'), # Attributes - "l4slhh" # Format -) - -SoundDescription = _MediaDescriptionCodec( - 1, - 36, - ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', - 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', - 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed)), - "l4slhhhh4shhhhl" # Format -) - -SoundDescriptionV1 = _MediaDescriptionCodec( - 1, - 52, - ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', - 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', - 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed), 'samplesPerPacket', - 'bytesPerPacket', 'bytesPerFrame', 'bytesPerSample'), - "l4slhhhh4shhhhlllll" # Format -) - -ImageDescription = _MediaDescriptionCodec( - 1, # May be longer, truncate - 86, # size - ('idSize', 'cType', 'resvd1', 'resvd2', 'dataRefIndex', 'version', - 'revisionLevel', 'vendor', 'temporalQuality', 'spatialQuality', - 'width', 'height', ('hRes', _tofixed, _fromfixed), ('vRes', _tofixed, _fromfixed), - 'dataSize', 'frameCount', ('name', _tostr31, _fromstr31), - 'depth', 'clutID'), - 'l4slhhhh4sllhhlllh32shh', -) - -# XXXX Others, like TextDescription and such, remain to be done. diff --git a/sys/lib/python/plat-mac/Carbon/Menu.py b/sys/lib/python/plat-mac/Carbon/Menu.py deleted file mode 100644 index 075cb9d8a..000000000 --- a/sys/lib/python/plat-mac/Carbon/Menu.py +++ /dev/null @@ -1 +0,0 @@ -from _Menu import * diff --git a/sys/lib/python/plat-mac/Carbon/Menus.py b/sys/lib/python/plat-mac/Carbon/Menus.py deleted file mode 100644 index 01affb096..000000000 --- a/sys/lib/python/plat-mac/Carbon/Menus.py +++ /dev/null @@ -1,169 +0,0 @@ -# Generated from 'Menus.h' - -def FOUR_CHAR_CODE(x): return x -noMark = 0 -kMenuDrawMsg = 0 -kMenuSizeMsg = 2 -kMenuPopUpMsg = 3 -kMenuCalcItemMsg = 5 -kMenuThemeSavvyMsg = 7 -mDrawMsg = 0 -mSizeMsg = 2 -mPopUpMsg = 3 -mCalcItemMsg = 5 -mChooseMsg = 1 -mDrawItemMsg = 4 -kMenuChooseMsg = 1 -kMenuDrawItemMsg = 4 -kThemeSavvyMenuResponse = 0x7473 -kMenuInitMsg = 8 -kMenuDisposeMsg = 9 -kMenuFindItemMsg = 10 -kMenuHiliteItemMsg = 11 -kMenuDrawItemsMsg = 12 -textMenuProc = 0 -hMenuCmd = 27 -hierMenu = -1 -kInsertHierarchicalMenu = -1 -mctAllItems = -98 -mctLastIDIndic = -99 -kMenuStdMenuProc = 63 -kMenuStdMenuBarProc = 63 -kMenuNoModifiers = 0 -kMenuShiftModifier = (1 << 0) -kMenuOptionModifier = (1 << 1) -kMenuControlModifier = (1 << 2) -kMenuNoCommandModifier = (1 << 3) -kMenuNoIcon = 0 -kMenuIconType = 1 -kMenuShrinkIconType = 2 -kMenuSmallIconType = 3 -kMenuColorIconType = 4 -kMenuIconSuiteType = 5 -kMenuIconRefType = 6 -kMenuCGImageRefType = 7 -kMenuSystemIconSelectorType = 8 -kMenuIconResourceType = 9 -kMenuNullGlyph = 0x00 -kMenuTabRightGlyph = 0x02 -kMenuTabLeftGlyph = 0x03 -kMenuEnterGlyph = 0x04 -kMenuShiftGlyph = 0x05 -kMenuControlGlyph = 0x06 -kMenuOptionGlyph = 0x07 -kMenuSpaceGlyph = 0x09 -kMenuDeleteRightGlyph = 0x0A -kMenuReturnGlyph = 0x0B -kMenuReturnR2LGlyph = 0x0C -kMenuNonmarkingReturnGlyph = 0x0D -kMenuPencilGlyph = 0x0F -kMenuDownwardArrowDashedGlyph = 0x10 -kMenuCommandGlyph = 0x11 -kMenuCheckmarkGlyph = 0x12 -kMenuDiamondGlyph = 0x13 -kMenuAppleLogoFilledGlyph = 0x14 -kMenuParagraphKoreanGlyph = 0x15 -kMenuDeleteLeftGlyph = 0x17 -kMenuLeftArrowDashedGlyph = 0x18 -kMenuUpArrowDashedGlyph = 0x19 -kMenuRightArrowDashedGlyph = 0x1A -kMenuEscapeGlyph = 0x1B -kMenuClearGlyph = 0x1C -kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D -kMenuRightDoubleQuotesJapaneseGlyph = 0x1E -kMenuTrademarkJapaneseGlyph = 0x1F -kMenuBlankGlyph = 0x61 -kMenuPageUpGlyph = 0x62 -kMenuCapsLockGlyph = 0x63 -kMenuLeftArrowGlyph = 0x64 -kMenuRightArrowGlyph = 0x65 -kMenuNorthwestArrowGlyph = 0x66 -kMenuHelpGlyph = 0x67 -kMenuUpArrowGlyph = 0x68 -kMenuSoutheastArrowGlyph = 0x69 -kMenuDownArrowGlyph = 0x6A -kMenuPageDownGlyph = 0x6B -kMenuAppleLogoOutlineGlyph = 0x6C -kMenuContextualMenuGlyph = 0x6D -kMenuPowerGlyph = 0x6E -kMenuF1Glyph = 0x6F -kMenuF2Glyph = 0x70 -kMenuF3Glyph = 0x71 -kMenuF4Glyph = 0x72 -kMenuF5Glyph = 0x73 -kMenuF6Glyph = 0x74 -kMenuF7Glyph = 0x75 -kMenuF8Glyph = 0x76 -kMenuF9Glyph = 0x77 -kMenuF10Glyph = 0x78 -kMenuF11Glyph = 0x79 -kMenuF12Glyph = 0x7A -kMenuF13Glyph = 0x87 -kMenuF14Glyph = 0x88 -kMenuF15Glyph = 0x89 -kMenuControlISOGlyph = 0x8A -kMenuAttrExcludesMarkColumn = (1 << 0) -kMenuAttrAutoDisable = (1 << 2) -kMenuAttrUsePencilGlyph = (1 << 3) -kMenuAttrHidden = (1 << 4) -kMenuItemAttrDisabled = (1 << 0) -kMenuItemAttrIconDisabled = (1 << 1) -kMenuItemAttrSubmenuParentChoosable = (1 << 2) -kMenuItemAttrDynamic = (1 << 3) -kMenuItemAttrNotPreviousAlternate = (1 << 4) -kMenuItemAttrHidden = (1 << 5) -kMenuItemAttrSeparator = (1 << 6) -kMenuItemAttrSectionHeader = (1 << 7) -kMenuItemAttrIgnoreMeta = (1 << 8) -kMenuItemAttrAutoRepeat = (1 << 9) -kMenuItemAttrUseVirtualKey = (1 << 10) -kMenuItemAttrCustomDraw = (1 << 11) -kMenuItemAttrIncludeInCmdKeyMatching = (1 << 12) -kMenuTrackingModeMouse = 1 -kMenuTrackingModeKeyboard = 2 -kMenuEventIncludeDisabledItems = 0x0001 -kMenuEventQueryOnly = 0x0002 -kMenuEventDontCheckSubmenus = 0x0004 -kMenuItemDataText = (1 << 0) -kMenuItemDataMark = (1 << 1) -kMenuItemDataCmdKey = (1 << 2) -kMenuItemDataCmdKeyGlyph = (1 << 3) -kMenuItemDataCmdKeyModifiers = (1 << 4) -kMenuItemDataStyle = (1 << 5) -kMenuItemDataEnabled = (1 << 6) -kMenuItemDataIconEnabled = (1 << 7) -kMenuItemDataIconID = (1 << 8) -kMenuItemDataIconHandle = (1 << 9) -kMenuItemDataCommandID = (1 << 10) -kMenuItemDataTextEncoding = (1 << 11) -kMenuItemDataSubmenuID = (1 << 12) -kMenuItemDataSubmenuHandle = (1 << 13) -kMenuItemDataFontID = (1 << 14) -kMenuItemDataRefcon = (1 << 15) -kMenuItemDataAttributes = (1 << 16) -kMenuItemDataCFString = (1 << 17) -kMenuItemDataProperties = (1 << 18) -kMenuItemDataIndent = (1 << 19) -kMenuItemDataCmdVirtualKey = (1 << 20) -kMenuItemDataAllDataVersionOne = 0x000FFFFF -kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey -kMenuDefProcPtr = 0 -kMenuPropertyPersistent = 0x00000001 -kHierarchicalFontMenuOption = 0x00000001 -gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu') -gestaltContextualMenuUnusedBit = 0 -gestaltContextualMenuTrapAvailable = 1 -gestaltContextualMenuHasAttributeAndModifierKeys = 2 -gestaltContextualMenuHasUnicodeSupport = 3 -kCMHelpItemNoHelp = 0 -kCMHelpItemAppleGuide = 1 -kCMHelpItemOtherHelp = 2 -kCMHelpItemRemoveHelp = 3 -kCMNothingSelected = 0 -kCMMenuItemSelected = 1 -kCMShowHelpSelected = 3 -keyContextualMenuName = FOUR_CHAR_CODE('pnam') -keyContextualMenuCommandID = FOUR_CHAR_CODE('cmcd') -keyContextualMenuSubmenu = FOUR_CHAR_CODE('cmsb') -keyContextualMenuAttributes = FOUR_CHAR_CODE('cmat') -keyContextualMenuModifiers = FOUR_CHAR_CODE('cmmd') diff --git a/sys/lib/python/plat-mac/Carbon/Mlte.py b/sys/lib/python/plat-mac/Carbon/Mlte.py deleted file mode 100644 index b81fbc528..000000000 --- a/sys/lib/python/plat-mac/Carbon/Mlte.py +++ /dev/null @@ -1 +0,0 @@ -from _Mlte import * diff --git a/sys/lib/python/plat-mac/Carbon/OSA.py b/sys/lib/python/plat-mac/Carbon/OSA.py deleted file mode 100644 index 8d6732c94..000000000 --- a/sys/lib/python/plat-mac/Carbon/OSA.py +++ /dev/null @@ -1 +0,0 @@ -from _OSA import * diff --git a/sys/lib/python/plat-mac/Carbon/OSAconst.py b/sys/lib/python/plat-mac/Carbon/OSAconst.py deleted file mode 100644 index 3b64c2481..000000000 --- a/sys/lib/python/plat-mac/Carbon/OSAconst.py +++ /dev/null @@ -1,133 +0,0 @@ -# Generated from 'OSA.h' - -def FOUR_CHAR_CODE(x): return x -from Carbon.AppleEvents import * -kAEUseStandardDispatch = -1 -kOSAComponentType = FOUR_CHAR_CODE('osa ') -kOSAGenericScriptingComponentSubtype = FOUR_CHAR_CODE('scpt') -kOSAFileType = FOUR_CHAR_CODE('osas') -kOSASuite = FOUR_CHAR_CODE('ascr') -kOSARecordedText = FOUR_CHAR_CODE('recd') -kOSAScriptIsModified = FOUR_CHAR_CODE('modi') -kOSAScriptIsTypeCompiledScript = FOUR_CHAR_CODE('cscr') -kOSAScriptIsTypeScriptValue = FOUR_CHAR_CODE('valu') -kOSAScriptIsTypeScriptContext = FOUR_CHAR_CODE('cntx') -kOSAScriptBestType = FOUR_CHAR_CODE('best') -kOSACanGetSource = FOUR_CHAR_CODE('gsrc') -typeOSADialectInfo = FOUR_CHAR_CODE('difo') -keyOSADialectName = FOUR_CHAR_CODE('dnam') -keyOSADialectCode = FOUR_CHAR_CODE('dcod') -keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd') -keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd') -kOSANullScript = 0L -kOSANullMode = 0 -kOSAModeNull = 0 -kOSASupportsCompiling = 0x0002 -kOSASupportsGetSource = 0x0004 -kOSASupportsAECoercion = 0x0008 -kOSASupportsAESending = 0x0010 -kOSASupportsRecording = 0x0020 -kOSASupportsConvenience = 0x0040 -kOSASupportsDialects = 0x0080 -kOSASupportsEventHandling = 0x0100 -kOSASelectLoad = 0x0001 -kOSASelectStore = 0x0002 -kOSASelectExecute = 0x0003 -kOSASelectDisplay = 0x0004 -kOSASelectScriptError = 0x0005 -kOSASelectDispose = 0x0006 -kOSASelectSetScriptInfo = 0x0007 -kOSASelectGetScriptInfo = 0x0008 -kOSASelectSetActiveProc = 0x0009 -kOSASelectGetActiveProc = 0x000A -kOSASelectScriptingComponentName = 0x0102 -kOSASelectCompile = 0x0103 -kOSASelectCopyID = 0x0104 -kOSASelectCopyScript = 0x0105 -kOSASelectGetSource = 0x0201 -kOSASelectCoerceFromDesc = 0x0301 -kOSASelectCoerceToDesc = 0x0302 -kOSASelectSetSendProc = 0x0401 -kOSASelectGetSendProc = 0x0402 -kOSASelectSetCreateProc = 0x0403 -kOSASelectGetCreateProc = 0x0404 -kOSASelectSetDefaultTarget = 0x0405 -kOSASelectStartRecording = 0x0501 -kOSASelectStopRecording = 0x0502 -kOSASelectLoadExecute = 0x0601 -kOSASelectCompileExecute = 0x0602 -kOSASelectDoScript = 0x0603 -kOSASelectSetCurrentDialect = 0x0701 -kOSASelectGetCurrentDialect = 0x0702 -kOSASelectAvailableDialects = 0x0703 -kOSASelectGetDialectInfo = 0x0704 -kOSASelectAvailableDialectCodeList = 0x0705 -kOSASelectSetResumeDispatchProc = 0x0801 -kOSASelectGetResumeDispatchProc = 0x0802 -kOSASelectExecuteEvent = 0x0803 -kOSASelectDoEvent = 0x0804 -kOSASelectMakeContext = 0x0805 -kOSADebuggerCreateSession = 0x0901 -kOSADebuggerGetSessionState = 0x0902 -kOSADebuggerSessionStep = 0x0903 -kOSADebuggerDisposeSession = 0x0904 -kOSADebuggerGetStatementRanges = 0x0905 -kOSADebuggerGetBreakpoint = 0x0910 -kOSADebuggerSetBreakpoint = 0x0911 -kOSADebuggerGetDefaultBreakpoint = 0x0912 -kOSADebuggerGetCurrentCallFrame = 0x0906 -kOSADebuggerGetCallFrameState = 0x0907 -kOSADebuggerGetVariable = 0x0908 -kOSADebuggerSetVariable = 0x0909 -kOSADebuggerGetPreviousCallFrame = 0x090A -kOSADebuggerDisposeCallFrame = 0x090B -kOSADebuggerCountVariables = 0x090C -kOSASelectComponentSpecificStart = 0x1001 -kOSAModePreventGetSource = 0x00000001 -kOSAModeNeverInteract = kAENeverInteract -kOSAModeCanInteract = kAECanInteract -kOSAModeAlwaysInteract = kAEAlwaysInteract -kOSAModeDontReconnect = kAEDontReconnect -kOSAModeCantSwitchLayer = 0x00000040 -kOSAModeDoRecord = 0x00001000 -kOSAModeCompileIntoContext = 0x00000002 -kOSAModeAugmentContext = 0x00000004 -kOSAModeDisplayForHumans = 0x00000008 -kOSAModeDontStoreParent = 0x00010000 -kOSAModeDispatchToDirectObject = 0x00020000 -kOSAModeDontGetDataForArguments = 0x00040000 -kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype -typeOSAGenericStorage = kOSAScriptResourceType -kOSAErrorNumber = keyErrorNumber -kOSAErrorMessage = keyErrorString -kOSAErrorBriefMessage = FOUR_CHAR_CODE('errb') -kOSAErrorApp = FOUR_CHAR_CODE('erap') -kOSAErrorPartialResult = FOUR_CHAR_CODE('ptlr') -kOSAErrorOffendingObject = FOUR_CHAR_CODE('erob') -kOSAErrorExpectedType = FOUR_CHAR_CODE('errt') -kOSAErrorRange = FOUR_CHAR_CODE('erng') -typeOSAErrorRange = FOUR_CHAR_CODE('erng') -keyOSASourceStart = FOUR_CHAR_CODE('srcs') -keyOSASourceEnd = FOUR_CHAR_CODE('srce') -kOSAUseStandardDispatch = kAEUseStandardDispatch -kOSANoDispatch = kAENoDispatch -kOSADontUsePhac = 0x0001 -eNotStarted = 0 -eRunnable = 1 -eRunning = 2 -eStopped = 3 -eTerminated = 4 -eStepOver = 0 -eStepIn = 1 -eStepOut = 2 -eRun = 3 -eLocal = 0 -eGlobal = 1 -eProperties = 2 -keyProgramState = FOUR_CHAR_CODE('dsps') -typeStatementRange = FOUR_CHAR_CODE('srng') -keyProcedureName = FOUR_CHAR_CODE('dfnm') -keyStatementRange = FOUR_CHAR_CODE('dfsr') -keyLocalsNames = FOUR_CHAR_CODE('dfln') -keyGlobalsNames = FOUR_CHAR_CODE('dfgn') -keyParamsNames = FOUR_CHAR_CODE('dfpn') diff --git a/sys/lib/python/plat-mac/Carbon/QDOffscreen.py b/sys/lib/python/plat-mac/Carbon/QDOffscreen.py deleted file mode 100644 index b3f557e43..000000000 --- a/sys/lib/python/plat-mac/Carbon/QDOffscreen.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated from 'QDOffscreen.h' - -def FOUR_CHAR_CODE(x): return x -pixPurgeBit = 0 -noNewDeviceBit = 1 -useTempMemBit = 2 -keepLocalBit = 3 -useDistantHdwrMemBit = 4 -useLocalHdwrMemBit = 5 -pixelsPurgeableBit = 6 -pixelsLockedBit = 7 -mapPixBit = 16 -newDepthBit = 17 -alignPixBit = 18 -newRowBytesBit = 19 -reallocPixBit = 20 -clipPixBit = 28 -stretchPixBit = 29 -ditherPixBit = 30 -gwFlagErrBit = 31 -pixPurge = 1L << pixPurgeBit -noNewDevice = 1L << noNewDeviceBit -useTempMem = 1L << useTempMemBit -keepLocal = 1L << keepLocalBit -useDistantHdwrMem = 1L << useDistantHdwrMemBit -useLocalHdwrMem = 1L << useLocalHdwrMemBit -pixelsPurgeable = 1L << pixelsPurgeableBit -pixelsLocked = 1L << pixelsLockedBit -kAllocDirectDrawSurface = 1L << 14 -mapPix = 1L << mapPixBit -newDepth = 1L << newDepthBit -alignPix = 1L << alignPixBit -newRowBytes = 1L << newRowBytesBit -reallocPix = 1L << reallocPixBit -clipPix = 1L << clipPixBit -stretchPix = 1L << stretchPixBit -ditherPix = 1L << ditherPixBit -gwFlagErr = 1L << gwFlagErrBit -deviceIsIndirect = (1L << 0) -deviceNeedsLock = (1L << 1) -deviceIsStatic = (1L << 2) -deviceIsExternalBuffer = (1L << 3) -deviceIsDDSurface = (1L << 4) -deviceIsDCISurface = (1L << 5) -deviceIsGDISurface = (1L << 6) -deviceIsAScreen = (1L << 7) -deviceIsOverlaySurface = (1L << 8) diff --git a/sys/lib/python/plat-mac/Carbon/Qd.py b/sys/lib/python/plat-mac/Carbon/Qd.py deleted file mode 100644 index 227fe9855..000000000 --- a/sys/lib/python/plat-mac/Carbon/Qd.py +++ /dev/null @@ -1 +0,0 @@ -from _Qd import * diff --git a/sys/lib/python/plat-mac/Carbon/Qdoffs.py b/sys/lib/python/plat-mac/Carbon/Qdoffs.py deleted file mode 100644 index 90a3d2cec..000000000 --- a/sys/lib/python/plat-mac/Carbon/Qdoffs.py +++ /dev/null @@ -1 +0,0 @@ -from _Qdoffs import * diff --git a/sys/lib/python/plat-mac/Carbon/Qt.py b/sys/lib/python/plat-mac/Carbon/Qt.py deleted file mode 100644 index 590a92ad1..000000000 --- a/sys/lib/python/plat-mac/Carbon/Qt.py +++ /dev/null @@ -1,5 +0,0 @@ -from _Qt import * -try: - _ = AddFilePreview -except: - raise ImportError, "Old (2.3) _Qt.so module loaded in stead of new (2.4) _Qt.so" diff --git a/sys/lib/python/plat-mac/Carbon/QuickDraw.py b/sys/lib/python/plat-mac/Carbon/QuickDraw.py deleted file mode 100644 index 65c2f9a94..000000000 --- a/sys/lib/python/plat-mac/Carbon/QuickDraw.py +++ /dev/null @@ -1,218 +0,0 @@ -# Generated from 'QuickDraw.h' - - -def FOUR_CHAR_CODE(x): return x -normal = 0 -bold = 1 -italic = 2 -underline = 4 -outline = 8 -shadow = 0x10 -condense = 0x20 -extend = 0x40 -invalColReq = -1 -srcCopy = 0 -srcOr = 1 -srcXor = 2 -srcBic = 3 -notSrcCopy = 4 -notSrcOr = 5 -notSrcXor = 6 -notSrcBic = 7 -patCopy = 8 -patOr = 9 -patXor = 10 -patBic = 11 -notPatCopy = 12 -notPatOr = 13 -notPatXor = 14 -notPatBic = 15 -grayishTextOr = 49 -hilitetransfermode = 50 -hilite = 50 -blend = 32 -addPin = 33 -addOver = 34 -subPin = 35 -addMax = 37 -adMax = 37 -subOver = 38 -adMin = 39 -ditherCopy = 64 -transparent = 36 -italicBit = 1 -ulineBit = 2 -outlineBit = 3 -shadowBit = 4 -condenseBit = 5 -extendBit = 6 -normalBit = 0 -inverseBit = 1 -redBit = 4 -greenBit = 3 -blueBit = 2 -cyanBit = 8 -magentaBit = 7 -yellowBit = 6 -blackBit = 5 -blackColor = 33 -whiteColor = 30 -redColor = 205 -greenColor = 341 -blueColor = 409 -cyanColor = 273 -magentaColor = 137 -yellowColor = 69 -picLParen = 0 -picRParen = 1 -clutType = 0 -fixedType = 1 -directType = 2 -gdDevType = 0 -interlacedDevice = 2 -hwMirroredDevice = 4 -roundedDevice = 5 -hasAuxMenuBar = 6 -burstDevice = 7 -ext32Device = 8 -ramInit = 10 -mainScreen = 11 -allInit = 12 -screenDevice = 13 -noDriver = 14 -screenActive = 15 -hiliteBit = 7 -pHiliteBit = 0 -defQDColors = 127 -RGBDirect = 16 -baseAddr32 = 4 -sysPatListID = 0 -iBeamCursor = 1 -crossCursor = 2 -plusCursor = 3 -watchCursor = 4 -kQDGrafVerbFrame = 0 -kQDGrafVerbPaint = 1 -kQDGrafVerbErase = 2 -kQDGrafVerbInvert = 3 -kQDGrafVerbFill = 4 -frame = kQDGrafVerbFrame -paint = kQDGrafVerbPaint -erase = kQDGrafVerbErase -invert = kQDGrafVerbInvert -fill = kQDGrafVerbFill -chunky = 0 -chunkyPlanar = 1 -planar = 2 -singleDevicesBit = 0 -dontMatchSeedsBit = 1 -allDevicesBit = 2 -singleDevices = 1 << singleDevicesBit -dontMatchSeeds = 1 << dontMatchSeedsBit -allDevices = 1 << allDevicesBit -kPrinterFontStatus = 0 -kPrinterScalingStatus = 1 -kNoConstraint = 0 -kVerticalConstraint = 1 -kHorizontalConstraint = 2 -k1MonochromePixelFormat = 0x00000001 -k2IndexedPixelFormat = 0x00000002 -k4IndexedPixelFormat = 0x00000004 -k8IndexedPixelFormat = 0x00000008 -k16BE555PixelFormat = 0x00000010 -k24RGBPixelFormat = 0x00000018 -k32ARGBPixelFormat = 0x00000020 -k1IndexedGrayPixelFormat = 0x00000021 -k2IndexedGrayPixelFormat = 0x00000022 -k4IndexedGrayPixelFormat = 0x00000024 -k8IndexedGrayPixelFormat = 0x00000028 -k16LE555PixelFormat = FOUR_CHAR_CODE('L555') -k16LE5551PixelFormat = FOUR_CHAR_CODE('5551') -k16BE565PixelFormat = FOUR_CHAR_CODE('B565') -k16LE565PixelFormat = FOUR_CHAR_CODE('L565') -k24BGRPixelFormat = FOUR_CHAR_CODE('24BG') -k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA') -k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR') -k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA') -kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs') -kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu') -kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9') -kYUV411PixelFormat = FOUR_CHAR_CODE('Y411') -kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU') -kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY') -kYUV211PixelFormat = FOUR_CHAR_CODE('Y211') -k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy') -kCursorImageMajorVersion = 0x0001 -kCursorImageMinorVersion = 0x0000 -kQDParseRegionFromTop = (1 << 0) -kQDParseRegionFromBottom = (1 << 1) -kQDParseRegionFromLeft = (1 << 2) -kQDParseRegionFromRight = (1 << 3) -kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft -kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight -kQDRegionToRectsMsgInit = 1 -kQDRegionToRectsMsgParse = 2 -kQDRegionToRectsMsgTerminate = 3 -colorXorXFer = 52 -noiseXFer = 53 -customXFer = 54 -kXFer1PixelAtATime = 0x00000001 -kXFerConvertPixelToRGB32 = 0x00000002 -kCursorComponentsVersion = 0x00010001 -kCursorComponentType = FOUR_CHAR_CODE('curs') -cursorDoesAnimate = 1L << 0 -cursorDoesHardware = 1L << 1 -cursorDoesUnreadableScreenBits = 1L << 2 -kRenderCursorInHardware = 1L << 0 -kRenderCursorInSoftware = 1L << 1 -kCursorComponentInit = 0x0001 -kCursorComponentGetInfo = 0x0002 -kCursorComponentSetOutputMode = 0x0003 -kCursorComponentSetData = 0x0004 -kCursorComponentReconfigure = 0x0005 -kCursorComponentDraw = 0x0006 -kCursorComponentErase = 0x0007 -kCursorComponentMove = 0x0008 -kCursorComponentAnimate = 0x0009 -kCursorComponentLastReserved = 0x0050 -# Generated from 'QuickDrawText.h' - - -def FOUR_CHAR_CODE(x): return x -normal = 0 -bold = 1 -italic = 2 -underline = 4 -outline = 8 -shadow = 0x10 -condense = 0x20 -extend = 0x40 -leftCaret = 0 -rightCaret = -1 -kHilite = 1 -smLeftCaret = 0 -smRightCaret = -1 -smHilite = 1 -onlyStyleRun = 0 -leftStyleRun = 1 -rightStyleRun = 2 -middleStyleRun = 3 -smOnlyStyleRun = 0 -smLeftStyleRun = 1 -smRightStyleRun = 2 -smMiddleStyleRun = 3 -truncEnd = 0 -truncMiddle = 0x4000 -smTruncEnd = 0 -smTruncMiddle = 0x4000 -notTruncated = 0 -truncated = 1 -truncErr = -1 -smNotTruncated = 0 -smTruncated = 1 -smTruncErr = -1 -smBreakWord = 0 -smBreakChar = 1 -smBreakOverflow = 2 -tfAntiAlias = 1 << 0 -tfUnicode = 1 << 1 diff --git a/sys/lib/python/plat-mac/Carbon/QuickTime.py b/sys/lib/python/plat-mac/Carbon/QuickTime.py deleted file mode 100644 index 8fba58cb3..000000000 --- a/sys/lib/python/plat-mac/Carbon/QuickTime.py +++ /dev/null @@ -1,3468 +0,0 @@ -# Generated from 'Movies.h' - -def FOUR_CHAR_CODE(x): return x -xmlIdentifierUnrecognized = -1 -kControllerMinimum = -0xf777 -notImplementedMusicOSErr = -2071 -cantSendToSynthesizerOSErr = -2072 -cantReceiveFromSynthesizerOSErr = -2073 -illegalVoiceAllocationOSErr = -2074 -illegalPartOSErr = -2075 -illegalChannelOSErr = -2076 -illegalKnobOSErr = -2077 -illegalKnobValueOSErr = -2078 -illegalInstrumentOSErr = -2079 -illegalControllerOSErr = -2080 -midiManagerAbsentOSErr = -2081 -synthesizerNotRespondingOSErr = -2082 -synthesizerOSErr = -2083 -illegalNoteChannelOSErr = -2084 -noteChannelNotAllocatedOSErr = -2085 -tunePlayerFullOSErr = -2086 -tuneParseOSErr = -2087 -MovieFileType = FOUR_CHAR_CODE('MooV') -MovieScrapType = FOUR_CHAR_CODE('moov') -MovieResourceType = FOUR_CHAR_CODE('moov') -MovieForwardPointerResourceType = FOUR_CHAR_CODE('fore') -MovieBackwardPointerResourceType = FOUR_CHAR_CODE('back') -MovieResourceAtomType = FOUR_CHAR_CODE('moov') -MovieDataAtomType = FOUR_CHAR_CODE('mdat') -FreeAtomType = FOUR_CHAR_CODE('free') -SkipAtomType = FOUR_CHAR_CODE('skip') -WideAtomPlaceholderType = FOUR_CHAR_CODE('wide') -MediaHandlerType = FOUR_CHAR_CODE('mhlr') -DataHandlerType = FOUR_CHAR_CODE('dhlr') -VideoMediaType = FOUR_CHAR_CODE('vide') -SoundMediaType = FOUR_CHAR_CODE('soun') -TextMediaType = FOUR_CHAR_CODE('text') -BaseMediaType = FOUR_CHAR_CODE('gnrc') -MPEGMediaType = FOUR_CHAR_CODE('MPEG') -MusicMediaType = FOUR_CHAR_CODE('musi') -TimeCodeMediaType = FOUR_CHAR_CODE('tmcd') -SpriteMediaType = FOUR_CHAR_CODE('sprt') -FlashMediaType = FOUR_CHAR_CODE('flsh') -MovieMediaType = FOUR_CHAR_CODE('moov') -TweenMediaType = FOUR_CHAR_CODE('twen') -ThreeDeeMediaType = FOUR_CHAR_CODE('qd3d') -SkinMediaType = FOUR_CHAR_CODE('skin') -HandleDataHandlerSubType = FOUR_CHAR_CODE('hndl') -PointerDataHandlerSubType = FOUR_CHAR_CODE('ptr ') -NullDataHandlerSubType = FOUR_CHAR_CODE('null') -ResourceDataHandlerSubType = FOUR_CHAR_CODE('rsrc') -URLDataHandlerSubType = FOUR_CHAR_CODE('url ') -WiredActionHandlerType = FOUR_CHAR_CODE('wire') -VisualMediaCharacteristic = FOUR_CHAR_CODE('eyes') -AudioMediaCharacteristic = FOUR_CHAR_CODE('ears') -kCharacteristicCanSendVideo = FOUR_CHAR_CODE('vsnd') -kCharacteristicProvidesActions = FOUR_CHAR_CODE('actn') -kCharacteristicNonLinear = FOUR_CHAR_CODE('nonl') -kCharacteristicCanStep = FOUR_CHAR_CODE('step') -kCharacteristicHasNoDuration = FOUR_CHAR_CODE('noti') -kCharacteristicHasSkinData = FOUR_CHAR_CODE('skin') -kCharacteristicProvidesKeyFocus = FOUR_CHAR_CODE('keyf') -kUserDataMovieControllerType = FOUR_CHAR_CODE('ctyp') -kUserDataName = FOUR_CHAR_CODE('name') -kUserDataTextAlbum = FOUR_CHAR_CODE('\xa9alb') -kUserDataTextArtist = FOUR_CHAR_CODE('\xa9ART') -kUserDataTextAuthor = FOUR_CHAR_CODE('\xa9aut') -kUserDataTextChapter = FOUR_CHAR_CODE('\xa9chp') -kUserDataTextComment = FOUR_CHAR_CODE('\xa9cmt') -kUserDataTextComposer = FOUR_CHAR_CODE('\xa9com') -kUserDataTextCopyright = FOUR_CHAR_CODE('\xa9cpy') -kUserDataTextCreationDate = FOUR_CHAR_CODE('\xa9day') -kUserDataTextDescription = FOUR_CHAR_CODE('\xa9des') -kUserDataTextDirector = FOUR_CHAR_CODE('\xa9dir') -kUserDataTextDisclaimer = FOUR_CHAR_CODE('\xa9dis') -kUserDataTextEncodedBy = FOUR_CHAR_CODE('\xa9enc') -kUserDataTextFullName = FOUR_CHAR_CODE('\xa9nam') -kUserDataTextGenre = FOUR_CHAR_CODE('\xa9gen') -kUserDataTextHostComputer = FOUR_CHAR_CODE('\xa9hst') -kUserDataTextInformation = FOUR_CHAR_CODE('\xa9inf') -kUserDataTextKeywords = FOUR_CHAR_CODE('\xa9key') -kUserDataTextMake = FOUR_CHAR_CODE('\xa9mak') -kUserDataTextModel = FOUR_CHAR_CODE('\xa9mod') -kUserDataTextOriginalArtist = FOUR_CHAR_CODE('\xa9ope') -kUserDataTextOriginalFormat = FOUR_CHAR_CODE('\xa9fmt') -kUserDataTextOriginalSource = FOUR_CHAR_CODE('\xa9src') -kUserDataTextPerformers = FOUR_CHAR_CODE('\xa9prf') -kUserDataTextProducer = FOUR_CHAR_CODE('\xa9prd') -kUserDataTextProduct = FOUR_CHAR_CODE('\xa9PRD') -kUserDataTextSoftware = FOUR_CHAR_CODE('\xa9swr') -kUserDataTextSpecialPlaybackRequirements = FOUR_CHAR_CODE('\xa9req') -kUserDataTextTrack = FOUR_CHAR_CODE('\xa9trk') -kUserDataTextWarning = FOUR_CHAR_CODE('\xa9wrn') -kUserDataTextWriter = FOUR_CHAR_CODE('\xa9wrt') -kUserDataTextURLLink = FOUR_CHAR_CODE('\xa9url') -kUserDataTextEditDate1 = FOUR_CHAR_CODE('\xa9ed1') -kUserDataUnicodeBit = 1L << 7 -DoTheRightThing = 0 -kQTNetworkStatusNoNetwork = -2 -kQTNetworkStatusUncertain = -1 -kQTNetworkStatusNotConnected = 0 -kQTNetworkStatusConnected = 1 -kMusicFlagDontPlay2Soft = 1L << 0 -kMusicFlagDontSlaveToMovie = 1L << 1 -dfDontDisplay = 1 << 0 -dfDontAutoScale = 1 << 1 -dfClipToTextBox = 1 << 2 -dfUseMovieBGColor = 1 << 3 -dfShrinkTextBoxToFit = 1 << 4 -dfScrollIn = 1 << 5 -dfScrollOut = 1 << 6 -dfHorizScroll = 1 << 7 -dfReverseScroll = 1 << 8 -dfContinuousScroll = 1 << 9 -dfFlowHoriz = 1 << 10 -dfContinuousKaraoke = 1 << 11 -dfDropShadow = 1 << 12 -dfAntiAlias = 1 << 13 -dfKeyedText = 1 << 14 -dfInverseHilite = 1 << 15 -dfTextColorHilite = 1 << 16 -searchTextDontGoToFoundTime = 1L << 16 -searchTextDontHiliteFoundText = 1L << 17 -searchTextOneTrackOnly = 1L << 18 -searchTextEnabledTracksOnly = 1L << 19 -kTextTextHandle = 1 -kTextTextPtr = 2 -kTextTEStyle = 3 -kTextSelection = 4 -kTextBackColor = 5 -kTextForeColor = 6 -kTextFace = 7 -kTextFont = 8 -kTextSize = 9 -kTextAlignment = 10 -kTextHilite = 11 -kTextDropShadow = 12 -kTextDisplayFlags = 13 -kTextScroll = 14 -kTextRelativeScroll = 15 -kTextHyperTextFace = 16 -kTextHyperTextColor = 17 -kTextKeyEntry = 18 -kTextMouseDown = 19 -kTextTextBox = 20 -kTextEditState = 21 -kTextLength = 22 -k3DMediaRendererEntry = FOUR_CHAR_CODE('rend') -k3DMediaRendererName = FOUR_CHAR_CODE('name') -k3DMediaRendererCode = FOUR_CHAR_CODE('rcod') -movieProgressOpen = 0 -movieProgressUpdatePercent = 1 -movieProgressClose = 2 -progressOpFlatten = 1 -progressOpInsertTrackSegment = 2 -progressOpInsertMovieSegment = 3 -progressOpPaste = 4 -progressOpAddMovieSelection = 5 -progressOpCopy = 6 -progressOpCut = 7 -progressOpLoadMovieIntoRam = 8 -progressOpLoadTrackIntoRam = 9 -progressOpLoadMediaIntoRam = 10 -progressOpImportMovie = 11 -progressOpExportMovie = 12 -mediaQualityDraft = 0x0000 -mediaQualityNormal = 0x0040 -mediaQualityBetter = 0x0080 -mediaQualityBest = 0x00C0 -kQTEventPayloadIsQTList = 1L << 0 -kActionMovieSetVolume = 1024 -kActionMovieSetRate = 1025 -kActionMovieSetLoopingFlags = 1026 -kActionMovieGoToTime = 1027 -kActionMovieGoToTimeByName = 1028 -kActionMovieGoToBeginning = 1029 -kActionMovieGoToEnd = 1030 -kActionMovieStepForward = 1031 -kActionMovieStepBackward = 1032 -kActionMovieSetSelection = 1033 -kActionMovieSetSelectionByName = 1034 -kActionMoviePlaySelection = 1035 -kActionMovieSetLanguage = 1036 -kActionMovieChanged = 1037 -kActionMovieRestartAtTime = 1038 -kActionMovieGotoNextChapter = 1039 -kActionMovieGotoPreviousChapter = 1040 -kActionMovieGotoFirstChapter = 1041 -kActionMovieGotoLastChapter = 1042 -kActionMovieGotoChapterByIndex = 1043 -kActionMovieSetScale = 1044 -kActionTrackSetVolume = 2048 -kActionTrackSetBalance = 2049 -kActionTrackSetEnabled = 2050 -kActionTrackSetMatrix = 2051 -kActionTrackSetLayer = 2052 -kActionTrackSetClip = 2053 -kActionTrackSetCursor = 2054 -kActionTrackSetGraphicsMode = 2055 -kActionTrackSetIdleFrequency = 2056 -kActionTrackSetBassTreble = 2057 -kActionSpriteSetMatrix = 3072 -kActionSpriteSetImageIndex = 3073 -kActionSpriteSetVisible = 3074 -kActionSpriteSetLayer = 3075 -kActionSpriteSetGraphicsMode = 3076 -kActionSpritePassMouseToCodec = 3078 -kActionSpriteClickOnCodec = 3079 -kActionSpriteTranslate = 3080 -kActionSpriteScale = 3081 -kActionSpriteRotate = 3082 -kActionSpriteStretch = 3083 -kActionSpriteSetCanBeHitTested = 3094 -kActionQTVRSetPanAngle = 4096 -kActionQTVRSetTiltAngle = 4097 -kActionQTVRSetFieldOfView = 4098 -kActionQTVRShowDefaultView = 4099 -kActionQTVRGoToNodeID = 4100 -kActionQTVREnableHotSpot = 4101 -kActionQTVRShowHotSpots = 4102 -kActionQTVRTranslateObject = 4103 -kActionQTVRSetViewState = 4109 -kActionMusicPlayNote = 5120 -kActionMusicSetController = 5121 -kActionCase = 6144 -kActionWhile = 6145 -kActionGoToURL = 6146 -kActionSendQTEventToSprite = 6147 -kActionDebugStr = 6148 -kActionPushCurrentTime = 6149 -kActionPushCurrentTimeWithLabel = 6150 -kActionPopAndGotoTopTime = 6151 -kActionPopAndGotoLabeledTime = 6152 -kActionStatusString = 6153 -kActionSendQTEventToTrackObject = 6154 -kActionAddChannelSubscription = 6155 -kActionRemoveChannelSubscription = 6156 -kActionOpenCustomActionHandler = 6157 -kActionDoScript = 6158 -kActionDoCompressedActions = 6159 -kActionSendAppMessage = 6160 -kActionLoadComponent = 6161 -kActionSetFocus = 6162 -kActionDontPassKeyEvent = 6163 -kActionSetRandomSeed = 6164 -kActionSpriteTrackSetVariable = 7168 -kActionSpriteTrackNewSprite = 7169 -kActionSpriteTrackDisposeSprite = 7170 -kActionSpriteTrackSetVariableToString = 7171 -kActionSpriteTrackConcatVariables = 7172 -kActionSpriteTrackSetVariableToMovieURL = 7173 -kActionSpriteTrackSetVariableToMovieBaseURL = 7174 -kActionSpriteTrackSetAllSpritesHitTestingMode = 7181 -kActionSpriteTrackNewImage = 7182 -kActionSpriteTrackDisposeImage = 7183 -kActionApplicationNumberAndString = 8192 -kActionQD3DNamedObjectTranslateTo = 9216 -kActionQD3DNamedObjectScaleTo = 9217 -kActionQD3DNamedObjectRotateTo = 9218 -kActionFlashTrackSetPan = 10240 -kActionFlashTrackSetZoom = 10241 -kActionFlashTrackSetZoomRect = 10242 -kActionFlashTrackGotoFrameNumber = 10243 -kActionFlashTrackGotoFrameLabel = 10244 -kActionFlashTrackSetFlashVariable = 10245 -kActionFlashTrackDoButtonActions = 10246 -kActionMovieTrackAddChildMovie = 11264 -kActionMovieTrackLoadChildMovie = 11265 -kActionMovieTrackLoadChildMovieWithQTListParams = 11266 -kActionTextTrackPasteText = 12288 -kActionTextTrackSetTextBox = 12291 -kActionTextTrackSetTextStyle = 12292 -kActionTextTrackSetSelection = 12293 -kActionTextTrackSetBackgroundColor = 12294 -kActionTextTrackSetForegroundColor = 12295 -kActionTextTrackSetFace = 12296 -kActionTextTrackSetFont = 12297 -kActionTextTrackSetSize = 12298 -kActionTextTrackSetAlignment = 12299 -kActionTextTrackSetHilite = 12300 -kActionTextTrackSetDropShadow = 12301 -kActionTextTrackSetDisplayFlags = 12302 -kActionTextTrackSetScroll = 12303 -kActionTextTrackRelativeScroll = 12304 -kActionTextTrackFindText = 12305 -kActionTextTrackSetHyperTextFace = 12306 -kActionTextTrackSetHyperTextColor = 12307 -kActionTextTrackKeyEntry = 12308 -kActionTextTrackMouseDown = 12309 -kActionTextTrackSetEditable = 12310 -kActionListAddElement = 13312 -kActionListRemoveElements = 13313 -kActionListSetElementValue = 13314 -kActionListPasteFromXML = 13315 -kActionListSetMatchingFromXML = 13316 -kActionListSetFromURL = 13317 -kActionListExchangeLists = 13318 -kActionListServerQuery = 13319 -kOperandExpression = 1 -kOperandConstant = 2 -kOperandSubscribedToChannel = 3 -kOperandUniqueCustomActionHandlerID = 4 -kOperandCustomActionHandlerIDIsOpen = 5 -kOperandConnectionSpeed = 6 -kOperandGMTDay = 7 -kOperandGMTMonth = 8 -kOperandGMTYear = 9 -kOperandGMTHours = 10 -kOperandGMTMinutes = 11 -kOperandGMTSeconds = 12 -kOperandLocalDay = 13 -kOperandLocalMonth = 14 -kOperandLocalYear = 15 -kOperandLocalHours = 16 -kOperandLocalMinutes = 17 -kOperandLocalSeconds = 18 -kOperandRegisteredForQuickTimePro = 19 -kOperandPlatformRunningOn = 20 -kOperandQuickTimeVersion = 21 -kOperandComponentVersion = 22 -kOperandOriginalHandlerRefcon = 23 -kOperandTicks = 24 -kOperandMaxLoadedTimeInMovie = 25 -kOperandEventParameter = 26 -kOperandFreeMemory = 27 -kOperandNetworkStatus = 28 -kOperandQuickTimeVersionRegistered = 29 -kOperandSystemVersion = 30 -kOperandMovieVolume = 1024 -kOperandMovieRate = 1025 -kOperandMovieIsLooping = 1026 -kOperandMovieLoopIsPalindrome = 1027 -kOperandMovieTime = 1028 -kOperandMovieDuration = 1029 -kOperandMovieTimeScale = 1030 -kOperandMovieWidth = 1031 -kOperandMovieHeight = 1032 -kOperandMovieLoadState = 1033 -kOperandMovieTrackCount = 1034 -kOperandMovieIsActive = 1035 -kOperandMovieName = 1036 -kOperandMovieID = 1037 -kOperandMovieChapterCount = 1038 -kOperandMovieChapterIndex = 1039 -kOperandMovieChapterName = 1040 -kOperandMovieChapterNameByIndex = 1041 -kOperandMovieChapterIndexByName = 1042 -kOperandMovieAnnotation = 1043 -kOperandMovieConnectionFlags = 1044 -kOperandMovieConnectionString = 1045 -kOperandTrackVolume = 2048 -kOperandTrackBalance = 2049 -kOperandTrackEnabled = 2050 -kOperandTrackLayer = 2051 -kOperandTrackWidth = 2052 -kOperandTrackHeight = 2053 -kOperandTrackDuration = 2054 -kOperandTrackName = 2055 -kOperandTrackID = 2056 -kOperandTrackIdleFrequency = 2057 -kOperandTrackBass = 2058 -kOperandTrackTreble = 2059 -kOperandSpriteBoundsLeft = 3072 -kOperandSpriteBoundsTop = 3073 -kOperandSpriteBoundsRight = 3074 -kOperandSpriteBoundsBottom = 3075 -kOperandSpriteImageIndex = 3076 -kOperandSpriteVisible = 3077 -kOperandSpriteLayer = 3078 -kOperandSpriteTrackVariable = 3079 -kOperandSpriteTrackNumSprites = 3080 -kOperandSpriteTrackNumImages = 3081 -kOperandSpriteID = 3082 -kOperandSpriteIndex = 3083 -kOperandSpriteFirstCornerX = 3084 -kOperandSpriteFirstCornerY = 3085 -kOperandSpriteSecondCornerX = 3086 -kOperandSpriteSecondCornerY = 3087 -kOperandSpriteThirdCornerX = 3088 -kOperandSpriteThirdCornerY = 3089 -kOperandSpriteFourthCornerX = 3090 -kOperandSpriteFourthCornerY = 3091 -kOperandSpriteImageRegistrationPointX = 3092 -kOperandSpriteImageRegistrationPointY = 3093 -kOperandSpriteTrackSpriteIDAtPoint = 3094 -kOperandSpriteName = 3095 -kOperandSpriteCanBeHitTested = 3105 -kOperandSpriteTrackAllSpritesHitTestingMode = 3106 -kOperandSpriteTrackImageIDByIndex = 3107 -kOperandSpriteTrackImageIndexByID = 3108 -kOperandQTVRPanAngle = 4096 -kOperandQTVRTiltAngle = 4097 -kOperandQTVRFieldOfView = 4098 -kOperandQTVRNodeID = 4099 -kOperandQTVRHotSpotsVisible = 4100 -kOperandQTVRViewCenterH = 4101 -kOperandQTVRViewCenterV = 4102 -kOperandQTVRViewStateCount = 4103 -kOperandQTVRViewState = 4104 -kOperandMouseLocalHLoc = 5120 -kOperandMouseLocalVLoc = 5121 -kOperandKeyIsDown = 5122 -kOperandRandom = 5123 -kOperandCanHaveFocus = 5124 -kOperandHasFocus = 5125 -kOperandTextTrackEditable = 6144 -kOperandTextTrackCopyText = 6145 -kOperandTextTrackStartSelection = 6146 -kOperandTextTrackEndSelection = 6147 -kOperandTextTrackTextBoxLeft = 6148 -kOperandTextTrackTextBoxTop = 6149 -kOperandTextTrackTextBoxRight = 6150 -kOperandTextTrackTextBoxBottom = 6151 -kOperandTextTrackTextLength = 6152 -kOperandListCountElements = 7168 -kOperandListGetElementPathByIndex = 7169 -kOperandListGetElementValue = 7170 -kOperandListCopyToXML = 7171 -kOperandSin = 8192 -kOperandCos = 8193 -kOperandTan = 8194 -kOperandATan = 8195 -kOperandATan2 = 8196 -kOperandDegreesToRadians = 8197 -kOperandRadiansToDegrees = 8198 -kOperandSquareRoot = 8199 -kOperandExponent = 8200 -kOperandLog = 8201 -kOperandFlashTrackVariable = 9216 -kOperandStringLength = 10240 -kOperandStringCompare = 10241 -kOperandStringSubString = 10242 -kOperandStringConcat = 10243 -kFirstMovieAction = kActionMovieSetVolume -kLastMovieAction = kActionMovieSetScale -kFirstTrackAction = kActionTrackSetVolume -kLastTrackAction = kActionTrackSetBassTreble -kFirstSpriteAction = kActionSpriteSetMatrix -kLastSpriteAction = kActionSpriteSetCanBeHitTested -kFirstQTVRAction = kActionQTVRSetPanAngle -kLastQTVRAction = kActionQTVRSetViewState -kFirstMusicAction = kActionMusicPlayNote -kLastMusicAction = kActionMusicSetController -kFirstSystemAction = kActionCase -kLastSystemAction = kActionSetRandomSeed -kFirstSpriteTrackAction = kActionSpriteTrackSetVariable -kLastSpriteTrackAction = kActionSpriteTrackDisposeImage -kFirstApplicationAction = kActionApplicationNumberAndString -kLastApplicationAction = kActionApplicationNumberAndString -kFirstQD3DNamedObjectAction = kActionQD3DNamedObjectTranslateTo -kLastQD3DNamedObjectAction = kActionQD3DNamedObjectRotateTo -kFirstFlashTrackAction = kActionFlashTrackSetPan -kLastFlashTrackAction = kActionFlashTrackDoButtonActions -kFirstMovieTrackAction = kActionMovieTrackAddChildMovie -kLastMovieTrackAction = kActionMovieTrackLoadChildMovieWithQTListParams -kFirstTextTrackAction = kActionTextTrackPasteText -kLastTextTrackAction = kActionTextTrackSetEditable -kFirstMultiTargetAction = kActionListAddElement -kLastMultiTargetAction = kActionListServerQuery -kFirstAction = kFirstMovieAction -kLastAction = kLastMultiTargetAction -kTargetMovie = FOUR_CHAR_CODE('moov') -kTargetMovieName = FOUR_CHAR_CODE('mona') -kTargetMovieID = FOUR_CHAR_CODE('moid') -kTargetRootMovie = FOUR_CHAR_CODE('moro') -kTargetParentMovie = FOUR_CHAR_CODE('mopa') -kTargetChildMovieTrackName = FOUR_CHAR_CODE('motn') -kTargetChildMovieTrackID = FOUR_CHAR_CODE('moti') -kTargetChildMovieTrackIndex = FOUR_CHAR_CODE('motx') -kTargetChildMovieMovieName = FOUR_CHAR_CODE('momn') -kTargetChildMovieMovieID = FOUR_CHAR_CODE('momi') -kTargetTrackName = FOUR_CHAR_CODE('trna') -kTargetTrackID = FOUR_CHAR_CODE('trid') -kTargetTrackType = FOUR_CHAR_CODE('trty') -kTargetTrackIndex = FOUR_CHAR_CODE('trin') -kTargetSpriteName = FOUR_CHAR_CODE('spna') -kTargetSpriteID = FOUR_CHAR_CODE('spid') -kTargetSpriteIndex = FOUR_CHAR_CODE('spin') -kTargetQD3DNamedObjectName = FOUR_CHAR_CODE('nana') -kTargetCurrentQTEventParams = FOUR_CHAR_CODE('evpa') -kQTEventType = FOUR_CHAR_CODE('evnt') -kAction = FOUR_CHAR_CODE('actn') -kWhichAction = FOUR_CHAR_CODE('whic') -kActionParameter = FOUR_CHAR_CODE('parm') -kActionTarget = FOUR_CHAR_CODE('targ') -kActionFlags = FOUR_CHAR_CODE('flag') -kActionParameterMinValue = FOUR_CHAR_CODE('minv') -kActionParameterMaxValue = FOUR_CHAR_CODE('maxv') -kActionListAtomType = FOUR_CHAR_CODE('list') -kExpressionContainerAtomType = FOUR_CHAR_CODE('expr') -kConditionalAtomType = FOUR_CHAR_CODE('test') -kOperatorAtomType = FOUR_CHAR_CODE('oper') -kOperandAtomType = FOUR_CHAR_CODE('oprn') -kCommentAtomType = FOUR_CHAR_CODE('why ') -kCustomActionHandler = FOUR_CHAR_CODE('cust') -kCustomHandlerID = FOUR_CHAR_CODE('id ') -kCustomHandlerDesc = FOUR_CHAR_CODE('desc') -kQTEventRecordAtomType = FOUR_CHAR_CODE('erec') -kQTEventMouseClick = FOUR_CHAR_CODE('clik') -kQTEventMouseClickEnd = FOUR_CHAR_CODE('cend') -kQTEventMouseClickEndTriggerButton = FOUR_CHAR_CODE('trig') -kQTEventMouseEnter = FOUR_CHAR_CODE('entr') -kQTEventMouseExit = FOUR_CHAR_CODE('exit') -kQTEventMouseMoved = FOUR_CHAR_CODE('move') -kQTEventFrameLoaded = FOUR_CHAR_CODE('fram') -kQTEventIdle = FOUR_CHAR_CODE('idle') -kQTEventKey = FOUR_CHAR_CODE('key ') -kQTEventMovieLoaded = FOUR_CHAR_CODE('load') -kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') -kQTEventListReceived = FOUR_CHAR_CODE('list') -kQTEventKeyUp = FOUR_CHAR_CODE('keyU') -kActionFlagActionIsDelta = 1L << 1 -kActionFlagParameterWrapsAround = 1L << 2 -kActionFlagActionIsToggle = 1L << 3 -kStatusStringIsURLLink = 1L << 1 -kStatusStringIsStreamingStatus = 1L << 2 -kStatusHasCodeNumber = 1L << 3 -kStatusIsError = 1L << 4 -kScriptIsUnknownType = 1L << 0 -kScriptIsJavaScript = 1L << 1 -kScriptIsLingoEvent = 1L << 2 -kScriptIsVBEvent = 1L << 3 -kScriptIsProjectorCommand = 1L << 4 -kScriptIsAppleScript = 1L << 5 -kQTRegistrationDialogTimeOutFlag = 1 << 0 -kQTRegistrationDialogShowDialog = 1 << 1 -kQTRegistrationDialogForceDialog = 1 << 2 -kOperatorAdd = FOUR_CHAR_CODE('add ') -kOperatorSubtract = FOUR_CHAR_CODE('sub ') -kOperatorMultiply = FOUR_CHAR_CODE('mult') -kOperatorDivide = FOUR_CHAR_CODE('div ') -kOperatorOr = FOUR_CHAR_CODE('or ') -kOperatorAnd = FOUR_CHAR_CODE('and ') -kOperatorNot = FOUR_CHAR_CODE('not ') -kOperatorLessThan = FOUR_CHAR_CODE('< ') -kOperatorLessThanEqualTo = FOUR_CHAR_CODE('<= ') -kOperatorEqualTo = FOUR_CHAR_CODE('= ') -kOperatorNotEqualTo = FOUR_CHAR_CODE('!= ') -kOperatorGreaterThan = FOUR_CHAR_CODE('> ') -kOperatorGreaterThanEqualTo = FOUR_CHAR_CODE('>= ') -kOperatorModulo = FOUR_CHAR_CODE('mod ') -kOperatorIntegerDivide = FOUR_CHAR_CODE('idiv') -kOperatorAbsoluteValue = FOUR_CHAR_CODE('abs ') -kOperatorNegate = FOUR_CHAR_CODE('neg ') -kPlatformMacintosh = 1 -kPlatformWindows = 2 -kSystemIsWindows9x = 0x00010000 -kSystemIsWindowsNT = 0x00020000 -kMediaPropertyNonLinearAtomType = FOUR_CHAR_CODE('nonl') -kMediaPropertyHasActions = 105 -loopTimeBase = 1 -palindromeLoopTimeBase = 2 -maintainTimeBaseZero = 4 -triggerTimeFwd = 0x0001 -triggerTimeBwd = 0x0002 -triggerTimeEither = 0x0003 -triggerRateLT = 0x0004 -triggerRateGT = 0x0008 -triggerRateEqual = 0x0010 -triggerRateLTE = triggerRateLT | triggerRateEqual -triggerRateGTE = triggerRateGT | triggerRateEqual -triggerRateNotEqual = triggerRateGT | triggerRateEqual | triggerRateLT -triggerRateChange = 0 -triggerAtStart = 0x0001 -triggerAtStop = 0x0002 -timeBaseBeforeStartTime = 1 -timeBaseAfterStopTime = 2 -callBackAtTime = 1 -callBackAtRate = 2 -callBackAtTimeJump = 3 -callBackAtExtremes = 4 -callBackAtTimeBaseDisposed = 5 -callBackAtInterrupt = 0x8000 -callBackAtDeferredTask = 0x4000 -qtcbNeedsRateChanges = 1 -qtcbNeedsTimeChanges = 2 -qtcbNeedsStartStopChanges = 4 -keepInRam = 1 << 0 -unkeepInRam = 1 << 1 -flushFromRam = 1 << 2 -loadForwardTrackEdits = 1 << 3 -loadBackwardTrackEdits = 1 << 4 -newMovieActive = 1 << 0 -newMovieDontResolveDataRefs = 1 << 1 -newMovieDontAskUnresolvedDataRefs = 1 << 2 -newMovieDontAutoAlternates = 1 << 3 -newMovieDontUpdateForeBackPointers = 1 << 4 -newMovieDontAutoUpdateClock = 1 << 5 -newMovieAsyncOK = 1 << 8 -newMovieIdleImportOK = 1 << 10 -newMovieDontInteractWithUser = 1 << 11 -trackUsageInMovie = 1 << 1 -trackUsageInPreview = 1 << 2 -trackUsageInPoster = 1 << 3 -mediaSampleNotSync = 1 << 0 -mediaSampleShadowSync = 1 << 1 -pasteInParallel = 1 << 0 -showUserSettingsDialog = 1 << 1 -movieToFileOnlyExport = 1 << 2 -movieFileSpecValid = 1 << 3 -nextTimeMediaSample = 1 << 0 -nextTimeMediaEdit = 1 << 1 -nextTimeTrackEdit = 1 << 2 -nextTimeSyncSample = 1 << 3 -nextTimeStep = 1 << 4 -nextTimeEdgeOK = 1 << 14 -nextTimeIgnoreActiveSegment = 1 << 15 -createMovieFileDeleteCurFile = 1L << 31 -createMovieFileDontCreateMovie = 1L << 30 -createMovieFileDontOpenFile = 1L << 29 -createMovieFileDontCreateResFile = 1L << 28 -flattenAddMovieToDataFork = 1L << 0 -flattenActiveTracksOnly = 1L << 2 -flattenDontInterleaveFlatten = 1L << 3 -flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 -flattenCompressMovieResource = 1L << 5 -flattenForceMovieResourceBeforeMovieData = 1L << 6 -movieInDataForkResID = -1 -mcTopLeftMovie = 1 << 0 -mcScaleMovieToFit = 1 << 1 -mcWithBadge = 1 << 2 -mcNotVisible = 1 << 3 -mcWithFrame = 1 << 4 -movieScrapDontZeroScrap = 1 << 0 -movieScrapOnlyPutMovie = 1 << 1 -dataRefSelfReference = 1 << 0 -dataRefWasNotResolved = 1 << 1 -kMovieAnchorDataRefIsDefault = 1 << 0 -hintsScrubMode = 1 << 0 -hintsLoop = 1 << 1 -hintsDontPurge = 1 << 2 -hintsUseScreenBuffer = 1 << 5 -hintsAllowInterlace = 1 << 6 -hintsUseSoundInterp = 1 << 7 -hintsHighQuality = 1 << 8 -hintsPalindrome = 1 << 9 -hintsInactive = 1 << 11 -hintsOffscreen = 1 << 12 -hintsDontDraw = 1 << 13 -hintsAllowBlacklining = 1 << 14 -hintsDontUseVideoOverlaySurface = 1 << 16 -hintsIgnoreBandwidthRestrictions = 1 << 17 -hintsPlayingEveryFrame = 1 << 18 -hintsAllowDynamicResize = 1 << 19 -hintsSingleField = 1 << 20 -hintsNoRenderingTimeOut = 1 << 21 -hintsFlushVideoInsteadOfDirtying = 1 << 22 -hintsEnableSubPixelPositioning = 1L << 23 -mediaHandlerFlagBaseClient = 1 -movieTrackMediaType = 1 << 0 -movieTrackCharacteristic = 1 << 1 -movieTrackEnabledOnly = 1 << 2 -kMovieControlOptionHideController = (1L << 0) -kMovieControlOptionLocateTopLeft = (1L << 1) -kMovieControlOptionEnableEditing = (1L << 2) -kMovieControlOptionHandleEditingHI = (1L << 3) -kMovieControlOptionSetKeysEnabled = (1L << 4) -kMovieControlOptionManuallyIdled = (1L << 5) -kMovieControlDataMovieController = FOUR_CHAR_CODE('mc ') -kMovieControlDataMovie = FOUR_CHAR_CODE('moov') -kMovieControlDataManualIdling = FOUR_CHAR_CODE('manu') -movieDrawingCallWhenChanged = 0 -movieDrawingCallAlways = 1 -kQTCloneShareSamples = 1 << 0 -kQTCloneDontCopyEdits = 1 << 1 -kGetMovieImporterValidateToFind = 1L << 0 -kGetMovieImporterAllowNewFile = 1L << 1 -kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 -kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 -kGetMovieImporterAutoImportOnly = 1L << 10 -kQTGetMIMETypeInfoIsQuickTimeMovieType = FOUR_CHAR_CODE('moov') -kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb') -kQTCopyUserDataReplace = FOUR_CHAR_CODE('rplc') -kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg') -kMovieLoadStateError = -1L -kMovieLoadStateLoading = 1000 -kMovieLoadStateLoaded = 2000 -kMovieLoadStatePlayable = 10000 -kMovieLoadStatePlaythroughOK = 20000 -kMovieLoadStateComplete = 100000L -kQTDontUseDataToFindImporter = 1L << 0 -kQTDontLookForMovieImporterIfGraphicsImporterFound = 1L << 1 -kQTAllowOpeningStillImagesAsMovies = 1L << 2 -kQTAllowImportersThatWouldCreateNewFile = 1L << 3 -kQTAllowAggressiveImporters = 1L << 4 -preloadAlways = 1L << 0 -preloadOnlyIfEnabled = 1L << 1 -fullScreenHideCursor = 1L << 0 -fullScreenAllowEvents = 1L << 1 -fullScreenDontChangeMenuBar = 1L << 2 -fullScreenPreflightSize = 1L << 3 -movieExecuteWiredActionDontExecute = 1L << 0 -kRefConNavigationNext = 0 -kRefConNavigationPrevious = 1 -kRefConPropertyCanHaveFocus = 1 -kRefConPropertyHasFocus = 2 -kTrackFocusCanEditFlag = FOUR_CHAR_CODE('kedt') -kTrackDefaultFocusFlags = FOUR_CHAR_CODE('kfoc') -kTrackFocusDefaultRefcon = FOUR_CHAR_CODE('kref') -kTrackFocusOn = 1 -kTrackHandlesTabs = 2 -kFlashTrackPropertyAcceptAllClicks = FOUR_CHAR_CODE('clik') -kBackgroundSpriteLayerNum = 32767 -kSpritePropertyMatrix = 1 -kSpritePropertyImageDescription = 2 -kSpritePropertyImageDataPtr = 3 -kSpritePropertyVisible = 4 -kSpritePropertyLayer = 5 -kSpritePropertyGraphicsMode = 6 -kSpritePropertyImageDataSize = 7 -kSpritePropertyActionHandlingSpriteID = 8 -kSpritePropertyCanBeHitTested = 9 -kSpritePropertyImageIndex = 100 -kSpriteTrackPropertyBackgroundColor = 101 -kSpriteTrackPropertyOffscreenBitDepth = 102 -kSpriteTrackPropertySampleFormat = 103 -kSpriteTrackPropertyScaleSpritesToScaleWorld = 104 -kSpriteTrackPropertyHasActions = 105 -kSpriteTrackPropertyVisible = 106 -kSpriteTrackPropertyQTIdleEventsFrequency = 107 -kSpriteTrackPropertyAllSpritesHitTestingMode = 108 -kSpriteTrackPropertyPreferredDepthInterpretationMode = 109 -kSpriteImagePropertyRegistrationPoint = 1000 -kSpriteImagePropertyGroupID = 1001 -kSpriteTrackPreferredDepthCompatibilityMode = 0 -kSpriteTrackPreferredDepthModernMode = 1 -kSpriteHitTestUseSpritesOwnPropertiesMode = 0 -kSpriteHitTestTreatAllSpritesAsHitTestableMode = 1 -kSpriteHitTestTreatAllSpritesAsNotHitTestableMode = 2 -kNoQTIdleEvents = -1 -kGetSpriteWorldInvalidRegionAndLeaveIntact = -1L -kGetSpriteWorldInvalidRegionAndThenSetEmpty = -2L -kOnlyDrawToSpriteWorld = 1L << 0 -kSpriteWorldPreflight = 1L << 1 -kSpriteWorldDidDraw = 1L << 0 -kSpriteWorldNeedsToDraw = 1L << 1 -kKeyFrameAndSingleOverride = 1L << 1 -kKeyFrameAndAllOverrides = 1L << 2 -kScaleSpritesToScaleWorld = 1L << 1 -kSpriteWorldHighQuality = 1L << 2 -kSpriteWorldDontAutoInvalidate = 1L << 3 -kSpriteWorldInvisible = 1L << 4 -kSpriteWorldDirtyInsteadOfFlush = 1L << 5 -kParentAtomIsContainer = 0 -kTweenRecordNoFlags = 0 -kTweenRecordIsAtInterruptTime = 0x00000001 -kEffectNameAtom = FOUR_CHAR_CODE('name') -kEffectTypeAtom = FOUR_CHAR_CODE('type') -kEffectManufacturerAtom = FOUR_CHAR_CODE('manu') -pdActionConfirmDialog = 1 -pdActionSetAppleMenu = 2 -pdActionSetEditMenu = 3 -pdActionGetDialogValues = 4 -pdActionSetPreviewUserItem = 5 -pdActionSetPreviewPicture = 6 -pdActionSetColorPickerEventProc = 7 -pdActionSetDialogTitle = 8 -pdActionGetSubPanelMenu = 9 -pdActionActivateSubPanel = 10 -pdActionConductStopAlert = 11 -pdActionModelessCallback = 12 -pdActionFetchPreview = 13 -pdActionSetDialogSettings = 14 -pdActionGetDialogSettings = 15 -pdActionGetNextSample = 16 -pdActionGetPreviousSample = 17 -pdActionCompactSample = 18 -pdActionSetEditCallout = 19 -pdActionSetSampleTime = 20 -pdActionDoEditCommand = 21 -pdActionGetSubPanelMenuValue = 22 -pdActionCustomNewControl = 23 -pdActionCustomDisposeControl = 24 -pdActionCustomPositionControl = 25 -pdActionCustomShowHideControl = 26 -pdActionCustomHandleEvent = 27 -pdActionCustomSetFocus = 28 -pdActionCustomSetEditMenu = 29 -pdActionCustomSetPreviewPicture = 30 -pdActionCustomSetEditCallout = 31 -pdActionCustomGetEnableValue = 32 -pdActionCustomSetSampleTime = 33 -pdActionCustomGetValue = 34 -pdActionCustomDoEditCommand = 35 -pdSampleTimeDisplayOptionsNone = 0x00000000 -pdActionFocusOff = 0 -pdActionFocusFirst = 1 -pdActionFocusLast = 2 -pdActionFocusForward = 3 -pdActionFocusBackward = 4 -elOptionsIncludeNoneInList = 0x00000001 -pdOptionsCollectOneValue = 0x00000001 -pdOptionsAllowOptionalInterpolations = 0x00000002 -pdOptionsModalDialogBox = 0x00000004 -pdOptionsEditCurrentEffectOnly = 0x00000008 -pdOptionsHidePreview = 0x00000010 -effectIsRealtime = 0 -kAccessKeyAtomType = FOUR_CHAR_CODE('acky') -kAccessKeySystemFlag = 1L << 0 -ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') -BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg') -kQTIdlePriority = 10 -kQTNonRealTimePriority = 20 -kQTRealTimeSharedPriority = 25 -kQTRealTimePriority = 30 -kQTBandwidthNotifyNeedToStop = 1L << 0 -kQTBandwidthNotifyGoodToGo = 1L << 1 -kQTBandwidthChangeRequest = 1L << 2 -kQTBandwidthQueueRequest = 1L << 3 -kQTBandwidthScheduledRequest = 1L << 4 -kQTBandwidthVoluntaryRelease = 1L << 5 -kITextRemoveEverythingBut = 0 << 1 -kITextRemoveLeaveSuggestedAlternate = 1 << 1 -kITextAtomType = FOUR_CHAR_CODE('itxt') -kITextStringAtomType = FOUR_CHAR_CODE('text') -kQTParseTextHREFText = FOUR_CHAR_CODE('text') -kQTParseTextHREFBaseURL = FOUR_CHAR_CODE('burl') -kQTParseTextHREFClickPoint = FOUR_CHAR_CODE('clik') -kQTParseTextHREFUseAltDelim = FOUR_CHAR_CODE('altd') -kQTParseTextHREFDelimiter = FOUR_CHAR_CODE('delm') -kQTParseTextHREFRecomposeHREF = FOUR_CHAR_CODE('rhrf') -kQTParseTextHREFURL = FOUR_CHAR_CODE('url ') -kQTParseTextHREFTarget = FOUR_CHAR_CODE('targ') -kQTParseTextHREFChapter = FOUR_CHAR_CODE('chap') -kQTParseTextHREFIsAutoHREF = FOUR_CHAR_CODE('auto') -kQTParseTextHREFIsServerMap = FOUR_CHAR_CODE('smap') -kQTParseTextHREFHREF = FOUR_CHAR_CODE('href') -kQTParseTextHREFEMBEDArgs = FOUR_CHAR_CODE('mbed') -kTrackReferenceChapterList = FOUR_CHAR_CODE('chap') -kTrackReferenceTimeCode = FOUR_CHAR_CODE('tmcd') -kTrackReferenceModifier = FOUR_CHAR_CODE('ssrc') -kTrackModifierInput = 0x696E -kTrackModifierType = 0x7479 -kTrackModifierReference = FOUR_CHAR_CODE('ssrc') -kTrackModifierObjectID = FOUR_CHAR_CODE('obid') -kTrackModifierInputName = FOUR_CHAR_CODE('name') -kInputMapSubInputID = FOUR_CHAR_CODE('subi') -kTrackModifierTypeMatrix = 1 -kTrackModifierTypeClip = 2 -kTrackModifierTypeGraphicsMode = 5 -kTrackModifierTypeVolume = 3 -kTrackModifierTypeBalance = 4 -kTrackModifierTypeImage = FOUR_CHAR_CODE('vide') -kTrackModifierObjectMatrix = 6 -kTrackModifierObjectGraphicsMode = 7 -kTrackModifierType3d4x4Matrix = 8 -kTrackModifierCameraData = 9 -kTrackModifierSoundLocalizationData = 10 -kTrackModifierObjectImageIndex = 11 -kTrackModifierObjectLayer = 12 -kTrackModifierObjectVisible = 13 -kTrackModifierAngleAspectCamera = 14 -kTrackModifierPanAngle = FOUR_CHAR_CODE('pan ') -kTrackModifierTiltAngle = FOUR_CHAR_CODE('tilt') -kTrackModifierVerticalFieldOfViewAngle = FOUR_CHAR_CODE('fov ') -kTrackModifierObjectQTEventSend = FOUR_CHAR_CODE('evnt') -kTrackModifierObjectCanBeHitTested = 15 -kTweenTypeShort = 1 -kTweenTypeLong = 2 -kTweenTypeFixed = 3 -kTweenTypePoint = 4 -kTweenTypeQDRect = 5 -kTweenTypeQDRegion = 6 -kTweenTypeMatrix = 7 -kTweenTypeRGBColor = 8 -kTweenTypeGraphicsModeWithRGBColor = 9 -kTweenTypeQTFloatSingle = 10 -kTweenTypeQTFloatDouble = 11 -kTweenTypeFixedPoint = 12 -kTweenType3dScale = FOUR_CHAR_CODE('3sca') -kTweenType3dTranslate = FOUR_CHAR_CODE('3tra') -kTweenType3dRotate = FOUR_CHAR_CODE('3rot') -kTweenType3dRotateAboutPoint = FOUR_CHAR_CODE('3rap') -kTweenType3dRotateAboutAxis = FOUR_CHAR_CODE('3rax') -kTweenType3dRotateAboutVector = FOUR_CHAR_CODE('3rvc') -kTweenType3dQuaternion = FOUR_CHAR_CODE('3qua') -kTweenType3dMatrix = FOUR_CHAR_CODE('3mat') -kTweenType3dCameraData = FOUR_CHAR_CODE('3cam') -kTweenType3dAngleAspectCameraData = FOUR_CHAR_CODE('3caa') -kTweenType3dSoundLocalizationData = FOUR_CHAR_CODE('3slc') -kTweenTypePathToMatrixTranslation = FOUR_CHAR_CODE('gxmt') -kTweenTypePathToMatrixRotation = FOUR_CHAR_CODE('gxpr') -kTweenTypePathToMatrixTranslationAndRotation = FOUR_CHAR_CODE('gxmr') -kTweenTypePathToFixedPoint = FOUR_CHAR_CODE('gxfp') -kTweenTypePathXtoY = FOUR_CHAR_CODE('gxxy') -kTweenTypePathYtoX = FOUR_CHAR_CODE('gxyx') -kTweenTypeAtomList = FOUR_CHAR_CODE('atom') -kTweenTypePolygon = FOUR_CHAR_CODE('poly') -kTweenTypeMultiMatrix = FOUR_CHAR_CODE('mulm') -kTweenTypeSpin = FOUR_CHAR_CODE('spin') -kTweenType3dMatrixNonLinear = FOUR_CHAR_CODE('3nlr') -kTweenType3dVRObject = FOUR_CHAR_CODE('3vro') -kTweenEntry = FOUR_CHAR_CODE('twen') -kTweenData = FOUR_CHAR_CODE('data') -kTweenType = FOUR_CHAR_CODE('twnt') -kTweenStartOffset = FOUR_CHAR_CODE('twst') -kTweenDuration = FOUR_CHAR_CODE('twdu') -kTweenFlags = FOUR_CHAR_CODE('flag') -kTweenOutputMin = FOUR_CHAR_CODE('omin') -kTweenOutputMax = FOUR_CHAR_CODE('omax') -kTweenSequenceElement = FOUR_CHAR_CODE('seqe') -kTween3dInitialCondition = FOUR_CHAR_CODE('icnd') -kTweenInterpolationID = FOUR_CHAR_CODE('intr') -kTweenRegionData = FOUR_CHAR_CODE('qdrg') -kTweenPictureData = FOUR_CHAR_CODE('PICT') -kListElementType = FOUR_CHAR_CODE('type') -kListElementDataType = FOUR_CHAR_CODE('daty') -kNameAtom = FOUR_CHAR_CODE('name') -kInitialRotationAtom = FOUR_CHAR_CODE('inro') -kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth') -kTweenReturnDelta = 1L << 0 -kQTRestrictionClassSave = FOUR_CHAR_CODE('save') -kQTRestrictionSaveDontAddMovieResource = (1L << 0) -kQTRestrictionSaveDontFlatten = (1L << 1) -kQTRestrictionSaveDontExport = (1L << 2) -kQTRestrictionSaveDontExtract = (1L << 3) -kQTRestrictionClassEdit = FOUR_CHAR_CODE('edit') -kQTRestrictionEditDontCopy = (1L << 0) -kQTRestrictionEditDontCut = (1L << 1) -kQTRestrictionEditDontPaste = (1L << 2) -kQTRestrictionEditDontClear = (1L << 3) -kQTRestrictionEditDontModify = (1L << 4) -kQTRestrictionEditDontExtract = (1L << 5) -videoFlagDontLeanAhead = 1L << 0 -txtProcDefaultDisplay = 0 -txtProcDontDisplay = 1 -txtProcDoDisplay = 2 -findTextEdgeOK = 1 << 0 -findTextCaseSensitive = 1 << 1 -findTextReverseSearch = 1 << 2 -findTextWrapAround = 1 << 3 -findTextUseOffset = 1 << 4 -dropShadowOffsetType = FOUR_CHAR_CODE('drpo') -dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') -spriteHitTestBounds = 1L << 0 -spriteHitTestImage = 1L << 1 -spriteHitTestInvisibleSprites = 1L << 2 -spriteHitTestIsClick = 1L << 3 -spriteHitTestLocInDisplayCoordinates = 1L << 4 -spriteHitTestTreatAllSpritesAsHitTestable = 1L << 5 -kSpriteAtomType = FOUR_CHAR_CODE('sprt') -kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') -kSpriteImageAtomType = FOUR_CHAR_CODE('imag') -kSpriteImageDataAtomType = FOUR_CHAR_CODE('imda') -kSpriteImageDataRefAtomType = FOUR_CHAR_CODE('imre') -kSpriteImageDataRefTypeAtomType = FOUR_CHAR_CODE('imrt') -kSpriteImageGroupIDAtomType = FOUR_CHAR_CODE('imgr') -kSpriteImageRegistrationAtomType = FOUR_CHAR_CODE('imrg') -kSpriteImageDefaultImageIndexAtomType = FOUR_CHAR_CODE('defi') -kSpriteSharedDataAtomType = FOUR_CHAR_CODE('dflt') -kSpriteNameAtomType = FOUR_CHAR_CODE('name') -kSpriteImageNameAtomType = FOUR_CHAR_CODE('name') -kSpriteUsesImageIDsAtomType = FOUR_CHAR_CODE('uses') -kSpriteBehaviorsAtomType = FOUR_CHAR_CODE('beha') -kSpriteImageBehaviorAtomType = FOUR_CHAR_CODE('imag') -kSpriteCursorBehaviorAtomType = FOUR_CHAR_CODE('crsr') -kSpriteStatusStringsBehaviorAtomType = FOUR_CHAR_CODE('sstr') -kSpriteVariablesContainerAtomType = FOUR_CHAR_CODE('vars') -kSpriteStringVariableAtomType = FOUR_CHAR_CODE('strv') -kSpriteFloatingPointVariableAtomType = FOUR_CHAR_CODE('flov') -kMovieMediaDataReference = FOUR_CHAR_CODE('mmdr') -kMovieMediaDefaultDataReferenceID = FOUR_CHAR_CODE('ddri') -kMovieMediaSlaveTime = FOUR_CHAR_CODE('slti') -kMovieMediaSlaveAudio = FOUR_CHAR_CODE('slau') -kMovieMediaSlaveGraphicsMode = FOUR_CHAR_CODE('slgr') -kMovieMediaAutoPlay = FOUR_CHAR_CODE('play') -kMovieMediaLoop = FOUR_CHAR_CODE('loop') -kMovieMediaUseMIMEType = FOUR_CHAR_CODE('mime') -kMovieMediaTitle = FOUR_CHAR_CODE('titl') -kMovieMediaAltText = FOUR_CHAR_CODE('altt') -kMovieMediaClipBegin = FOUR_CHAR_CODE('clpb') -kMovieMediaClipDuration = FOUR_CHAR_CODE('clpd') -kMovieMediaRegionAtom = FOUR_CHAR_CODE('regi') -kMovieMediaSlaveTrackDuration = FOUR_CHAR_CODE('sltr') -kMovieMediaEnableFrameStepping = FOUR_CHAR_CODE('enfs') -kMovieMediaBackgroundColor = FOUR_CHAR_CODE('bkcl') -kMovieMediaPrerollTime = FOUR_CHAR_CODE('prer') -kMovieMediaFitNone = 0 -kMovieMediaFitScroll = FOUR_CHAR_CODE('scro') -kMovieMediaFitClipIfNecessary = FOUR_CHAR_CODE('hidd') -kMovieMediaFitFill = FOUR_CHAR_CODE('fill') -kMovieMediaFitMeet = FOUR_CHAR_CODE('meet') -kMovieMediaFitSlice = FOUR_CHAR_CODE('slic') -kMovieMediaSpatialAdjustment = FOUR_CHAR_CODE('fit ') -kMovieMediaRectangleAtom = FOUR_CHAR_CODE('rect') -kMovieMediaTop = FOUR_CHAR_CODE('top ') -kMovieMediaLeft = FOUR_CHAR_CODE('left') -kMovieMediaWidth = FOUR_CHAR_CODE('wd ') -kMovieMediaHeight = FOUR_CHAR_CODE('ht ') -kMoviePropertyDuration = FOUR_CHAR_CODE('dura') -kMoviePropertyTimeScale = FOUR_CHAR_CODE('tims') -kMoviePropertyTime = FOUR_CHAR_CODE('timv') -kMoviePropertyNaturalBounds = FOUR_CHAR_CODE('natb') -kMoviePropertyMatrix = FOUR_CHAR_CODE('mtrx') -kMoviePropertyTrackList = FOUR_CHAR_CODE('tlst') -kTrackPropertyMediaType = FOUR_CHAR_CODE('mtyp') -kTrackPropertyInstantiation = FOUR_CHAR_CODE('inst') -MovieControllerComponentType = FOUR_CHAR_CODE('play') -kMovieControllerQTVRFlag = 1 << 0 -kMovieControllerDontDisplayToUser = 1 << 1 -mcActionIdle = 1 -mcActionDraw = 2 -mcActionActivate = 3 -mcActionDeactivate = 4 -mcActionMouseDown = 5 -mcActionKey = 6 -mcActionPlay = 8 -mcActionGoToTime = 12 -mcActionSetVolume = 14 -mcActionGetVolume = 15 -mcActionStep = 18 -mcActionSetLooping = 21 -mcActionGetLooping = 22 -mcActionSetLoopIsPalindrome = 23 -mcActionGetLoopIsPalindrome = 24 -mcActionSetGrowBoxBounds = 25 -mcActionControllerSizeChanged = 26 -mcActionSetSelectionBegin = 29 -mcActionSetSelectionDuration = 30 -mcActionSetKeysEnabled = 32 -mcActionGetKeysEnabled = 33 -mcActionSetPlaySelection = 34 -mcActionGetPlaySelection = 35 -mcActionSetUseBadge = 36 -mcActionGetUseBadge = 37 -mcActionSetFlags = 38 -mcActionGetFlags = 39 -mcActionSetPlayEveryFrame = 40 -mcActionGetPlayEveryFrame = 41 -mcActionGetPlayRate = 42 -mcActionShowBalloon = 43 -mcActionBadgeClick = 44 -mcActionMovieClick = 45 -mcActionSuspend = 46 -mcActionResume = 47 -mcActionSetControllerKeysEnabled = 48 -mcActionGetTimeSliderRect = 49 -mcActionMovieEdited = 50 -mcActionGetDragEnabled = 51 -mcActionSetDragEnabled = 52 -mcActionGetSelectionBegin = 53 -mcActionGetSelectionDuration = 54 -mcActionPrerollAndPlay = 55 -mcActionGetCursorSettingEnabled = 56 -mcActionSetCursorSettingEnabled = 57 -mcActionSetColorTable = 58 -mcActionLinkToURL = 59 -mcActionCustomButtonClick = 60 -mcActionForceTimeTableUpdate = 61 -mcActionSetControllerTimeLimits = 62 -mcActionExecuteAllActionsForQTEvent = 63 -mcActionExecuteOneActionForQTEvent = 64 -mcActionAdjustCursor = 65 -mcActionUseTrackForTimeTable = 66 -mcActionClickAndHoldPoint = 67 -mcActionShowMessageString = 68 -mcActionShowStatusString = 69 -mcActionGetExternalMovie = 70 -mcActionGetChapterTime = 71 -mcActionPerformActionList = 72 -mcActionEvaluateExpression = 73 -mcActionFetchParameterAs = 74 -mcActionGetCursorByID = 75 -mcActionGetNextURL = 76 -mcActionMovieChanged = 77 -mcActionDoScript = 78 -mcActionRestartAtTime = 79 -mcActionGetIndChapter = 80 -mcActionLinkToURLExtended = 81 -mcActionSetVolumeStep = 82 -mcActionAutoPlay = 83 -mcActionPauseToBuffer = 84 -mcActionAppMessageReceived = 85 -mcActionEvaluateExpressionWithType = 89 -mcActionGetMovieName = 90 -mcActionGetMovieID = 91 -mcActionGetMovieActive = 92 -mcFlagSuppressMovieFrame = 1 << 0 -mcFlagSuppressStepButtons = 1 << 1 -mcFlagSuppressSpeakerButton = 1 << 2 -mcFlagsUseWindowPalette = 1 << 3 -mcFlagsDontInvalidate = 1 << 4 -mcFlagsUseCustomButton = 1 << 5 -mcPositionDontInvalidate = 1 << 5 -kMCIEEnabledButtonPicture = 1 -kMCIEDisabledButtonPicture = 2 -kMCIEDepressedButtonPicture = 3 -kMCIEEnabledSizeBoxPicture = 4 -kMCIEDisabledSizeBoxPicture = 5 -kMCIEEnabledUnavailableButtonPicture = 6 -kMCIEDisabledUnavailableButtonPicture = 7 -kMCIESoundSlider = 128 -kMCIESoundThumb = 129 -kMCIEColorTable = 256 -kMCIEIsFlatAppearance = 257 -kMCIEDoButtonIconsDropOnDepress = 258 -mcInfoUndoAvailable = 1 << 0 -mcInfoCutAvailable = 1 << 1 -mcInfoCopyAvailable = 1 << 2 -mcInfoPasteAvailable = 1 << 3 -mcInfoClearAvailable = 1 << 4 -mcInfoHasSound = 1 << 5 -mcInfoIsPlaying = 1 << 6 -mcInfoIsLooping = 1 << 7 -mcInfoIsInPalindrome = 1 << 8 -mcInfoEditingEnabled = 1 << 9 -mcInfoMovieIsInteractive = 1 << 10 -mcMenuUndo = 1 -mcMenuCut = 3 -mcMenuCopy = 4 -mcMenuPaste = 5 -mcMenuClear = 6 -kQTAppMessageSoftwareChanged = 1 -kQTAppMessageWindowCloseRequested = 3 -kQTAppMessageExitFullScreenRequested = 4 -kQTAppMessageDisplayChannels = 5 -kQTAppMessageEnterFullScreenRequested = 6 -kFetchAsBooleanPtr = 1 -kFetchAsShortPtr = 2 -kFetchAsLongPtr = 3 -kFetchAsMatrixRecordPtr = 4 -kFetchAsModifierTrackGraphicsModeRecord = 5 -kFetchAsHandle = 6 -kFetchAsStr255 = 7 -kFetchAsFloatPtr = 8 -kFetchAsPointPtr = 9 -kFetchAsNewAtomContainer = 10 -kFetchAsQTEventRecordPtr = 11 -kFetchAsFixedPtr = 12 -kFetchAsSetControllerValuePtr = 13 -kFetchAsRgnHandle = 14 -kFetchAsComponentDescriptionPtr = 15 -kFetchAsCString = 16 -kQTCursorOpenHand = -19183 -kQTCursorClosedHand = -19182 -kQTCursorPointingHand = -19181 -kQTCursorRightArrow = -19180 -kQTCursorLeftArrow = -19179 -kQTCursorDownArrow = -19178 -kQTCursorUpArrow = -19177 -kQTCursorIBeam = -19176 -kControllerUnderstandsIdleManagers = 1 << 0 -kVideoMediaResetStatisticsSelect = 0x0105 -kVideoMediaGetStatisticsSelect = 0x0106 -kVideoMediaGetStallCountSelect = 0x010E -kVideoMediaSetCodecParameterSelect = 0x010F -kVideoMediaGetCodecParameterSelect = 0x0110 -kTextMediaSetTextProcSelect = 0x0101 -kTextMediaAddTextSampleSelect = 0x0102 -kTextMediaAddTESampleSelect = 0x0103 -kTextMediaAddHiliteSampleSelect = 0x0104 -kTextMediaDrawRawSelect = 0x0109 -kTextMediaSetTextPropertySelect = 0x010A -kTextMediaRawSetupSelect = 0x010B -kTextMediaRawIdleSelect = 0x010C -kTextMediaGetTextPropertySelect = 0x010D -kTextMediaFindNextTextSelect = 0x0105 -kTextMediaHiliteTextSampleSelect = 0x0106 -kTextMediaSetTextSampleDataSelect = 0x0107 -kSpriteMediaSetPropertySelect = 0x0101 -kSpriteMediaGetPropertySelect = 0x0102 -kSpriteMediaHitTestSpritesSelect = 0x0103 -kSpriteMediaCountSpritesSelect = 0x0104 -kSpriteMediaCountImagesSelect = 0x0105 -kSpriteMediaGetIndImageDescriptionSelect = 0x0106 -kSpriteMediaGetDisplayedSampleNumberSelect = 0x0107 -kSpriteMediaGetSpriteNameSelect = 0x0108 -kSpriteMediaGetImageNameSelect = 0x0109 -kSpriteMediaSetSpritePropertySelect = 0x010A -kSpriteMediaGetSpritePropertySelect = 0x010B -kSpriteMediaHitTestAllSpritesSelect = 0x010C -kSpriteMediaHitTestOneSpriteSelect = 0x010D -kSpriteMediaSpriteIndexToIDSelect = 0x010E -kSpriteMediaSpriteIDToIndexSelect = 0x010F -kSpriteMediaGetSpriteActionsForQTEventSelect = 0x0110 -kSpriteMediaSetActionVariableSelect = 0x0111 -kSpriteMediaGetActionVariableSelect = 0x0112 -kSpriteMediaGetIndImagePropertySelect = 0x0113 -kSpriteMediaNewSpriteSelect = 0x0114 -kSpriteMediaDisposeSpriteSelect = 0x0115 -kSpriteMediaSetActionVariableToStringSelect = 0x0116 -kSpriteMediaGetActionVariableAsStringSelect = 0x0117 -kSpriteMediaNewImageSelect = 0x011B -kSpriteMediaDisposeImageSelect = 0x011C -kSpriteMediaImageIndexToIDSelect = 0x011D -kSpriteMediaImageIDToIndexSelect = 0x011E -kFlashMediaSetPanSelect = 0x0101 -kFlashMediaSetZoomSelect = 0x0102 -kFlashMediaSetZoomRectSelect = 0x0103 -kFlashMediaGetRefConBoundsSelect = 0x0104 -kFlashMediaGetRefConIDSelect = 0x0105 -kFlashMediaIDToRefConSelect = 0x0106 -kFlashMediaGetDisplayedFrameNumberSelect = 0x0107 -kFlashMediaFrameNumberToMovieTimeSelect = 0x0108 -kFlashMediaFrameLabelToMovieTimeSelect = 0x0109 -kFlashMediaGetFlashVariableSelect = 0x010A -kFlashMediaSetFlashVariableSelect = 0x010B -kFlashMediaDoButtonActionsSelect = 0x010C -kFlashMediaGetSupportedSwfVersionSelect = 0x010D -kMovieMediaGetChildDoMCActionCallbackSelect = 0x0102 -kMovieMediaGetDoMCActionCallbackSelect = 0x0103 -kMovieMediaGetCurrentMoviePropertySelect = 0x0104 -kMovieMediaGetCurrentTrackPropertySelect = 0x0105 -kMovieMediaGetChildMovieDataReferenceSelect = 0x0106 -kMovieMediaSetChildMovieDataReferenceSelect = 0x0107 -kMovieMediaLoadChildMovieFromDataReferenceSelect = 0x0108 -kMedia3DGetNamedObjectListSelect = 0x0101 -kMedia3DGetRendererListSelect = 0x0102 -kMedia3DGetCurrentGroupSelect = 0x0103 -kMedia3DTranslateNamedObjectToSelect = 0x0104 -kMedia3DScaleNamedObjectToSelect = 0x0105 -kMedia3DRotateNamedObjectToSelect = 0x0106 -kMedia3DSetCameraDataSelect = 0x0107 -kMedia3DGetCameraDataSelect = 0x0108 -kMedia3DSetCameraAngleAspectSelect = 0x0109 -kMedia3DGetCameraAngleAspectSelect = 0x010A -kMedia3DSetCameraRangeSelect = 0x010D -kMedia3DGetCameraRangeSelect = 0x010E -kMedia3DGetViewObjectSelect = 0x010F -kMCSetMovieSelect = 0x0002 -kMCGetIndMovieSelect = 0x0005 -kMCRemoveAllMoviesSelect = 0x0006 -kMCRemoveAMovieSelect = 0x0003 -kMCRemoveMovieSelect = 0x0006 -kMCIsPlayerEventSelect = 0x0007 -kMCSetActionFilterSelect = 0x0008 -kMCDoActionSelect = 0x0009 -kMCSetControllerAttachedSelect = 0x000A -kMCIsControllerAttachedSelect = 0x000B -kMCSetControllerPortSelect = 0x000C -kMCGetControllerPortSelect = 0x000D -kMCSetVisibleSelect = 0x000E -kMCGetVisibleSelect = 0x000F -kMCGetControllerBoundsRectSelect = 0x0010 -kMCSetControllerBoundsRectSelect = 0x0011 -kMCGetControllerBoundsRgnSelect = 0x0012 -kMCGetWindowRgnSelect = 0x0013 -kMCMovieChangedSelect = 0x0014 -kMCSetDurationSelect = 0x0015 -kMCGetCurrentTimeSelect = 0x0016 -kMCNewAttachedControllerSelect = 0x0017 -kMCDrawSelect = 0x0018 -kMCActivateSelect = 0x0019 -kMCIdleSelect = 0x001A -kMCKeySelect = 0x001B -kMCClickSelect = 0x001C -kMCEnableEditingSelect = 0x001D -kMCIsEditingEnabledSelect = 0x001E -kMCCopySelect = 0x001F -kMCCutSelect = 0x0020 -kMCPasteSelect = 0x0021 -kMCClearSelect = 0x0022 -kMCUndoSelect = 0x0023 -kMCPositionControllerSelect = 0x0024 -kMCGetControllerInfoSelect = 0x0025 -kMCSetClipSelect = 0x0028 -kMCGetClipSelect = 0x0029 -kMCDrawBadgeSelect = 0x002A -kMCSetUpEditMenuSelect = 0x002B -kMCGetMenuStringSelect = 0x002C -kMCSetActionFilterWithRefConSelect = 0x002D -kMCPtInControllerSelect = 0x002E -kMCInvalidateSelect = 0x002F -kMCAdjustCursorSelect = 0x0030 -kMCGetInterfaceElementSelect = 0x0031 -kMCGetDoActionsProcSelect = 0x0032 -kMCAddMovieSegmentSelect = 0x0033 -kMCTrimMovieSegmentSelect = 0x0034 -kMCSetIdleManagerSelect = 0x0035 -kMCSetControllerCapabilitiesSelect = 0x0036 -kMusicMediaGetIndexedTunePlayerSelect = 0x0101 -kRawCodecType = FOUR_CHAR_CODE('raw ') -kCinepakCodecType = FOUR_CHAR_CODE('cvid') -kGraphicsCodecType = FOUR_CHAR_CODE('smc ') -kAnimationCodecType = FOUR_CHAR_CODE('rle ') -kVideoCodecType = FOUR_CHAR_CODE('rpza') -kComponentVideoCodecType = FOUR_CHAR_CODE('yuv2') -kJPEGCodecType = FOUR_CHAR_CODE('jpeg') -kMotionJPEGACodecType = FOUR_CHAR_CODE('mjpa') -kMotionJPEGBCodecType = FOUR_CHAR_CODE('mjpb') -kSGICodecType = FOUR_CHAR_CODE('.SGI') -kPlanarRGBCodecType = FOUR_CHAR_CODE('8BPS') -kMacPaintCodecType = FOUR_CHAR_CODE('PNTG') -kGIFCodecType = FOUR_CHAR_CODE('gif ') -kPhotoCDCodecType = FOUR_CHAR_CODE('kpcd') -kQuickDrawGXCodecType = FOUR_CHAR_CODE('qdgx') -kAVRJPEGCodecType = FOUR_CHAR_CODE('avr ') -kOpenDMLJPEGCodecType = FOUR_CHAR_CODE('dmb1') -kBMPCodecType = FOUR_CHAR_CODE('WRLE') -kWindowsRawCodecType = FOUR_CHAR_CODE('WRAW') -kVectorCodecType = FOUR_CHAR_CODE('path') -kQuickDrawCodecType = FOUR_CHAR_CODE('qdrw') -kWaterRippleCodecType = FOUR_CHAR_CODE('ripl') -kFireCodecType = FOUR_CHAR_CODE('fire') -kCloudCodecType = FOUR_CHAR_CODE('clou') -kH261CodecType = FOUR_CHAR_CODE('h261') -kH263CodecType = FOUR_CHAR_CODE('h263') -kDVCNTSCCodecType = FOUR_CHAR_CODE('dvc ') -kDVCPALCodecType = FOUR_CHAR_CODE('dvcp') -kDVCProPALCodecType = FOUR_CHAR_CODE('dvpp') -kBaseCodecType = FOUR_CHAR_CODE('base') -kFLCCodecType = FOUR_CHAR_CODE('flic') -kTargaCodecType = FOUR_CHAR_CODE('tga ') -kPNGCodecType = FOUR_CHAR_CODE('png ') -kTIFFCodecType = FOUR_CHAR_CODE('tiff') -kComponentVideoSigned = FOUR_CHAR_CODE('yuvu') -kComponentVideoUnsigned = FOUR_CHAR_CODE('yuvs') -kCMYKCodecType = FOUR_CHAR_CODE('cmyk') -kMicrosoftVideo1CodecType = FOUR_CHAR_CODE('msvc') -kSorensonCodecType = FOUR_CHAR_CODE('SVQ1') -kSorenson3CodecType = FOUR_CHAR_CODE('SVQ3') -kIndeo4CodecType = FOUR_CHAR_CODE('IV41') -kMPEG4VisualCodecType = FOUR_CHAR_CODE('mp4v') -k64ARGBCodecType = FOUR_CHAR_CODE('b64a') -k48RGBCodecType = FOUR_CHAR_CODE('b48r') -k32AlphaGrayCodecType = FOUR_CHAR_CODE('b32a') -k16GrayCodecType = FOUR_CHAR_CODE('b16g') -kMpegYUV420CodecType = FOUR_CHAR_CODE('myuv') -kYUV420CodecType = FOUR_CHAR_CODE('y420') -kSorensonYUV9CodecType = FOUR_CHAR_CODE('syv9') -k422YpCbCr8CodecType = FOUR_CHAR_CODE('2vuy') -k444YpCbCr8CodecType = FOUR_CHAR_CODE('v308') -k4444YpCbCrA8CodecType = FOUR_CHAR_CODE('v408') -k422YpCbCr16CodecType = FOUR_CHAR_CODE('v216') -k422YpCbCr10CodecType = FOUR_CHAR_CODE('v210') -k444YpCbCr10CodecType = FOUR_CHAR_CODE('v410') -k4444YpCbCrA8RCodecType = FOUR_CHAR_CODE('r408') -kBlurImageFilterType = FOUR_CHAR_CODE('blur') -kSharpenImageFilterType = FOUR_CHAR_CODE('shrp') -kEdgeDetectImageFilterType = FOUR_CHAR_CODE('edge') -kEmbossImageFilterType = FOUR_CHAR_CODE('embs') -kConvolveImageFilterType = FOUR_CHAR_CODE('genk') -kAlphaGainImageFilterType = FOUR_CHAR_CODE('gain') -kRGBColorBalanceImageFilterType = FOUR_CHAR_CODE('rgbb') -kHSLColorBalanceImageFilterType = FOUR_CHAR_CODE('hslb') -kColorSyncImageFilterType = FOUR_CHAR_CODE('sync') -kFilmNoiseImageFilterType = FOUR_CHAR_CODE('fmns') -kSolarizeImageFilterType = FOUR_CHAR_CODE('solr') -kColorTintImageFilterType = FOUR_CHAR_CODE('tint') -kLensFlareImageFilterType = FOUR_CHAR_CODE('lens') -kBrightnessContrastImageFilterType = FOUR_CHAR_CODE('brco') -kAlphaCompositorTransitionType = FOUR_CHAR_CODE('blnd') -kCrossFadeTransitionType = FOUR_CHAR_CODE('dslv') -kChannelCompositeEffectType = FOUR_CHAR_CODE('chan') -kChromaKeyTransitionType = FOUR_CHAR_CODE('ckey') -kImplodeTransitionType = FOUR_CHAR_CODE('mplo') -kExplodeTransitionType = FOUR_CHAR_CODE('xplo') -kGradientTransitionType = FOUR_CHAR_CODE('matt') -kPushTransitionType = FOUR_CHAR_CODE('push') -kSlideTransitionType = FOUR_CHAR_CODE('slid') -kWipeTransitionType = FOUR_CHAR_CODE('smpt') -kIrisTransitionType = FOUR_CHAR_CODE('smp2') -kRadialTransitionType = FOUR_CHAR_CODE('smp3') -kMatrixTransitionType = FOUR_CHAR_CODE('smp4') -kZoomTransitionType = FOUR_CHAR_CODE('zoom') -kTravellingMatteEffectType = FOUR_CHAR_CODE('trav') -kCMYKPixelFormat = FOUR_CHAR_CODE('cmyk') -k64ARGBPixelFormat = FOUR_CHAR_CODE('b64a') -k48RGBPixelFormat = FOUR_CHAR_CODE('b48r') -k32AlphaGrayPixelFormat = FOUR_CHAR_CODE('b32a') -k16GrayPixelFormat = FOUR_CHAR_CODE('b16g') -k422YpCbCr8PixelFormat = FOUR_CHAR_CODE('2vuy') -k4444YpCbCrA8PixelFormat = FOUR_CHAR_CODE('v408') -k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408') -kYUV420PixelFormat = FOUR_CHAR_CODE('y420') -codecInfoDoes1 = (1L << 0) -codecInfoDoes2 = (1L << 1) -codecInfoDoes4 = (1L << 2) -codecInfoDoes8 = (1L << 3) -codecInfoDoes16 = (1L << 4) -codecInfoDoes32 = (1L << 5) -codecInfoDoesDither = (1L << 6) -codecInfoDoesStretch = (1L << 7) -codecInfoDoesShrink = (1L << 8) -codecInfoDoesMask = (1L << 9) -codecInfoDoesTemporal = (1L << 10) -codecInfoDoesDouble = (1L << 11) -codecInfoDoesQuad = (1L << 12) -codecInfoDoesHalf = (1L << 13) -codecInfoDoesQuarter = (1L << 14) -codecInfoDoesRotate = (1L << 15) -codecInfoDoesHorizFlip = (1L << 16) -codecInfoDoesVertFlip = (1L << 17) -codecInfoHasEffectParameterList = (1L << 18) -codecInfoDoesBlend = (1L << 19) -codecInfoDoesWarp = (1L << 20) -codecInfoDoesRecompress = (1L << 21) -codecInfoDoesSpool = (1L << 22) -codecInfoDoesRateConstrain = (1L << 23) -codecInfoDepth1 = (1L << 0) -codecInfoDepth2 = (1L << 1) -codecInfoDepth4 = (1L << 2) -codecInfoDepth8 = (1L << 3) -codecInfoDepth16 = (1L << 4) -codecInfoDepth32 = (1L << 5) -codecInfoDepth24 = (1L << 6) -codecInfoDepth33 = (1L << 7) -codecInfoDepth34 = (1L << 8) -codecInfoDepth36 = (1L << 9) -codecInfoDepth40 = (1L << 10) -codecInfoStoresClut = (1L << 11) -codecInfoDoesLossless = (1L << 12) -codecInfoSequenceSensitive = (1L << 13) -codecFlagUseImageBuffer = (1L << 0) -codecFlagUseScreenBuffer = (1L << 1) -codecFlagUpdatePrevious = (1L << 2) -codecFlagNoScreenUpdate = (1L << 3) -codecFlagWasCompressed = (1L << 4) -codecFlagDontOffscreen = (1L << 5) -codecFlagUpdatePreviousComp = (1L << 6) -codecFlagForceKeyFrame = (1L << 7) -codecFlagOnlyScreenUpdate = (1L << 8) -codecFlagLiveGrab = (1L << 9) -codecFlagDiffFrame = (1L << 9) -codecFlagDontUseNewImageBuffer = (1L << 10) -codecFlagInterlaceUpdate = (1L << 11) -codecFlagCatchUpDiff = (1L << 12) -codecFlagSupportDisable = (1L << 13) -codecFlagReenable = (1L << 14) -codecFlagOutUpdateOnNextIdle = (1L << 9) -codecFlagOutUpdateOnDataSourceChange = (1L << 10) -codecFlagSequenceSensitive = (1L << 11) -codecFlagOutUpdateOnTimeChange = (1L << 12) -codecFlagImageBufferNotSourceImage = (1L << 13) -codecFlagUsedNewImageBuffer = (1L << 14) -codecFlagUsedImageBuffer = (1L << 15) -codecMinimumDataSize = 32768L -compressorComponentType = FOUR_CHAR_CODE('imco') -decompressorComponentType = FOUR_CHAR_CODE('imdc') -codecLosslessQuality = 0x00000400 -codecMaxQuality = 0x000003FF -codecMinQuality = 0x00000000 -codecLowQuality = 0x00000100 -codecNormalQuality = 0x00000200 -codecHighQuality = 0x00000300 -codecLockBitsShieldCursor = (1 << 0) -codecCompletionSource = (1 << 0) -codecCompletionDest = (1 << 1) -codecCompletionDontUnshield = (1 << 2) -codecCompletionWentOffscreen = (1 << 3) -codecCompletionUnlockBits = (1 << 4) -codecCompletionForceChainFlush = (1 << 5) -codecCompletionDropped = (1 << 6) -codecProgressOpen = 0 -codecProgressUpdatePercent = 1 -codecProgressClose = 2 -defaultDither = 0 -forceDither = 1 -suppressDither = 2 -useColorMatching = 4 -callStdBits = 1 -callOldBits = 2 -noDefaultOpcodes = 4 -graphicsModeStraightAlpha = 256 -graphicsModePreWhiteAlpha = 257 -graphicsModePreBlackAlpha = 258 -graphicsModeComposition = 259 -graphicsModeStraightAlphaBlend = 260 -graphicsModePreMulColorAlpha = 261 -evenField1ToEvenFieldOut = 1 << 0 -evenField1ToOddFieldOut = 1 << 1 -oddField1ToEvenFieldOut = 1 << 2 -oddField1ToOddFieldOut = 1 << 3 -evenField2ToEvenFieldOut = 1 << 4 -evenField2ToOddFieldOut = 1 << 5 -oddField2ToEvenFieldOut = 1 << 6 -oddField2ToOddFieldOut = 1 << 7 -icmFrameTimeHasVirtualStartTimeAndDuration = 1 << 0 -codecDSequenceDisableOverlaySurface = (1L << 5) -codecDSequenceSingleField = (1L << 6) -codecDSequenceBidirectionalPrediction = (1L << 7) -codecDSequenceFlushInsteadOfDirtying = (1L << 8) -codecDSequenceEnableSubPixelPositioning = (1L << 9) -kICMSequenceTaskWeight = FOUR_CHAR_CODE('twei') -kICMSequenceTaskName = FOUR_CHAR_CODE('tnam') -kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt') -kImageDescriptionSampleFormat = FOUR_CHAR_CODE('idfm') -kImageDescriptionClassicAtomFormat = FOUR_CHAR_CODE('atom') -kImageDescriptionQTAtomFormat = FOUR_CHAR_CODE('qtat') -kImageDescriptionEffectDataFormat = FOUR_CHAR_CODE('fxat') -kImageDescriptionPrivateDataFormat = FOUR_CHAR_CODE('priv') -kImageDescriptionAlternateCodec = FOUR_CHAR_CODE('subs') -kImageDescriptionColorSpace = FOUR_CHAR_CODE('cspc') -sfpItemPreviewAreaUser = 11 -sfpItemPreviewStaticText = 12 -sfpItemPreviewDividerUser = 13 -sfpItemCreatePreviewButton = 14 -sfpItemShowPreviewButton = 15 -kICMPixelFormatIsPlanarMask = 0x0F -kICMPixelFormatIsIndexed = (1L << 4) -kICMPixelFormatIsSupportedByQD = (1L << 5) -kICMPixelFormatIsMonochrome = (1L << 6) -kICMPixelFormatHasAlphaChannel = (1L << 7) -kICMGetChainUltimateParent = 0 -kICMGetChainParent = 1 -kICMGetChainChild = 2 -kICMGetChainUltimateChild = 3 -kDontUseValidateToFindGraphicsImporter = 1L << 0 -kICMTempThenAppMemory = 1L << 12 -kICMAppThenTempMemory = 1L << 13 -kQTUsePlatformDefaultGammaLevel = 0 -kQTUseSourceGammaLevel = -1L -kQTCCIR601VideoGammaLevel = 0x00023333 -identityMatrixType = 0x00 -translateMatrixType = 0x01 -scaleMatrixType = 0x02 -scaleTranslateMatrixType = 0x03 -linearMatrixType = 0x04 -linearTranslateMatrixType = 0x05 -perspectiveMatrixType = 0x06 -GraphicsImporterComponentType = FOUR_CHAR_CODE('grip') -graphicsImporterUsesImageDecompressor = 1L << 23 -quickTimeImageFileImageDescriptionAtom = FOUR_CHAR_CODE('idsc') -quickTimeImageFileImageDataAtom = FOUR_CHAR_CODE('idat') -quickTimeImageFileMetaDataAtom = FOUR_CHAR_CODE('meta') -quickTimeImageFileColorSyncProfileAtom = FOUR_CHAR_CODE('iicc') -graphicsImporterDrawsAllPixels = 0 -graphicsImporterDoesntDrawAllPixels = 1 -graphicsImporterDontKnowIfDrawAllPixels = 2 -kGraphicsImporterDontDoGammaCorrection = 1L << 0 -kGraphicsImporterTrustResolutionFromFile = 1L << 1 -kGraphicsImporterEnableSubPixelPositioning = 1L << 2 -kGraphicsExportGroup = FOUR_CHAR_CODE('expo') -kGraphicsExportFileType = FOUR_CHAR_CODE('ftyp') -kGraphicsExportMIMEType = FOUR_CHAR_CODE('mime') -kGraphicsExportExtension = FOUR_CHAR_CODE('ext ') -kGraphicsExportDescription = FOUR_CHAR_CODE('desc') -kQTPhotoshopLayerMode = FOUR_CHAR_CODE('lmod') -kQTPhotoshopLayerOpacity = FOUR_CHAR_CODE('lopa') -kQTPhotoshopLayerClipping = FOUR_CHAR_CODE('lclp') -kQTPhotoshopLayerFlags = FOUR_CHAR_CODE('lflg') -kQTPhotoshopLayerName = FOUR_CHAR_CODE('\xa9lnm') -kQTPhotoshopLayerUnicodeName = FOUR_CHAR_CODE('luni') -kQTIndexedImageType = FOUR_CHAR_CODE('nth?') -kQTIndexedImageIsThumbnail = FOUR_CHAR_CODE('n=th') -kQTIndexedImageIsLayer = FOUR_CHAR_CODE('n=ly') -kQTIndexedImageIsPage = FOUR_CHAR_CODE('n=pg') -kQTIndexedImageIsMultiResolution = FOUR_CHAR_CODE('n=rs') -kQTTIFFUserDataPrefix = 0x74690000 -kQTTIFFExifUserDataPrefix = 0x65780000 -kQTTIFFExifGPSUserDataPrefix = 0x67700000 -kQTAlphaMode = FOUR_CHAR_CODE('almo') -kQTAlphaModePreMulColor = FOUR_CHAR_CODE('almp') -kUserDataIPTC = FOUR_CHAR_CODE('iptc') -kQTTIFFUserDataOrientation = 0x74690112 -kQTTIFFUserDataTransferFunction = 0x7469012D -kQTTIFFUserDataWhitePoint = 0x7469013E -kQTTIFFUserDataPrimaryChromaticities = 0x7469013F -kQTTIFFUserDataTransferRange = 0x74690156 -kQTTIFFUserDataYCbCrPositioning = 0x74690213 -kQTTIFFUserDataReferenceBlackWhite = 0x74690214 -kQTTIFFUserDataModelPixelScale = 0x7469830E -kQTTIFFUserDataModelTransformation = 0x746985D8 -kQTTIFFUserDataModelTiepoint = 0x74698482 -kQTTIFFUserDataGeoKeyDirectory = 0x746987AF -kQTTIFFUserDataGeoDoubleParams = 0x746987B0 -kQTTIFFUserDataGeoAsciiParams = 0x746987B1 -kQTTIFFUserDataIntergraphMatrix = 0x74698480 -kQTExifUserDataExifVersion = 0x65789000 -kQTExifUserDataFlashPixVersion = 0x6578A000 -kQTExifUserDataColorSpace = 0x6578A001 -kQTExifUserDataComponentsConfiguration = 0x65789101 -kQTExifUserDataCompressedBitsPerPixel = 0x65789102 -kQTExifUserDataPixelXDimension = 0x6578A002 -kQTExifUserDataPixelYDimension = 0x6578A003 -kQTExifUserDataMakerNote = 0x6578927C -kQTExifUserDataUserComment = 0x6578928C -kQTExifUserDataRelatedSoundFile = 0x6578A004 -kQTExifUserDataDateTimeOriginal = 0x65789003 -kQTExifUserDataDateTimeDigitized = 0x65789004 -kQTExifUserDataSubSecTime = 0x65789290 -kQTExifUserDataSubSecTimeOriginal = 0x65789291 -kQTExifUserDataSubSecTimeDigitized = 0x65789292 -kQTExifUserDataExposureTime = 0x6578829A -kQTExifUserDataFNumber = 0x6578829D -kQTExifUserDataExposureProgram = 0x65788822 -kQTExifUserDataSpectralSensitivity = 0x65788824 -kQTExifUserDataISOSpeedRatings = 0x65788827 -kQTExifUserDataShutterSpeedValue = 0x65789201 -kQTExifUserDataApertureValue = 0x65789202 -kQTExifUserDataBrightnessValue = 0x65789203 -kQTExifUserDataExposureBiasValue = 0x65789204 -kQTExifUserDataMaxApertureValue = 0x65789205 -kQTExifUserDataSubjectDistance = 0x65789206 -kQTExifUserDataMeteringMode = 0x65789207 -kQTExifUserDataLightSource = 0x65789208 -kQTExifUserDataFlash = 0x65789209 -kQTExifUserDataFocalLength = 0x6578920A -kQTExifUserDataFlashEnergy = 0x6578A20B -kQTExifUserDataFocalPlaneXResolution = 0x6578A20E -kQTExifUserDataFocalPlaneYResolution = 0x6578A20F -kQTExifUserDataFocalPlaneResolutionUnit = 0x6578A210 -kQTExifUserDataSubjectLocation = 0x6578A214 -kQTExifUserDataExposureIndex = 0x6578A215 -kQTExifUserDataSensingMethod = 0x6578A217 -kQTExifUserDataFileSource = 0x6578A300 -kQTExifUserDataSceneType = 0x6578A301 -kQTExifUserDataGPSVersionID = 0x06770000 -kQTExifUserDataGPSLatitudeRef = 0x06770001 -kQTExifUserDataGPSLatitude = 0x06770002 -kQTExifUserDataGPSLongitudeRef = 0x06770003 -kQTExifUserDataGPSLongitude = 0x06770004 -kQTExifUserDataGPSAltitudeRef = 0x06770005 -kQTExifUserDataGPSAltitude = 0x06770006 -kQTExifUserDataGPSTimeStamp = 0x06770007 -kQTExifUserDataGPSSatellites = 0x06770008 -kQTExifUserDataGPSStatus = 0x06770009 -kQTExifUserDataGPSMeasureMode = 0x0677000A -kQTExifUserDataGPSDOP = 0x0677000B -kQTExifUserDataGPSSpeedRef = 0x0677000C -kQTExifUserDataGPSSpeed = 0x0677000D -kQTExifUserDataGPSTrackRef = 0x0677000E -kQTExifUserDataGPSTrack = 0x0677000F -kQTExifUserDataGPSImgDirectionRef = 0x06770010 -kQTExifUserDataGPSImgDirection = 0x06770011 -kQTExifUserDataGPSMapDatum = 0x06770012 -kQTExifUserDataGPSDestLatitudeRef = 0x06770013 -kQTExifUserDataGPSDestLatitude = 0x06770014 -kQTExifUserDataGPSDestLongitudeRef = 0x06770015 -kQTExifUserDataGPSDestLongitude = 0x06770016 -kQTExifUserDataGPSDestBearingRef = 0x06770017 -kQTExifUserDataGPSDestBearing = 0x06770018 -kQTExifUserDataGPSDestDistanceRef = 0x06770019 -kQTExifUserDataGPSDestDistance = 0x0677001A -GraphicsExporterComponentType = FOUR_CHAR_CODE('grex') -kBaseGraphicsExporterSubType = FOUR_CHAR_CODE('base') -graphicsExporterIsBaseExporter = 1L << 0 -graphicsExporterCanTranscode = 1L << 1 -graphicsExporterUsesImageCompressor = 1L << 2 -kQTResolutionSettings = FOUR_CHAR_CODE('reso') -kQTTargetDataSize = FOUR_CHAR_CODE('dasz') -kQTDontRecompress = FOUR_CHAR_CODE('dntr') -kQTInterlaceStyle = FOUR_CHAR_CODE('ilac') -kQTColorSyncProfile = FOUR_CHAR_CODE('iccp') -kQTThumbnailSettings = FOUR_CHAR_CODE('thum') -kQTEnableExif = FOUR_CHAR_CODE('exif') -kQTMetaData = FOUR_CHAR_CODE('meta') -kQTTIFFCompressionMethod = FOUR_CHAR_CODE('tifc') -kQTTIFFCompression_None = 1 -kQTTIFFCompression_PackBits = 32773L -kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife') -kQTPNGFilterPreference = FOUR_CHAR_CODE('pngf') -kQTPNGFilterBestForColorType = FOUR_CHAR_CODE('bflt') -kQTPNGFilterNone = 0 -kQTPNGFilterSub = 1 -kQTPNGFilterUp = 2 -kQTPNGFilterAverage = 3 -kQTPNGFilterPaeth = 4 -kQTPNGFilterAdaptivePerRow = FOUR_CHAR_CODE('aflt') -kQTPNGInterlaceStyle = FOUR_CHAR_CODE('ilac') -kQTPNGInterlaceNone = 0 -kQTPNGInterlaceAdam7 = 1 -ImageTranscodererComponentType = FOUR_CHAR_CODE('imtc') -kGraphicsImportSetDataReferenceSelect = 0x0001 -kGraphicsImportGetDataReferenceSelect = 0x0002 -kGraphicsImportSetDataFileSelect = 0x0003 -kGraphicsImportGetDataFileSelect = 0x0004 -kGraphicsImportSetDataHandleSelect = 0x0005 -kGraphicsImportGetDataHandleSelect = 0x0006 -kGraphicsImportGetImageDescriptionSelect = 0x0007 -kGraphicsImportGetDataOffsetAndSizeSelect = 0x0008 -kGraphicsImportReadDataSelect = 0x0009 -kGraphicsImportSetClipSelect = 0x000A -kGraphicsImportGetClipSelect = 0x000B -kGraphicsImportSetSourceRectSelect = 0x000C -kGraphicsImportGetSourceRectSelect = 0x000D -kGraphicsImportGetNaturalBoundsSelect = 0x000E -kGraphicsImportDrawSelect = 0x000F -kGraphicsImportSetGWorldSelect = 0x0010 -kGraphicsImportGetGWorldSelect = 0x0011 -kGraphicsImportSetMatrixSelect = 0x0012 -kGraphicsImportGetMatrixSelect = 0x0013 -kGraphicsImportSetBoundsRectSelect = 0x0014 -kGraphicsImportGetBoundsRectSelect = 0x0015 -kGraphicsImportSaveAsPictureSelect = 0x0016 -kGraphicsImportSetGraphicsModeSelect = 0x0017 -kGraphicsImportGetGraphicsModeSelect = 0x0018 -kGraphicsImportSetQualitySelect = 0x0019 -kGraphicsImportGetQualitySelect = 0x001A -kGraphicsImportSaveAsQuickTimeImageFileSelect = 0x001B -kGraphicsImportSetDataReferenceOffsetAndLimitSelect = 0x001C -kGraphicsImportGetDataReferenceOffsetAndLimitSelect = 0x001D -kGraphicsImportGetAliasedDataReferenceSelect = 0x001E -kGraphicsImportValidateSelect = 0x001F -kGraphicsImportGetMetaDataSelect = 0x0020 -kGraphicsImportGetMIMETypeListSelect = 0x0021 -kGraphicsImportDoesDrawAllPixelsSelect = 0x0022 -kGraphicsImportGetAsPictureSelect = 0x0023 -kGraphicsImportExportImageFileSelect = 0x0024 -kGraphicsImportGetExportImageTypeListSelect = 0x0025 -kGraphicsImportDoExportImageFileDialogSelect = 0x0026 -kGraphicsImportGetExportSettingsAsAtomContainerSelect = 0x0027 -kGraphicsImportSetExportSettingsFromAtomContainerSelect = 0x0028 -kGraphicsImportSetProgressProcSelect = 0x0029 -kGraphicsImportGetProgressProcSelect = 0x002A -kGraphicsImportGetImageCountSelect = 0x002B -kGraphicsImportSetImageIndexSelect = 0x002C -kGraphicsImportGetImageIndexSelect = 0x002D -kGraphicsImportGetDataOffsetAndSize64Select = 0x002E -kGraphicsImportReadData64Select = 0x002F -kGraphicsImportSetDataReferenceOffsetAndLimit64Select = 0x0030 -kGraphicsImportGetDataReferenceOffsetAndLimit64Select = 0x0031 -kGraphicsImportGetDefaultMatrixSelect = 0x0032 -kGraphicsImportGetDefaultClipSelect = 0x0033 -kGraphicsImportGetDefaultGraphicsModeSelect = 0x0034 -kGraphicsImportGetDefaultSourceRectSelect = 0x0035 -kGraphicsImportGetColorSyncProfileSelect = 0x0036 -kGraphicsImportSetDestRectSelect = 0x0037 -kGraphicsImportGetDestRectSelect = 0x0038 -kGraphicsImportSetFlagsSelect = 0x0039 -kGraphicsImportGetFlagsSelect = 0x003A -kGraphicsImportGetBaseDataOffsetAndSize64Select = 0x003D -kGraphicsImportSetImageIndexToThumbnailSelect = 0x003E -kGraphicsExportDoExportSelect = 0x0001 -kGraphicsExportCanTranscodeSelect = 0x0002 -kGraphicsExportDoTranscodeSelect = 0x0003 -kGraphicsExportCanUseCompressorSelect = 0x0004 -kGraphicsExportDoUseCompressorSelect = 0x0005 -kGraphicsExportDoStandaloneExportSelect = 0x0006 -kGraphicsExportGetDefaultFileTypeAndCreatorSelect = 0x0007 -kGraphicsExportGetDefaultFileNameExtensionSelect = 0x0008 -kGraphicsExportGetMIMETypeListSelect = 0x0009 -kGraphicsExportRequestSettingsSelect = 0x000B -kGraphicsExportSetSettingsFromAtomContainerSelect = 0x000C -kGraphicsExportGetSettingsAsAtomContainerSelect = 0x000D -kGraphicsExportGetSettingsAsTextSelect = 0x000E -kGraphicsExportSetDontRecompressSelect = 0x000F -kGraphicsExportGetDontRecompressSelect = 0x0010 -kGraphicsExportSetInterlaceStyleSelect = 0x0011 -kGraphicsExportGetInterlaceStyleSelect = 0x0012 -kGraphicsExportSetMetaDataSelect = 0x0013 -kGraphicsExportGetMetaDataSelect = 0x0014 -kGraphicsExportSetTargetDataSizeSelect = 0x0015 -kGraphicsExportGetTargetDataSizeSelect = 0x0016 -kGraphicsExportSetCompressionMethodSelect = 0x0017 -kGraphicsExportGetCompressionMethodSelect = 0x0018 -kGraphicsExportSetCompressionQualitySelect = 0x0019 -kGraphicsExportGetCompressionQualitySelect = 0x001A -kGraphicsExportSetResolutionSelect = 0x001B -kGraphicsExportGetResolutionSelect = 0x001C -kGraphicsExportSetDepthSelect = 0x001D -kGraphicsExportGetDepthSelect = 0x001E -kGraphicsExportSetColorSyncProfileSelect = 0x0021 -kGraphicsExportGetColorSyncProfileSelect = 0x0022 -kGraphicsExportSetProgressProcSelect = 0x0023 -kGraphicsExportGetProgressProcSelect = 0x0024 -kGraphicsExportSetInputDataReferenceSelect = 0x0025 -kGraphicsExportGetInputDataReferenceSelect = 0x0026 -kGraphicsExportSetInputFileSelect = 0x0027 -kGraphicsExportGetInputFileSelect = 0x0028 -kGraphicsExportSetInputHandleSelect = 0x0029 -kGraphicsExportGetInputHandleSelect = 0x002A -kGraphicsExportSetInputPtrSelect = 0x002B -kGraphicsExportGetInputPtrSelect = 0x002C -kGraphicsExportSetInputGraphicsImporterSelect = 0x002D -kGraphicsExportGetInputGraphicsImporterSelect = 0x002E -kGraphicsExportSetInputPictureSelect = 0x002F -kGraphicsExportGetInputPictureSelect = 0x0030 -kGraphicsExportSetInputGWorldSelect = 0x0031 -kGraphicsExportGetInputGWorldSelect = 0x0032 -kGraphicsExportSetInputPixmapSelect = 0x0033 -kGraphicsExportGetInputPixmapSelect = 0x0034 -kGraphicsExportSetInputOffsetAndLimitSelect = 0x0035 -kGraphicsExportGetInputOffsetAndLimitSelect = 0x0036 -kGraphicsExportMayExporterReadInputDataSelect = 0x0037 -kGraphicsExportGetInputDataSizeSelect = 0x0038 -kGraphicsExportReadInputDataSelect = 0x0039 -kGraphicsExportGetInputImageDescriptionSelect = 0x003A -kGraphicsExportGetInputImageDimensionsSelect = 0x003B -kGraphicsExportGetInputImageDepthSelect = 0x003C -kGraphicsExportDrawInputImageSelect = 0x003D -kGraphicsExportSetOutputDataReferenceSelect = 0x003E -kGraphicsExportGetOutputDataReferenceSelect = 0x003F -kGraphicsExportSetOutputFileSelect = 0x0040 -kGraphicsExportGetOutputFileSelect = 0x0041 -kGraphicsExportSetOutputHandleSelect = 0x0042 -kGraphicsExportGetOutputHandleSelect = 0x0043 -kGraphicsExportSetOutputOffsetAndMaxSizeSelect = 0x0044 -kGraphicsExportGetOutputOffsetAndMaxSizeSelect = 0x0045 -kGraphicsExportSetOutputFileTypeAndCreatorSelect = 0x0046 -kGraphicsExportGetOutputFileTypeAndCreatorSelect = 0x0047 -kGraphicsExportWriteOutputDataSelect = 0x0048 -kGraphicsExportSetOutputMarkSelect = 0x0049 -kGraphicsExportGetOutputMarkSelect = 0x004A -kGraphicsExportReadOutputDataSelect = 0x004B -kGraphicsExportSetThumbnailEnabledSelect = 0x004C -kGraphicsExportGetThumbnailEnabledSelect = 0x004D -kGraphicsExportSetExifEnabledSelect = 0x004E -kGraphicsExportGetExifEnabledSelect = 0x004F -kImageTranscoderBeginSequenceSelect = 0x0001 -kImageTranscoderConvertSelect = 0x0002 -kImageTranscoderDisposeDataSelect = 0x0003 -kImageTranscoderEndSequenceSelect = 0x0004 -clockComponentType = FOUR_CHAR_CODE('clok') -systemTickClock = FOUR_CHAR_CODE('tick') -systemSecondClock = FOUR_CHAR_CODE('seco') -systemMillisecondClock = FOUR_CHAR_CODE('mill') -systemMicrosecondClock = FOUR_CHAR_CODE('micr') -kClockRateIsLinear = 1 -kClockImplementsCallBacks = 2 -kClockCanHandleIntermittentSound = 4 -StandardCompressionType = FOUR_CHAR_CODE('scdi') -StandardCompressionSubType = FOUR_CHAR_CODE('imag') -StandardCompressionSubTypeSound = FOUR_CHAR_CODE('soun') -scListEveryCodec = 1L << 1 -scAllowZeroFrameRate = 1L << 2 -scAllowZeroKeyFrameRate = 1L << 3 -scShowBestDepth = 1L << 4 -scUseMovableModal = 1L << 5 -scDisableFrameRateItem = 1L << 6 -scShowDataRateAsKilobits = 1L << 7 -scPreferCropping = 1 << 0 -scPreferScaling = 1 << 1 -scPreferScalingAndCropping = scPreferScaling | scPreferCropping -scDontDetermineSettingsFromTestImage = 1 << 2 -scTestImageWidth = 80 -scTestImageHeight = 80 -scOKItem = 1 -scCancelItem = 2 -scCustomItem = 3 -scUserCancelled = 1 -scPositionRect = 2 -scPositionDialog = 3 -scSetTestImagePictHandle = 4 -scSetTestImagePictFile = 5 -scSetTestImagePixMap = 6 -scGetBestDeviceRect = 7 -scRequestImageSettings = 10 -scCompressImage = 11 -scCompressPicture = 12 -scCompressPictureFile = 13 -scRequestSequenceSettings = 14 -scCompressSequenceBegin = 15 -scCompressSequenceFrame = 16 -scCompressSequenceEnd = 17 -scDefaultPictHandleSettings = 18 -scDefaultPictFileSettings = 19 -scDefaultPixMapSettings = 20 -scGetInfo = 21 -scSetInfo = 22 -scNewGWorld = 23 -scSpatialSettingsType = FOUR_CHAR_CODE('sptl') -scTemporalSettingsType = FOUR_CHAR_CODE('tprl') -scDataRateSettingsType = FOUR_CHAR_CODE('drat') -scColorTableType = FOUR_CHAR_CODE('clut') -scProgressProcType = FOUR_CHAR_CODE('prog') -scExtendedProcsType = FOUR_CHAR_CODE('xprc') -scPreferenceFlagsType = FOUR_CHAR_CODE('pref') -scSettingsStateType = FOUR_CHAR_CODE('ssta') -scSequenceIDType = FOUR_CHAR_CODE('sequ') -scWindowPositionType = FOUR_CHAR_CODE('wndw') -scCodecFlagsType = FOUR_CHAR_CODE('cflg') -scCodecSettingsType = FOUR_CHAR_CODE('cdec') -scForceKeyValueType = FOUR_CHAR_CODE('ksim') -scSoundSampleRateType = FOUR_CHAR_CODE('ssrt') -scSoundSampleSizeType = FOUR_CHAR_CODE('ssss') -scSoundChannelCountType = FOUR_CHAR_CODE('sscc') -scSoundCompressionType = FOUR_CHAR_CODE('ssct') -scCompressionListType = FOUR_CHAR_CODE('ctyl') -scCodecManufacturerType = FOUR_CHAR_CODE('cmfr') -scSoundVBRCompressionOK = FOUR_CHAR_CODE('cvbr') -scSoundInputSampleRateType = FOUR_CHAR_CODE('ssir') -scSoundSampleRateChangeOK = FOUR_CHAR_CODE('rcok') -scAvailableCompressionListType = FOUR_CHAR_CODE('avai') -scGetCompression = 1 -scShowMotionSettings = 1L << 0 -scSettingsChangedItem = -1 -scCompressFlagIgnoreIdenticalFrames = 1 -kQTSettingsVideo = FOUR_CHAR_CODE('vide') -kQTSettingsSound = FOUR_CHAR_CODE('soun') -kQTSettingsComponentVersion = FOUR_CHAR_CODE('vers') -TweenComponentType = FOUR_CHAR_CODE('twen') -TCSourceRefNameType = FOUR_CHAR_CODE('name') -tcDropFrame = 1 << 0 -tc24HourMax = 1 << 1 -tcNegTimesOK = 1 << 2 -tcCounter = 1 << 3 -tctNegFlag = 0x80 -tcdfShowTimeCode = 1 << 0 -MovieImportType = FOUR_CHAR_CODE('eat ') -MovieExportType = FOUR_CHAR_CODE('spit') -canMovieImportHandles = 1 << 0 -canMovieImportFiles = 1 << 1 -hasMovieImportUserInterface = 1 << 2 -canMovieExportHandles = 1 << 3 -canMovieExportFiles = 1 << 4 -hasMovieExportUserInterface = 1 << 5 -movieImporterIsXMLBased = 1 << 5 -dontAutoFileMovieImport = 1 << 6 -canMovieExportAuxDataHandle = 1 << 7 -canMovieImportValidateHandles = 1 << 8 -canMovieImportValidateFile = 1 << 9 -dontRegisterWithEasyOpen = 1 << 10 -canMovieImportInPlace = 1 << 11 -movieImportSubTypeIsFileExtension = 1 << 12 -canMovieImportPartial = 1 << 13 -hasMovieImportMIMEList = 1 << 14 -canMovieImportAvoidBlocking = 1 << 15 -canMovieExportFromProcedures = 1 << 15 -canMovieExportValidateMovie = 1L << 16 -movieImportMustGetDestinationMediaType = 1L << 16 -movieExportNeedsResourceFork = 1L << 17 -canMovieImportDataReferences = 1L << 18 -movieExportMustGetSourceMediaType = 1L << 19 -canMovieImportWithIdle = 1L << 20 -canMovieImportValidateDataReferences = 1L << 21 -reservedForUseByGraphicsImporters = 1L << 23 -movieImportCreateTrack = 1 -movieImportInParallel = 2 -movieImportMustUseTrack = 4 -movieImportWithIdle = 16 -movieImportResultUsedMultipleTracks = 8 -movieImportResultNeedIdles = 32 -movieImportResultComplete = 64 -kMovieExportTextOnly = 0 -kMovieExportAbsoluteTime = 1 -kMovieExportRelativeTime = 2 -kMIDIImportSilenceBefore = 1 << 0 -kMIDIImportSilenceAfter = 1 << 1 -kMIDIImport20Playable = 1 << 2 -kMIDIImportWantLyrics = 1 << 3 -kQTMediaConfigResourceType = FOUR_CHAR_CODE('mcfg') -kQTMediaConfigResourceVersion = 2 -kQTMediaGroupResourceType = FOUR_CHAR_CODE('mgrp') -kQTMediaGroupResourceVersion = 1 -kQTBrowserInfoResourceType = FOUR_CHAR_CODE('brws') -kQTBrowserInfoResourceVersion = 1 -kQTMediaMIMEInfoHasChanged = (1L << 1) -kQTMediaFileInfoHasChanged = (1L << 2) -kQTMediaConfigCanUseApp = (1L << 18) -kQTMediaConfigCanUsePlugin = (1L << 19) -kQTMediaConfigUNUSED = (1L << 20) -kQTMediaConfigBinaryFile = (1L << 23) -kQTMediaConfigTextFile = 0 -kQTMediaConfigMacintoshFile = (1L << 24) -kQTMediaConfigAssociateByDefault = (1L << 27) -kQTMediaConfigUseAppByDefault = (1L << 28) -kQTMediaConfigUsePluginByDefault = (1L << 29) -kQTMediaConfigDefaultsMask = (kQTMediaConfigUseAppByDefault | kQTMediaConfigUsePluginByDefault) -kQTMediaConfigDefaultsShift = 12 -kQTMediaConfigHasFileHasQTAtoms = (1L << 30) -kQTMediaConfigStreamGroupID = FOUR_CHAR_CODE('strm') -kQTMediaConfigInteractiveGroupID = FOUR_CHAR_CODE('intr') -kQTMediaConfigVideoGroupID = FOUR_CHAR_CODE('eyes') -kQTMediaConfigAudioGroupID = FOUR_CHAR_CODE('ears') -kQTMediaConfigMPEGGroupID = FOUR_CHAR_CODE('mpeg') -kQTMediaConfigMP3GroupID = FOUR_CHAR_CODE('mp3 ') -kQTMediaConfigImageGroupID = FOUR_CHAR_CODE('ogle') -kQTMediaConfigMiscGroupID = FOUR_CHAR_CODE('misc') -kQTMediaInfoNetGroup = FOUR_CHAR_CODE('net ') -kQTMediaInfoWinGroup = FOUR_CHAR_CODE('win ') -kQTMediaInfoMacGroup = FOUR_CHAR_CODE('mac ') -kQTMediaInfoMiscGroup = 0x3F3F3F3F -kMimeInfoMimeTypeTag = FOUR_CHAR_CODE('mime') -kMimeInfoFileExtensionTag = FOUR_CHAR_CODE('ext ') -kMimeInfoDescriptionTag = FOUR_CHAR_CODE('desc') -kMimeInfoGroupTag = FOUR_CHAR_CODE('grop') -kMimeInfoDoNotOverrideExistingFileTypeAssociation = FOUR_CHAR_CODE('nofa') -kQTFileTypeAIFF = FOUR_CHAR_CODE('AIFF') -kQTFileTypeAIFC = FOUR_CHAR_CODE('AIFC') -kQTFileTypeDVC = FOUR_CHAR_CODE('dvc!') -kQTFileTypeMIDI = FOUR_CHAR_CODE('Midi') -kQTFileTypePicture = FOUR_CHAR_CODE('PICT') -kQTFileTypeMovie = FOUR_CHAR_CODE('MooV') -kQTFileTypeText = FOUR_CHAR_CODE('TEXT') -kQTFileTypeWave = FOUR_CHAR_CODE('WAVE') -kQTFileTypeSystemSevenSound = FOUR_CHAR_CODE('sfil') -kQTFileTypeMuLaw = FOUR_CHAR_CODE('ULAW') -kQTFileTypeAVI = FOUR_CHAR_CODE('VfW ') -kQTFileTypeSoundDesignerII = FOUR_CHAR_CODE('Sd2f') -kQTFileTypeAudioCDTrack = FOUR_CHAR_CODE('trak') -kQTFileTypePICS = FOUR_CHAR_CODE('PICS') -kQTFileTypeGIF = FOUR_CHAR_CODE('GIFf') -kQTFileTypePNG = FOUR_CHAR_CODE('PNGf') -kQTFileTypeTIFF = FOUR_CHAR_CODE('TIFF') -kQTFileTypePhotoShop = FOUR_CHAR_CODE('8BPS') -kQTFileTypeSGIImage = FOUR_CHAR_CODE('.SGI') -kQTFileTypeBMP = FOUR_CHAR_CODE('BMPf') -kQTFileTypeJPEG = FOUR_CHAR_CODE('JPEG') -kQTFileTypeJFIF = FOUR_CHAR_CODE('JPEG') -kQTFileTypeMacPaint = FOUR_CHAR_CODE('PNTG') -kQTFileTypeTargaImage = FOUR_CHAR_CODE('TPIC') -kQTFileTypeQuickDrawGXPicture = FOUR_CHAR_CODE('qdgx') -kQTFileTypeQuickTimeImage = FOUR_CHAR_CODE('qtif') -kQTFileType3DMF = FOUR_CHAR_CODE('3DMF') -kQTFileTypeFLC = FOUR_CHAR_CODE('FLC ') -kQTFileTypeFlash = FOUR_CHAR_CODE('SWFL') -kQTFileTypeFlashPix = FOUR_CHAR_CODE('FPix') -kQTFileTypeMP4 = FOUR_CHAR_CODE('mpg4') -kQTSettingsDVExportNTSC = FOUR_CHAR_CODE('dvcv') -kQTSettingsDVExportLockedAudio = FOUR_CHAR_CODE('lock') -kQTSettingsEffect = FOUR_CHAR_CODE('effe') -kQTSettingsGraphicsFileImportSequence = FOUR_CHAR_CODE('sequ') -kQTSettingsGraphicsFileImportSequenceEnabled = FOUR_CHAR_CODE('enab') -kQTSettingsMovieExportEnableVideo = FOUR_CHAR_CODE('envi') -kQTSettingsMovieExportEnableSound = FOUR_CHAR_CODE('enso') -kQTSettingsMovieExportSaveOptions = FOUR_CHAR_CODE('save') -kQTSettingsMovieExportSaveForInternet = FOUR_CHAR_CODE('fast') -kQTSettingsMovieExportSaveCompressedMovie = FOUR_CHAR_CODE('cmpm') -kQTSettingsMIDI = FOUR_CHAR_CODE('MIDI') -kQTSettingsMIDISettingFlags = FOUR_CHAR_CODE('sttg') -kQTSettingsText = FOUR_CHAR_CODE('text') -kQTSettingsTextDescription = FOUR_CHAR_CODE('desc') -kQTSettingsTextSize = FOUR_CHAR_CODE('size') -kQTSettingsTextSettingFlags = FOUR_CHAR_CODE('sttg') -kQTSettingsTextTimeFraction = FOUR_CHAR_CODE('timf') -kQTSettingsTime = FOUR_CHAR_CODE('time') -kQTSettingsTimeDuration = FOUR_CHAR_CODE('dura') -kQTSettingsAudioCDTrack = FOUR_CHAR_CODE('trak') -kQTSettingsAudioCDTrackRateShift = FOUR_CHAR_CODE('rshf') -kQTSettingsDVExportDVFormat = FOUR_CHAR_CODE('dvcf') -kQTPresetsListResourceType = FOUR_CHAR_CODE('stg#') -kQTPresetsPlatformListResourceType = FOUR_CHAR_CODE('stgp') -kQTPresetInfoIsDivider = 1 -kQTMovieExportSourceInfoResourceType = FOUR_CHAR_CODE('src#') -kQTMovieExportSourceInfoIsMediaType = 1L << 0 -kQTMovieExportSourceInfoIsMediaCharacteristic = 1L << 1 -kQTMovieExportSourceInfoIsSourceType = 1L << 2 -movieExportUseConfiguredSettings = FOUR_CHAR_CODE('ucfg') -movieExportWidth = FOUR_CHAR_CODE('wdth') -movieExportHeight = FOUR_CHAR_CODE('hegt') -movieExportDuration = FOUR_CHAR_CODE('dura') -movieExportVideoFilter = FOUR_CHAR_CODE('iflt') -movieExportTimeScale = FOUR_CHAR_CODE('tmsc') -kQTBrowserInfoCanUseSystemFolderPlugin = (1L << 0) -kQTPreFlightOpenComponent = (1L << 1) -pnotComponentWantsEvents = 1 -pnotComponentNeedsNoCache = 2 -ShowFilePreviewComponentType = FOUR_CHAR_CODE('pnot') -CreateFilePreviewComponentType = FOUR_CHAR_CODE('pmak') -DataCompressorComponentType = FOUR_CHAR_CODE('dcom') -DataDecompressorComponentType = FOUR_CHAR_CODE('ddec') -AppleDataCompressorSubType = FOUR_CHAR_CODE('adec') -zlibDataCompressorSubType = FOUR_CHAR_CODE('zlib') -kDataHCanRead = 1L << 0 -kDataHSpecialRead = 1L << 1 -kDataHSpecialReadFile = 1L << 2 -kDataHCanWrite = 1L << 3 -kDataHSpecialWrite = 1 << 4 -kDataHSpecialWriteFile = 1 << 5 -kDataHCanStreamingWrite = 1 << 6 -kDataHMustCheckDataRef = 1 << 7 -kDataRefExtensionChokeSpeed = FOUR_CHAR_CODE('chok') -kDataRefExtensionFileName = FOUR_CHAR_CODE('fnam') -kDataRefExtensionMIMEType = FOUR_CHAR_CODE('mime') -kDataRefExtensionMacOSFileType = FOUR_CHAR_CODE('ftyp') -kDataRefExtensionInitializationData = FOUR_CHAR_CODE('data') -kDataRefExtensionQuickTimeMediaType = FOUR_CHAR_CODE('mtyp') -kDataHChokeToMovieDataRate = 1 << 0 -kDataHChokeToParam = 1 << 1 -kDataHExtendedSchedule = FOUR_CHAR_CODE('xtnd') -kDataHInfoFlagNeverStreams = 1 << 0 -kDataHInfoFlagCanUpdateDataRefs = 1 << 1 -kDataHInfoFlagNeedsNetworkBandwidth = 1 << 2 -kDataHFileTypeMacOSFileType = FOUR_CHAR_CODE('ftyp') -kDataHFileTypeExtension = FOUR_CHAR_CODE('fext') -kDataHFileTypeMIME = FOUR_CHAR_CODE('mime') -kDataHCreateFileButDontCreateResFile = (1L << 0) -kDataHMovieUsageDoAppendMDAT = 1L << 0 -kDataHTempUseSameDirectory = 1L << 0 -kDataHTempUseSameVolume = 1L << 1 -kDataHTempCreateFile = 1L << 2 -kDataHTempOpenFile = 1L << 3 -kDataHGetDataRateInfiniteRate = 0x7FFFFFFF -kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0 -videoDigitizerComponentType = FOUR_CHAR_CODE('vdig') -vdigInterfaceRev = 2 -ntscIn = 0 -currentIn = 0 -palIn = 1 -secamIn = 2 -ntscReallyIn = 3 -compositeIn = 0 -sVideoIn = 1 -rgbComponentIn = 2 -rgbComponentSyncIn = 3 -yuvComponentIn = 4 -yuvComponentSyncIn = 5 -tvTunerIn = 6 -sdiIn = 7 -vdPlayThruOff = 0 -vdPlayThruOn = 1 -vdDigitizerBW = 0 -vdDigitizerRGB = 1 -vdBroadcastMode = 0 -vdVTRMode = 1 -vdUseAnyField = 0 -vdUseOddField = 1 -vdUseEvenField = 2 -vdTypeBasic = 0 -vdTypeAlpha = 1 -vdTypeMask = 2 -vdTypeKey = 3 -digiInDoesNTSC = 1L << 0 -digiInDoesPAL = 1L << 1 -digiInDoesSECAM = 1L << 2 -digiInDoesGenLock = 1L << 7 -digiInDoesComposite = 1L << 8 -digiInDoesSVideo = 1L << 9 -digiInDoesComponent = 1L << 10 -digiInVTR_Broadcast = 1L << 11 -digiInDoesColor = 1L << 12 -digiInDoesBW = 1L << 13 -digiInSignalLock = 1L << 31 -digiOutDoes1 = 1L << 0 -digiOutDoes2 = 1L << 1 -digiOutDoes4 = 1L << 2 -digiOutDoes8 = 1L << 3 -digiOutDoes16 = 1L << 4 -digiOutDoes32 = 1L << 5 -digiOutDoesDither = 1L << 6 -digiOutDoesStretch = 1L << 7 -digiOutDoesShrink = 1L << 8 -digiOutDoesMask = 1L << 9 -digiOutDoesDouble = 1L << 11 -digiOutDoesQuad = 1L << 12 -digiOutDoesQuarter = 1L << 13 -digiOutDoesSixteenth = 1L << 14 -digiOutDoesRotate = 1L << 15 -digiOutDoesHorizFlip = 1L << 16 -digiOutDoesVertFlip = 1L << 17 -digiOutDoesSkew = 1L << 18 -digiOutDoesBlend = 1L << 19 -digiOutDoesWarp = 1L << 20 -digiOutDoesHW_DMA = 1L << 21 -digiOutDoesHWPlayThru = 1L << 22 -digiOutDoesILUT = 1L << 23 -digiOutDoesKeyColor = 1L << 24 -digiOutDoesAsyncGrabs = 1L << 25 -digiOutDoesUnreadableScreenBits = 1L << 26 -digiOutDoesCompress = 1L << 27 -digiOutDoesCompressOnly = 1L << 28 -digiOutDoesPlayThruDuringCompress = 1L << 29 -digiOutDoesCompressPartiallyVisible = 1L << 30 -digiOutDoesNotNeedCopyOfCompressData = 1L << 31 -dmaDepth1 = 1 -dmaDepth2 = 2 -dmaDepth4 = 4 -dmaDepth8 = 8 -dmaDepth16 = 16 -dmaDepth32 = 32 -dmaDepth2Gray = 64 -dmaDepth4Gray = 128 -dmaDepth8Gray = 256 -kVDIGControlledFrameRate = -1 -vdDeviceFlagShowInputsAsDevices = (1 << 0) -vdDeviceFlagHideDevice = (1 << 1) -vdFlagCaptureStarting = (1 << 0) -vdFlagCaptureStopping = (1 << 1) -vdFlagCaptureIsForPreview = (1 << 2) -vdFlagCaptureIsForRecord = (1 << 3) -vdFlagCaptureLowLatency = (1 << 4) -vdFlagCaptureAlwaysUseTimeBase = (1 << 5) -vdFlagCaptureSetSettingsBegin = (1 << 6) -vdFlagCaptureSetSettingsEnd = (1 << 7) -xmlParseComponentType = FOUR_CHAR_CODE('pars') -xmlParseComponentSubType = FOUR_CHAR_CODE('xml ') -xmlIdentifierInvalid = 0 -# xmlIdentifierUnrecognized = (long)0xFFFFFFFF -xmlContentTypeInvalid = 0 -xmlContentTypeElement = 1 -xmlContentTypeCharData = 2 -elementFlagAlwaysSelfContained = 1L << 0 -elementFlagPreserveWhiteSpace = 1L << 1 -xmlParseFlagAllowUppercase = 1L << 0 -xmlParseFlagAllowUnquotedAttributeValues = 1L << 1 -xmlParseFlagEventParseOnly = 1L << 2 -attributeValueKindCharString = 0 -attributeValueKindInteger = 1L << 0 -attributeValueKindPercent = 1L << 1 -attributeValueKindBoolean = 1L << 2 -attributeValueKindOnOff = 1L << 3 -attributeValueKindColor = 1L << 4 -attributeValueKindEnum = 1L << 5 -attributeValueKindCaseSensEnum = 1L << 6 -MAX_ATTRIBUTE_VALUE_KIND = attributeValueKindCaseSensEnum -nameSpaceIDNone = 0 -element_xml = 1 -attr_src = 1 -SeqGrabComponentType = FOUR_CHAR_CODE('barg') -SeqGrabChannelType = FOUR_CHAR_CODE('sgch') -SeqGrabPanelType = FOUR_CHAR_CODE('sgpn') -SeqGrabCompressionPanelType = FOUR_CHAR_CODE('cmpr') -SeqGrabSourcePanelType = FOUR_CHAR_CODE('sour') -seqGrabToDisk = 1 -seqGrabToMemory = 2 -seqGrabDontUseTempMemory = 4 -seqGrabAppendToFile = 8 -seqGrabDontAddMovieResource = 16 -seqGrabDontMakeMovie = 32 -seqGrabPreExtendFile = 64 -seqGrabDataProcIsInterruptSafe = 128 -seqGrabDataProcDoesOverlappingReads = 256 -seqGrabRecord = 1 -seqGrabPreview = 2 -seqGrabPlayDuringRecord = 4 -seqGrabLowLatencyCapture = 8 -seqGrabAlwaysUseTimeBase = 16 -seqGrabHasBounds = 1 -seqGrabHasVolume = 2 -seqGrabHasDiscreteSamples = 4 -seqGrabDoNotBufferizeData = 8 -seqGrabCanMoveWindowWhileRecording = 16 -grabPictOffScreen = 1 -grabPictIgnoreClip = 2 -grabPictCurrentImage = 4 -sgFlagControlledGrab = (1 << 0) -sgFlagAllowNonRGBPixMaps = (1 << 1) -sgDeviceInputNameFlagInputUnavailable = (1 << 0) -sgDeviceNameFlagDeviceUnavailable = (1 << 0) -sgDeviceNameFlagShowInputsAsDevices = (1 << 1) -sgDeviceListWithIcons = (1 << 0) -sgDeviceListDontCheckAvailability = (1 << 1) -sgDeviceListIncludeInputs = (1 << 2) -seqGrabWriteAppend = 0 -seqGrabWriteReserve = 1 -seqGrabWriteFill = 2 -seqGrabUnpause = 0 -seqGrabPause = 1 -seqGrabPauseForMenu = 3 -channelFlagDontOpenResFile = 2 -channelFlagHasDependency = 4 -sgPanelFlagForPanel = 1 -seqGrabSettingsPreviewOnly = 1 -channelPlayNormal = 0 -channelPlayFast = 1 -channelPlayHighQuality = 2 -channelPlayAllData = 4 -sgSetSettingsBegin = (1 << 0) -sgSetSettingsEnd = (1 << 1) -kSGSmallestDITLSize = -1 -kSGLargestDITLSize = -2 -sgChannelAtom = FOUR_CHAR_CODE('chan') -sgChannelSettingsAtom = FOUR_CHAR_CODE('ctom') -sgChannelDescription = FOUR_CHAR_CODE('cdsc') -sgChannelSettings = FOUR_CHAR_CODE('cset') -sgDeviceNameType = FOUR_CHAR_CODE('name') -sgDeviceDisplayNameType = FOUR_CHAR_CODE('dnam') -sgDeviceUIDType = FOUR_CHAR_CODE('duid') -sgInputUIDType = FOUR_CHAR_CODE('iuid') -sgUsageType = FOUR_CHAR_CODE('use ') -sgPlayFlagsType = FOUR_CHAR_CODE('plyf') -sgClipType = FOUR_CHAR_CODE('clip') -sgMatrixType = FOUR_CHAR_CODE('mtrx') -sgVolumeType = FOUR_CHAR_CODE('volu') -sgPanelSettingsAtom = FOUR_CHAR_CODE('ptom') -sgPanelDescription = FOUR_CHAR_CODE('pdsc') -sgPanelSettings = FOUR_CHAR_CODE('pset') -sgcSoundCompressionType = FOUR_CHAR_CODE('scmp') -sgcSoundCodecSettingsType = FOUR_CHAR_CODE('cdec') -sgcSoundSampleRateType = FOUR_CHAR_CODE('srat') -sgcSoundChannelCountType = FOUR_CHAR_CODE('schn') -sgcSoundSampleSizeType = FOUR_CHAR_CODE('ssiz') -sgcSoundInputType = FOUR_CHAR_CODE('sinp') -sgcSoundGainType = FOUR_CHAR_CODE('gain') -sgcVideoHueType = FOUR_CHAR_CODE('hue ') -sgcVideoSaturationType = FOUR_CHAR_CODE('satr') -sgcVideoContrastType = FOUR_CHAR_CODE('trst') -sgcVideoSharpnessType = FOUR_CHAR_CODE('shrp') -sgcVideoBrigtnessType = FOUR_CHAR_CODE('brit') -sgcVideoBlackLevelType = FOUR_CHAR_CODE('blkl') -sgcVideoWhiteLevelType = FOUR_CHAR_CODE('whtl') -sgcVideoInputType = FOUR_CHAR_CODE('vinp') -sgcVideoFormatType = FOUR_CHAR_CODE('vstd') -sgcVideoFilterType = FOUR_CHAR_CODE('vflt') -sgcVideoRectType = FOUR_CHAR_CODE('vrct') -sgcVideoDigitizerType = FOUR_CHAR_CODE('vdig') -QTVideoOutputComponentType = FOUR_CHAR_CODE('vout') -QTVideoOutputComponentBaseSubType = FOUR_CHAR_CODE('base') -kQTVideoOutputDontDisplayToUser = 1L << 0 -kQTVODisplayModeItem = FOUR_CHAR_CODE('qdmi') -kQTVODimensions = FOUR_CHAR_CODE('dimn') -kQTVOResolution = FOUR_CHAR_CODE('resl') -kQTVORefreshRate = FOUR_CHAR_CODE('refr') -kQTVOPixelType = FOUR_CHAR_CODE('pixl') -kQTVOName = FOUR_CHAR_CODE('name') -kQTVODecompressors = FOUR_CHAR_CODE('deco') -kQTVODecompressorType = FOUR_CHAR_CODE('dety') -kQTVODecompressorContinuous = FOUR_CHAR_CODE('cont') -kQTVODecompressorComponent = FOUR_CHAR_CODE('cmpt') -kClockGetTimeSelect = 0x0001 -kClockNewCallBackSelect = 0x0002 -kClockDisposeCallBackSelect = 0x0003 -kClockCallMeWhenSelect = 0x0004 -kClockCancelCallBackSelect = 0x0005 -kClockRateChangedSelect = 0x0006 -kClockTimeChangedSelect = 0x0007 -kClockSetTimeBaseSelect = 0x0008 -kClockStartStopChangedSelect = 0x0009 -kClockGetRateSelect = 0x000A -kSCGetCompressionExtendedSelect = 0x0001 -kSCPositionRectSelect = 0x0002 -kSCPositionDialogSelect = 0x0003 -kSCSetTestImagePictHandleSelect = 0x0004 -kSCSetTestImagePictFileSelect = 0x0005 -kSCSetTestImagePixMapSelect = 0x0006 -kSCGetBestDeviceRectSelect = 0x0007 -kSCRequestImageSettingsSelect = 0x000A -kSCCompressImageSelect = 0x000B -kSCCompressPictureSelect = 0x000C -kSCCompressPictureFileSelect = 0x000D -kSCRequestSequenceSettingsSelect = 0x000E -kSCCompressSequenceBeginSelect = 0x000F -kSCCompressSequenceFrameSelect = 0x0010 -kSCCompressSequenceEndSelect = 0x0011 -kSCDefaultPictHandleSettingsSelect = 0x0012 -kSCDefaultPictFileSettingsSelect = 0x0013 -kSCDefaultPixMapSettingsSelect = 0x0014 -kSCGetInfoSelect = 0x0015 -kSCSetInfoSelect = 0x0016 -kSCNewGWorldSelect = 0x0017 -kSCSetCompressFlagsSelect = 0x0018 -kSCGetCompressFlagsSelect = 0x0019 -kSCGetSettingsAsTextSelect = 0x001A -kSCGetSettingsAsAtomContainerSelect = 0x001B -kSCSetSettingsFromAtomContainerSelect = 0x001C -kSCCompressSequenceFrameAsyncSelect = 0x001D -kSCAsyncIdleSelect = 0x001E -kTweenerInitializeSelect = 0x0001 -kTweenerDoTweenSelect = 0x0002 -kTweenerResetSelect = 0x0003 -kTCGetCurrentTimeCodeSelect = 0x0101 -kTCGetTimeCodeAtTimeSelect = 0x0102 -kTCTimeCodeToStringSelect = 0x0103 -kTCTimeCodeToFrameNumberSelect = 0x0104 -kTCFrameNumberToTimeCodeSelect = 0x0105 -kTCGetSourceRefSelect = 0x0106 -kTCSetSourceRefSelect = 0x0107 -kTCSetTimeCodeFlagsSelect = 0x0108 -kTCGetTimeCodeFlagsSelect = 0x0109 -kTCSetDisplayOptionsSelect = 0x010A -kTCGetDisplayOptionsSelect = 0x010B -kMovieImportHandleSelect = 0x0001 -kMovieImportFileSelect = 0x0002 -kMovieImportSetSampleDurationSelect = 0x0003 -kMovieImportSetSampleDescriptionSelect = 0x0004 -kMovieImportSetMediaFileSelect = 0x0005 -kMovieImportSetDimensionsSelect = 0x0006 -kMovieImportSetChunkSizeSelect = 0x0007 -kMovieImportSetProgressProcSelect = 0x0008 -kMovieImportSetAuxiliaryDataSelect = 0x0009 -kMovieImportSetFromScrapSelect = 0x000A -kMovieImportDoUserDialogSelect = 0x000B -kMovieImportSetDurationSelect = 0x000C -kMovieImportGetAuxiliaryDataTypeSelect = 0x000D -kMovieImportValidateSelect = 0x000E -kMovieImportGetFileTypeSelect = 0x000F -kMovieImportDataRefSelect = 0x0010 -kMovieImportGetSampleDescriptionSelect = 0x0011 -kMovieImportGetMIMETypeListSelect = 0x0012 -kMovieImportSetOffsetAndLimitSelect = 0x0013 -kMovieImportGetSettingsAsAtomContainerSelect = 0x0014 -kMovieImportSetSettingsFromAtomContainerSelect = 0x0015 -kMovieImportSetOffsetAndLimit64Select = 0x0016 -kMovieImportIdleSelect = 0x0017 -kMovieImportValidateDataRefSelect = 0x0018 -kMovieImportGetLoadStateSelect = 0x0019 -kMovieImportGetMaxLoadedTimeSelect = 0x001A -kMovieImportEstimateCompletionTimeSelect = 0x001B -kMovieImportSetDontBlockSelect = 0x001C -kMovieImportGetDontBlockSelect = 0x001D -kMovieImportSetIdleManagerSelect = 0x001E -kMovieImportSetNewMovieFlagsSelect = 0x001F -kMovieImportGetDestinationMediaTypeSelect = 0x0020 -kMovieExportToHandleSelect = 0x0080 -kMovieExportToFileSelect = 0x0081 -kMovieExportGetAuxiliaryDataSelect = 0x0083 -kMovieExportSetProgressProcSelect = 0x0084 -kMovieExportSetSampleDescriptionSelect = 0x0085 -kMovieExportDoUserDialogSelect = 0x0086 -kMovieExportGetCreatorTypeSelect = 0x0087 -kMovieExportToDataRefSelect = 0x0088 -kMovieExportFromProceduresToDataRefSelect = 0x0089 -kMovieExportAddDataSourceSelect = 0x008A -kMovieExportValidateSelect = 0x008B -kMovieExportGetSettingsAsAtomContainerSelect = 0x008C -kMovieExportSetSettingsFromAtomContainerSelect = 0x008D -kMovieExportGetFileNameExtensionSelect = 0x008E -kMovieExportGetShortFileTypeStringSelect = 0x008F -kMovieExportGetSourceMediaTypeSelect = 0x0090 -kMovieExportSetGetMoviePropertyProcSelect = 0x0091 -kTextExportGetDisplayDataSelect = 0x0100 -kTextExportGetTimeFractionSelect = 0x0101 -kTextExportSetTimeFractionSelect = 0x0102 -kTextExportGetSettingsSelect = 0x0103 -kTextExportSetSettingsSelect = 0x0104 -kMIDIImportGetSettingsSelect = 0x0100 -kMIDIImportSetSettingsSelect = 0x0101 -kMovieExportNewGetDataAndPropertiesProcsSelect = 0x0100 -kMovieExportDisposeGetDataAndPropertiesProcsSelect = 0x0101 -kGraphicsImageImportSetSequenceEnabledSelect = 0x0100 -kGraphicsImageImportGetSequenceEnabledSelect = 0x0101 -kPreviewShowDataSelect = 0x0001 -kPreviewMakePreviewSelect = 0x0002 -kPreviewMakePreviewReferenceSelect = 0x0003 -kPreviewEventSelect = 0x0004 -kDataCodecDecompressSelect = 0x0001 -kDataCodecGetCompressBufferSizeSelect = 0x0002 -kDataCodecCompressSelect = 0x0003 -kDataCodecBeginInterruptSafeSelect = 0x0004 -kDataCodecEndInterruptSafeSelect = 0x0005 -kDataCodecDecompressPartialSelect = 0x0006 -kDataCodecCompressPartialSelect = 0x0007 -kDataHGetDataSelect = 0x0002 -kDataHPutDataSelect = 0x0003 -kDataHFlushDataSelect = 0x0004 -kDataHOpenForWriteSelect = 0x0005 -kDataHCloseForWriteSelect = 0x0006 -kDataHOpenForReadSelect = 0x0008 -kDataHCloseForReadSelect = 0x0009 -kDataHSetDataRefSelect = 0x000A -kDataHGetDataRefSelect = 0x000B -kDataHCompareDataRefSelect = 0x000C -kDataHTaskSelect = 0x000D -kDataHScheduleDataSelect = 0x000E -kDataHFinishDataSelect = 0x000F -kDataHFlushCacheSelect = 0x0010 -kDataHResolveDataRefSelect = 0x0011 -kDataHGetFileSizeSelect = 0x0012 -kDataHCanUseDataRefSelect = 0x0013 -kDataHGetVolumeListSelect = 0x0014 -kDataHWriteSelect = 0x0015 -kDataHPreextendSelect = 0x0016 -kDataHSetFileSizeSelect = 0x0017 -kDataHGetFreeSpaceSelect = 0x0018 -kDataHCreateFileSelect = 0x0019 -kDataHGetPreferredBlockSizeSelect = 0x001A -kDataHGetDeviceIndexSelect = 0x001B -kDataHIsStreamingDataHandlerSelect = 0x001C -kDataHGetDataInBufferSelect = 0x001D -kDataHGetScheduleAheadTimeSelect = 0x001E -kDataHSetCacheSizeLimitSelect = 0x001F -kDataHGetCacheSizeLimitSelect = 0x0020 -kDataHGetMovieSelect = 0x0021 -kDataHAddMovieSelect = 0x0022 -kDataHUpdateMovieSelect = 0x0023 -kDataHDoesBufferSelect = 0x0024 -kDataHGetFileNameSelect = 0x0025 -kDataHGetAvailableFileSizeSelect = 0x0026 -kDataHGetMacOSFileTypeSelect = 0x0027 -kDataHGetMIMETypeSelect = 0x0028 -kDataHSetDataRefWithAnchorSelect = 0x0029 -kDataHGetDataRefWithAnchorSelect = 0x002A -kDataHSetMacOSFileTypeSelect = 0x002B -kDataHSetTimeBaseSelect = 0x002C -kDataHGetInfoFlagsSelect = 0x002D -kDataHScheduleData64Select = 0x002E -kDataHWrite64Select = 0x002F -kDataHGetFileSize64Select = 0x0030 -kDataHPreextend64Select = 0x0031 -kDataHSetFileSize64Select = 0x0032 -kDataHGetFreeSpace64Select = 0x0033 -kDataHAppend64Select = 0x0034 -kDataHReadAsyncSelect = 0x0035 -kDataHPollReadSelect = 0x0036 -kDataHGetDataAvailabilitySelect = 0x0037 -kDataHGetFileSizeAsyncSelect = 0x003A -kDataHGetDataRefAsTypeSelect = 0x003B -kDataHSetDataRefExtensionSelect = 0x003C -kDataHGetDataRefExtensionSelect = 0x003D -kDataHGetMovieWithFlagsSelect = 0x003E -kDataHGetFileTypeOrderingSelect = 0x0040 -kDataHCreateFileWithFlagsSelect = 0x0041 -kDataHGetMIMETypeAsyncSelect = 0x0042 -kDataHGetInfoSelect = 0x0043 -kDataHSetIdleManagerSelect = 0x0044 -kDataHDeleteFileSelect = 0x0045 -kDataHSetMovieUsageFlagsSelect = 0x0046 -kDataHUseTemporaryDataRefSelect = 0x0047 -kDataHGetTemporaryDataRefCapabilitiesSelect = 0x0048 -kDataHRenameFileSelect = 0x0049 -kDataHPlaybackHintsSelect = 0x0103 -kDataHPlaybackHints64Select = 0x010E -kDataHGetDataRateSelect = 0x0110 -kDataHSetTimeHintsSelect = 0x0111 -kVDGetMaxSrcRectSelect = 0x0001 -kVDGetActiveSrcRectSelect = 0x0002 -kVDSetDigitizerRectSelect = 0x0003 -kVDGetDigitizerRectSelect = 0x0004 -kVDGetVBlankRectSelect = 0x0005 -kVDGetMaskPixMapSelect = 0x0006 -kVDGetPlayThruDestinationSelect = 0x0008 -kVDUseThisCLUTSelect = 0x0009 -kVDSetInputGammaValueSelect = 0x000A -kVDGetInputGammaValueSelect = 0x000B -kVDSetBrightnessSelect = 0x000C -kVDGetBrightnessSelect = 0x000D -kVDSetContrastSelect = 0x000E -kVDSetHueSelect = 0x000F -kVDSetSharpnessSelect = 0x0010 -kVDSetSaturationSelect = 0x0011 -kVDGetContrastSelect = 0x0012 -kVDGetHueSelect = 0x0013 -kVDGetSharpnessSelect = 0x0014 -kVDGetSaturationSelect = 0x0015 -kVDGrabOneFrameSelect = 0x0016 -kVDGetMaxAuxBufferSelect = 0x0017 -kVDGetDigitizerInfoSelect = 0x0019 -kVDGetCurrentFlagsSelect = 0x001A -kVDSetKeyColorSelect = 0x001B -kVDGetKeyColorSelect = 0x001C -kVDAddKeyColorSelect = 0x001D -kVDGetNextKeyColorSelect = 0x001E -kVDSetKeyColorRangeSelect = 0x001F -kVDGetKeyColorRangeSelect = 0x0020 -kVDSetDigitizerUserInterruptSelect = 0x0021 -kVDSetInputColorSpaceModeSelect = 0x0022 -kVDGetInputColorSpaceModeSelect = 0x0023 -kVDSetClipStateSelect = 0x0024 -kVDGetClipStateSelect = 0x0025 -kVDSetClipRgnSelect = 0x0026 -kVDClearClipRgnSelect = 0x0027 -kVDGetCLUTInUseSelect = 0x0028 -kVDSetPLLFilterTypeSelect = 0x0029 -kVDGetPLLFilterTypeSelect = 0x002A -kVDGetMaskandValueSelect = 0x002B -kVDSetMasterBlendLevelSelect = 0x002C -kVDSetPlayThruDestinationSelect = 0x002D -kVDSetPlayThruOnOffSelect = 0x002E -kVDSetFieldPreferenceSelect = 0x002F -kVDGetFieldPreferenceSelect = 0x0030 -kVDPreflightDestinationSelect = 0x0032 -kVDPreflightGlobalRectSelect = 0x0033 -kVDSetPlayThruGlobalRectSelect = 0x0034 -kVDSetInputGammaRecordSelect = 0x0035 -kVDGetInputGammaRecordSelect = 0x0036 -kVDSetBlackLevelValueSelect = 0x0037 -kVDGetBlackLevelValueSelect = 0x0038 -kVDSetWhiteLevelValueSelect = 0x0039 -kVDGetWhiteLevelValueSelect = 0x003A -kVDGetVideoDefaultsSelect = 0x003B -kVDGetNumberOfInputsSelect = 0x003C -kVDGetInputFormatSelect = 0x003D -kVDSetInputSelect = 0x003E -kVDGetInputSelect = 0x003F -kVDSetInputStandardSelect = 0x0040 -kVDSetupBuffersSelect = 0x0041 -kVDGrabOneFrameAsyncSelect = 0x0042 -kVDDoneSelect = 0x0043 -kVDSetCompressionSelect = 0x0044 -kVDCompressOneFrameAsyncSelect = 0x0045 -kVDCompressDoneSelect = 0x0046 -kVDReleaseCompressBufferSelect = 0x0047 -kVDGetImageDescriptionSelect = 0x0048 -kVDResetCompressSequenceSelect = 0x0049 -kVDSetCompressionOnOffSelect = 0x004A -kVDGetCompressionTypesSelect = 0x004B -kVDSetTimeBaseSelect = 0x004C -kVDSetFrameRateSelect = 0x004D -kVDGetDataRateSelect = 0x004E -kVDGetSoundInputDriverSelect = 0x004F -kVDGetDMADepthsSelect = 0x0050 -kVDGetPreferredTimeScaleSelect = 0x0051 -kVDReleaseAsyncBuffersSelect = 0x0052 -kVDSetDataRateSelect = 0x0054 -kVDGetTimeCodeSelect = 0x0055 -kVDUseSafeBuffersSelect = 0x0056 -kVDGetSoundInputSourceSelect = 0x0057 -kVDGetCompressionTimeSelect = 0x0058 -kVDSetPreferredPacketSizeSelect = 0x0059 -kVDSetPreferredImageDimensionsSelect = 0x005A -kVDGetPreferredImageDimensionsSelect = 0x005B -kVDGetInputNameSelect = 0x005C -kVDSetDestinationPortSelect = 0x005D -kVDGetDeviceNameAndFlagsSelect = 0x005E -kVDCaptureStateChangingSelect = 0x005F -kVDGetUniqueIDsSelect = 0x0060 -kVDSelectUniqueIDsSelect = 0x0061 -kXMLParseDataRefSelect = 0x0001 -kXMLParseFileSelect = 0x0002 -kXMLParseDisposeXMLDocSelect = 0x0003 -kXMLParseGetDetailedParseErrorSelect = 0x0004 -kXMLParseAddElementSelect = 0x0005 -kXMLParseAddAttributeSelect = 0x0006 -kXMLParseAddMultipleAttributesSelect = 0x0007 -kXMLParseAddAttributeAndValueSelect = 0x0008 -kXMLParseAddMultipleAttributesAndValuesSelect = 0x0009 -kXMLParseAddAttributeValueKindSelect = 0x000A -kXMLParseAddNameSpaceSelect = 0x000B -kXMLParseSetOffsetAndLimitSelect = 0x000C -kXMLParseSetEventParseRefConSelect = 0x000D -kXMLParseSetStartDocumentHandlerSelect = 0x000E -kXMLParseSetEndDocumentHandlerSelect = 0x000F -kXMLParseSetStartElementHandlerSelect = 0x0010 -kXMLParseSetEndElementHandlerSelect = 0x0011 -kXMLParseSetCharDataHandlerSelect = 0x0012 -kXMLParseSetPreprocessInstructionHandlerSelect = 0x0013 -kXMLParseSetCommentHandlerSelect = 0x0014 -kXMLParseSetCDataHandlerSelect = 0x0015 -kSGInitializeSelect = 0x0001 -kSGSetDataOutputSelect = 0x0002 -kSGGetDataOutputSelect = 0x0003 -kSGSetGWorldSelect = 0x0004 -kSGGetGWorldSelect = 0x0005 -kSGNewChannelSelect = 0x0006 -kSGDisposeChannelSelect = 0x0007 -kSGStartPreviewSelect = 0x0010 -kSGStartRecordSelect = 0x0011 -kSGIdleSelect = 0x0012 -kSGStopSelect = 0x0013 -kSGPauseSelect = 0x0014 -kSGPrepareSelect = 0x0015 -kSGReleaseSelect = 0x0016 -kSGGetMovieSelect = 0x0017 -kSGSetMaximumRecordTimeSelect = 0x0018 -kSGGetMaximumRecordTimeSelect = 0x0019 -kSGGetStorageSpaceRemainingSelect = 0x001A -kSGGetTimeRemainingSelect = 0x001B -kSGGrabPictSelect = 0x001C -kSGGetLastMovieResIDSelect = 0x001D -kSGSetFlagsSelect = 0x001E -kSGGetFlagsSelect = 0x001F -kSGSetDataProcSelect = 0x0020 -kSGNewChannelFromComponentSelect = 0x0021 -kSGDisposeDeviceListSelect = 0x0022 -kSGAppendDeviceListToMenuSelect = 0x0023 -kSGSetSettingsSelect = 0x0024 -kSGGetSettingsSelect = 0x0025 -kSGGetIndChannelSelect = 0x0026 -kSGUpdateSelect = 0x0027 -kSGGetPauseSelect = 0x0028 -kSGSettingsDialogSelect = 0x0029 -kSGGetAlignmentProcSelect = 0x002A -kSGSetChannelSettingsSelect = 0x002B -kSGGetChannelSettingsSelect = 0x002C -kSGGetModeSelect = 0x002D -kSGSetDataRefSelect = 0x002E -kSGGetDataRefSelect = 0x002F -kSGNewOutputSelect = 0x0030 -kSGDisposeOutputSelect = 0x0031 -kSGSetOutputFlagsSelect = 0x0032 -kSGSetChannelOutputSelect = 0x0033 -kSGGetDataOutputStorageSpaceRemainingSelect = 0x0034 -kSGHandleUpdateEventSelect = 0x0035 -kSGSetOutputNextOutputSelect = 0x0036 -kSGGetOutputNextOutputSelect = 0x0037 -kSGSetOutputMaximumOffsetSelect = 0x0038 -kSGGetOutputMaximumOffsetSelect = 0x0039 -kSGGetOutputDataReferenceSelect = 0x003A -kSGWriteExtendedMovieDataSelect = 0x003B -kSGGetStorageSpaceRemaining64Select = 0x003C -kSGGetDataOutputStorageSpaceRemaining64Select = 0x003D -kSGWriteMovieDataSelect = 0x0100 -kSGAddFrameReferenceSelect = 0x0101 -kSGGetNextFrameReferenceSelect = 0x0102 -kSGGetTimeBaseSelect = 0x0103 -kSGSortDeviceListSelect = 0x0104 -kSGAddMovieDataSelect = 0x0105 -kSGChangedSourceSelect = 0x0106 -kSGAddExtendedFrameReferenceSelect = 0x0107 -kSGGetNextExtendedFrameReferenceSelect = 0x0108 -kSGAddExtendedMovieDataSelect = 0x0109 -kSGAddOutputDataRefToMediaSelect = 0x010A -kSGSetSettingsSummarySelect = 0x010B -kSGSetChannelUsageSelect = 0x0080 -kSGGetChannelUsageSelect = 0x0081 -kSGSetChannelBoundsSelect = 0x0082 -kSGGetChannelBoundsSelect = 0x0083 -kSGSetChannelVolumeSelect = 0x0084 -kSGGetChannelVolumeSelect = 0x0085 -kSGGetChannelInfoSelect = 0x0086 -kSGSetChannelPlayFlagsSelect = 0x0087 -kSGGetChannelPlayFlagsSelect = 0x0088 -kSGSetChannelMaxFramesSelect = 0x0089 -kSGGetChannelMaxFramesSelect = 0x008A -kSGSetChannelRefConSelect = 0x008B -kSGSetChannelClipSelect = 0x008C -kSGGetChannelClipSelect = 0x008D -kSGGetChannelSampleDescriptionSelect = 0x008E -kSGGetChannelDeviceListSelect = 0x008F -kSGSetChannelDeviceSelect = 0x0090 -kSGSetChannelMatrixSelect = 0x0091 -kSGGetChannelMatrixSelect = 0x0092 -kSGGetChannelTimeScaleSelect = 0x0093 -kSGChannelPutPictureSelect = 0x0094 -kSGChannelSetRequestedDataRateSelect = 0x0095 -kSGChannelGetRequestedDataRateSelect = 0x0096 -kSGChannelSetDataSourceNameSelect = 0x0097 -kSGChannelGetDataSourceNameSelect = 0x0098 -kSGChannelSetCodecSettingsSelect = 0x0099 -kSGChannelGetCodecSettingsSelect = 0x009A -kSGGetChannelTimeBaseSelect = 0x009B -kSGGetChannelRefConSelect = 0x009C -kSGGetChannelDeviceAndInputNamesSelect = 0x009D -kSGSetChannelDeviceInputSelect = 0x009E -kSGSetChannelSettingsStateChangingSelect = 0x009F -kSGInitChannelSelect = 0x0180 -kSGWriteSamplesSelect = 0x0181 -kSGGetDataRateSelect = 0x0182 -kSGAlignChannelRectSelect = 0x0183 -kSGPanelGetDitlSelect = 0x0200 -kSGPanelGetTitleSelect = 0x0201 -kSGPanelCanRunSelect = 0x0202 -kSGPanelInstallSelect = 0x0203 -kSGPanelEventSelect = 0x0204 -kSGPanelItemSelect = 0x0205 -kSGPanelRemoveSelect = 0x0206 -kSGPanelSetGrabberSelect = 0x0207 -kSGPanelSetResFileSelect = 0x0208 -kSGPanelGetSettingsSelect = 0x0209 -kSGPanelSetSettingsSelect = 0x020A -kSGPanelValidateInputSelect = 0x020B -kSGPanelSetEventFilterSelect = 0x020C -kSGPanelGetDITLForSizeSelect = 0x020D -kSGGetSrcVideoBoundsSelect = 0x0100 -kSGSetVideoRectSelect = 0x0101 -kSGGetVideoRectSelect = 0x0102 -kSGGetVideoCompressorTypeSelect = 0x0103 -kSGSetVideoCompressorTypeSelect = 0x0104 -kSGSetVideoCompressorSelect = 0x0105 -kSGGetVideoCompressorSelect = 0x0106 -kSGGetVideoDigitizerComponentSelect = 0x0107 -kSGSetVideoDigitizerComponentSelect = 0x0108 -kSGVideoDigitizerChangedSelect = 0x0109 -kSGSetVideoBottlenecksSelect = 0x010A -kSGGetVideoBottlenecksSelect = 0x010B -kSGGrabFrameSelect = 0x010C -kSGGrabFrameCompleteSelect = 0x010D -kSGDisplayFrameSelect = 0x010E -kSGCompressFrameSelect = 0x010F -kSGCompressFrameCompleteSelect = 0x0110 -kSGAddFrameSelect = 0x0111 -kSGTransferFrameForCompressSelect = 0x0112 -kSGSetCompressBufferSelect = 0x0113 -kSGGetCompressBufferSelect = 0x0114 -kSGGetBufferInfoSelect = 0x0115 -kSGSetUseScreenBufferSelect = 0x0116 -kSGGetUseScreenBufferSelect = 0x0117 -kSGGrabCompressCompleteSelect = 0x0118 -kSGDisplayCompressSelect = 0x0119 -kSGSetFrameRateSelect = 0x011A -kSGGetFrameRateSelect = 0x011B -kSGSetPreferredPacketSizeSelect = 0x0121 -kSGGetPreferredPacketSizeSelect = 0x0122 -kSGSetUserVideoCompressorListSelect = 0x0123 -kSGGetUserVideoCompressorListSelect = 0x0124 -kSGSetSoundInputDriverSelect = 0x0100 -kSGGetSoundInputDriverSelect = 0x0101 -kSGSoundInputDriverChangedSelect = 0x0102 -kSGSetSoundRecordChunkSizeSelect = 0x0103 -kSGGetSoundRecordChunkSizeSelect = 0x0104 -kSGSetSoundInputRateSelect = 0x0105 -kSGGetSoundInputRateSelect = 0x0106 -kSGSetSoundInputParametersSelect = 0x0107 -kSGGetSoundInputParametersSelect = 0x0108 -kSGSetAdditionalSoundRatesSelect = 0x0109 -kSGGetAdditionalSoundRatesSelect = 0x010A -kSGSetFontNameSelect = 0x0100 -kSGSetFontSizeSelect = 0x0101 -kSGSetTextForeColorSelect = 0x0102 -kSGSetTextBackColorSelect = 0x0103 -kSGSetJustificationSelect = 0x0104 -kSGGetTextReturnToSpaceValueSelect = 0x0105 -kSGSetTextReturnToSpaceValueSelect = 0x0106 -kSGGetInstrumentSelect = 0x0100 -kSGSetInstrumentSelect = 0x0101 -kQTVideoOutputGetDisplayModeListSelect = 0x0001 -kQTVideoOutputGetCurrentClientNameSelect = 0x0002 -kQTVideoOutputSetClientNameSelect = 0x0003 -kQTVideoOutputGetClientNameSelect = 0x0004 -kQTVideoOutputBeginSelect = 0x0005 -kQTVideoOutputEndSelect = 0x0006 -kQTVideoOutputSetDisplayModeSelect = 0x0007 -kQTVideoOutputGetDisplayModeSelect = 0x0008 -kQTVideoOutputCustomConfigureDisplaySelect = 0x0009 -kQTVideoOutputSaveStateSelect = 0x000A -kQTVideoOutputRestoreStateSelect = 0x000B -kQTVideoOutputGetGWorldSelect = 0x000C -kQTVideoOutputGetGWorldParametersSelect = 0x000D -kQTVideoOutputGetIndSoundOutputSelect = 0x000E -kQTVideoOutputGetClockSelect = 0x000F -kQTVideoOutputSetEchoPortSelect = 0x0010 -kQTVideoOutputGetIndImageDecompressorSelect = 0x0011 -kQTVideoOutputBaseSetEchoPortSelect = 0x0012 -handlerHasSpatial = 1 << 0 -handlerCanClip = 1 << 1 -handlerCanMatte = 1 << 2 -handlerCanTransferMode = 1 << 3 -handlerNeedsBuffer = 1 << 4 -handlerNoIdle = 1 << 5 -handlerNoScheduler = 1 << 6 -handlerWantsTime = 1 << 7 -handlerCGrafPortOnly = 1 << 8 -handlerCanSend = 1 << 9 -handlerCanHandleComplexMatrix = 1 << 10 -handlerWantsDestinationPixels = 1 << 11 -handlerCanSendImageData = 1 << 12 -handlerCanPicSave = 1 << 13 -mMustDraw = 1 << 3 -mAtEnd = 1 << 4 -mPreflightDraw = 1 << 5 -mSyncDrawing = 1 << 6 -mPrecompositeOnly = 1 << 9 -mSoundOnly = 1 << 10 -mDoIdleActionsBeforeDraws = 1 << 11 -mDisableIdleActions = 1 << 12 -mDidDraw = 1 << 0 -mNeedsToDraw = 1 << 2 -mDrawAgain = 1 << 3 -mPartialDraw = 1 << 4 -mWantIdleActions = 1 << 5 -forceUpdateRedraw = 1 << 0 -forceUpdateNewBuffer = 1 << 1 -mHitTestBounds = 1L << 0 -mHitTestImage = 1L << 1 -mHitTestInvisible = 1L << 2 -mHitTestIsClick = 1L << 3 -mOpaque = 1L << 0 -mInvisible = 1L << 1 -kMediaQTIdleFrequencySelector = FOUR_CHAR_CODE('idfq') -kMediaVideoParamBrightness = 1 -kMediaVideoParamContrast = 2 -kMediaVideoParamHue = 3 -kMediaVideoParamSharpness = 4 -kMediaVideoParamSaturation = 5 -kMediaVideoParamBlackLevel = 6 -kMediaVideoParamWhiteLevel = 7 -kMHInfoEncodedFrameRate = FOUR_CHAR_CODE('orat') -kEmptyPurgableChunksOverAllowance = 1 -kCallComponentExecuteWiredActionSelect = -9 -kMediaSetChunkManagementFlagsSelect = 0x0415 -kMediaGetChunkManagementFlagsSelect = 0x0416 -kMediaSetPurgeableChunkMemoryAllowanceSelect = 0x0417 -kMediaGetPurgeableChunkMemoryAllowanceSelect = 0x0418 -kMediaEmptyAllPurgeableChunksSelect = 0x0419 -kMediaInitializeSelect = 0x0501 -kMediaSetHandlerCapabilitiesSelect = 0x0502 -kMediaIdleSelect = 0x0503 -kMediaGetMediaInfoSelect = 0x0504 -kMediaPutMediaInfoSelect = 0x0505 -kMediaSetActiveSelect = 0x0506 -kMediaSetRateSelect = 0x0507 -kMediaGGetStatusSelect = 0x0508 -kMediaTrackEditedSelect = 0x0509 -kMediaSetMediaTimeScaleSelect = 0x050A -kMediaSetMovieTimeScaleSelect = 0x050B -kMediaSetGWorldSelect = 0x050C -kMediaSetDimensionsSelect = 0x050D -kMediaSetClipSelect = 0x050E -kMediaSetMatrixSelect = 0x050F -kMediaGetTrackOpaqueSelect = 0x0510 -kMediaSetGraphicsModeSelect = 0x0511 -kMediaGetGraphicsModeSelect = 0x0512 -kMediaGSetVolumeSelect = 0x0513 -kMediaSetSoundBalanceSelect = 0x0514 -kMediaGetSoundBalanceSelect = 0x0515 -kMediaGetNextBoundsChangeSelect = 0x0516 -kMediaGetSrcRgnSelect = 0x0517 -kMediaPrerollSelect = 0x0518 -kMediaSampleDescriptionChangedSelect = 0x0519 -kMediaHasCharacteristicSelect = 0x051A -kMediaGetOffscreenBufferSizeSelect = 0x051B -kMediaSetHintsSelect = 0x051C -kMediaGetNameSelect = 0x051D -kMediaForceUpdateSelect = 0x051E -kMediaGetDrawingRgnSelect = 0x051F -kMediaGSetActiveSegmentSelect = 0x0520 -kMediaInvalidateRegionSelect = 0x0521 -kMediaGetNextStepTimeSelect = 0x0522 -kMediaSetNonPrimarySourceDataSelect = 0x0523 -kMediaChangedNonPrimarySourceSelect = 0x0524 -kMediaTrackReferencesChangedSelect = 0x0525 -kMediaGetSampleDataPointerSelect = 0x0526 -kMediaReleaseSampleDataPointerSelect = 0x0527 -kMediaTrackPropertyAtomChangedSelect = 0x0528 -kMediaSetTrackInputMapReferenceSelect = 0x0529 -kMediaSetVideoParamSelect = 0x052B -kMediaGetVideoParamSelect = 0x052C -kMediaCompareSelect = 0x052D -kMediaGetClockSelect = 0x052E -kMediaSetSoundOutputComponentSelect = 0x052F -kMediaGetSoundOutputComponentSelect = 0x0530 -kMediaSetSoundLocalizationDataSelect = 0x0531 -kMediaGetInvalidRegionSelect = 0x053C -kMediaSampleDescriptionB2NSelect = 0x053E -kMediaSampleDescriptionN2BSelect = 0x053F -kMediaQueueNonPrimarySourceDataSelect = 0x0540 -kMediaFlushNonPrimarySourceDataSelect = 0x0541 -kMediaGetURLLinkSelect = 0x0543 -kMediaMakeMediaTimeTableSelect = 0x0545 -kMediaHitTestForTargetRefConSelect = 0x0546 -kMediaHitTestTargetRefConSelect = 0x0547 -kMediaGetActionsForQTEventSelect = 0x0548 -kMediaDisposeTargetRefConSelect = 0x0549 -kMediaTargetRefConsEqualSelect = 0x054A -kMediaSetActionsCallbackSelect = 0x054B -kMediaPrePrerollBeginSelect = 0x054C -kMediaPrePrerollCancelSelect = 0x054D -kMediaEnterEmptyEditSelect = 0x054F -kMediaCurrentMediaQueuedDataSelect = 0x0550 -kMediaGetEffectiveVolumeSelect = 0x0551 -kMediaResolveTargetRefConSelect = 0x0552 -kMediaGetSoundLevelMeteringEnabledSelect = 0x0553 -kMediaSetSoundLevelMeteringEnabledSelect = 0x0554 -kMediaGetSoundLevelMeterInfoSelect = 0x0555 -kMediaGetEffectiveSoundBalanceSelect = 0x0556 -kMediaSetScreenLockSelect = 0x0557 -kMediaSetDoMCActionCallbackSelect = 0x0558 -kMediaGetErrorStringSelect = 0x0559 -kMediaGetSoundEqualizerBandsSelect = 0x055A -kMediaSetSoundEqualizerBandsSelect = 0x055B -kMediaGetSoundEqualizerBandLevelsSelect = 0x055C -kMediaDoIdleActionsSelect = 0x055D -kMediaSetSoundBassAndTrebleSelect = 0x055E -kMediaGetSoundBassAndTrebleSelect = 0x055F -kMediaTimeBaseChangedSelect = 0x0560 -kMediaMCIsPlayerEventSelect = 0x0561 -kMediaGetMediaLoadStateSelect = 0x0562 -kMediaVideoOutputChangedSelect = 0x0563 -kMediaEmptySampleCacheSelect = 0x0564 -kMediaGetPublicInfoSelect = 0x0565 -kMediaSetPublicInfoSelect = 0x0566 -kMediaGetUserPreferredCodecsSelect = 0x0567 -kMediaSetUserPreferredCodecsSelect = 0x0568 -kMediaRefConSetPropertySelect = 0x0569 -kMediaRefConGetPropertySelect = 0x056A -kMediaNavigateTargetRefConSelect = 0x056B -kMediaGGetIdleManagerSelect = 0x056C -kMediaGSetIdleManagerSelect = 0x056D -kaiToneDescType = FOUR_CHAR_CODE('tone') -kaiNoteRequestInfoType = FOUR_CHAR_CODE('ntrq') -kaiKnobListType = FOUR_CHAR_CODE('knbl') -kaiKeyRangeInfoType = FOUR_CHAR_CODE('sinf') -kaiSampleDescType = FOUR_CHAR_CODE('sdsc') -kaiSampleInfoType = FOUR_CHAR_CODE('smin') -kaiSampleDataType = FOUR_CHAR_CODE('sdat') -kaiSampleDataQUIDType = FOUR_CHAR_CODE('quid') -kaiInstInfoType = FOUR_CHAR_CODE('iinf') -kaiPictType = FOUR_CHAR_CODE('pict') -kaiWriterType = FOUR_CHAR_CODE('\xa9wrt') -kaiCopyrightType = FOUR_CHAR_CODE('\xa9cpy') -kaiOtherStrType = FOUR_CHAR_CODE('str ') -kaiInstrumentRefType = FOUR_CHAR_CODE('iref') -kaiInstGMQualityType = FOUR_CHAR_CODE('qual') -kaiLibraryInfoType = FOUR_CHAR_CODE('linf') -kaiLibraryDescType = FOUR_CHAR_CODE('ldsc') -kInstKnobMissingUnknown = 0 -kInstKnobMissingDefault = (1 << 0) -kMusicLoopTypeNormal = 0 -kMusicLoopTypePalindrome = 1 -instSamplePreProcessFlag = 1 << 0 -kQTMIDIComponentType = FOUR_CHAR_CODE('midi') -kOMSComponentSubType = FOUR_CHAR_CODE('OMS ') -kFMSComponentSubType = FOUR_CHAR_CODE('FMS ') -kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr') -kOSXMIDIComponentSubType = FOUR_CHAR_CODE('osxm') -kMusicPacketPortLost = 1 -kMusicPacketPortFound = 2 -kMusicPacketTimeGap = 3 -kAppleSysexID = 0x11 -kAppleSysexCmdSampleSize = 0x0001 -kAppleSysexCmdSampleBreak = 0x0002 -kAppleSysexCmdAtomicInstrument = 0x0010 -kAppleSysexCmdDeveloper = 0x7F00 -kSynthesizerConnectionFMS = 1 -kSynthesizerConnectionMMgr = 2 -kSynthesizerConnectionOMS = 4 -kSynthesizerConnectionQT = 8 -kSynthesizerConnectionOSXMIDI = 16 -kSynthesizerConnectionUnavailable = 256 -kMusicComponentType = FOUR_CHAR_CODE('musi') -kInstrumentComponentType = FOUR_CHAR_CODE('inst') -kSoftSynthComponentSubType = FOUR_CHAR_CODE('ss ') -kGMSynthComponentSubType = FOUR_CHAR_CODE('gm ') -kSynthesizerDynamicVoice = 1 << 0 -kSynthesizerUsesMIDIPort = 1 << 1 -kSynthesizerMicrotone = 1 << 2 -kSynthesizerHasSamples = 1 << 3 -kSynthesizerMixedDrums = 1 << 4 -kSynthesizerSoftware = 1 << 5 -kSynthesizerHardware = 1 << 6 -kSynthesizerDynamicChannel = 1 << 7 -kSynthesizerHogsSystemChannel = 1 << 8 -kSynthesizerHasSystemChannel = 1 << 9 -kSynthesizerSlowSetPart = 1 << 10 -kSynthesizerOffline = 1 << 12 -kSynthesizerGM = 1 << 14 -kSynthesizerDLS = 1 << 15 -kSynthesizerSoundLocalization = 1 << 16 -kControllerModulationWheel = 1 -kControllerBreath = 2 -kControllerFoot = 4 -kControllerPortamentoTime = 5 -kControllerVolume = 7 -kControllerBalance = 8 -kControllerPan = 10 -kControllerExpression = 11 -kControllerLever1 = 16 -kControllerLever2 = 17 -kControllerLever3 = 18 -kControllerLever4 = 19 -kControllerLever5 = 80 -kControllerLever6 = 81 -kControllerLever7 = 82 -kControllerLever8 = 83 -kControllerPitchBend = 32 -kControllerAfterTouch = 33 -kControllerPartTranspose = 40 -kControllerTuneTranspose = 41 -kControllerPartVolume = 42 -kControllerTuneVolume = 43 -kControllerSustain = 64 -kControllerPortamento = 65 -kControllerSostenuto = 66 -kControllerSoftPedal = 67 -kControllerReverb = 91 -kControllerTremolo = 92 -kControllerChorus = 93 -kControllerCeleste = 94 -kControllerPhaser = 95 -kControllerEditPart = 113 -kControllerMasterTune = 114 -kControllerMasterTranspose = 114 -kControllerMasterVolume = 115 -kControllerMasterCPULoad = 116 -kControllerMasterPolyphony = 117 -kControllerMasterFeatures = 118 -kQTMSKnobStartID = 0x02000000 -kQTMSKnobVolumeAttackTimeID = 0x02000001 -kQTMSKnobVolumeDecayTimeID = 0x02000002 -kQTMSKnobVolumeSustainLevelID = 0x02000003 -kQTMSKnobVolumeRelease1RateID = 0x02000004 -kQTMSKnobVolumeDecayKeyScalingID = 0x02000005 -kQTMSKnobVolumeReleaseTimeID = 0x02000006 -kQTMSKnobVolumeLFODelayID = 0x02000007 -kQTMSKnobVolumeLFORampTimeID = 0x02000008 -kQTMSKnobVolumeLFOPeriodID = 0x02000009 -kQTMSKnobVolumeLFOShapeID = 0x0200000A -kQTMSKnobVolumeLFODepthID = 0x0200000B -kQTMSKnobVolumeOverallID = 0x0200000C -kQTMSKnobVolumeVelocity127ID = 0x0200000D -kQTMSKnobVolumeVelocity96ID = 0x0200000E -kQTMSKnobVolumeVelocity64ID = 0x0200000F -kQTMSKnobVolumeVelocity32ID = 0x02000010 -kQTMSKnobVolumeVelocity16ID = 0x02000011 -kQTMSKnobPitchTransposeID = 0x02000012 -kQTMSKnobPitchLFODelayID = 0x02000013 -kQTMSKnobPitchLFORampTimeID = 0x02000014 -kQTMSKnobPitchLFOPeriodID = 0x02000015 -kQTMSKnobPitchLFOShapeID = 0x02000016 -kQTMSKnobPitchLFODepthID = 0x02000017 -kQTMSKnobPitchLFOQuantizeID = 0x02000018 -kQTMSKnobStereoDefaultPanID = 0x02000019 -kQTMSKnobStereoPositionKeyScalingID = 0x0200001A -kQTMSKnobPitchLFOOffsetID = 0x0200001B -kQTMSKnobExclusionGroupID = 0x0200001C -kQTMSKnobSustainTimeID = 0x0200001D -kQTMSKnobSustainInfiniteID = 0x0200001E -kQTMSKnobVolumeLFOStereoID = 0x0200001F -kQTMSKnobVelocityLowID = 0x02000020 -kQTMSKnobVelocityHighID = 0x02000021 -kQTMSKnobVelocitySensitivityID = 0x02000022 -kQTMSKnobPitchSensitivityID = 0x02000023 -kQTMSKnobVolumeLFODepthFromWheelID = 0x02000024 -kQTMSKnobPitchLFODepthFromWheelID = 0x02000025 -kQTMSKnobVolumeExpOptionsID = 0x02000026 -kQTMSKnobEnv1AttackTimeID = 0x02000027 -kQTMSKnobEnv1DecayTimeID = 0x02000028 -kQTMSKnobEnv1SustainLevelID = 0x02000029 -kQTMSKnobEnv1SustainTimeID = 0x0200002A -kQTMSKnobEnv1SustainInfiniteID = 0x0200002B -kQTMSKnobEnv1ReleaseTimeID = 0x0200002C -kQTMSKnobEnv1ExpOptionsID = 0x0200002D -kQTMSKnobEnv2AttackTimeID = 0x0200002E -kQTMSKnobEnv2DecayTimeID = 0x0200002F -kQTMSKnobEnv2SustainLevelID = 0x02000030 -kQTMSKnobEnv2SustainTimeID = 0x02000031 -kQTMSKnobEnv2SustainInfiniteID = 0x02000032 -kQTMSKnobEnv2ReleaseTimeID = 0x02000033 -kQTMSKnobEnv2ExpOptionsID = 0x02000034 -kQTMSKnobPitchEnvelopeID = 0x02000035 -kQTMSKnobPitchEnvelopeDepthID = 0x02000036 -kQTMSKnobFilterKeyFollowID = 0x02000037 -kQTMSKnobFilterTransposeID = 0x02000038 -kQTMSKnobFilterQID = 0x02000039 -kQTMSKnobFilterFrequencyEnvelopeID = 0x0200003A -kQTMSKnobFilterFrequencyEnvelopeDepthID = 0x0200003B -kQTMSKnobFilterQEnvelopeID = 0x0200003C -kQTMSKnobFilterQEnvelopeDepthID = 0x0200003D -kQTMSKnobReverbThresholdID = 0x0200003E -kQTMSKnobVolumeAttackVelScalingID = 0x0200003F -kQTMSKnobLastIDPlus1 = 0x02000040 -kControllerMaximum = 0x00007FFF -# kControllerMinimum = (long)0xFFFF8000 -kVoiceCountDynamic = -1 -kFirstGMInstrument = 0x00000001 -kLastGMInstrument = 0x00000080 -kFirstGSInstrument = 0x00000081 -kLastGSInstrument = 0x00003FFF -kFirstDrumkit = 0x00004000 -kLastDrumkit = 0x00004080 -kFirstROMInstrument = 0x00008000 -kLastROMInstrument = 0x0000FFFF -kFirstUserInstrument = 0x00010000 -kLastUserInstrument = 0x0001FFFF -kInstrumentMatchSynthesizerType = 1 -kInstrumentMatchSynthesizerName = 2 -kInstrumentMatchName = 4 -kInstrumentMatchNumber = 8 -kInstrumentMatchGMNumber = 16 -kInstrumentMatchGSNumber = 32 -kKnobBasic = 8 -kKnobReadOnly = 16 -kKnobInterruptUnsafe = 32 -kKnobKeyrangeOverride = 64 -kKnobGroupStart = 128 -kKnobFixedPoint8 = 1024 -kKnobFixedPoint16 = 2048 -kKnobTypeNumber = 0 << 12 -kKnobTypeGroupName = 1 << 12 -kKnobTypeBoolean = 2 << 12 -kKnobTypeNote = 3 << 12 -kKnobTypePan = 4 << 12 -kKnobTypeInstrument = 5 << 12 -kKnobTypeSetting = 6 << 12 -kKnobTypeMilliseconds = 7 << 12 -kKnobTypePercentage = 8 << 12 -kKnobTypeHertz = 9 << 12 -kKnobTypeButton = 10 << 12 -kUnknownKnobValue = 0x7FFFFFFF -kDefaultKnobValue = 0x7FFFFFFE -notImplementedMusicErr = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))) -cantSendToSynthesizerErr = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))) -cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))) -illegalVoiceAllocationErr = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))) -illegalPartErr = (0x80000000 | (0xFFFF & (illegalPartOSErr))) -illegalChannelErr = (0x80000000 | (0xFFFF & (illegalChannelOSErr))) -illegalKnobErr = (0x80000000 | (0xFFFF & (illegalKnobOSErr))) -illegalKnobValueErr = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))) -illegalInstrumentErr = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))) -illegalControllerErr = (0x80000000 | (0xFFFF & (illegalControllerOSErr))) -midiManagerAbsentErr = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))) -synthesizerNotRespondingErr = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))) -synthesizerErr = (0x80000000 | (0xFFFF & (synthesizerOSErr))) -illegalNoteChannelErr = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))) -noteChannelNotAllocatedErr = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))) -tunePlayerFullErr = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))) -tuneParseErr = (0x80000000 | (0xFFFF & (tuneParseOSErr))) -kGetAtomicInstNoExpandedSamples = 1 << 0 -kGetAtomicInstNoOriginalSamples = 1 << 1 -kGetAtomicInstNoSamples = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples -kGetAtomicInstNoKnobList = 1 << 2 -kGetAtomicInstNoInstrumentInfo = 1 << 3 -kGetAtomicInstOriginalKnobList = 1 << 4 -kGetAtomicInstAllKnobs = 1 << 5 -kSetAtomicInstKeepOriginalInstrument = 1 << 0 -kSetAtomicInstShareAcrossParts = 1 << 1 -kSetAtomicInstCallerTosses = 1 << 2 -kSetAtomicInstCallerGuarantees = 1 << 3 -kSetAtomicInstInterruptSafe = 1 << 4 -kSetAtomicInstDontPreprocess = 1 << 7 -kInstrumentNamesModifiable = 1 -kInstrumentNamesBoth = 2 -kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene') -kGenericMusicKnob = 1 -kGenericMusicInstrumentKnob = 2 -kGenericMusicDrumKnob = 3 -kGenericMusicGlobalController = 4 -kGenericMusicResFirst = 0 -kGenericMusicResMiscStringList = 1 -kGenericMusicResMiscLongList = 2 -kGenericMusicResInstrumentList = 3 -kGenericMusicResDrumList = 4 -kGenericMusicResInstrumentKnobDescriptionList = 5 -kGenericMusicResDrumKnobDescriptionList = 6 -kGenericMusicResKnobDescriptionList = 7 -kGenericMusicResBitsLongList = 8 -kGenericMusicResModifiableInstrumentHW = 9 -kGenericMusicResGMTranslation = 10 -kGenericMusicResROMInstrumentData = 11 -kGenericMusicResAboutPICT = 12 -kGenericMusicResLast = 13 -kGenericMusicMiscLongFirst = 0 -kGenericMusicMiscLongVoiceCount = 1 -kGenericMusicMiscLongPartCount = 2 -kGenericMusicMiscLongModifiableInstrumentCount = 3 -kGenericMusicMiscLongChannelMask = 4 -kGenericMusicMiscLongDrumPartCount = 5 -kGenericMusicMiscLongModifiableDrumCount = 6 -kGenericMusicMiscLongDrumChannelMask = 7 -kGenericMusicMiscLongOutputCount = 8 -kGenericMusicMiscLongLatency = 9 -kGenericMusicMiscLongFlags = 10 -kGenericMusicMiscLongFirstGMHW = 11 -kGenericMusicMiscLongFirstGMDrumHW = 12 -kGenericMusicMiscLongFirstUserHW = 13 -kGenericMusicMiscLongLast = 14 -kMusicGenericRange = 0x0100 -kMusicDerivedRange = 0x0200 -kGenericMusicDoMIDI = 1 << 0 -kGenericMusicBank0 = 1 << 1 -kGenericMusicBank32 = 1 << 2 -kGenericMusicErsatzMIDI = 1 << 3 -kGenericMusicCallKnobs = 1 << 4 -kGenericMusicCallParts = 1 << 5 -kGenericMusicCallInstrument = 1 << 6 -kGenericMusicCallNumber = 1 << 7 -kGenericMusicCallROMInstrument = 1 << 8 -kGenericMusicAllDefaults = 1 << 9 -kGetInstrumentInfoNoBuiltIn = 1 << 0 -kGetInstrumentInfoMidiUserInst = 1 << 1 -kGetInstrumentInfoNoIText = 1 << 2 -kNoteRequestNoGM = 1 -kNoteRequestNoSynthType = 2 -kNoteRequestSynthMustMatch = 4 -kNoteRequestSpecifyMIDIChannel = 0x80 -kPickDontMix = 1 -kPickSameSynth = 2 -kPickUserInsts = 4 -kPickEditAllowEdit = 8 -kPickEditAllowPick = 16 -kPickEditSynthGlobal = 32 -kPickEditControllers = 64 -kNoteAllocatorComponentType = FOUR_CHAR_CODE('nota') -kNADummyOneSelect = 29 -kNADummyTwoSelect = 30 -kTuneQueueDepth = 8 -kTunePlayerComponentType = FOUR_CHAR_CODE('tune') -kTuneStartNow = 1 -kTuneDontClipNotes = 2 -kTuneExcludeEdgeNotes = 4 -kTuneQuickStart = 8 -kTuneLoopUntil = 16 -kTunePlayDifference = 32 -kTunePlayConcurrent = 64 -kTuneStartNewMaster = 16384 -kTuneStopFade = 1 -kTuneStopSustain = 2 -kTuneStopInstant = 4 -kTuneStopReleaseChannels = 8 -kTuneMixMute = 1 -kTuneMixSolo = 2 -kRestEventType = 0x00000000 -kNoteEventType = 0x00000001 -kControlEventType = 0x00000002 -kMarkerEventType = 0x00000003 -kUndefined1EventType = 0x00000008 -kXNoteEventType = 0x00000009 -kXControlEventType = 0x0000000A -kKnobEventType = 0x0000000B -kUndefined2EventType = 0x0000000C -kUndefined3EventType = 0x0000000D -kUndefined4EventType = 0x0000000E -kGeneralEventType = 0x0000000F -kXEventLengthBits = 0x00000002 -kGeneralEventLengthBits = 0x00000003 -kEventLen = 1L -kXEventLen = 2L -kRestEventLen = kEventLen -kNoteEventLen = kEventLen -kControlEventLen = kEventLen -kMarkerEventLen = kEventLen -kXNoteEventLen = kXEventLen -kXControlEventLen = kXEventLen -kGeneralEventLen = kXEventLen -kEventLengthFieldPos = 30 -kEventLengthFieldWidth = 2 -kEventTypeFieldPos = 29 -kEventTypeFieldWidth = 3 -kXEventTypeFieldPos = 28 -kXEventTypeFieldWidth = 4 -kEventPartFieldPos = 24 -kEventPartFieldWidth = 5 -kXEventPartFieldPos = 16 -kXEventPartFieldWidth = 12 -kRestEventDurationFieldPos = 0 -kRestEventDurationFieldWidth = 24 -kRestEventDurationMax = ((1L << kRestEventDurationFieldWidth) - 1) -kNoteEventPitchFieldPos = 18 -kNoteEventPitchFieldWidth = 6 -kNoteEventPitchOffset = 32 -kNoteEventVolumeFieldPos = 11 -kNoteEventVolumeFieldWidth = 7 -kNoteEventVolumeOffset = 0 -kNoteEventDurationFieldPos = 0 -kNoteEventDurationFieldWidth = 11 -kNoteEventDurationMax = ((1L << kNoteEventDurationFieldWidth) - 1) -kXNoteEventPitchFieldPos = 0 -kXNoteEventPitchFieldWidth = 16 -kXNoteEventDurationFieldPos = 0 -kXNoteEventDurationFieldWidth = 22 -kXNoteEventDurationMax = ((1L << kXNoteEventDurationFieldWidth) - 1) -kXNoteEventVolumeFieldPos = 22 -kXNoteEventVolumeFieldWidth = 7 -kControlEventControllerFieldPos = 16 -kControlEventControllerFieldWidth = 8 -kControlEventValueFieldPos = 0 -kControlEventValueFieldWidth = 16 -kXControlEventControllerFieldPos = 0 -kXControlEventControllerFieldWidth = 16 -kXControlEventValueFieldPos = 0 -kXControlEventValueFieldWidth = 16 -kKnobEventValueHighFieldPos = 0 -kKnobEventValueHighFieldWidth = 16 -kKnobEventKnobFieldPos = 16 -kKnobEventKnobFieldWidth = 14 -kKnobEventValueLowFieldPos = 0 -kKnobEventValueLowFieldWidth = 16 -kMarkerEventSubtypeFieldPos = 16 -kMarkerEventSubtypeFieldWidth = 8 -kMarkerEventValueFieldPos = 0 -kMarkerEventValueFieldWidth = 16 -kGeneralEventSubtypeFieldPos = 16 -kGeneralEventSubtypeFieldWidth = 14 -kGeneralEventLengthFieldPos = 0 -kGeneralEventLengthFieldWidth = 16 -kEndMarkerValue = 0x00000060 -kEndMarkerValue = 0x60000000 -# _ext = qtma_EXT(*lP -# ulen = (_ext < 2) ? 1 : 2 -# ulen = (unsigned short)qtma_EXT(*lP -# ulen = lP[1] -# _ext = qtma_EXT(*lP -# ulen = (_ext < 2) ? 1 : 2 -# ulen = (unsigned short)qtma_EXT(*lP -# ulen = lP[-1] -# x = (kRestEventType << kEventTypeFieldPos) \ -# x = EndianU32_NtoB(x) ) -# x = (kNoteEventType << kEventTypeFieldPos) \ -# x = EndianU32_NtoB(x) ) -# x = (kControlEventType << kEventTypeFieldPos) \ -# x = EndianU32_NtoB(x) ) -# x = (kMarkerEventType << kEventTypeFieldPos) \ -# x = EndianU32_NtoB(x) ) -# w1 = (kXNoteEventType << kXEventTypeFieldPos) \ -# w1 = EndianU32_NtoB(w1) -# w2 = (kXEventLengthBits << kEventLengthFieldPos) \ -# w2 = EndianU32_NtoB(w2) ) -# w1 = (kXControlEventType << kXEventTypeFieldPos) \ -# w1 = EndianU32_NtoB(w1) -# w2 = (kXEventLengthBits << kEventLengthFieldPos) \ -# w2 = EndianU32_NtoB(w2) ) -# w1 = (kKnobEventType << kXEventTypeFieldPos) \ -# w1 = EndianU32_NtoB(w1) -# w2 = (kXEventLengthBits << kEventLengthFieldPos) \ -# w2 = EndianU32_NtoB(w2) ) -# w1 = (kGeneralEventType << kXEventTypeFieldPos) \ -# w1 = EndianU32_NtoB(w1) -# w2 = (kGeneralEventLengthBits << kEventLengthFieldPos) \ -# w2 = EndianU32_NtoB(w2) ) -kGeneralEventNoteRequest = 1 -kGeneralEventPartKey = 4 -kGeneralEventTuneDifference = 5 -kGeneralEventAtomicInstrument = 6 -kGeneralEventKnob = 7 -kGeneralEventMIDIChannel = 8 -kGeneralEventPartChange = 9 -kGeneralEventNoOp = 10 -kGeneralEventUsedNotes = 11 -kGeneralEventPartMix = 12 -kMarkerEventEnd = 0 -kMarkerEventBeat = 1 -kMarkerEventTempo = 2 -kCurrentlyNativeEndian = 1 -kCurrentlyNotNativeEndian = 2 -kQTMIDIGetMIDIPortsSelect = 0x0001 -kQTMIDIUseSendPortSelect = 0x0002 -kQTMIDISendMIDISelect = 0x0003 -kMusicGetDescriptionSelect = 0x0001 -kMusicGetPartSelect = 0x0002 -kMusicSetPartSelect = 0x0003 -kMusicSetPartInstrumentNumberSelect = 0x0004 -kMusicGetPartInstrumentNumberSelect = 0x0005 -kMusicStorePartInstrumentSelect = 0x0006 -kMusicGetPartAtomicInstrumentSelect = 0x0009 -kMusicSetPartAtomicInstrumentSelect = 0x000A -kMusicGetPartKnobSelect = 0x0010 -kMusicSetPartKnobSelect = 0x0011 -kMusicGetKnobSelect = 0x0012 -kMusicSetKnobSelect = 0x0013 -kMusicGetPartNameSelect = 0x0014 -kMusicSetPartNameSelect = 0x0015 -kMusicFindToneSelect = 0x0016 -kMusicPlayNoteSelect = 0x0017 -kMusicResetPartSelect = 0x0018 -kMusicSetPartControllerSelect = 0x0019 -kMusicGetPartControllerSelect = 0x001A -kMusicGetMIDIProcSelect = 0x001B -kMusicSetMIDIProcSelect = 0x001C -kMusicGetInstrumentNamesSelect = 0x001D -kMusicGetDrumNamesSelect = 0x001E -kMusicGetMasterTuneSelect = 0x001F -kMusicSetMasterTuneSelect = 0x0020 -kMusicGetInstrumentAboutInfoSelect = 0x0022 -kMusicGetDeviceConnectionSelect = 0x0023 -kMusicUseDeviceConnectionSelect = 0x0024 -kMusicGetKnobSettingStringsSelect = 0x0025 -kMusicGetMIDIPortsSelect = 0x0026 -kMusicSendMIDISelect = 0x0027 -kMusicStartOfflineSelect = 0x0029 -kMusicSetOfflineTimeToSelect = 0x002A -kMusicGetInstrumentKnobDescriptionSelect = 0x002B -kMusicGetDrumKnobDescriptionSelect = 0x002C -kMusicGetKnobDescriptionSelect = 0x002D -kMusicGetInfoTextSelect = 0x002E -kMusicGetInstrumentInfoSelect = 0x002F -kMusicTaskSelect = 0x0031 -kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032 -kMusicSetPartSoundLocalizationSelect = 0x0033 -kMusicGenericConfigureSelect = 0x0100 -kMusicGenericGetPartSelect = 0x0101 -kMusicGenericGetKnobListSelect = 0x0102 -kMusicGenericSetResourceNumbersSelect = 0x0103 -kMusicDerivedMIDISendSelect = 0x0200 -kMusicDerivedSetKnobSelect = 0x0201 -kMusicDerivedSetPartSelect = 0x0202 -kMusicDerivedSetInstrumentSelect = 0x0203 -kMusicDerivedSetPartInstrumentNumberSelect = 0x0204 -kMusicDerivedSetMIDISelect = 0x0205 -kMusicDerivedStorePartInstrumentSelect = 0x0206 -kMusicDerivedOpenResFileSelect = 0x0207 -kMusicDerivedCloseResFileSelect = 0x0208 -kNARegisterMusicDeviceSelect = 0x0000 -kNAUnregisterMusicDeviceSelect = 0x0001 -kNAGetRegisteredMusicDeviceSelect = 0x0002 -kNASaveMusicConfigurationSelect = 0x0003 -kNANewNoteChannelSelect = 0x0004 -kNADisposeNoteChannelSelect = 0x0005 -kNAGetNoteChannelInfoSelect = 0x0006 -kNAPrerollNoteChannelSelect = 0x0007 -kNAUnrollNoteChannelSelect = 0x0008 -kNASetNoteChannelVolumeSelect = 0x000B -kNAResetNoteChannelSelect = 0x000C -kNAPlayNoteSelect = 0x000D -kNASetControllerSelect = 0x000E -kNASetKnobSelect = 0x000F -kNAFindNoteChannelToneSelect = 0x0010 -kNASetInstrumentNumberSelect = 0x0011 -kNAPickInstrumentSelect = 0x0012 -kNAPickArrangementSelect = 0x0013 -kNAStuffToneDescriptionSelect = 0x001B -kNACopyrightDialogSelect = 0x001C -kNAGetIndNoteChannelSelect = 0x001F -kNAGetMIDIPortsSelect = 0x0021 -kNAGetNoteRequestSelect = 0x0022 -kNASendMIDISelect = 0x0023 -kNAPickEditInstrumentSelect = 0x0024 -kNANewNoteChannelFromAtomicInstrumentSelect = 0x0025 -kNASetAtomicInstrumentSelect = 0x0026 -kNAGetKnobSelect = 0x0028 -kNATaskSelect = 0x0029 -kNASetNoteChannelBalanceSelect = 0x002A -kNASetInstrumentNumberInterruptSafeSelect = 0x002B -kNASetNoteChannelSoundLocalizationSelect = 0x002C -kNAGetControllerSelect = 0x002D -kTuneSetHeaderSelect = 0x0004 -kTuneGetTimeBaseSelect = 0x0005 -kTuneSetTimeScaleSelect = 0x0006 -kTuneGetTimeScaleSelect = 0x0007 -kTuneGetIndexedNoteChannelSelect = 0x0008 -kTuneQueueSelect = 0x000A -kTuneInstantSelect = 0x000B -kTuneGetStatusSelect = 0x000C -kTuneStopSelect = 0x000D -kTuneSetVolumeSelect = 0x0010 -kTuneGetVolumeSelect = 0x0011 -kTunePrerollSelect = 0x0012 -kTuneUnrollSelect = 0x0013 -kTuneSetNoteChannelsSelect = 0x0014 -kTuneSetPartTransposeSelect = 0x0015 -kTuneGetNoteAllocatorSelect = 0x0017 -kTuneSetSofterSelect = 0x0018 -kTuneTaskSelect = 0x0019 -kTuneSetBalanceSelect = 0x001A -kTuneSetSoundLocalizationSelect = 0x001B -kTuneSetHeaderWithSizeSelect = 0x001C -kTuneSetPartMixSelect = 0x001D -kTuneGetPartMixSelect = 0x001E diff --git a/sys/lib/python/plat-mac/Carbon/Res.py b/sys/lib/python/plat-mac/Carbon/Res.py deleted file mode 100644 index 8f45d0946..000000000 --- a/sys/lib/python/plat-mac/Carbon/Res.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - from OverrideFrom23._Res import * -except ImportError: - from _Res import * diff --git a/sys/lib/python/plat-mac/Carbon/Resources.py b/sys/lib/python/plat-mac/Carbon/Resources.py deleted file mode 100644 index 2cd876168..000000000 --- a/sys/lib/python/plat-mac/Carbon/Resources.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated from 'Resources.h' - -resSysHeap = 64 -resPurgeable = 32 -resLocked = 16 -resProtected = 8 -resPreload = 4 -resChanged = 2 -mapReadOnly = 128 -mapCompact = 64 -mapChanged = 32 -resSysRefBit = 7 -resSysHeapBit = 6 -resPurgeableBit = 5 -resLockedBit = 4 -resProtectedBit = 3 -resPreloadBit = 2 -resChangedBit = 1 -mapReadOnlyBit = 7 -mapCompactBit = 6 -mapChangedBit = 5 -kResFileNotOpened = -1 -kSystemResFile = 0 -kRsrcChainBelowSystemMap = 0 -kRsrcChainBelowApplicationMap = 1 -kRsrcChainAboveApplicationMap = 2 -kRsrcChainAboveAllMaps = 4 diff --git a/sys/lib/python/plat-mac/Carbon/Scrap.py b/sys/lib/python/plat-mac/Carbon/Scrap.py deleted file mode 100644 index 0dcbd3748..000000000 --- a/sys/lib/python/plat-mac/Carbon/Scrap.py +++ /dev/null @@ -1 +0,0 @@ -from _Scrap import * diff --git a/sys/lib/python/plat-mac/Carbon/Snd.py b/sys/lib/python/plat-mac/Carbon/Snd.py deleted file mode 100644 index 679f10b9c..000000000 --- a/sys/lib/python/plat-mac/Carbon/Snd.py +++ /dev/null @@ -1 +0,0 @@ -from _Snd import * diff --git a/sys/lib/python/plat-mac/Carbon/Sndihooks.py b/sys/lib/python/plat-mac/Carbon/Sndihooks.py deleted file mode 100644 index 73a3d284c..000000000 --- a/sys/lib/python/plat-mac/Carbon/Sndihooks.py +++ /dev/null @@ -1 +0,0 @@ -from _Sndihooks import * diff --git a/sys/lib/python/plat-mac/Carbon/Sound.py b/sys/lib/python/plat-mac/Carbon/Sound.py deleted file mode 100644 index 0e7b2fb64..000000000 --- a/sys/lib/python/plat-mac/Carbon/Sound.py +++ /dev/null @@ -1,400 +0,0 @@ -# Generated from 'Sound.h' - -def FOUR_CHAR_CODE(x): return x -soundListRsrc = FOUR_CHAR_CODE('snd ') -kSimpleBeepID = 1 -# rate48khz = (long)0xBB800000 -# rate44khz = (long)0xAC440000 -rate32khz = 0x7D000000 -rate22050hz = 0x56220000 -rate22khz = 0x56EE8BA3 -rate16khz = 0x3E800000 -rate11khz = 0x2B7745D1 -rate11025hz = 0x2B110000 -rate8khz = 0x1F400000 -sampledSynth = 5 -squareWaveSynth = 1 -waveTableSynth = 3 -MACE3snthID = 11 -MACE6snthID = 13 -kMiddleC = 60 -kNoVolume = 0 -kFullVolume = 0x0100 -stdQLength = 128 -dataOffsetFlag = 0x8000 -kUseOptionalOutputDevice = -1 -notCompressed = 0 -fixedCompression = -1 -variableCompression = -2 -twoToOne = 1 -eightToThree = 2 -threeToOne = 3 -sixToOne = 4 -sixToOnePacketSize = 8 -threeToOnePacketSize = 16 -stateBlockSize = 64 -leftOverBlockSize = 32 -firstSoundFormat = 0x0001 -secondSoundFormat = 0x0002 -dbBufferReady = 0x00000001 -dbLastBuffer = 0x00000004 -sysBeepDisable = 0x0000 -sysBeepEnable = (1 << 0) -sysBeepSynchronous = (1 << 1) -unitTypeNoSelection = 0xFFFF -unitTypeSeconds = 0x0000 -stdSH = 0x00 -extSH = 0xFF -cmpSH = 0xFE -nullCmd = 0 -quietCmd = 3 -flushCmd = 4 -reInitCmd = 5 -waitCmd = 10 -pauseCmd = 11 -resumeCmd = 12 -callBackCmd = 13 -syncCmd = 14 -availableCmd = 24 -versionCmd = 25 -volumeCmd = 46 -getVolumeCmd = 47 -clockComponentCmd = 50 -getClockComponentCmd = 51 -scheduledSoundCmd = 52 -linkSoundComponentsCmd = 53 -soundCmd = 80 -bufferCmd = 81 -rateMultiplierCmd = 86 -getRateMultiplierCmd = 87 -initCmd = 1 -freeCmd = 2 -totalLoadCmd = 26 -loadCmd = 27 -freqDurationCmd = 40 -restCmd = 41 -freqCmd = 42 -ampCmd = 43 -timbreCmd = 44 -getAmpCmd = 45 -waveTableCmd = 60 -phaseCmd = 61 -rateCmd = 82 -continueCmd = 83 -doubleBufferCmd = 84 -getRateCmd = 85 -sizeCmd = 90 -convertCmd = 91 -waveInitChannelMask = 0x07 -waveInitChannel0 = 0x04 -waveInitChannel1 = 0x05 -waveInitChannel2 = 0x06 -waveInitChannel3 = 0x07 -initChan0 = waveInitChannel0 -initChan1 = waveInitChannel1 -initChan2 = waveInitChannel2 -initChan3 = waveInitChannel3 -outsideCmpSH = 0 -insideCmpSH = 1 -aceSuccess = 0 -aceMemFull = 1 -aceNilBlock = 2 -aceBadComp = 3 -aceBadEncode = 4 -aceBadDest = 5 -aceBadCmd = 6 -initChanLeft = 0x0002 -initChanRight = 0x0003 -initNoInterp = 0x0004 -initNoDrop = 0x0008 -initMono = 0x0080 -initStereo = 0x00C0 -initMACE3 = 0x0300 -initMACE6 = 0x0400 -initPanMask = 0x0003 -initSRateMask = 0x0030 -initStereoMask = 0x00C0 -initCompMask = 0xFF00 -siActiveChannels = FOUR_CHAR_CODE('chac') -siActiveLevels = FOUR_CHAR_CODE('lmac') -siAGCOnOff = FOUR_CHAR_CODE('agc ') -siAsync = FOUR_CHAR_CODE('asyn') -siAVDisplayBehavior = FOUR_CHAR_CODE('avdb') -siChannelAvailable = FOUR_CHAR_CODE('chav') -siCompressionAvailable = FOUR_CHAR_CODE('cmav') -siCompressionChannels = FOUR_CHAR_CODE('cpct') -siCompressionFactor = FOUR_CHAR_CODE('cmfa') -siCompressionHeader = FOUR_CHAR_CODE('cmhd') -siCompressionNames = FOUR_CHAR_CODE('cnam') -siCompressionParams = FOUR_CHAR_CODE('evaw') -siCompressionSampleRate = FOUR_CHAR_CODE('cprt') -siCompressionType = FOUR_CHAR_CODE('comp') -siContinuous = FOUR_CHAR_CODE('cont') -siDecompressionParams = FOUR_CHAR_CODE('wave') -siDeviceBufferInfo = FOUR_CHAR_CODE('dbin') -siDeviceConnected = FOUR_CHAR_CODE('dcon') -siDeviceIcon = FOUR_CHAR_CODE('icon') -siDeviceName = FOUR_CHAR_CODE('name') -siEQSpectrumBands = FOUR_CHAR_CODE('eqsb') -siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv') -siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo') -siEQSpectrumResolution = FOUR_CHAR_CODE('eqrs') -siEQToneControlGain = FOUR_CHAR_CODE('eqtg') -siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc') -siHardwareBalance = FOUR_CHAR_CODE('hbal') -siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls') -siHardwareBass = FOUR_CHAR_CODE('hbas') -siHardwareBassSteps = FOUR_CHAR_CODE('hbst') -siHardwareBusy = FOUR_CHAR_CODE('hwbs') -siHardwareFormat = FOUR_CHAR_CODE('hwfm') -siHardwareMute = FOUR_CHAR_CODE('hmut') -siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp') -siHardwareTreble = FOUR_CHAR_CODE('htrb') -siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts') -siHardwareVolume = FOUR_CHAR_CODE('hvol') -siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp') -siHeadphoneMute = FOUR_CHAR_CODE('pmut') -siHeadphoneVolume = FOUR_CHAR_CODE('pvol') -siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst') -siInputAvailable = FOUR_CHAR_CODE('inav') -siInputGain = FOUR_CHAR_CODE('gain') -siInputSource = FOUR_CHAR_CODE('sour') -siInputSourceNames = FOUR_CHAR_CODE('snam') -siLevelMeterOnOff = FOUR_CHAR_CODE('lmet') -siModemGain = FOUR_CHAR_CODE('mgai') -siMonitorAvailable = FOUR_CHAR_CODE('mnav') -siMonitorSource = FOUR_CHAR_CODE('mons') -siNumberChannels = FOUR_CHAR_CODE('chan') -siOptionsDialog = FOUR_CHAR_CODE('optd') -siOSTypeInputSource = FOUR_CHAR_CODE('inpt') -siOSTypeInputAvailable = FOUR_CHAR_CODE('inav') -siOutputDeviceName = FOUR_CHAR_CODE('onam') -siPlayThruOnOff = FOUR_CHAR_CODE('plth') -siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx') -siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx') -siQuality = FOUR_CHAR_CODE('qual') -siRateMultiplier = FOUR_CHAR_CODE('rmul') -siRecordingQuality = FOUR_CHAR_CODE('qual') -siSampleRate = FOUR_CHAR_CODE('srat') -siSampleRateAvailable = FOUR_CHAR_CODE('srav') -siSampleSize = FOUR_CHAR_CODE('ssiz') -siSampleSizeAvailable = FOUR_CHAR_CODE('ssav') -siSetupCDAudio = FOUR_CHAR_CODE('sucd') -siSetupModemAudio = FOUR_CHAR_CODE('sumd') -siSlopeAndIntercept = FOUR_CHAR_CODE('flap') -siSoundClock = FOUR_CHAR_CODE('sclk') -siUseThisSoundClock = FOUR_CHAR_CODE('sclc') -siSpeakerMute = FOUR_CHAR_CODE('smut') -siSpeakerVolume = FOUR_CHAR_CODE('svol') -siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll') -siSSpLocalization = FOUR_CHAR_CODE('3dif') -siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst') -siStereoInputGain = FOUR_CHAR_CODE('sgai') -siSubwooferMute = FOUR_CHAR_CODE('bmut') -siTerminalType = FOUR_CHAR_CODE('ttyp') -siTwosComplementOnOff = FOUR_CHAR_CODE('twos') -siVendorProduct = FOUR_CHAR_CODE('vpro') -siVolume = FOUR_CHAR_CODE('volu') -siVoxRecordInfo = FOUR_CHAR_CODE('voxr') -siVoxStopInfo = FOUR_CHAR_CODE('voxs') -siWideStereo = FOUR_CHAR_CODE('wide') -siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl') -siRateConverterRollOffSlope = FOUR_CHAR_CODE('rcdb') -siOutputLatency = FOUR_CHAR_CODE('olte') -siCloseDriver = FOUR_CHAR_CODE('clos') -siInitializeDriver = FOUR_CHAR_CODE('init') -siPauseRecording = FOUR_CHAR_CODE('paus') -siUserInterruptProc = FOUR_CHAR_CODE('user') -# kInvalidSource = (long)0xFFFFFFFF -kNoSource = FOUR_CHAR_CODE('none') -kCDSource = FOUR_CHAR_CODE('cd ') -kExtMicSource = FOUR_CHAR_CODE('emic') -kSoundInSource = FOUR_CHAR_CODE('sinj') -kRCAInSource = FOUR_CHAR_CODE('irca') -kTVFMTunerSource = FOUR_CHAR_CODE('tvfm') -kDAVInSource = FOUR_CHAR_CODE('idav') -kIntMicSource = FOUR_CHAR_CODE('imic') -kMediaBaySource = FOUR_CHAR_CODE('mbay') -kModemSource = FOUR_CHAR_CODE('modm') -kPCCardSource = FOUR_CHAR_CODE('pcm ') -kZoomVideoSource = FOUR_CHAR_CODE('zvpc') -kDVDSource = FOUR_CHAR_CODE('dvda') -kMicrophoneArray = FOUR_CHAR_CODE('mica') -kNoSoundComponentType = FOUR_CHAR_CODE('****') -kSoundComponentType = FOUR_CHAR_CODE('sift') -kSoundComponentPPCType = FOUR_CHAR_CODE('nift') -kRate8SubType = FOUR_CHAR_CODE('ratb') -kRate16SubType = FOUR_CHAR_CODE('ratw') -kConverterSubType = FOUR_CHAR_CODE('conv') -kSndSourceSubType = FOUR_CHAR_CODE('sour') -kMixerType = FOUR_CHAR_CODE('mixr') -kMixer8SubType = FOUR_CHAR_CODE('mixb') -kMixer16SubType = FOUR_CHAR_CODE('mixw') -kSoundInputDeviceType = FOUR_CHAR_CODE('sinp') -kWaveInSubType = FOUR_CHAR_CODE('wavi') -kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn') -kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev') -kClassicSubType = FOUR_CHAR_CODE('clas') -kASCSubType = FOUR_CHAR_CODE('asc ') -kDSPSubType = FOUR_CHAR_CODE('dsp ') -kAwacsSubType = FOUR_CHAR_CODE('awac') -kGCAwacsSubType = FOUR_CHAR_CODE('awgc') -kSingerSubType = FOUR_CHAR_CODE('sing') -kSinger2SubType = FOUR_CHAR_CODE('sng2') -kWhitSubType = FOUR_CHAR_CODE('whit') -kSoundBlasterSubType = FOUR_CHAR_CODE('sbls') -kWaveOutSubType = FOUR_CHAR_CODE('wavo') -kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn') -kDirectSoundSubType = FOUR_CHAR_CODE('dsnd') -kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn') -kUNIXsdevSubType = FOUR_CHAR_CODE('un1x') -kUSBSubType = FOUR_CHAR_CODE('usb ') -kBlueBoxSubType = FOUR_CHAR_CODE('bsnd') -kSoundCompressor = FOUR_CHAR_CODE('scom') -kSoundDecompressor = FOUR_CHAR_CODE('sdec') -kAudioComponentType = FOUR_CHAR_CODE('adio') -kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn') -kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc') -kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh') -kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav') -kSGSToneSubType = FOUR_CHAR_CODE('sgs0') -kSoundEffectsType = FOUR_CHAR_CODE('snfx') -kEqualizerSubType = FOUR_CHAR_CODE('eqal') -kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3') -kSoundNotCompressed = FOUR_CHAR_CODE('NONE') -k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw ') -k16BitBigEndianFormat = FOUR_CHAR_CODE('twos') -k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt') -kFloat32Format = FOUR_CHAR_CODE('fl32') -kFloat64Format = FOUR_CHAR_CODE('fl64') -k24BitFormat = FOUR_CHAR_CODE('in24') -k32BitFormat = FOUR_CHAR_CODE('in32') -k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni') -kMACE3Compression = FOUR_CHAR_CODE('MAC3') -kMACE6Compression = FOUR_CHAR_CODE('MAC6') -kCDXA4Compression = FOUR_CHAR_CODE('cdx4') -kCDXA2Compression = FOUR_CHAR_CODE('cdx2') -kIMACompression = FOUR_CHAR_CODE('ima4') -kULawCompression = FOUR_CHAR_CODE('ulaw') -kALawCompression = FOUR_CHAR_CODE('alaw') -kMicrosoftADPCMFormat = 0x6D730002 -kDVIIntelIMAFormat = 0x6D730011 -kDVAudioFormat = FOUR_CHAR_CODE('dvca') -kQDesignCompression = FOUR_CHAR_CODE('QDMC') -kQDesign2Compression = FOUR_CHAR_CODE('QDM2') -kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp') -kOffsetBinary = k8BitOffsetBinaryFormat -kTwosComplement = k16BitBigEndianFormat -kLittleEndianFormat = k16BitLittleEndianFormat -kMPEGLayer3Format = 0x6D730055 -kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3') -k16BitNativeEndianFormat = k16BitLittleEndianFormat -k16BitNonNativeEndianFormat = k16BitBigEndianFormat -k16BitNativeEndianFormat = k16BitBigEndianFormat -k16BitNonNativeEndianFormat = k16BitLittleEndianFormat -k8BitRawIn = (1 << 0) -k8BitTwosIn = (1 << 1) -k16BitIn = (1 << 2) -kStereoIn = (1 << 3) -k8BitRawOut = (1 << 8) -k8BitTwosOut = (1 << 9) -k16BitOut = (1 << 10) -kStereoOut = (1 << 11) -kReverse = (1L << 16) -kRateConvert = (1L << 17) -kCreateSoundSource = (1L << 18) -kVMAwareness = (1L << 21) -kHighQuality = (1L << 22) -kNonRealTime = (1L << 23) -kSourcePaused = (1 << 0) -kPassThrough = (1L << 16) -kNoSoundComponentChain = (1L << 17) -kNoMixing = (1 << 0) -kNoSampleRateConversion = (1 << 1) -kNoSampleSizeConversion = (1 << 2) -kNoSampleFormatConversion = (1 << 3) -kNoChannelConversion = (1 << 4) -kNoDecompression = (1 << 5) -kNoVolumeConversion = (1 << 6) -kNoRealtimeProcessing = (1 << 7) -kScheduledSource = (1 << 8) -kNonInterleavedBuffer = (1 << 9) -kNonPagingMixer = (1 << 10) -kSoundConverterMixer = (1 << 11) -kPagingMixer = (1 << 12) -kVMAwareMixer = (1 << 13) -kExtendedSoundData = (1 << 14) -kBestQuality = (1 << 0) -kInputMask = 0x000000FF -kOutputMask = 0x0000FF00 -kOutputShift = 8 -kActionMask = 0x00FF0000 -kSoundComponentBits = 0x00FFFFFF -kAudioFormatAtomType = FOUR_CHAR_CODE('frma') -kAudioEndianAtomType = FOUR_CHAR_CODE('enda') -kAudioVBRAtomType = FOUR_CHAR_CODE('vbra') -kAudioTerminatorAtomType = 0 -kAVDisplayHeadphoneRemove = 0 -kAVDisplayHeadphoneInsert = 1 -kAVDisplayPlainTalkRemove = 2 -kAVDisplayPlainTalkInsert = 3 -audioAllChannels = 0 -audioLeftChannel = 1 -audioRightChannel = 2 -audioUnmuted = 0 -audioMuted = 1 -audioDoesMono = (1L << 0) -audioDoesStereo = (1L << 1) -audioDoesIndependentChannels = (1L << 2) -siCDQuality = FOUR_CHAR_CODE('cd ') -siBestQuality = FOUR_CHAR_CODE('best') -siBetterQuality = FOUR_CHAR_CODE('betr') -siGoodQuality = FOUR_CHAR_CODE('good') -siNoneQuality = FOUR_CHAR_CODE('none') -siDeviceIsConnected = 1 -siDeviceNotConnected = 0 -siDontKnowIfConnected = -1 -siReadPermission = 0 -siWritePermission = 1 -kSoundConverterDidntFillBuffer = (1 << 0) -kSoundConverterHasLeftOverData = (1 << 1) -kExtendedSoundSampleCountNotValid = 1L << 0 -kExtendedSoundBufferSizeValid = 1L << 1 -kScheduledSoundDoScheduled = 1 << 0 -kScheduledSoundDoCallBack = 1 << 1 -kScheduledSoundExtendedHdr = 1 << 2 -kSoundComponentInitOutputDeviceSelect = 0x0001 -kSoundComponentSetSourceSelect = 0x0002 -kSoundComponentGetSourceSelect = 0x0003 -kSoundComponentGetSourceDataSelect = 0x0004 -kSoundComponentSetOutputSelect = 0x0005 -kSoundComponentAddSourceSelect = 0x0101 -kSoundComponentRemoveSourceSelect = 0x0102 -kSoundComponentGetInfoSelect = 0x0103 -kSoundComponentSetInfoSelect = 0x0104 -kSoundComponentStartSourceSelect = 0x0105 -kSoundComponentStopSourceSelect = 0x0106 -kSoundComponentPauseSourceSelect = 0x0107 -kSoundComponentPlaySourceBufferSelect = 0x0108 -kAudioGetVolumeSelect = 0x0000 -kAudioSetVolumeSelect = 0x0001 -kAudioGetMuteSelect = 0x0002 -kAudioSetMuteSelect = 0x0003 -kAudioSetToDefaultsSelect = 0x0004 -kAudioGetInfoSelect = 0x0005 -kAudioGetBassSelect = 0x0006 -kAudioSetBassSelect = 0x0007 -kAudioGetTrebleSelect = 0x0008 -kAudioSetTrebleSelect = 0x0009 -kAudioGetOutputDeviceSelect = 0x000A -kAudioMuteOnEventSelect = 0x0081 -kDelegatedSoundComponentSelectors = 0x0100 -kSndInputReadAsyncSelect = 0x0001 -kSndInputReadSyncSelect = 0x0002 -kSndInputPauseRecordingSelect = 0x0003 -kSndInputResumeRecordingSelect = 0x0004 -kSndInputStopRecordingSelect = 0x0005 -kSndInputGetStatusSelect = 0x0006 -kSndInputGetDeviceInfoSelect = 0x0007 -kSndInputSetDeviceInfoSelect = 0x0008 -kSndInputInitHardwareSelect = 0x0009 diff --git a/sys/lib/python/plat-mac/Carbon/TE.py b/sys/lib/python/plat-mac/Carbon/TE.py deleted file mode 100644 index 4351d7a40..000000000 --- a/sys/lib/python/plat-mac/Carbon/TE.py +++ /dev/null @@ -1 +0,0 @@ -from _TE import * diff --git a/sys/lib/python/plat-mac/Carbon/TextEdit.py b/sys/lib/python/plat-mac/Carbon/TextEdit.py deleted file mode 100644 index 176795af9..000000000 --- a/sys/lib/python/plat-mac/Carbon/TextEdit.py +++ /dev/null @@ -1,57 +0,0 @@ -# Generated from 'TextEdit.h' - -teJustLeft = 0 -teJustCenter = 1 -teJustRight = -1 -teForceLeft = -2 -teFlushDefault = 0 -teCenter = 1 -teFlushRight = -1 -teFlushLeft = -2 -fontBit = 0 -faceBit = 1 -sizeBit = 2 -clrBit = 3 -addSizeBit = 4 -toggleBit = 5 -doFont = 1 -doFace = 2 -doSize = 4 -doColor = 8 -doAll = 15 -addSize = 16 -doToggle = 32 -EOLHook = 0 -DRAWHook = 4 -WIDTHHook = 8 -HITTESTHook = 12 -nWIDTHHook = 24 -TextWidthHook = 28 -intEOLHook = 0 -intDrawHook = 1 -intWidthHook = 2 -intHitTestHook = 3 -intNWidthHook = 6 -intTextWidthHook = 7 -intInlineInputTSMTEPreUpdateHook = 8 -intInlineInputTSMTEPostUpdateHook = 9 -teFAutoScroll = 0 -teFTextBuffering = 1 -teFOutlineHilite = 2 -teFInlineInput = 3 -teFUseWhiteBackground = 4 -teFUseInlineInput = 5 -teFInlineInputAutoScroll = 6 -teFIdleWithEventLoopTimer = 7 -teBitClear = 0 -teBitSet = 1 -teBitTest = -1 -teWordSelect = 4 -teWordDrag = 8 -teFromFind = 12 -teFromRecal = 16 -teFind = 0 -teHighlight = 1 -teDraw = -1 -teCaret = -2 -teFUseTextServices = 4 diff --git a/sys/lib/python/plat-mac/Carbon/Win.py b/sys/lib/python/plat-mac/Carbon/Win.py deleted file mode 100644 index 28057723e..000000000 --- a/sys/lib/python/plat-mac/Carbon/Win.py +++ /dev/null @@ -1 +0,0 @@ -from _Win import * diff --git a/sys/lib/python/plat-mac/Carbon/Windows.py b/sys/lib/python/plat-mac/Carbon/Windows.py deleted file mode 100644 index b09d53710..000000000 --- a/sys/lib/python/plat-mac/Carbon/Windows.py +++ /dev/null @@ -1,279 +0,0 @@ -# Generated from 'MacWindows.h' - -def FOUR_CHAR_CODE(x): return x -false = 0 -true = 1 -kWindowNoConstrainAttribute = 0x80000000 -kAlertWindowClass = 1 -kMovableAlertWindowClass = 2 -kModalWindowClass = 3 -kMovableModalWindowClass = 4 -kFloatingWindowClass = 5 -kDocumentWindowClass = 6 -kUtilityWindowClass = 8 -kHelpWindowClass = 10 -kSheetWindowClass = 11 -kToolbarWindowClass = 12 -kPlainWindowClass = 13 -kOverlayWindowClass = 14 -kSheetAlertWindowClass = 15 -kAltPlainWindowClass = 16 -kDrawerWindowClass = 20 -# kAllWindowClasses = (unsigned long)0xFFFFFFFF -kWindowNoAttributes = 0L -kWindowCloseBoxAttribute = (1L << 0) -kWindowHorizontalZoomAttribute = (1L << 1) -kWindowVerticalZoomAttribute = (1L << 2) -kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute) -kWindowCollapseBoxAttribute = (1L << 3) -kWindowResizableAttribute = (1L << 4) -kWindowSideTitlebarAttribute = (1L << 5) -kWindowToolbarButtonAttribute = (1L << 6) -kWindowNoUpdatesAttribute = (1L << 16) -kWindowNoActivatesAttribute = (1L << 17) -kWindowOpaqueForEventsAttribute = (1L << 18) -kWindowNoShadowAttribute = (1L << 21) -kWindowHideOnSuspendAttribute = (1L << 24) -kWindowStandardHandlerAttribute = (1L << 25) -kWindowHideOnFullScreenAttribute = (1L << 26) -kWindowInWindowMenuAttribute = (1L << 27) -kWindowLiveResizeAttribute = (1L << 28) -# kWindowNoConstrainAttribute = (unsigned long)((1L << 31)) -kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute) -kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute) -kWindowDefProcType = FOUR_CHAR_CODE('WDEF') -kStandardWindowDefinition = 0 -kRoundWindowDefinition = 1 -kFloatingWindowDefinition = 124 -kDocumentWindowVariantCode = 0 -kModalDialogVariantCode = 1 -kPlainDialogVariantCode = 2 -kShadowDialogVariantCode = 3 -kMovableModalDialogVariantCode = 5 -kAlertVariantCode = 7 -kMovableAlertVariantCode = 9 -kSideFloaterVariantCode = 8 -documentProc = 0 -dBoxProc = 1 -plainDBox = 2 -altDBoxProc = 3 -noGrowDocProc = 4 -movableDBoxProc = 5 -zoomDocProc = 8 -zoomNoGrow = 12 -floatProc = 1985 -floatGrowProc = 1987 -floatZoomProc = 1989 -floatZoomGrowProc = 1991 -floatSideProc = 1993 -floatSideGrowProc = 1995 -floatSideZoomProc = 1997 -floatSideZoomGrowProc = 1999 -rDocProc = 16 -kWindowDocumentDefProcResID = 64 -kWindowDialogDefProcResID = 65 -kWindowUtilityDefProcResID = 66 -kWindowUtilitySideTitleDefProcResID = 67 -kWindowSheetDefProcResID = 68 -kWindowSimpleDefProcResID = 69 -kWindowSheetAlertDefProcResID = 70 -kWindowDocumentProc = 1024 -kWindowGrowDocumentProc = 1025 -kWindowVertZoomDocumentProc = 1026 -kWindowVertZoomGrowDocumentProc = 1027 -kWindowHorizZoomDocumentProc = 1028 -kWindowHorizZoomGrowDocumentProc = 1029 -kWindowFullZoomDocumentProc = 1030 -kWindowFullZoomGrowDocumentProc = 1031 -kWindowPlainDialogProc = 1040 -kWindowShadowDialogProc = 1041 -kWindowModalDialogProc = 1042 -kWindowMovableModalDialogProc = 1043 -kWindowAlertProc = 1044 -kWindowMovableAlertProc = 1045 -kWindowMovableModalGrowProc = 1046 -kWindowFloatProc = 1057 -kWindowFloatGrowProc = 1059 -kWindowFloatVertZoomProc = 1061 -kWindowFloatVertZoomGrowProc = 1063 -kWindowFloatHorizZoomProc = 1065 -kWindowFloatHorizZoomGrowProc = 1067 -kWindowFloatFullZoomProc = 1069 -kWindowFloatFullZoomGrowProc = 1071 -kWindowFloatSideProc = 1073 -kWindowFloatSideGrowProc = 1075 -kWindowFloatSideVertZoomProc = 1077 -kWindowFloatSideVertZoomGrowProc = 1079 -kWindowFloatSideHorizZoomProc = 1081 -kWindowFloatSideHorizZoomGrowProc = 1083 -kWindowFloatSideFullZoomProc = 1085 -kWindowFloatSideFullZoomGrowProc = 1087 -kWindowSheetProc = 1088 -kWindowSheetAlertProc = 1120 -kWindowSimpleProc = 1104 -kWindowSimpleFrameProc = 1105 -kWindowNoPosition = 0x0000 -kWindowDefaultPosition = 0x0000 -kWindowCenterMainScreen = 0x280A -kWindowAlertPositionMainScreen = 0x300A -kWindowStaggerMainScreen = 0x380A -kWindowCenterParentWindow = 0xA80A -kWindowAlertPositionParentWindow = 0xB00A -kWindowStaggerParentWindow = 0xB80A -kWindowCenterParentWindowScreen = 0x680A -kWindowAlertPositionParentWindowScreen = 0x700A -kWindowStaggerParentWindowScreen = 0x780A -kWindowCenterOnMainScreen = 1 -kWindowCenterOnParentWindow = 2 -kWindowCenterOnParentWindowScreen = 3 -kWindowCascadeOnMainScreen = 4 -kWindowCascadeOnParentWindow = 5 -kWindowCascadeOnParentWindowScreen = 6 -kWindowCascadeStartAtParentWindowScreen = 10 -kWindowAlertPositionOnMainScreen = 7 -kWindowAlertPositionOnParentWindow = 8 -kWindowAlertPositionOnParentWindowScreen = 9 -kWindowTitleBarRgn = 0 -kWindowTitleTextRgn = 1 -kWindowCloseBoxRgn = 2 -kWindowZoomBoxRgn = 3 -kWindowDragRgn = 5 -kWindowGrowRgn = 6 -kWindowCollapseBoxRgn = 7 -kWindowTitleProxyIconRgn = 8 -kWindowStructureRgn = 32 -kWindowContentRgn = 33 -kWindowUpdateRgn = 34 -kWindowOpaqueRgn = 35 -kWindowGlobalPortRgn = 40 -dialogKind = 2 -userKind = 8 -kDialogWindowKind = 2 -kApplicationWindowKind = 8 -inDesk = 0 -inNoWindow = 0 -inMenuBar = 1 -inSysWindow = 2 -inContent = 3 -inDrag = 4 -inGrow = 5 -inGoAway = 6 -inZoomIn = 7 -inZoomOut = 8 -inCollapseBox = 11 -inProxyIcon = 12 -inToolbarButton = 13 -inStructure = 15 -wNoHit = 0 -wInContent = 1 -wInDrag = 2 -wInGrow = 3 -wInGoAway = 4 -wInZoomIn = 5 -wInZoomOut = 6 -wInCollapseBox = 9 -wInProxyIcon = 10 -wInToolbarButton = 11 -wInStructure = 13 -kWindowMsgDraw = 0 -kWindowMsgHitTest = 1 -kWindowMsgCalculateShape = 2 -kWindowMsgInitialize = 3 -kWindowMsgCleanUp = 4 -kWindowMsgDrawGrowOutline = 5 -kWindowMsgDrawGrowBox = 6 -kWindowMsgGetFeatures = 7 -kWindowMsgGetRegion = 8 -kWindowMsgDragHilite = 9 -kWindowMsgModified = 10 -kWindowMsgDrawInCurrentPort = 11 -kWindowMsgSetupProxyDragImage = 12 -kWindowMsgStateChanged = 13 -kWindowMsgMeasureTitle = 14 -kWindowMsgGetGrowImageRegion = 19 -wDraw = 0 -wHit = 1 -wCalcRgns = 2 -wNew = 3 -wDispose = 4 -wGrow = 5 -wDrawGIcon = 6 -kWindowStateTitleChanged = (1 << 0) -kWindowCanGrow = (1 << 0) -kWindowCanZoom = (1 << 1) -kWindowCanCollapse = (1 << 2) -kWindowIsModal = (1 << 3) -kWindowCanGetWindowRegion = (1 << 4) -kWindowIsAlert = (1 << 5) -kWindowHasTitleBar = (1 << 6) -kWindowSupportsDragHilite = (1 << 7) -kWindowSupportsModifiedBit = (1 << 8) -kWindowCanDrawInCurrentPort = (1 << 9) -kWindowCanSetupProxyDragImage = (1 << 10) -kWindowCanMeasureTitle = (1 << 11) -kWindowWantsDisposeAtProcessDeath = (1 << 12) -kWindowSupportsGetGrowImageRegion = (1 << 13) -kWindowDefSupportsColorGrafPort = 0x40000002 -kWindowIsOpaque = (1 << 14) -kWindowSupportsSetGrowImageRegion = (1 << 13) -deskPatID = 16 -wContentColor = 0 -wFrameColor = 1 -wTextColor = 2 -wHiliteColor = 3 -wTitleBarColor = 4 -# kMouseUpOutOfSlop = (long)0x80008000 -kWindowDefinitionVersionOne = 1 -kWindowDefinitionVersionTwo = 2 -kWindowIsCollapsedState = (1 << 0L) -kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') -kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') -kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') -kWindowDefProcPtr = 0 -kWindowDefObjectClass = 1 -kWindowDefProcID = 2 -kWindowModalityNone = 0 -kWindowModalitySystemModal = 1 -kWindowModalityAppModal = 2 -kWindowModalityWindowModal = 3 -kWindowGroupAttrSelectAsLayer = 1 << 0 -kWindowGroupAttrMoveTogether = 1 << 1 -kWindowGroupAttrLayerTogether = 1 << 2 -kWindowGroupAttrSharedActivation = 1 << 3 -kWindowGroupAttrHideOnCollapse = 1 << 4 -kWindowActivationScopeNone = 0 -kWindowActivationScopeIndependent = 1 -kWindowActivationScopeAll = 2 -kNextWindowGroup = true -kPreviousWindowGroup = false -kWindowGroupContentsReturnWindows = 1 << 0 -kWindowGroupContentsRecurse = 1 << 1 -kWindowGroupContentsVisible = 1 << 2 -kWindowPaintProcOptionsNone = 0 -kScrollWindowNoOptions = 0 -kScrollWindowInvalidate = (1L << 0) -kScrollWindowEraseToPortBackground = (1L << 1) -kWindowMenuIncludeRotate = 1 << 0 -kWindowZoomTransitionEffect = 1 -kWindowSheetTransitionEffect = 2 -kWindowSlideTransitionEffect = 3 -kWindowShowTransitionAction = 1 -kWindowHideTransitionAction = 2 -kWindowMoveTransitionAction = 3 -kWindowResizeTransitionAction = 4 -kWindowConstrainMayResize = (1L << 0) -kWindowConstrainMoveRegardlessOfFit = (1L << 1) -kWindowConstrainAllowPartial = (1L << 2) -kWindowConstrainCalcOnly = (1L << 3) -kWindowConstrainUseTransitionWindow = (1L << 4) -kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit -kWindowLatentVisibleFloater = 1 << 0 -kWindowLatentVisibleSuspend = 1 << 1 -kWindowLatentVisibleFullScreen = 1 << 2 -kWindowLatentVisibleAppHidden = 1 << 3 -kWindowLatentVisibleCollapsedOwner = 1 << 4 -kWindowLatentVisibleCollapsedGroup = 1 << 5 -kWindowPropertyPersistent = 0x00000001 -kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer -kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether -kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether diff --git a/sys/lib/python/plat-mac/Carbon/__init__.py b/sys/lib/python/plat-mac/Carbon/__init__.py deleted file mode 100644 index 8018c1824..000000000 --- a/sys/lib/python/plat-mac/Carbon/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Filter out warnings about signed/unsigned constants -import warnings -warnings.filterwarnings("ignore", "", FutureWarning, ".*Controls") -warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor") diff --git a/sys/lib/python/plat-mac/EasyDialogs.py b/sys/lib/python/plat-mac/EasyDialogs.py deleted file mode 100644 index b33d1be54..000000000 --- a/sys/lib/python/plat-mac/EasyDialogs.py +++ /dev/null @@ -1,838 +0,0 @@ -"""Easy to use dialogs. - -Message(msg) -- display a message and an OK button. -AskString(prompt, default) -- ask for a string, display OK and Cancel buttons. -AskPassword(prompt, default) -- like AskString(), but shows text as bullets. -AskYesNoCancel(question, default) -- display a question and Yes, No and Cancel buttons. -GetArgv(optionlist, commandlist) -- fill a sys.argv-like list using a dialog -AskFileForOpen(...) -- Ask the user for an existing file -AskFileForSave(...) -- Ask the user for an output file -AskFolder(...) -- Ask the user to select a folder -bar = Progress(label, maxvalue) -- Display a progress bar -bar.set(value) -- Set value -bar.inc( *amount ) -- increment value by amount (default=1) -bar.label( *newlabel ) -- get or set text label. - -More documentation in each function. -This module uses DLOG resources 260 and on. -Based upon STDWIN dialogs with the same names and functions. -""" - -from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog -from Carbon import Qd -from Carbon import QuickDraw -from Carbon import Dialogs -from Carbon import Windows -from Carbon import Dlg,Win,Evt,Events # sdm7g -from Carbon import Ctl -from Carbon import Controls -from Carbon import Menu -from Carbon import AE -import Nav -import MacOS -import string -from Carbon.ControlAccessor import * # Also import Controls constants -import Carbon.File -import macresource -import os -import sys - -__all__ = ['Message', 'AskString', 'AskPassword', 'AskYesNoCancel', - 'GetArgv', 'AskFileForOpen', 'AskFileForSave', 'AskFolder', - 'ProgressBar'] - -_initialized = 0 - -def _initialize(): - global _initialized - if _initialized: return - macresource.need("DLOG", 260, "dialogs.rsrc", __name__) - -def _interact(): - """Make sure the application is in the foreground""" - AE.AEInteractWithUser(50000000) - -def cr2lf(text): - if '\r' in text: - text = string.join(string.split(text, '\r'), '\n') - return text - -def lf2cr(text): - if '\n' in text: - text = string.join(string.split(text, '\n'), '\r') - if len(text) > 253: - text = text[:253] + '\311' - return text - -def Message(msg, id=260, ok=None): - """Display a MESSAGE string. - - Return when the user clicks the OK button or presses Return. - - The MESSAGE string can be at most 255 characters long. - """ - _initialize() - _interact() - d = GetNewDialog(id, -1) - if not d: - print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)" - return - h = d.GetDialogItemAsControl(2) - SetDialogItemText(h, lf2cr(msg)) - if ok != None: - h = d.GetDialogItemAsControl(1) - h.SetControlTitle(ok) - d.SetDialogDefaultItem(1) - d.AutoSizeDialog() - d.GetDialogWindow().ShowWindow() - while 1: - n = ModalDialog(None) - if n == 1: - return - - -def AskString(prompt, default = "", id=261, ok=None, cancel=None): - """Display a PROMPT string and a text entry field with a DEFAULT string. - - Return the contents of the text entry field when the user clicks the - OK button or presses Return. - Return None when the user clicks the Cancel button. - - If omitted, DEFAULT is empty. - - The PROMPT and DEFAULT strings, as well as the return value, - can be at most 255 characters long. - """ - - _initialize() - _interact() - d = GetNewDialog(id, -1) - if not d: - print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)" - return - h = d.GetDialogItemAsControl(3) - SetDialogItemText(h, lf2cr(prompt)) - h = d.GetDialogItemAsControl(4) - SetDialogItemText(h, lf2cr(default)) - d.SelectDialogItemText(4, 0, 999) -# d.SetDialogItem(4, 0, 255) - if ok != None: - h = d.GetDialogItemAsControl(1) - h.SetControlTitle(ok) - if cancel != None: - h = d.GetDialogItemAsControl(2) - h.SetControlTitle(cancel) - d.SetDialogDefaultItem(1) - d.SetDialogCancelItem(2) - d.AutoSizeDialog() - d.GetDialogWindow().ShowWindow() - while 1: - n = ModalDialog(None) - if n == 1: - h = d.GetDialogItemAsControl(4) - return cr2lf(GetDialogItemText(h)) - if n == 2: return None - -def AskPassword(prompt, default='', id=264, ok=None, cancel=None): - """Display a PROMPT string and a text entry field with a DEFAULT string. - The string is displayed as bullets only. - - Return the contents of the text entry field when the user clicks the - OK button or presses Return. - Return None when the user clicks the Cancel button. - - If omitted, DEFAULT is empty. - - The PROMPT and DEFAULT strings, as well as the return value, - can be at most 255 characters long. - """ - _initialize() - _interact() - d = GetNewDialog(id, -1) - if not d: - print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)" - return - h = d.GetDialogItemAsControl(3) - SetDialogItemText(h, lf2cr(prompt)) - pwd = d.GetDialogItemAsControl(4) - bullets = '\245'*len(default) -## SetControlData(pwd, kControlEditTextPart, kControlEditTextTextTag, bullets) - SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default) - d.SelectDialogItemText(4, 0, 999) - Ctl.SetKeyboardFocus(d.GetDialogWindow(), pwd, kControlEditTextPart) - if ok != None: - h = d.GetDialogItemAsControl(1) - h.SetControlTitle(ok) - if cancel != None: - h = d.GetDialogItemAsControl(2) - h.SetControlTitle(cancel) - d.SetDialogDefaultItem(Dialogs.ok) - d.SetDialogCancelItem(Dialogs.cancel) - d.AutoSizeDialog() - d.GetDialogWindow().ShowWindow() - while 1: - n = ModalDialog(None) - if n == 1: - h = d.GetDialogItemAsControl(4) - return cr2lf(GetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag)) - if n == 2: return None - -def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262): - """Display a QUESTION string which can be answered with Yes or No. - - Return 1 when the user clicks the Yes button. - Return 0 when the user clicks the No button. - Return -1 when the user clicks the Cancel button. - - When the user presses Return, the DEFAULT value is returned. - If omitted, this is 0 (No). - - The QUESTION string can be at most 255 characters. - """ - - _initialize() - _interact() - d = GetNewDialog(id, -1) - if not d: - print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)" - return - # Button assignments: - # 1 = default (invisible) - # 2 = Yes - # 3 = No - # 4 = Cancel - # The question string is item 5 - h = d.GetDialogItemAsControl(5) - SetDialogItemText(h, lf2cr(question)) - if yes != None: - if yes == '': - d.HideDialogItem(2) - else: - h = d.GetDialogItemAsControl(2) - h.SetControlTitle(yes) - if no != None: - if no == '': - d.HideDialogItem(3) - else: - h = d.GetDialogItemAsControl(3) - h.SetControlTitle(no) - if cancel != None: - if cancel == '': - d.HideDialogItem(4) - else: - h = d.GetDialogItemAsControl(4) - h.SetControlTitle(cancel) - d.SetDialogCancelItem(4) - if default == 1: - d.SetDialogDefaultItem(2) - elif default == 0: - d.SetDialogDefaultItem(3) - elif default == -1: - d.SetDialogDefaultItem(4) - d.AutoSizeDialog() - d.GetDialogWindow().ShowWindow() - while 1: - n = ModalDialog(None) - if n == 1: return default - if n == 2: return 1 - if n == 3: return 0 - if n == 4: return -1 - - - - -screenbounds = Qd.GetQDGlobalsScreenBits().bounds -screenbounds = screenbounds[0]+4, screenbounds[1]+4, \ - screenbounds[2]-4, screenbounds[3]-4 - -kControlProgressBarIndeterminateTag = 'inde' # from Controls.py - - -class ProgressBar: - def __init__(self, title="Working...", maxval=0, label="", id=263): - self.w = None - self.d = None - _initialize() - self.d = GetNewDialog(id, -1) - self.w = self.d.GetDialogWindow() - self.label(label) - self.title(title) - self.set(0, maxval) - self.d.AutoSizeDialog() - self.w.ShowWindow() - self.d.DrawDialog() - - def __del__(self): - if self.w: - self.w.BringToFront() - self.w.HideWindow() - del self.w - del self.d - - def title(self, newstr=""): - """title(text) - Set title of progress window""" - self.w.BringToFront() - self.w.SetWTitle(newstr) - - def label(self, *newstr): - """label(text) - Set text in progress box""" - self.w.BringToFront() - if newstr: - self._label = lf2cr(newstr[0]) - text_h = self.d.GetDialogItemAsControl(2) - SetDialogItemText(text_h, self._label) - - def _update(self, value): - maxval = self.maxval - if maxval == 0: # an indeterminate bar - Ctl.IdleControls(self.w) # spin the barber pole - else: # a determinate bar - if maxval > 32767: - value = int(value/(maxval/32767.0)) - maxval = 32767 - maxval = int(maxval) - value = int(value) - progbar = self.d.GetDialogItemAsControl(3) - progbar.SetControlMaximum(maxval) - progbar.SetControlValue(value) # set the bar length - - # Test for cancel button - ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) - if ready : - what,msg,when,where,mod = ev - part = Win.FindWindow(where)[0] - if Dlg.IsDialogEvent(ev): - ds = Dlg.DialogSelect(ev) - if ds[0] and ds[1] == self.d and ds[-1] == 1: - self.w.HideWindow() - self.w = None - self.d = None - raise KeyboardInterrupt, ev - else: - if part == 4: # inDrag - self.w.DragWindow(where, screenbounds) - else: - MacOS.HandleEvent(ev) - - - def set(self, value, max=None): - """set(value) - Set progress bar position""" - if max != None: - self.maxval = max - bar = self.d.GetDialogItemAsControl(3) - if max <= 0: # indeterminate bar - bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x01') - else: # determinate bar - bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x00') - if value < 0: - value = 0 - elif value > self.maxval: - value = self.maxval - self.curval = value - self._update(value) - - def inc(self, n=1): - """inc(amt) - Increment progress bar position""" - self.set(self.curval + n) - -ARGV_ID=265 -ARGV_ITEM_OK=1 -ARGV_ITEM_CANCEL=2 -ARGV_OPTION_GROUP=3 -ARGV_OPTION_EXPLAIN=4 -ARGV_OPTION_VALUE=5 -ARGV_OPTION_ADD=6 -ARGV_COMMAND_GROUP=7 -ARGV_COMMAND_EXPLAIN=8 -ARGV_COMMAND_ADD=9 -ARGV_ADD_OLDFILE=10 -ARGV_ADD_NEWFILE=11 -ARGV_ADD_FOLDER=12 -ARGV_CMDLINE_GROUP=13 -ARGV_CMDLINE_DATA=14 - -##def _myModalDialog(d): -## while 1: -## ready, ev = Evt.WaitNextEvent(0xffff, -1) -## print 'DBG: WNE', ready, ev -## if ready : -## what,msg,when,where,mod = ev -## part, window = Win.FindWindow(where) -## if Dlg.IsDialogEvent(ev): -## didit, dlgdone, itemdone = Dlg.DialogSelect(ev) -## print 'DBG: DialogSelect', didit, dlgdone, itemdone, d -## if didit and dlgdone == d: -## return itemdone -## elif window == d.GetDialogWindow(): -## d.GetDialogWindow().SelectWindow() -## if part == 4: # inDrag -## d.DragWindow(where, screenbounds) -## else: -## MacOS.HandleEvent(ev) -## else: -## MacOS.HandleEvent(ev) -## -def _setmenu(control, items): - mhandle = control.GetControlData_Handle(Controls.kControlMenuPart, - Controls.kControlPopupButtonMenuHandleTag) - menu = Menu.as_Menu(mhandle) - for item in items: - if type(item) == type(()): - label = item[0] - else: - label = item - if label[-1] == '=' or label[-1] == ':': - label = label[:-1] - menu.AppendMenu(label) -## mhandle, mid = menu.getpopupinfo() -## control.SetControlData_Handle(Controls.kControlMenuPart, -## Controls.kControlPopupButtonMenuHandleTag, mhandle) - control.SetControlMinimum(1) - control.SetControlMaximum(len(items)+1) - -def _selectoption(d, optionlist, idx): - if idx < 0 or idx >= len(optionlist): - MacOS.SysBeep() - return - option = optionlist[idx] - if type(option) == type(()): - if len(option) == 4: - help = option[2] - elif len(option) > 1: - help = option[-1] - else: - help = '' - else: - help = '' - h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN) - if help and len(help) > 250: - help = help[:250] + '...' - Dlg.SetDialogItemText(h, help) - hasvalue = 0 - if type(option) == type(()): - label = option[0] - else: - label = option - if label[-1] == '=' or label[-1] == ':': - hasvalue = 1 - h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE) - Dlg.SetDialogItemText(h, '') - if hasvalue: - d.ShowDialogItem(ARGV_OPTION_VALUE) - d.SelectDialogItemText(ARGV_OPTION_VALUE, 0, 0) - else: - d.HideDialogItem(ARGV_OPTION_VALUE) - - -def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): - _initialize() - _interact() - d = GetNewDialog(id, -1) - if not d: - print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)" - return -# h = d.GetDialogItemAsControl(3) -# SetDialogItemText(h, lf2cr(prompt)) -# h = d.GetDialogItemAsControl(4) -# SetDialogItemText(h, lf2cr(default)) -# d.SelectDialogItemText(4, 0, 999) -# d.SetDialogItem(4, 0, 255) - if optionlist: - _setmenu(d.GetDialogItemAsControl(ARGV_OPTION_GROUP), optionlist) - _selectoption(d, optionlist, 0) - else: - d.GetDialogItemAsControl(ARGV_OPTION_GROUP).DeactivateControl() - if commandlist: - _setmenu(d.GetDialogItemAsControl(ARGV_COMMAND_GROUP), commandlist) - if type(commandlist[0]) == type(()) and len(commandlist[0]) > 1: - help = commandlist[0][-1] - h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN) - Dlg.SetDialogItemText(h, help) - else: - d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).DeactivateControl() - if not addoldfile: - d.GetDialogItemAsControl(ARGV_ADD_OLDFILE).DeactivateControl() - if not addnewfile: - d.GetDialogItemAsControl(ARGV_ADD_NEWFILE).DeactivateControl() - if not addfolder: - d.GetDialogItemAsControl(ARGV_ADD_FOLDER).DeactivateControl() - d.SetDialogDefaultItem(ARGV_ITEM_OK) - d.SetDialogCancelItem(ARGV_ITEM_CANCEL) - d.GetDialogWindow().ShowWindow() - d.DrawDialog() - if hasattr(MacOS, 'SchedParams'): - appsw = MacOS.SchedParams(1, 0) - try: - while 1: - stringstoadd = [] - n = ModalDialog(None) - if n == ARGV_ITEM_OK: - break - elif n == ARGV_ITEM_CANCEL: - raise SystemExit - elif n == ARGV_OPTION_GROUP: - idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1 - _selectoption(d, optionlist, idx) - elif n == ARGV_OPTION_VALUE: - pass - elif n == ARGV_OPTION_ADD: - idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1 - if 0 <= idx < len(optionlist): - option = optionlist[idx] - if type(option) == type(()): - option = option[0] - if option[-1] == '=' or option[-1] == ':': - option = option[:-1] - h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE) - value = Dlg.GetDialogItemText(h) - else: - value = '' - if len(option) == 1: - stringtoadd = '-' + option - else: - stringtoadd = '--' + option - stringstoadd = [stringtoadd] - if value: - stringstoadd.append(value) - else: - MacOS.SysBeep() - elif n == ARGV_COMMAND_GROUP: - idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1 - if 0 <= idx < len(commandlist) and type(commandlist[idx]) == type(()) and \ - len(commandlist[idx]) > 1: - help = commandlist[idx][-1] - h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN) - Dlg.SetDialogItemText(h, help) - elif n == ARGV_COMMAND_ADD: - idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1 - if 0 <= idx < len(commandlist): - command = commandlist[idx] - if type(command) == type(()): - command = command[0] - stringstoadd = [command] - else: - MacOS.SysBeep() - elif n == ARGV_ADD_OLDFILE: - pathname = AskFileForOpen() - if pathname: - stringstoadd = [pathname] - elif n == ARGV_ADD_NEWFILE: - pathname = AskFileForSave() - if pathname: - stringstoadd = [pathname] - elif n == ARGV_ADD_FOLDER: - pathname = AskFolder() - if pathname: - stringstoadd = [pathname] - elif n == ARGV_CMDLINE_DATA: - pass # Nothing to do - else: - raise RuntimeError, "Unknown dialog item %d"%n - - for stringtoadd in stringstoadd: - if '"' in stringtoadd or "'" in stringtoadd or " " in stringtoadd: - stringtoadd = repr(stringtoadd) - h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA) - oldstr = GetDialogItemText(h) - if oldstr and oldstr[-1] != ' ': - oldstr = oldstr + ' ' - oldstr = oldstr + stringtoadd - if oldstr[-1] != ' ': - oldstr = oldstr + ' ' - SetDialogItemText(h, oldstr) - d.SelectDialogItemText(ARGV_CMDLINE_DATA, 0x7fff, 0x7fff) - h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA) - oldstr = GetDialogItemText(h) - tmplist = string.split(oldstr) - newlist = [] - while tmplist: - item = tmplist[0] - del tmplist[0] - if item[0] == '"': - while item[-1] != '"': - if not tmplist: - raise RuntimeError, "Unterminated quoted argument" - item = item + ' ' + tmplist[0] - del tmplist[0] - item = item[1:-1] - if item[0] == "'": - while item[-1] != "'": - if not tmplist: - raise RuntimeError, "Unterminated quoted argument" - item = item + ' ' + tmplist[0] - del tmplist[0] - item = item[1:-1] - newlist.append(item) - return newlist - finally: - if hasattr(MacOS, 'SchedParams'): - MacOS.SchedParams(*appsw) - del d - -def _process_Nav_args(dftflags, **args): - import aepack - import Carbon.AE - import Carbon.File - for k in args.keys(): - if args[k] is None: - del args[k] - # Set some defaults, and modify some arguments - if not args.has_key('dialogOptionFlags'): - args['dialogOptionFlags'] = dftflags - if args.has_key('defaultLocation') and \ - not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): - defaultLocation = args['defaultLocation'] - if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): - args['defaultLocation'] = aepack.pack(defaultLocation) - else: - defaultLocation = Carbon.File.FSRef(defaultLocation) - args['defaultLocation'] = aepack.pack(defaultLocation) - if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): - typeList = args['typeList'][:] - # Workaround for OSX typeless files: - if 'TEXT' in typeList and not '\0\0\0\0' in typeList: - typeList = typeList + ('\0\0\0\0',) - data = 'Pyth' + struct.pack("hh", 0, len(typeList)) - for type in typeList: - data = data+type - args['typeList'] = Carbon.Res.Handle(data) - tpwanted = str - if args.has_key('wanted'): - tpwanted = args['wanted'] - del args['wanted'] - return args, tpwanted - -def _dummy_Nav_eventproc(msg, data): - pass - -_default_Nav_eventproc = _dummy_Nav_eventproc - -def SetDefaultEventProc(proc): - global _default_Nav_eventproc - rv = _default_Nav_eventproc - if proc is None: - proc = _dummy_Nav_eventproc - _default_Nav_eventproc = proc - return rv - -def AskFileForOpen( - message=None, - typeList=None, - # From here on the order is not documented - version=None, - defaultLocation=None, - dialogOptionFlags=None, - location=None, - clientName=None, - windowTitle=None, - actionButtonLabel=None, - cancelButtonLabel=None, - preferenceKey=None, - popupExtension=None, - eventProc=_dummy_Nav_eventproc, - previewProc=None, - filterProc=None, - wanted=None, - multiple=None): - """Display a dialog asking the user for a file to open. - - wanted is the return type wanted: FSSpec, FSRef, unicode or string (default) - the other arguments can be looked up in Apple's Navigation Services documentation""" - - default_flags = 0x56 # Or 0xe4? - args, tpwanted = _process_Nav_args(default_flags, version=version, - defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags, - location=location,clientName=clientName,windowTitle=windowTitle, - actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel, - message=message,preferenceKey=preferenceKey, - popupExtension=popupExtension,eventProc=eventProc,previewProc=previewProc, - filterProc=filterProc,typeList=typeList,wanted=wanted,multiple=multiple) - _interact() - try: - rr = Nav.NavChooseFile(args) - good = 1 - except Nav.error, arg: - if arg[0] != -128: # userCancelledErr - raise Nav.error, arg - return None - if not rr.validRecord or not rr.selection: - return None - if issubclass(tpwanted, Carbon.File.FSRef): - return tpwanted(rr.selection_fsr[0]) - if issubclass(tpwanted, Carbon.File.FSSpec): - return tpwanted(rr.selection[0]) - if issubclass(tpwanted, str): - return tpwanted(rr.selection_fsr[0].as_pathname()) - if issubclass(tpwanted, unicode): - return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8') - raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted) - -def AskFileForSave( - message=None, - savedFileName=None, - # From here on the order is not documented - version=None, - defaultLocation=None, - dialogOptionFlags=None, - location=None, - clientName=None, - windowTitle=None, - actionButtonLabel=None, - cancelButtonLabel=None, - preferenceKey=None, - popupExtension=None, - eventProc=_dummy_Nav_eventproc, - fileType=None, - fileCreator=None, - wanted=None, - multiple=None): - """Display a dialog asking the user for a filename to save to. - - wanted is the return type wanted: FSSpec, FSRef, unicode or string (default) - the other arguments can be looked up in Apple's Navigation Services documentation""" - - - default_flags = 0x07 - args, tpwanted = _process_Nav_args(default_flags, version=version, - defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags, - location=location,clientName=clientName,windowTitle=windowTitle, - actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel, - savedFileName=savedFileName,message=message,preferenceKey=preferenceKey, - popupExtension=popupExtension,eventProc=eventProc,fileType=fileType, - fileCreator=fileCreator,wanted=wanted,multiple=multiple) - _interact() - try: - rr = Nav.NavPutFile(args) - good = 1 - except Nav.error, arg: - if arg[0] != -128: # userCancelledErr - raise Nav.error, arg - return None - if not rr.validRecord or not rr.selection: - return None - if issubclass(tpwanted, Carbon.File.FSRef): - raise TypeError, "Cannot pass wanted=FSRef to AskFileForSave" - if issubclass(tpwanted, Carbon.File.FSSpec): - return tpwanted(rr.selection[0]) - if issubclass(tpwanted, (str, unicode)): - if sys.platform == 'mac': - fullpath = rr.selection[0].as_pathname() - else: - # This is gross, and probably incorrect too - vrefnum, dirid, name = rr.selection[0].as_tuple() - pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, '')) - pardir_fsr = Carbon.File.FSRef(pardir_fss) - pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8 - name_utf8 = unicode(name, 'macroman').encode('utf8') - fullpath = os.path.join(pardir_path, name_utf8) - if issubclass(tpwanted, unicode): - return unicode(fullpath, 'utf8') - return tpwanted(fullpath) - raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted) - -def AskFolder( - message=None, - # From here on the order is not documented - version=None, - defaultLocation=None, - dialogOptionFlags=None, - location=None, - clientName=None, - windowTitle=None, - actionButtonLabel=None, - cancelButtonLabel=None, - preferenceKey=None, - popupExtension=None, - eventProc=_dummy_Nav_eventproc, - filterProc=None, - wanted=None, - multiple=None): - """Display a dialog asking the user for select a folder. - - wanted is the return type wanted: FSSpec, FSRef, unicode or string (default) - the other arguments can be looked up in Apple's Navigation Services documentation""" - - default_flags = 0x17 - args, tpwanted = _process_Nav_args(default_flags, version=version, - defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags, - location=location,clientName=clientName,windowTitle=windowTitle, - actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel, - message=message,preferenceKey=preferenceKey, - popupExtension=popupExtension,eventProc=eventProc,filterProc=filterProc, - wanted=wanted,multiple=multiple) - _interact() - try: - rr = Nav.NavChooseFolder(args) - good = 1 - except Nav.error, arg: - if arg[0] != -128: # userCancelledErr - raise Nav.error, arg - return None - if not rr.validRecord or not rr.selection: - return None - if issubclass(tpwanted, Carbon.File.FSRef): - return tpwanted(rr.selection_fsr[0]) - if issubclass(tpwanted, Carbon.File.FSSpec): - return tpwanted(rr.selection[0]) - if issubclass(tpwanted, str): - return tpwanted(rr.selection_fsr[0].as_pathname()) - if issubclass(tpwanted, unicode): - return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8') - raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted) - - -def test(): - import time - - Message("Testing EasyDialogs.") - optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), - ('flags=', 'Valued option'), ('f:', 'Short valued option')) - commandlist = (('start', 'Start something'), ('stop', 'Stop something')) - argv = GetArgv(optionlist=optionlist, commandlist=commandlist, addoldfile=0) - Message("Command line: %s"%' '.join(argv)) - for i in range(len(argv)): - print 'arg[%d] = %r' % (i, argv[i]) - ok = AskYesNoCancel("Do you want to proceed?") - ok = AskYesNoCancel("Do you want to identify?", yes="Identify", no="No") - if ok > 0: - s = AskString("Enter your first name", "Joe") - s2 = AskPassword("Okay %s, tell us your nickname"%s, s, cancel="None") - if not s2: - Message("%s has no secret nickname"%s) - else: - Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2)) - else: - s = 'Anonymous' - rv = AskFileForOpen(message="Gimme a file, %s"%s, wanted=Carbon.File.FSSpec) - Message("rv: %s"%rv) - rv = AskFileForSave(wanted=Carbon.File.FSRef, savedFileName="%s.txt"%s) - Message("rv.as_pathname: %s"%rv.as_pathname()) - rv = AskFolder() - Message("Folder name: %s"%rv) - text = ( "Working Hard...", "Hardly Working..." , - "So far, so good!", "Keep on truckin'" ) - bar = ProgressBar("Progress, progress...", 0, label="Ramping up...") - try: - if hasattr(MacOS, 'SchedParams'): - appsw = MacOS.SchedParams(1, 0) - for i in xrange(20): - bar.inc() - time.sleep(0.05) - bar.set(0,100) - for i in xrange(100): - bar.set(i) - time.sleep(0.05) - if i % 10 == 0: - bar.label(text[(i/10) % 4]) - bar.label("Done.") - time.sleep(1.0) # give'em a chance to see "Done." - finally: - del bar - if hasattr(MacOS, 'SchedParams'): - MacOS.SchedParams(*appsw) - -if __name__ == '__main__': - try: - test() - except KeyboardInterrupt: - Message("Operation Canceled.") diff --git a/sys/lib/python/plat-mac/FrameWork.py b/sys/lib/python/plat-mac/FrameWork.py deleted file mode 100644 index 0a8c1b8e6..000000000 --- a/sys/lib/python/plat-mac/FrameWork.py +++ /dev/null @@ -1,1123 +0,0 @@ -"A sort of application framework for the Mac" - -DEBUG=0 - -import MacOS -import traceback - -from Carbon.AE import * -from Carbon.AppleEvents import * -from Carbon.Ctl import * -from Carbon.Controls import * -from Carbon.Dlg import * -from Carbon.Dialogs import * -from Carbon.Evt import * -from Carbon.Events import * -from Carbon.Help import * -from Carbon.Menu import * -from Carbon.Menus import * -from Carbon.Qd import * -from Carbon.QuickDraw import * -#from Carbon.Res import * -#from Carbon.Resources import * -#from Carbon.Snd import * -#from Carbon.Sound import * -from Carbon.Win import * -from Carbon.Windows import * -import types - -import EasyDialogs - -try: - MyFrontWindow = FrontNonFloatingWindow -except NameError: - MyFrontWindow = FrontWindow - -kHighLevelEvent = 23 # Don't know what header file this should come from -SCROLLBARWIDTH = 16 # Again, not a clue... - -# Trick to forestall a set of SIOUX menus being added to our menubar -SIOUX_APPLEMENU_ID=32000 - - -# Map event 'what' field to strings -eventname = {} -eventname[1] = 'mouseDown' -eventname[2] = 'mouseUp' -eventname[3] = 'keyDown' -eventname[4] = 'keyUp' -eventname[5] = 'autoKey' -eventname[6] = 'updateEvt' -eventname[7] = 'diskEvt' -eventname[8] = 'activateEvt' -eventname[15] = 'osEvt' -eventname[23] = 'kHighLevelEvent' - -# Map part codes returned by WhichWindow() to strings -partname = {} -partname[0] = 'inDesk' -partname[1] = 'inMenuBar' -partname[2] = 'inSysWindow' -partname[3] = 'inContent' -partname[4] = 'inDrag' -partname[5] = 'inGrow' -partname[6] = 'inGoAway' -partname[7] = 'inZoomIn' -partname[8] = 'inZoomOut' - -# -# The useable portion of the screen -# ## but what happens with multiple screens? jvr -screenbounds = GetQDGlobalsScreenBits().bounds -screenbounds = screenbounds[0]+4, screenbounds[1]+4, \ - screenbounds[2]-4, screenbounds[3]-4 - -next_window_x = 16 # jvr -next_window_y = 44 # jvr - -def windowbounds(width, height): - "Return sensible window bounds" - global next_window_x, next_window_y - r, b = next_window_x+width, next_window_y+height - if r > screenbounds[2]: - next_window_x = 16 - if b > screenbounds[3]: - next_window_y = 44 - l, t = next_window_x, next_window_y - r, b = next_window_x+width, next_window_y+height - next_window_x, next_window_y = next_window_x + 8, next_window_y + 20 # jvr - return l, t, r, b - -_watch = None -def setwatchcursor(): - global _watch - - if _watch == None: - _watch = GetCursor(4).data - SetCursor(_watch) - -def setarrowcursor(): - SetCursor(GetQDGlobalsArrow()) - -class Application: - - "Application framework -- your application should be a derived class" - - def __init__(self, nomenubar=0): - self._doing_asyncevents = 0 - self.quitting = 0 - self.needmenubarredraw = 0 - self._windows = {} - self._helpmenu = None - if nomenubar: - self.menubar = None - else: - self.makemenubar() - - def __del__(self): - if self._doing_asyncevents: - self._doing_asyncevents = 0 - MacOS.SetEventHandler() - - def makemenubar(self): - self.menubar = MenuBar(self) - AppleMenu(self.menubar, self.getabouttext(), self.do_about) - self.makeusermenus() - - def makeusermenus(self): - self.filemenu = m = Menu(self.menubar, "File") - self._quititem = MenuItem(m, "Quit", "Q", self._quit) - - def gethelpmenu(self): - if self._helpmenu == None: - self._helpmenu = HelpMenu(self.menubar) - return self._helpmenu - - def _quit(self, *args): - self.quitting = 1 - - def cleanup(self): - for w in self._windows.values(): - w.do_close() - return self._windows == {} - - def appendwindow(self, wid, window): - self._windows[wid] = window - - def removewindow(self, wid): - del self._windows[wid] - - def getabouttext(self): - return "About %s..." % self.__class__.__name__ - - def do_about(self, id, item, window, event): - EasyDialogs.Message("Hello, world!" + "\015(%s)" % self.__class__.__name__) - - # The main event loop is broken up in several simple steps. - # This is done so you can override each individual part, - # if you have a need to do extra processing independent of the - # event type. - # Normally, however, you'd just define handlers for individual - # events. - - schedparams = (0, 0) # By default disable Python's event handling - default_wait = None # By default we wait GetCaretTime in WaitNextEvent - - def mainloop(self, mask = everyEvent, wait = None): - self.quitting = 0 - if hasattr(MacOS, 'SchedParams'): - saveparams = MacOS.SchedParams(*self.schedparams) - try: - while not self.quitting: - try: - self.do1event(mask, wait) - except (Application, SystemExit): - # Note: the raising of "self" is old-fashioned idiom to - # exit the mainloop. Calling _quit() is better for new - # applications. - break - finally: - if hasattr(MacOS, 'SchedParams'): - MacOS.SchedParams(*saveparams) - - def dopendingevents(self, mask = everyEvent): - """dopendingevents - Handle all pending events""" - while self.do1event(mask, wait=0): - pass - - def do1event(self, mask = everyEvent, wait = None): - ok, event = self.getevent(mask, wait) - if IsDialogEvent(event): - if self.do_dialogevent(event): - return - if ok: - self.dispatch(event) - else: - self.idle(event) - - def idle(self, event): - pass - - def getevent(self, mask = everyEvent, wait = None): - if self.needmenubarredraw: - DrawMenuBar() - self.needmenubarredraw = 0 - if wait is None: - wait = self.default_wait - if wait is None: - wait = GetCaretTime() - ok, event = WaitNextEvent(mask, wait) - return ok, event - - def dispatch(self, event): - # The following appears to be double work (already done in do1event) - # but we need it for asynchronous event handling - if IsDialogEvent(event): - if self.do_dialogevent(event): - return - (what, message, when, where, modifiers) = event - if eventname.has_key(what): - name = "do_" + eventname[what] - else: - name = "do_%d" % what - try: - handler = getattr(self, name) - except AttributeError: - handler = self.do_unknownevent - handler(event) - - def asyncevents(self, onoff): - """asyncevents - Set asynchronous event handling on or off""" - if MacOS.runtimemodel == 'macho': - raise 'Unsupported in MachoPython' - old = self._doing_asyncevents - if old: - MacOS.SetEventHandler() - MacOS.SchedParams(*self.schedparams) - if onoff: - MacOS.SetEventHandler(self.dispatch) - doint, dummymask, benice, howoften, bgyield = \ - self.schedparams - MacOS.SchedParams(doint, everyEvent, benice, - howoften, bgyield) - self._doing_asyncevents = onoff - return old - - def do_dialogevent(self, event): - gotone, dlg, item = DialogSelect(event) - if gotone: - window = dlg.GetDialogWindow() - if self._windows.has_key(window): - self._windows[window].do_itemhit(item, event) - else: - print 'Dialog event for unknown dialog' - return 1 - return 0 - - def do_mouseDown(self, event): - (what, message, when, where, modifiers) = event - partcode, wid = FindWindow(where) - - # - # Find the correct name. - # - if partname.has_key(partcode): - name = "do_" + partname[partcode] - else: - name = "do_%d" % partcode - - if wid == None: - # No window, or a non-python window - try: - handler = getattr(self, name) - except AttributeError: - # Not menubar or something, so assume someone - # else's window - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - return - elif self._windows.has_key(wid): - # It is a window. Hand off to correct window. - window = self._windows[wid] - try: - handler = getattr(window, name) - except AttributeError: - handler = self.do_unknownpartcode - else: - # It is a python-toolbox window, but not ours. - handler = self.do_unknownwindow - handler(partcode, wid, event) - - def do_inSysWindow(self, partcode, window, event): - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_inDesk(self, partcode, window, event): - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_inMenuBar(self, partcode, window, event): - if not self.menubar: - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - return - (what, message, when, where, modifiers) = event - result = MenuSelect(where) - id = (result>>16) & 0xffff # Hi word - if id >= 0x8000: - id = -65536 + id - item = result & 0xffff # Lo word - self.do_rawmenu(id, item, window, event) - - def do_rawmenu(self, id, item, window, event): - try: - self.do_menu(id, item, window, event) - finally: - HiliteMenu(0) - - def do_menu(self, id, item, window, event): - if hasattr(MacOS, 'OutputSeen'): - MacOS.OutputSeen() - self.menubar.dispatch(id, item, window, event) - - - def do_unknownpartcode(self, partcode, window, event): - (what, message, when, where, modifiers) = event - if DEBUG: print "Mouse down at global:", where - if DEBUG: print "\tUnknown part code:", partcode - if DEBUG: print "\tEvent:", self.printevent(event) - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_unknownwindow(self, partcode, window, event): - if DEBUG: print 'Unknown window:', window - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_keyDown(self, event): - self.do_key(event) - - def do_autoKey(self, event): - if not event[-1] & cmdKey: - self.do_key(event) - - def do_key(self, event): - (what, message, when, where, modifiers) = event - c = chr(message & charCodeMask) - if self.menubar: - result = MenuEvent(event) - id = (result>>16) & 0xffff # Hi word - item = result & 0xffff # Lo word - if id: - self.do_rawmenu(id, item, None, event) - return - # Otherwise we fall-through - if modifiers & cmdKey: - if c == '.': - raise self - else: - if not self.menubar: - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - return - else: - # See whether the front window wants it - w = MyFrontWindow() - if w and self._windows.has_key(w): - window = self._windows[w] - try: - do_char = window.do_char - except AttributeError: - do_char = self.do_char - do_char(c, event) - # else it wasn't for us, sigh... - - def do_char(self, c, event): - if DEBUG: print "Character", repr(c) - - def do_updateEvt(self, event): - (what, message, when, where, modifiers) = event - wid = WhichWindow(message) - if wid and self._windows.has_key(wid): - window = self._windows[wid] - window.do_rawupdate(wid, event) - else: - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_activateEvt(self, event): - (what, message, when, where, modifiers) = event - wid = WhichWindow(message) - if wid and self._windows.has_key(wid): - window = self._windows[wid] - window.do_activate(modifiers & 1, event) - else: - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - - def do_osEvt(self, event): - (what, message, when, where, modifiers) = event - which = (message >> 24) & 0xff - if which == 1: # suspend/resume - self.do_suspendresume(event) - else: - if DEBUG: - print 'unknown osEvt:', - self.printevent(event) - - def do_suspendresume(self, event): - (what, message, when, where, modifiers) = event - wid = MyFrontWindow() - if wid and self._windows.has_key(wid): - window = self._windows[wid] - window.do_activate(message & 1, event) - - def do_kHighLevelEvent(self, event): - (what, message, when, where, modifiers) = event - if DEBUG: - print "High Level Event:", - self.printevent(event) - try: - AEProcessAppleEvent(event) - except: - pass - #print "AEProcessAppleEvent error:" - #traceback.print_exc() - - def do_unknownevent(self, event): - if DEBUG: - print "Unhandled event:", - self.printevent(event) - - def printevent(self, event): - (what, message, when, where, modifiers) = event - nicewhat = repr(what) - if eventname.has_key(what): - nicewhat = eventname[what] - print nicewhat, - if what == kHighLevelEvent: - h, v = where - print repr(ostypecode(message)), hex(when), repr(ostypecode(h | (v<<16))), - else: - print hex(message), hex(when), where, - print hex(modifiers) - - -class MenuBar: - """Represent a set of menus in a menu bar. - - Interface: - - - (constructor) - - (destructor) - - addmenu - - addpopup (normally used internally) - - dispatch (called from Application) - """ - - nextid = 1 # Necessarily a class variable - - def getnextid(self): - id = MenuBar.nextid - MenuBar.nextid = id+1 - return id - - def __init__(self, parent=None): - self.parent = parent - ClearMenuBar() - self.bar = GetMenuBar() - self.menus = {} - - # XXX necessary? - def close(self): - self.parent = None - self.bar = None - self.menus = None - - def addmenu(self, title, after = 0, id=None): - if id == None: - id = self.getnextid() - if DEBUG: print 'Newmenu', title, id # XXXX - m = NewMenu(id, title) - m.InsertMenu(after) - if after >= 0: - if self.parent: - self.parent.needmenubarredraw = 1 - else: - DrawMenuBar() - return id, m - - def delmenu(self, id): - if DEBUG: print 'Delmenu', id # XXXX - DeleteMenu(id) - - def addpopup(self, title = ''): - return self.addmenu(title, -1) - -# Useless: -# def install(self): -# if not self.bar: return -# SetMenuBar(self.bar) -# if self.parent: -# self.parent.needmenubarredraw = 1 -# else: -# DrawMenuBar() - - def fixmenudimstate(self): - for m in self.menus.keys(): - menu = self.menus[m] - if menu.__class__ == FrameWork.AppleMenu: - continue - for i in range(len(menu.items)): - label, shortcut, callback, kind = menu.items[i] - if type(callback) == types.StringType: - wid = MyFrontWindow() - if wid and self.parent._windows.has_key(wid): - window = self.parent._windows[wid] - if hasattr(window, "domenu_" + callback): - menu.menu.EnableMenuItem(i + 1) - elif hasattr(self.parent, "domenu_" + callback): - menu.menu.EnableMenuItem(i + 1) - else: - menu.menu.DisableMenuItem(i + 1) - elif hasattr(self.parent, "domenu_" + callback): - menu.menu.EnableMenuItem(i + 1) - else: - menu.menu.DisableMenuItem(i + 1) - elif callback: - pass - - def dispatch(self, id, item, window, event): - if self.menus.has_key(id): - self.menus[id].dispatch(id, item, window, event) - else: - if DEBUG: print "MenuBar.dispatch(%d, %d, %s, %s)" % \ - (id, item, window, event) - - -# XXX Need a way to get menus as resources and bind them to callbacks - -class Menu: - "One menu." - - def __init__(self, bar, title, after=0, id=None): - self.bar = bar - self.id, self.menu = self.bar.addmenu(title, after, id) - bar.menus[self.id] = self - self.items = [] - self._parent = None - - def delete(self): - self.bar.delmenu(self.id) - del self.bar.menus[self.id] - self.menu.DisposeMenu() - del self.bar - del self.items - del self.menu - del self.id - del self._parent - - def additem(self, label, shortcut=None, callback=None, kind=None): - self.menu.AppendMenu('x') # add a dummy string - self.items.append((label, shortcut, callback, kind)) - item = len(self.items) - if isinstance(label, unicode): - self.menu.SetMenuItemTextWithCFString(item, label) - else: - self.menu.SetMenuItemText(item, label) - if shortcut and type(shortcut) == type(()): - modifiers, char = shortcut[:2] - self.menu.SetItemCmd(item, ord(char)) - self.menu.SetMenuItemModifiers(item, modifiers) - if len(shortcut) > 2: - self.menu.SetMenuItemKeyGlyph(item, shortcut[2]) - elif shortcut: - self.menu.SetItemCmd(item, ord(shortcut)) - return item - - def delitem(self, item): - if item != len(self.items): - raise 'Can only delete last item of a menu' - self.menu.DeleteMenuItem(item) - del self.items[item-1] - - def addcheck(self, label, shortcut=None, callback=None): - return self.additem(label, shortcut, callback, 'check') - - def addradio(self, label, shortcut=None, callback=None): - return self.additem(label, shortcut, callback, 'radio') - - def addseparator(self): - self.menu.AppendMenu('(-') - self.items.append(('', None, None, 'separator')) - - def addsubmenu(self, label, title=''): - sub = Menu(self.bar, title, -1) - item = self.additem(label, '\x1B', None, 'submenu') - self.menu.SetItemMark(item, sub.id) - sub._parent = self - sub._parent_item = item - return sub - - def dispatch(self, id, item, window, event): - title, shortcut, callback, mtype = self.items[item-1] - if callback: - if not self.bar.parent or type(callback) <> types.StringType: - menuhandler = callback - else: - # callback is string - wid = MyFrontWindow() - if wid and self.bar.parent._windows.has_key(wid): - window = self.bar.parent._windows[wid] - if hasattr(window, "domenu_" + callback): - menuhandler = getattr(window, "domenu_" + callback) - elif hasattr(self.bar.parent, "domenu_" + callback): - menuhandler = getattr(self.bar.parent, "domenu_" + callback) - else: - # nothing we can do. we shouldn't have come this far - # since the menu item should have been disabled... - return - elif hasattr(self.bar.parent, "domenu_" + callback): - menuhandler = getattr(self.bar.parent, "domenu_" + callback) - else: - # nothing we can do. we shouldn't have come this far - # since the menu item should have been disabled... - return - menuhandler(id, item, window, event) - - def enable(self, onoff): - if onoff: - self.menu.EnableMenuItem(0) - if self._parent: - self._parent.menu.EnableMenuItem(self._parent_item) - else: - self.menu.DisableMenuItem(0) - if self._parent: - self._parent.menu.DisableMenuItem(self._parent_item) - if self.bar and self.bar.parent: - self.bar.parent.needmenubarredraw = 1 - -class PopupMenu(Menu): - def __init__(self, bar): - Menu.__init__(self, bar, '(popup)', -1) - - def popup(self, x, y, event, default=1, window=None): - # NOTE that x and y are global coordinates, and they should probably - # be topleft of the button the user clicked (not mouse-coordinates), - # so the popup nicely overlaps. - reply = self.menu.PopUpMenuSelect(x, y, default) - if not reply: - return - id = (reply >> 16) & 0xffff - item = reply & 0xffff - if not window: - wid = MyFrontWindow() - try: - window = self.bar.parent._windows[wid] - except: - pass # If we can't find the window we pass None - self.dispatch(id, item, window, event) - -class MenuItem: - def __init__(self, menu, title, shortcut=None, callback=None, kind=None): - self.item = menu.additem(title, shortcut, callback) - self.menu = menu - - def delete(self): - self.menu.delitem(self.item) - del self.menu - del self.item - - def check(self, onoff): - self.menu.menu.CheckMenuItem(self.item, onoff) - - def enable(self, onoff): - if onoff: - self.menu.menu.EnableMenuItem(self.item) - else: - self.menu.menu.DisableMenuItem(self.item) - - def settext(self, text): - self.menu.menu.SetMenuItemText(self.item, text) - - def setstyle(self, style): - self.menu.menu.SetItemStyle(self.item, style) - - def seticon(self, icon): - self.menu.menu.SetItemIcon(self.item, icon) - - def setcmd(self, cmd): - self.menu.menu.SetItemCmd(self.item, cmd) - - def setmark(self, cmd): - self.menu.menu.SetItemMark(self.item, cmd) - - -class RadioItem(MenuItem): - def __init__(self, menu, title, shortcut=None, callback=None): - MenuItem.__init__(self, menu, title, shortcut, callback, 'radio') - -class CheckItem(MenuItem): - def __init__(self, menu, title, shortcut=None, callback=None): - MenuItem.__init__(self, menu, title, shortcut, callback, 'check') - -def Separator(menu): - menu.addseparator() - -def SubMenu(menu, label, title=''): - return menu.addsubmenu(label, title) - - -class AppleMenu(Menu): - - def __init__(self, bar, abouttext="About me...", aboutcallback=None): - Menu.__init__(self, bar, "\024", id=SIOUX_APPLEMENU_ID) - if MacOS.runtimemodel == 'ppc': - self.additem(abouttext, None, aboutcallback) - self.addseparator() - self.menu.AppendResMenu('DRVR') - else: - # Additem()'s tricks do not work for "apple" menu under Carbon - self.menu.InsertMenuItem(abouttext, 0) - self.items.append((abouttext, None, aboutcallback, None)) - - def dispatch(self, id, item, window, event): - if item == 1: - Menu.dispatch(self, id, item, window, event) - elif MacOS.runtimemodel == 'ppc': - name = self.menu.GetMenuItemText(item) - OpenDeskAcc(name) - -class HelpMenu(Menu): - def __init__(self, bar): - # Note we don't call Menu.__init__, we do the necessary things by hand - self.bar = bar - self.menu, index = HMGetHelpMenu() - self.id = self.menu.GetMenuID() - bar.menus[self.id] = self - # The next line caters for the entries the system already handles for us - self.items = [None]*(index-1) - self._parent = None - - -class Window: - """A single window belonging to an application""" - - def __init__(self, parent): - self.wid = None - self.parent = parent - - def open(self, bounds=(40, 40, 400, 400), resid=None): - if resid <> None: - self.wid = GetNewWindow(resid, -1) - else: - self.wid = NewWindow(bounds, self.__class__.__name__, 1, - 8, -1, 1, 0) # changed to proc id 8 to include zoom box. jvr - self.do_postopen() - - def do_postopen(self): - """Tell our parent we exist""" - self.parent.appendwindow(self.wid, self) - - def close(self): - self.do_postclose() - - def do_postclose(self): - self.parent.removewindow(self.wid) - self.parent = None - self.wid = None - - def SetPort(self): - # Convinience method - SetPort(self.wid) - - def GetWindow(self): - return self.wid - - def do_inDrag(self, partcode, window, event): - where = event[3] - window.DragWindow(where, self.draglimit) - - draglimit = screenbounds - - def do_inGoAway(self, partcode, window, event): - where = event[3] - if window.TrackGoAway(where): - self.close() - - def do_inZoom(self, partcode, window, event): - (what, message, when, where, modifiers) = event - if window.TrackBox(where, partcode): - window.ZoomWindow(partcode, 1) - rect = window.GetWindowUserState() # so that zoom really works... jvr - self.do_postresize(rect[2] - rect[0], rect[3] - rect[1], window) # jvr - - def do_inZoomIn(self, partcode, window, event): - SetPort(window) # !!! - self.do_inZoom(partcode, window, event) - - def do_inZoomOut(self, partcode, window, event): - SetPort(window) # !!! - self.do_inZoom(partcode, window, event) - - def do_inGrow(self, partcode, window, event): - (what, message, when, where, modifiers) = event - result = window.GrowWindow(where, self.growlimit) - if result: - height = (result>>16) & 0xffff # Hi word - width = result & 0xffff # Lo word - self.do_resize(width, height, window) - - growlimit = (50, 50, screenbounds[2] - screenbounds[0], screenbounds[3] - screenbounds[1]) # jvr - - def do_resize(self, width, height, window): - l, t, r, b = self.wid.GetWindowPort().GetPortBounds() # jvr, forGrowIcon - self.SetPort() # jvr - self.wid.InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr - window.SizeWindow(width, height, 1) # changed updateFlag to true jvr - self.do_postresize(width, height, window) - - def do_postresize(self, width, height, window): - SetPort(window) - self.wid.InvalWindowRect(window.GetWindowPort().GetPortBounds()) - - def do_inContent(self, partcode, window, event): - # - # If we're not frontmost, select ourselves and wait for - # the activate event. - # - if MyFrontWindow() <> window: - window.SelectWindow() - return - # We are. Handle the event. - (what, message, when, where, modifiers) = event - SetPort(window) - local = GlobalToLocal(where) - self.do_contentclick(local, modifiers, event) - - def do_contentclick(self, local, modifiers, event): - if DEBUG: - print 'Click in contents at %s, modifiers %s'%(local, modifiers) - - def do_rawupdate(self, window, event): - if DEBUG: print "raw update for", window - SetPort(window) - window.BeginUpdate() - self.do_update(window, event) - window.EndUpdate() - - def do_update(self, window, event): - if DEBUG: - import time - for i in range(8): - time.sleep(0.1) - InvertRgn(window.GetWindowPort().visRgn) - FillRgn(window.GetWindowPort().visRgn, GetQDGlobalsGray()) - else: - EraseRgn(window.GetWindowPort().visRgn) - - def do_activate(self, activate, event): - if DEBUG: print 'Activate %d for %s'%(activate, self.wid) - -class ControlsWindow(Window): - - def do_rawupdate(self, window, event): - if DEBUG: print "raw update for", window - SetPort(window) - window.BeginUpdate() - self.do_update(window, event) - #DrawControls(window) # jvr - UpdateControls(window, window.GetWindowPort().visRgn) # jvr - window.DrawGrowIcon() - window.EndUpdate() - - def do_controlhit(self, window, control, pcode, event): - if DEBUG: print "control hit in", window, "on", control, "; pcode =", pcode - - def do_inContent(self, partcode, window, event): - if MyFrontWindow() <> window: - window.SelectWindow() - return - (what, message, when, where, modifiers) = event - SetPort(window) # XXXX Needed? - local = GlobalToLocal(where) - pcode, control = FindControl(local, window) - if pcode and control: - self.do_rawcontrolhit(window, control, pcode, local, event) - else: - if DEBUG: print "FindControl(%s, %s) -> (%s, %s)" % \ - (local, window, pcode, control) - self.do_contentclick(local, modifiers, event) - - def do_rawcontrolhit(self, window, control, pcode, local, event): - pcode = control.TrackControl(local) - if pcode: - self.do_controlhit(window, control, pcode, event) - -class ScrolledWindow(ControlsWindow): - def __init__(self, parent): - self.barx = self.bary = None - self.barx_enabled = self.bary_enabled = 1 - self.activated = 1 - ControlsWindow.__init__(self, parent) - - def scrollbars(self, wantx=1, wanty=1): - SetPort(self.wid) - self.barx = self.bary = None - self.barx_enabled = self.bary_enabled = 1 - x0, y0, x1, y1 = self.wid.GetWindowPort().GetPortBounds() - vx, vy = self.getscrollbarvalues() - if vx == None: self.barx_enabled, vx = 0, 0 - if vy == None: self.bary_enabled, vy = 0, 0 - if wantx: - rect = x0-1, y1-(SCROLLBARWIDTH-1), x1-(SCROLLBARWIDTH-2), y1+1 - self.barx = NewControl(self.wid, rect, "", 1, vx, 0, 32767, 16, 0) - if not self.barx_enabled: self.barx.HiliteControl(255) -## self.wid.InvalWindowRect(rect) - if wanty: - rect = x1-(SCROLLBARWIDTH-1), y0-1, x1+1, y1-(SCROLLBARWIDTH-2) - self.bary = NewControl(self.wid, rect, "", 1, vy, 0, 32767, 16, 0) - if not self.bary_enabled: self.bary.HiliteControl(255) -## self.wid.InvalWindowRect(rect) - - def do_postclose(self): - self.barx = self.bary = None - ControlsWindow.do_postclose(self) - - def do_activate(self, onoff, event): - self.activated = onoff - if onoff: - if self.barx and self.barx_enabled: - self.barx.ShowControl() # jvr - if self.bary and self.bary_enabled: - self.bary.ShowControl() # jvr - else: - if self.barx: - self.barx.HideControl() # jvr; An inactive window should have *hidden* - # scrollbars, not just dimmed (no matter what - # BBEdit does... look at the Finder) - if self.bary: - self.bary.HideControl() # jvr - self.wid.DrawGrowIcon() # jvr - - def do_postresize(self, width, height, window): - l, t, r, b = self.wid.GetWindowPort().GetPortBounds() - self.SetPort() - if self.barx: - self.barx.HideControl() # jvr - self.barx.MoveControl(l-1, b-(SCROLLBARWIDTH-1)) - self.barx.SizeControl((r-l)-(SCROLLBARWIDTH-3), SCROLLBARWIDTH) # jvr - if self.bary: - self.bary.HideControl() # jvr - self.bary.MoveControl(r-(SCROLLBARWIDTH-1), t-1) - self.bary.SizeControl(SCROLLBARWIDTH, (b-t)-(SCROLLBARWIDTH-3)) # jvr - if self.barx: - self.barx.ShowControl() # jvr - self.wid.ValidWindowRect((l, b - SCROLLBARWIDTH + 1, r - SCROLLBARWIDTH + 2, b)) # jvr - if self.bary: - self.bary.ShowControl() # jvr - self.wid.ValidWindowRect((r - SCROLLBARWIDTH + 1, t, r, b - SCROLLBARWIDTH + 2)) # jvr - self.wid.InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr, growicon - - - def do_rawcontrolhit(self, window, control, pcode, local, event): - if control == self.barx: - which = 'x' - elif control == self.bary: - which = 'y' - else: - return 0 - if pcode in (inUpButton, inDownButton, inPageUp, inPageDown): - # We do the work for the buttons and grey area in the tracker - dummy = control.TrackControl(local, self.do_controltrack) - else: - # but the thumb is handled here - pcode = control.TrackControl(local) - if pcode == inThumb: - value = control.GetControlValue() - print 'setbars', which, value #DBG - self.scrollbar_callback(which, 'set', value) - self.updatescrollbars() - else: - print 'funny part', pcode #DBG - return 1 - - def do_controltrack(self, control, pcode): - if control == self.barx: - which = 'x' - elif control == self.bary: - which = 'y' - else: - return - - if pcode == inUpButton: - what = '-' - elif pcode == inDownButton: - what = '+' - elif pcode == inPageUp: - what = '--' - elif pcode == inPageDown: - what = '++' - else: - return - self.scrollbar_callback(which, what, None) - self.updatescrollbars() - - def updatescrollbars(self): - SetPort(self.wid) - vx, vy = self.getscrollbarvalues() - if self.barx: - if vx == None: - self.barx.HiliteControl(255) - self.barx_enabled = 0 - else: - if not self.barx_enabled: - self.barx_enabled = 1 - if self.activated: - self.barx.HiliteControl(0) - self.barx.SetControlValue(vx) - if self.bary: - if vy == None: - self.bary.HiliteControl(255) - self.bary_enabled = 0 - else: - if not self.bary_enabled: - self.bary_enabled = 1 - if self.activated: - self.bary.HiliteControl(0) - self.bary.SetControlValue(vy) - - # Auxiliary function: convert standard text/image/etc coordinate - # to something palatable as getscrollbarvalues() return - def scalebarvalue(self, absmin, absmax, curmin, curmax): - if curmin <= absmin and curmax >= absmax: - return None - if curmin <= absmin: - return 0 - if curmax >= absmax: - return 32767 - perc = float(curmin-absmin)/float(absmax-absmin) - return int(perc*32767) - - # To be overridden: - - def getscrollbarvalues(self): - return 0, 0 - - def scrollbar_callback(self, which, what, value): - print 'scroll', which, what, value - -class DialogWindow(Window): - """A modeless dialog window""" - - def open(self, resid): - self.dlg = GetNewDialog(resid, -1) - self.wid = self.dlg.GetDialogWindow() - self.do_postopen() - - def close(self): - self.do_postclose() - - def do_postclose(self): - self.dlg = None - Window.do_postclose(self) - - def do_itemhit(self, item, event): - print 'Dialog %s, item %d hit'%(self.dlg, item) - - def do_rawupdate(self, window, event): - pass - -def ostypecode(x): - "Convert a long int to the 4-character code it really is" - s = '' - for i in range(4): - x, c = divmod(x, 256) - s = chr(c) + s - return s - - -class TestApp(Application): - - "This class is used by the test() function" - - def makeusermenus(self): - self.filemenu = m = Menu(self.menubar, "File") - self.saveitem = MenuItem(m, "Save", "S", self.save) - Separator(m) - self.optionsmenu = mm = SubMenu(m, "Options") - self.opt1 = CheckItem(mm, "Arguments", "A") - self.opt2 = CheckItem(mm, "Being hit on the head lessons", (kMenuOptionModifier, "A")) - self.opt3 = CheckItem(mm, "Complaints", (kMenuOptionModifier|kMenuNoCommandModifier, "A")) - Separator(m) - self.itemeh = MenuItem(m, "Enable Help", None, self.enablehelp) - self.itemdbg = MenuItem(m, "Debug", None, self.debug) - Separator(m) - self.quititem = MenuItem(m, "Quit", "Q", self.quit) - - def save(self, *args): - print "Save" - - def quit(self, *args): - raise self - - def enablehelp(self, *args): - hm = self.gethelpmenu() - self.nohelpitem = MenuItem(hm, "There isn't any", None, self.nohelp) - - def nohelp(self, *args): - print "I told you there isn't any!" - - def debug(self, *args): - import pdb - pdb.set_trace() - - -def test(): - "Test program" - app = TestApp() - app.mainloop() - - -if __name__ == '__main__': - test() diff --git a/sys/lib/python/plat-mac/MiniAEFrame.py b/sys/lib/python/plat-mac/MiniAEFrame.py deleted file mode 100644 index 98247cbf3..000000000 --- a/sys/lib/python/plat-mac/MiniAEFrame.py +++ /dev/null @@ -1,198 +0,0 @@ -"""MiniAEFrame - A minimal AppleEvent Application framework. - -There are two classes: - AEServer -- a mixin class offering nice AE handling. - MiniApplication -- a very minimal alternative to FrameWork.py, - only suitable for the simplest of AppleEvent servers. -""" - -import sys -import traceback -import MacOS -from Carbon import AE -from Carbon.AppleEvents import * -from Carbon import Evt -from Carbon.Events import * -from Carbon import Menu -from Carbon import Win -from Carbon.Windows import * -from Carbon import Qd - -import aetools -import EasyDialogs - -kHighLevelEvent = 23 # Not defined anywhere for Python yet? - - -class MiniApplication: - - """A minimal FrameWork.Application-like class""" - - def __init__(self): - self.quitting = 0 - # Initialize menu - self.appleid = 1 - self.quitid = 2 - Menu.ClearMenuBar() - self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024") - applemenu.AppendMenu("%s;(-" % self.getaboutmenutext()) - if MacOS.runtimemodel == 'ppc': - applemenu.AppendResMenu('DRVR') - applemenu.InsertMenu(0) - self.quitmenu = Menu.NewMenu(self.quitid, "File") - self.quitmenu.AppendMenu("Quit") - self.quitmenu.SetItemCmd(1, ord("Q")) - self.quitmenu.InsertMenu(0) - Menu.DrawMenuBar() - - def __del__(self): - self.close() - - def close(self): - pass - - def mainloop(self, mask = everyEvent, timeout = 60*60): - while not self.quitting: - self.dooneevent(mask, timeout) - - def _quit(self): - self.quitting = 1 - - def dooneevent(self, mask = everyEvent, timeout = 60*60): - got, event = Evt.WaitNextEvent(mask, timeout) - if got: - self.lowlevelhandler(event) - - def lowlevelhandler(self, event): - what, message, when, where, modifiers = event - h, v = where - if what == kHighLevelEvent: - msg = "High Level Event: %r %r" % (code(message), code(h | (v<<16))) - try: - AE.AEProcessAppleEvent(event) - except AE.Error, err: - print 'AE error: ', err - print 'in', msg - traceback.print_exc() - return - elif what == keyDown: - c = chr(message & charCodeMask) - if modifiers & cmdKey: - if c == '.': - raise KeyboardInterrupt, "Command-period" - if c == 'q': - if hasattr(MacOS, 'OutputSeen'): - MacOS.OutputSeen() - self.quitting = 1 - return - elif what == mouseDown: - partcode, window = Win.FindWindow(where) - if partcode == inMenuBar: - result = Menu.MenuSelect(where) - id = (result>>16) & 0xffff # Hi word - item = result & 0xffff # Lo word - if id == self.appleid: - if item == 1: - EasyDialogs.Message(self.getabouttext()) - elif item > 1 and hasattr(Menu, 'OpenDeskAcc'): - name = self.applemenu.GetMenuItemText(item) - Menu.OpenDeskAcc(name) - elif id == self.quitid and item == 1: - if hasattr(MacOS, 'OutputSeen'): - MacOS.OutputSeen() - self.quitting = 1 - Menu.HiliteMenu(0) - return - # Anything not handled is passed to Python/SIOUX - if hasattr(MacOS, 'HandleEvent'): - MacOS.HandleEvent(event) - else: - print "Unhandled event:", event - - def getabouttext(self): - return self.__class__.__name__ - - def getaboutmenutext(self): - return "About %s\311" % self.__class__.__name__ - - -class AEServer: - - def __init__(self): - self.ae_handlers = {} - - def installaehandler(self, classe, type, callback): - AE.AEInstallEventHandler(classe, type, self.callback_wrapper) - self.ae_handlers[(classe, type)] = callback - - def close(self): - for classe, type in self.ae_handlers.keys(): - AE.AERemoveEventHandler(classe, type) - - def callback_wrapper(self, _request, _reply): - _parameters, _attributes = aetools.unpackevent(_request) - _class = _attributes['evcl'].type - _type = _attributes['evid'].type - - if self.ae_handlers.has_key((_class, _type)): - _function = self.ae_handlers[(_class, _type)] - elif self.ae_handlers.has_key((_class, '****')): - _function = self.ae_handlers[(_class, '****')] - elif self.ae_handlers.has_key(('****', '****')): - _function = self.ae_handlers[('****', '****')] - else: - raise 'Cannot happen: AE callback without handler', (_class, _type) - - # XXXX Do key-to-name mapping here - - _parameters['_attributes'] = _attributes - _parameters['_class'] = _class - _parameters['_type'] = _type - if _parameters.has_key('----'): - _object = _parameters['----'] - del _parameters['----'] - # The try/except that used to be here can mask programmer errors. - # Let the program crash, the programmer can always add a **args - # to the formal parameter list. - rv = _function(_object, **_parameters) - else: - #Same try/except comment as above - rv = _function(**_parameters) - - if rv == None: - aetools.packevent(_reply, {}) - else: - aetools.packevent(_reply, {'----':rv}) - - -def code(x): - "Convert a long int to the 4-character code it really is" - s = '' - for i in range(4): - x, c = divmod(x, 256) - s = chr(c) + s - return s - -class _Test(AEServer, MiniApplication): - """Mini test application, handles required events""" - - def __init__(self): - MiniApplication.__init__(self) - AEServer.__init__(self) - self.installaehandler('aevt', 'oapp', self.open_app) - self.installaehandler('aevt', 'quit', self.quit) - self.installaehandler('****', '****', self.other) - self.mainloop() - - def quit(self, **args): - self._quit() - - def open_app(self, **args): - pass - - def other(self, _object=None, _class=None, _type=None, **args): - print 'AppleEvent', (_class, _type), 'for', _object, 'Other args:', args - - -if __name__ == '__main__': - _Test() diff --git a/sys/lib/python/plat-mac/PixMapWrapper.py b/sys/lib/python/plat-mac/PixMapWrapper.py deleted file mode 100644 index 7edbac26c..000000000 --- a/sys/lib/python/plat-mac/PixMapWrapper.py +++ /dev/null @@ -1,214 +0,0 @@ -"""PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque -QuickDraw PixMap data structure in a handy Python class. Also provides -methods to convert to/from pixel data (from, e.g., the img module) or a -Python Imaging Library Image object. - -J. Strout February 1999""" - -from Carbon import Qd -from Carbon import QuickDraw -import struct -import MacOS -import img -import imgformat - -# PixMap data structure element format (as used with struct) -_pmElemFormat = { - 'baseAddr':'l', # address of pixel data - 'rowBytes':'H', # bytes per row, plus 0x8000 - 'bounds':'hhhh', # coordinates imposed over pixel data - 'top':'h', - 'left':'h', - 'bottom':'h', - 'right':'h', - 'pmVersion':'h', # flags for Color QuickDraw - 'packType':'h', # format of compression algorithm - 'packSize':'l', # size after compression - 'hRes':'l', # horizontal pixels per inch - 'vRes':'l', # vertical pixels per inch - 'pixelType':'h', # pixel format - 'pixelSize':'h', # bits per pixel - 'cmpCount':'h', # color components per pixel - 'cmpSize':'h', # bits per component - 'planeBytes':'l', # offset in bytes to next plane - 'pmTable':'l', # handle to color table - 'pmReserved':'l' # reserved for future use -} - -# PixMap data structure element offset -_pmElemOffset = { - 'baseAddr':0, - 'rowBytes':4, - 'bounds':6, - 'top':6, - 'left':8, - 'bottom':10, - 'right':12, - 'pmVersion':14, - 'packType':16, - 'packSize':18, - 'hRes':22, - 'vRes':26, - 'pixelType':30, - 'pixelSize':32, - 'cmpCount':34, - 'cmpSize':36, - 'planeBytes':38, - 'pmTable':42, - 'pmReserved':46 -} - -class PixMapWrapper: - """PixMapWrapper -- wraps the QD PixMap object in a Python class, - with methods to easily get/set various pixmap fields. Note: Use the - PixMap() method when passing to QD calls.""" - - def __init__(self): - self.__dict__['data'] = '' - self._header = struct.pack("lhhhhhhhlllhhhhlll", - id(self.data)+MacOS.string_id_to_buffer, - 0, # rowBytes - 0, 0, 0, 0, # bounds - 0, # pmVersion - 0, 0, # packType, packSize - 72<<16, 72<<16, # hRes, vRes - QuickDraw.RGBDirect, # pixelType - 16, # pixelSize - 2, 5, # cmpCount, cmpSize, - 0, 0, 0) # planeBytes, pmTable, pmReserved - self.__dict__['_pm'] = Qd.RawBitMap(self._header) - - def _stuff(self, element, bytes): - offset = _pmElemOffset[element] - fmt = _pmElemFormat[element] - self._header = self._header[:offset] \ - + struct.pack(fmt, bytes) \ - + self._header[offset + struct.calcsize(fmt):] - self.__dict__['_pm'] = None - - def _unstuff(self, element): - offset = _pmElemOffset[element] - fmt = _pmElemFormat[element] - return struct.unpack(fmt, self._header[offset:offset+struct.calcsize(fmt)])[0] - - def __setattr__(self, attr, val): - if attr == 'baseAddr': - raise 'UseErr', "don't assign to .baseAddr -- assign to .data instead" - elif attr == 'data': - self.__dict__['data'] = val - self._stuff('baseAddr', id(self.data) + MacOS.string_id_to_buffer) - elif attr == 'rowBytes': - # high bit is always set for some odd reason - self._stuff('rowBytes', val | 0x8000) - elif attr == 'bounds': - # assume val is in official Left, Top, Right, Bottom order! - self._stuff('left',val[0]) - self._stuff('top',val[1]) - self._stuff('right',val[2]) - self._stuff('bottom',val[3]) - elif attr == 'hRes' or attr == 'vRes': - # 16.16 fixed format, so just shift 16 bits - self._stuff(attr, int(val) << 16) - elif attr in _pmElemFormat.keys(): - # any other pm attribute -- just stuff - self._stuff(attr, val) - else: - self.__dict__[attr] = val - - def __getattr__(self, attr): - if attr == 'rowBytes': - # high bit is always set for some odd reason - return self._unstuff('rowBytes') & 0x7FFF - elif attr == 'bounds': - # return bounds in official Left, Top, Right, Bottom order! - return ( \ - self._unstuff('left'), - self._unstuff('top'), - self._unstuff('right'), - self._unstuff('bottom') ) - elif attr == 'hRes' or attr == 'vRes': - # 16.16 fixed format, so just shift 16 bits - return self._unstuff(attr) >> 16 - elif attr in _pmElemFormat.keys(): - # any other pm attribute -- just unstuff - return self._unstuff(attr) - else: - return self.__dict__[attr] - - - def PixMap(self): - "Return a QuickDraw PixMap corresponding to this data." - if not self.__dict__['_pm']: - self.__dict__['_pm'] = Qd.RawBitMap(self._header) - return self.__dict__['_pm'] - - def blit(self, x1=0,y1=0,x2=None,y2=None, port=None): - """Draw this pixmap into the given (default current) grafport.""" - src = self.bounds - dest = [x1,y1,x2,y2] - if x2 == None: - dest[2] = x1 + src[2]-src[0] - if y2 == None: - dest[3] = y1 + src[3]-src[1] - if not port: port = Qd.GetPort() - Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest), - QuickDraw.srcCopy, None) - - def fromstring(self,s,width,height,format=imgformat.macrgb): - """Stuff this pixmap with raw pixel data from a string. - Supply width, height, and one of the imgformat specifiers.""" - # we only support 16- and 32-bit mac rgb... - # so convert if necessary - if format != imgformat.macrgb and format != imgformat.macrgb16: - # (LATER!) - raise "NotImplementedError", "conversion to macrgb or macrgb16" - self.data = s - self.bounds = (0,0,width,height) - self.cmpCount = 3 - self.pixelType = QuickDraw.RGBDirect - if format == imgformat.macrgb: - self.pixelSize = 32 - self.cmpSize = 8 - else: - self.pixelSize = 16 - self.cmpSize = 5 - self.rowBytes = width*self.pixelSize/8 - - def tostring(self, format=imgformat.macrgb): - """Return raw data as a string in the specified format.""" - # is the native format requested? if so, just return data - if (format == imgformat.macrgb and self.pixelSize == 32) or \ - (format == imgformat.macrgb16 and self.pixelsize == 16): - return self.data - # otherwise, convert to the requested format - # (LATER!) - raise "NotImplementedError", "data format conversion" - - def fromImage(self,im): - """Initialize this PixMap from a PIL Image object.""" - # We need data in ARGB format; PIL can't currently do that, - # but it can do RGBA, which we can use by inserting one null - # up frontpm = - if im.mode != 'RGBA': im = im.convert('RGBA') - data = chr(0) + im.tostring() - self.fromstring(data, im.size[0], im.size[1]) - - def toImage(self): - """Return the contents of this PixMap as a PIL Image object.""" - import Image - # our tostring() method returns data in ARGB format, - # whereas Image uses RGBA; a bit of slicing fixes this... - data = self.tostring()[1:] + chr(0) - bounds = self.bounds - return Image.fromstring('RGBA',(bounds[2]-bounds[0],bounds[3]-bounds[1]),data) - -def test(): - import MacOS - import EasyDialogs - import Image - path = EasyDialogs.AskFileForOpen("Image File:") - if not path: return - pm = PixMapWrapper() - pm.fromImage( Image.open(path) ) - pm.blit(20,20) - return pm diff --git a/sys/lib/python/plat-mac/aepack.py b/sys/lib/python/plat-mac/aepack.py deleted file mode 100644 index 529a0a4ed..000000000 --- a/sys/lib/python/plat-mac/aepack.py +++ /dev/null @@ -1,366 +0,0 @@ -"""Tools for use in AppleEvent clients and servers: -conversion between AE types and python types - -pack(x) converts a Python object to an AEDesc object -unpack(desc) does the reverse -coerce(x, wanted_sample) coerces a python object to another python object -""" - -# -# This code was originally written by Guido, and modified/extended by Jack -# to include the various types that were missing. The reference used is -# Apple Event Registry, chapter 9. -# - -import struct -import string -import types -from string import strip -from types import * -from Carbon import AE -from Carbon.AppleEvents import * -import MacOS -import Carbon.File -import StringIO -import aetypes -from aetypes import mkenum, ObjectSpecifier -import os - -# These ones seem to be missing from AppleEvents -# (they're in AERegistry.h) - -#typeColorTable = 'clrt' -#typeDrawingArea = 'cdrw' -#typePixelMap = 'cpix' -#typePixelMapMinus = 'tpmm' -#typeRotation = 'trot' -#typeTextStyles = 'tsty' -#typeStyledText = 'STXT' -#typeAEText = 'tTXT' -#typeEnumeration = 'enum' - -# -# Some AE types are immedeately coerced into something -# we like better (and which is equivalent) -# -unpacker_coercions = { - typeComp : typeFloat, - typeColorTable : typeAEList, - typeDrawingArea : typeAERecord, - typeFixed : typeFloat, - typeExtended : typeFloat, - typePixelMap : typeAERecord, - typeRotation : typeAERecord, - typeStyledText : typeAERecord, - typeTextStyles : typeAERecord, -}; - -# -# Some python types we need in the packer: -# -AEDescType = AE.AEDescType -FSSType = Carbon.File.FSSpecType -FSRefType = Carbon.File.FSRefType -AliasType = Carbon.File.AliasType - -def packkey(ae, key, value): - if hasattr(key, 'which'): - keystr = key.which - elif hasattr(key, 'want'): - keystr = key.want - else: - keystr = key - ae.AEPutParamDesc(keystr, pack(value)) - -def pack(x, forcetype = None): - """Pack a python object into an AE descriptor""" - - if forcetype: - if type(x) is StringType: - return AE.AECreateDesc(forcetype, x) - else: - return pack(x).AECoerceDesc(forcetype) - - if x == None: - return AE.AECreateDesc('null', '') - - if isinstance(x, AEDescType): - return x - if isinstance(x, FSSType): - return AE.AECreateDesc('fss ', x.data) - if isinstance(x, FSRefType): - return AE.AECreateDesc('fsrf', x.data) - if isinstance(x, AliasType): - return AE.AECreateDesc('alis', x.data) - if isinstance(x, IntType): - return AE.AECreateDesc('long', struct.pack('l', x)) - if isinstance(x, FloatType): - return AE.AECreateDesc('doub', struct.pack('d', x)) - if isinstance(x, StringType): - return AE.AECreateDesc('TEXT', x) - if isinstance(x, UnicodeType): - data = x.encode('utf16') - if data[:2] == '\xfe\xff': - data = data[2:] - return AE.AECreateDesc('utxt', data) - if isinstance(x, ListType): - list = AE.AECreateList('', 0) - for item in x: - list.AEPutDesc(0, pack(item)) - return list - if isinstance(x, DictionaryType): - record = AE.AECreateList('', 1) - for key, value in x.items(): - packkey(record, key, value) - #record.AEPutParamDesc(key, pack(value)) - return record - if type(x) == types.ClassType and issubclass(x, ObjectSpecifier): - # Note: we are getting a class object here, not an instance - return AE.AECreateDesc('type', x.want) - if hasattr(x, '__aepack__'): - return x.__aepack__() - if hasattr(x, 'which'): - return AE.AECreateDesc('TEXT', x.which) - if hasattr(x, 'want'): - return AE.AECreateDesc('TEXT', x.want) - return AE.AECreateDesc('TEXT', repr(x)) # Copout - -def unpack(desc, formodulename=""): - """Unpack an AE descriptor to a python object""" - t = desc.type - - if unpacker_coercions.has_key(t): - desc = desc.AECoerceDesc(unpacker_coercions[t]) - t = desc.type # This is a guess by Jack.... - - if t == typeAEList: - l = [] - for i in range(desc.AECountItems()): - keyword, item = desc.AEGetNthDesc(i+1, '****') - l.append(unpack(item, formodulename)) - return l - if t == typeAERecord: - d = {} - for i in range(desc.AECountItems()): - keyword, item = desc.AEGetNthDesc(i+1, '****') - d[keyword] = unpack(item, formodulename) - return d - if t == typeAEText: - record = desc.AECoerceDesc('reco') - return mkaetext(unpack(record, formodulename)) - if t == typeAlias: - return Carbon.File.Alias(rawdata=desc.data) - # typeAppleEvent returned as unknown - if t == typeBoolean: - return struct.unpack('b', desc.data)[0] - if t == typeChar: - return desc.data - if t == typeUnicodeText: - return unicode(desc.data, 'utf16') - # typeColorTable coerced to typeAEList - # typeComp coerced to extended - # typeData returned as unknown - # typeDrawingArea coerced to typeAERecord - if t == typeEnumeration: - return mkenum(desc.data) - # typeEPS returned as unknown - if t == typeFalse: - return 0 - if t == typeFloat: - data = desc.data - return struct.unpack('d', data)[0] - if t == typeFSS: - return Carbon.File.FSSpec(rawdata=desc.data) - if t == typeFSRef: - return Carbon.File.FSRef(rawdata=desc.data) - if t == typeInsertionLoc: - record = desc.AECoerceDesc('reco') - return mkinsertionloc(unpack(record, formodulename)) - # typeInteger equal to typeLongInteger - if t == typeIntlText: - script, language = struct.unpack('hh', desc.data[:4]) - return aetypes.IntlText(script, language, desc.data[4:]) - if t == typeIntlWritingCode: - script, language = struct.unpack('hh', desc.data) - return aetypes.IntlWritingCode(script, language) - if t == typeKeyword: - return mkkeyword(desc.data) - if t == typeLongInteger: - return struct.unpack('l', desc.data)[0] - if t == typeLongDateTime: - a, b = struct.unpack('lL', desc.data) - return (long(a) << 32) + b - if t == typeNull: - return None - if t == typeMagnitude: - v = struct.unpack('l', desc.data) - if v < 0: - v = 0x100000000L + v - return v - if t == typeObjectSpecifier: - record = desc.AECoerceDesc('reco') - # If we have been told the name of the module we are unpacking aedescs for, - # we can attempt to create the right type of python object from that module. - if formodulename: - return mkobjectfrommodule(unpack(record, formodulename), formodulename) - return mkobject(unpack(record, formodulename)) - # typePict returned as unknown - # typePixelMap coerced to typeAERecord - # typePixelMapMinus returned as unknown - # typeProcessSerialNumber returned as unknown - if t == typeQDPoint: - v, h = struct.unpack('hh', desc.data) - return aetypes.QDPoint(v, h) - if t == typeQDRectangle: - v0, h0, v1, h1 = struct.unpack('hhhh', desc.data) - return aetypes.QDRectangle(v0, h0, v1, h1) - if t == typeRGBColor: - r, g, b = struct.unpack('hhh', desc.data) - return aetypes.RGBColor(r, g, b) - # typeRotation coerced to typeAERecord - # typeScrapStyles returned as unknown - # typeSessionID returned as unknown - if t == typeShortFloat: - return struct.unpack('f', desc.data)[0] - if t == typeShortInteger: - return struct.unpack('h', desc.data)[0] - # typeSMFloat identical to typeShortFloat - # typeSMInt indetical to typeShortInt - # typeStyledText coerced to typeAERecord - if t == typeTargetID: - return mktargetid(desc.data) - # typeTextStyles coerced to typeAERecord - # typeTIFF returned as unknown - if t == typeTrue: - return 1 - if t == typeType: - return mktype(desc.data, formodulename) - # - # The following are special - # - if t == 'rang': - record = desc.AECoerceDesc('reco') - return mkrange(unpack(record, formodulename)) - if t == 'cmpd': - record = desc.AECoerceDesc('reco') - return mkcomparison(unpack(record, formodulename)) - if t == 'logi': - record = desc.AECoerceDesc('reco') - return mklogical(unpack(record, formodulename)) - return mkunknown(desc.type, desc.data) - -def coerce(data, egdata): - """Coerce a python object to another type using the AE coercers""" - pdata = pack(data) - pegdata = pack(egdata) - pdata = pdata.AECoerceDesc(pegdata.type) - return unpack(pdata) - -# -# Helper routines for unpack -# -def mktargetid(data): - sessionID = getlong(data[:4]) - name = mkppcportrec(data[4:4+72]) - location = mklocationnamerec(data[76:76+36]) - rcvrName = mkppcportrec(data[112:112+72]) - return sessionID, name, location, rcvrName - -def mkppcportrec(rec): - namescript = getword(rec[:2]) - name = getpstr(rec[2:2+33]) - portkind = getword(rec[36:38]) - if portkind == 1: - ctor = rec[38:42] - type = rec[42:46] - identity = (ctor, type) - else: - identity = getpstr(rec[38:38+33]) - return namescript, name, portkind, identity - -def mklocationnamerec(rec): - kind = getword(rec[:2]) - stuff = rec[2:] - if kind == 0: stuff = None - if kind == 2: stuff = getpstr(stuff) - return kind, stuff - -def mkunknown(type, data): - return aetypes.Unknown(type, data) - -def getpstr(s): - return s[1:1+ord(s[0])] - -def getlong(s): - return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3]) - -def getword(s): - return (ord(s[0])<<8) | (ord(s[1])<<0) - -def mkkeyword(keyword): - return aetypes.Keyword(keyword) - -def mkrange(dict): - return aetypes.Range(dict['star'], dict['stop']) - -def mkcomparison(dict): - return aetypes.Comparison(dict['obj1'], dict['relo'].enum, dict['obj2']) - -def mklogical(dict): - return aetypes.Logical(dict['logc'], dict['term']) - -def mkstyledtext(dict): - return aetypes.StyledText(dict['ksty'], dict['ktxt']) - -def mkaetext(dict): - return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText]) - -def mkinsertionloc(dict): - return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition]) - -def mkobject(dict): - want = dict['want'].type - form = dict['form'].enum - seld = dict['seld'] - fr = dict['from'] - if form in ('name', 'indx', 'rang', 'test'): - if want == 'text': return aetypes.Text(seld, fr) - if want == 'cha ': return aetypes.Character(seld, fr) - if want == 'cwor': return aetypes.Word(seld, fr) - if want == 'clin': return aetypes.Line(seld, fr) - if want == 'cpar': return aetypes.Paragraph(seld, fr) - if want == 'cwin': return aetypes.Window(seld, fr) - if want == 'docu': return aetypes.Document(seld, fr) - if want == 'file': return aetypes.File(seld, fr) - if want == 'cins': return aetypes.InsertionPoint(seld, fr) - if want == 'prop' and form == 'prop' and aetypes.IsType(seld): - return aetypes.Property(seld.type, fr) - return aetypes.ObjectSpecifier(want, form, seld, fr) - -# Note by Jack: I'm not 100% sure of the following code. This was -# provided by Donovan Preston, but I wonder whether the assignment -# to __class__ is safe. Moreover, shouldn't there be a better -# initializer for the classes in the suites? -def mkobjectfrommodule(dict, modulename): - if type(dict['want']) == types.ClassType and issubclass(dict['want'], ObjectSpecifier): - # The type has already been converted to Python. Convert back:-( - classtype = dict['want'] - dict['want'] = aetypes.mktype(classtype.want) - want = dict['want'].type - module = __import__(modulename) - codenamemapper = module._classdeclarations - classtype = codenamemapper.get(want, None) - newobj = mkobject(dict) - if classtype: - assert issubclass(classtype, ObjectSpecifier) - newobj.__class__ = classtype - return newobj - -def mktype(typecode, modulename=None): - if modulename: - module = __import__(modulename) - codenamemapper = module._classdeclarations - classtype = codenamemapper.get(typecode, None) - if classtype: - return classtype - return aetypes.mktype(typecode) diff --git a/sys/lib/python/plat-mac/aetools.py b/sys/lib/python/plat-mac/aetools.py deleted file mode 100644 index 79f397831..000000000 --- a/sys/lib/python/plat-mac/aetools.py +++ /dev/null @@ -1,360 +0,0 @@ -"""Tools for use in AppleEvent clients and servers. - -pack(x) converts a Python object to an AEDesc object -unpack(desc) does the reverse - -packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record -unpackevent(event) returns the parameters and attributes from an AEAppleEvent record - -Plus... Lots of classes and routines that help representing AE objects, -ranges, conditionals, logicals, etc., so you can write, e.g.: - - x = Character(1, Document("foobar")) - -and pack(x) will create an AE object reference equivalent to AppleScript's - - character 1 of document "foobar" - -Some of the stuff that appears to be exported from this module comes from other -files: the pack stuff from aepack, the objects from aetypes. - -""" - - -from types import * -from Carbon import AE -from Carbon import Evt -from Carbon import AppleEvents -import MacOS -import sys -import time - -from aetypes import * -from aepack import packkey, pack, unpack, coerce, AEDescType - -Error = 'aetools.Error' - -# Amount of time to wait for program to be launched -LAUNCH_MAX_WAIT_TIME=10 - -# Special code to unpack an AppleEvent (which is *not* a disguised record!) -# Note by Jack: No??!? If I read the docs correctly it *is*.... - -aekeywords = [ - 'tran', - 'rtid', - 'evcl', - 'evid', - 'addr', - 'optk', - 'timo', - 'inte', # this attribute is read only - will be set in AESend - 'esrc', # this attribute is read only - 'miss', # this attribute is read only - 'from' # new in 1.0.1 -] - -def missed(ae): - try: - desc = ae.AEGetAttributeDesc('miss', 'keyw') - except AE.Error, msg: - return None - return desc.data - -def unpackevent(ae, formodulename=""): - parameters = {} - try: - dirobj = ae.AEGetParamDesc('----', '****') - except AE.Error: - pass - else: - parameters['----'] = unpack(dirobj, formodulename) - del dirobj - # Workaround for what I feel is a bug in OSX 10.2: 'errn' won't show up in missed... - try: - dirobj = ae.AEGetParamDesc('errn', '****') - except AE.Error: - pass - else: - parameters['errn'] = unpack(dirobj, formodulename) - del dirobj - while 1: - key = missed(ae) - if not key: break - parameters[key] = unpack(ae.AEGetParamDesc(key, '****'), formodulename) - attributes = {} - for key in aekeywords: - try: - desc = ae.AEGetAttributeDesc(key, '****') - except (AE.Error, MacOS.Error), msg: - if msg[0] != -1701 and msg[0] != -1704: - raise - continue - attributes[key] = unpack(desc, formodulename) - return parameters, attributes - -def packevent(ae, parameters = {}, attributes = {}): - for key, value in parameters.items(): - packkey(ae, key, value) - for key, value in attributes.items(): - ae.AEPutAttributeDesc(key, pack(value)) - -# -# Support routine for automatically generated Suite interfaces -# These routines are also useable for the reverse function. -# -def keysubst(arguments, keydict): - """Replace long name keys by their 4-char counterparts, and check""" - ok = keydict.values() - for k in arguments.keys(): - if keydict.has_key(k): - v = arguments[k] - del arguments[k] - arguments[keydict[k]] = v - elif k != '----' and k not in ok: - raise TypeError, 'Unknown keyword argument: %s'%k - -def enumsubst(arguments, key, edict): - """Substitute a single enum keyword argument, if it occurs""" - if not arguments.has_key(key) or edict is None: - return - v = arguments[key] - ok = edict.values() - if edict.has_key(v): - arguments[key] = Enum(edict[v]) - elif not v in ok: - raise TypeError, 'Unknown enumerator: %s'%v - -def decodeerror(arguments): - """Create the 'best' argument for a raise MacOS.Error""" - errn = arguments['errn'] - err_a1 = errn - if arguments.has_key('errs'): - err_a2 = arguments['errs'] - else: - err_a2 = MacOS.GetErrorString(errn) - if arguments.has_key('erob'): - err_a3 = arguments['erob'] - else: - err_a3 = None - - return (err_a1, err_a2, err_a3) - -class TalkTo: - """An AE connection to an application""" - _signature = None # Can be overridden by subclasses - _moduleName = None # Can be overridden by subclasses - _elemdict = {} # Can be overridden by subclasses - _propdict = {} # Can be overridden by subclasses - - __eventloop_initialized = 0 - def __ensure_WMAvailable(klass): - if klass.__eventloop_initialized: return 1 - if not MacOS.WMAvailable(): return 0 - # Workaround for a but in MacOSX 10.2: we must have an event - # loop before we can call AESend. - Evt.WaitNextEvent(0,0) - return 1 - __ensure_WMAvailable = classmethod(__ensure_WMAvailable) - - def __init__(self, signature=None, start=0, timeout=0): - """Create a communication channel with a particular application. - - Addressing the application is done by specifying either a - 4-byte signature, an AEDesc or an object that will __aepack__ - to an AEDesc. - """ - self.target_signature = None - if signature is None: - signature = self._signature - if type(signature) == AEDescType: - self.target = signature - elif type(signature) == InstanceType and hasattr(signature, '__aepack__'): - self.target = signature.__aepack__() - elif type(signature) == StringType and len(signature) == 4: - self.target = AE.AECreateDesc(AppleEvents.typeApplSignature, signature) - self.target_signature = signature - else: - raise TypeError, "signature should be 4-char string or AEDesc" - self.send_flags = AppleEvents.kAEWaitReply - self.send_priority = AppleEvents.kAENormalPriority - if timeout: - self.send_timeout = timeout - else: - self.send_timeout = AppleEvents.kAEDefaultTimeout - if start: - self._start() - - def _start(self): - """Start the application, if it is not running yet""" - try: - self.send('ascr', 'noop') - except AE.Error: - _launch(self.target_signature) - for i in range(LAUNCH_MAX_WAIT_TIME): - try: - self.send('ascr', 'noop') - except AE.Error: - pass - else: - break - time.sleep(1) - - def start(self): - """Deprecated, used _start()""" - self._start() - - def newevent(self, code, subcode, parameters = {}, attributes = {}): - """Create a complete structure for an apple event""" - - event = AE.AECreateAppleEvent(code, subcode, self.target, - AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID) - packevent(event, parameters, attributes) - return event - - def sendevent(self, event): - """Send a pre-created appleevent, await the reply and unpack it""" - if not self.__ensure_WMAvailable(): - raise RuntimeError, "No window manager access, cannot send AppleEvent" - reply = event.AESend(self.send_flags, self.send_priority, - self.send_timeout) - parameters, attributes = unpackevent(reply, self._moduleName) - return reply, parameters, attributes - - def send(self, code, subcode, parameters = {}, attributes = {}): - """Send an appleevent given code/subcode/pars/attrs and unpack the reply""" - return self.sendevent(self.newevent(code, subcode, parameters, attributes)) - - # - # The following events are somehow "standard" and don't seem to appear in any - # suite... - # - def activate(self): - """Send 'activate' command""" - self.send('misc', 'actv') - - def _get(self, _object, as=None, _attributes={}): - """_get: get data from an object - Required argument: the object - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the data - """ - _code = 'core' - _subcode = 'getd' - - _arguments = {'----':_object} - if as: - _arguments['rtyp'] = mktype(as) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.has_key('errn'): - raise Error, decodeerror(_arguments) - - if _arguments.has_key('----'): - return _arguments['----'] - if as: - item.__class__ = as - return item - - get = _get - - _argmap_set = { - 'to' : 'data', - } - - def _set(self, _object, _attributes={}, **_arguments): - """set: Set an object's data. - Required argument: the object for the command - Keyword argument to: The new value. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise Error, decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - set = _set - - # Magic glue to allow suite-generated classes to function somewhat - # like the "application" class in OSA. - - def __getattr__(self, name): - if self._elemdict.has_key(name): - cls = self._elemdict[name] - return DelayedComponentItem(cls, None) - if self._propdict.has_key(name): - cls = self._propdict[name] - return cls() - raise AttributeError, name - -# Tiny Finder class, for local use only - -class _miniFinder(TalkTo): - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.has_key('errn'): - raise Error, decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] -#pass - -_finder = _miniFinder('MACS') - -def _launch(appfile): - """Open a file thru the finder. Specify file by name or fsspec""" - _finder.open(_application_file(('ID ', appfile))) - - -class _application_file(ComponentItem): - """application file - An application's file on disk""" - want = 'appf' - -_application_file._propdict = { -} -_application_file._elemdict = { -} - -# Test program -# XXXX Should test more, really... - -def test(): - target = AE.AECreateDesc('sign', 'quil') - ae = AE.AECreateAppleEvent('aevt', 'oapp', target, -1, 0) - print unpackevent(ae) - raw_input(":") - ae = AE.AECreateAppleEvent('core', 'getd', target, -1, 0) - obj = Character(2, Word(1, Document(1))) - print obj - print repr(obj) - packevent(ae, {'----': obj}) - params, attrs = unpackevent(ae) - print params['----'] - raw_input(":") - -if __name__ == '__main__': - test() - sys.exit(1) diff --git a/sys/lib/python/plat-mac/aetypes.py b/sys/lib/python/plat-mac/aetypes.py deleted file mode 100644 index 65b59ad0c..000000000 --- a/sys/lib/python/plat-mac/aetypes.py +++ /dev/null @@ -1,568 +0,0 @@ -"""aetypes - Python objects representing various AE types.""" - -from Carbon.AppleEvents import * -import struct -from types import * -import string - -# -# convoluted, since there are cyclic dependencies between this file and -# aetools_convert. -# -def pack(*args, **kwargs): - from aepack import pack - return pack( *args, **kwargs) - -def nice(s): - """'nice' representation of an object""" - if type(s) is StringType: return repr(s) - else: return str(s) - -class Unknown: - """An uninterpreted AE object""" - - def __init__(self, type, data): - self.type = type - self.data = data - - def __repr__(self): - return "Unknown(%r, %r)" % (self.type, self.data) - - def __aepack__(self): - return pack(self.data, self.type) - -class Enum: - """An AE enumeration value""" - - def __init__(self, enum): - self.enum = "%-4.4s" % str(enum) - - def __repr__(self): - return "Enum(%r)" % (self.enum,) - - def __str__(self): - return string.strip(self.enum) - - def __aepack__(self): - return pack(self.enum, typeEnumeration) - -def IsEnum(x): - return isinstance(x, Enum) - -def mkenum(enum): - if IsEnum(enum): return enum - return Enum(enum) - -# Jack changed the way this is done -class InsertionLoc: - def __init__(self, of, pos): - self.of = of - self.pos = pos - - def __repr__(self): - return "InsertionLoc(%r, %r)" % (self.of, self.pos) - - def __aepack__(self): - rec = {'kobj': self.of, 'kpos': self.pos} - return pack(rec, forcetype='insl') - -# Convenience functions for dsp: -def beginning(of): - return InsertionLoc(of, Enum('bgng')) - -def end(of): - return InsertionLoc(of, Enum('end ')) - -class Boolean: - """An AE boolean value""" - - def __init__(self, bool): - self.bool = (not not bool) - - def __repr__(self): - return "Boolean(%r)" % (self.bool,) - - def __str__(self): - if self.bool: - return "True" - else: - return "False" - - def __aepack__(self): - return pack(struct.pack('b', self.bool), 'bool') - -def IsBoolean(x): - return isinstance(x, Boolean) - -def mkboolean(bool): - if IsBoolean(bool): return bool - return Boolean(bool) - -class Type: - """An AE 4-char typename object""" - - def __init__(self, type): - self.type = "%-4.4s" % str(type) - - def __repr__(self): - return "Type(%r)" % (self.type,) - - def __str__(self): - return string.strip(self.type) - - def __aepack__(self): - return pack(self.type, typeType) - -def IsType(x): - return isinstance(x, Type) - -def mktype(type): - if IsType(type): return type - return Type(type) - - -class Keyword: - """An AE 4-char keyword object""" - - def __init__(self, keyword): - self.keyword = "%-4.4s" % str(keyword) - - def __repr__(self): - return "Keyword(%r)" % `self.keyword` - - def __str__(self): - return string.strip(self.keyword) - - def __aepack__(self): - return pack(self.keyword, typeKeyword) - -def IsKeyword(x): - return isinstance(x, Keyword) - -class Range: - """An AE range object""" - - def __init__(self, start, stop): - self.start = start - self.stop = stop - - def __repr__(self): - return "Range(%r, %r)" % (self.start, self.stop) - - def __str__(self): - return "%s thru %s" % (nice(self.start), nice(self.stop)) - - def __aepack__(self): - return pack({'star': self.start, 'stop': self.stop}, 'rang') - -def IsRange(x): - return isinstance(x, Range) - -class Comparison: - """An AE Comparison""" - - def __init__(self, obj1, relo, obj2): - self.obj1 = obj1 - self.relo = "%-4.4s" % str(relo) - self.obj2 = obj2 - - def __repr__(self): - return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2) - - def __str__(self): - return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2)) - - def __aepack__(self): - return pack({'obj1': self.obj1, - 'relo': mkenum(self.relo), - 'obj2': self.obj2}, - 'cmpd') - -def IsComparison(x): - return isinstance(x, Comparison) - -class NComparison(Comparison): - # The class attribute 'relo' must be set in a subclass - - def __init__(self, obj1, obj2): - Comparison.__init__(obj1, self.relo, obj2) - -class Ordinal: - """An AE Ordinal""" - - def __init__(self, abso): -# self.obj1 = obj1 - self.abso = "%-4.4s" % str(abso) - - def __repr__(self): - return "Ordinal(%r)" % (self.abso,) - - def __str__(self): - return "%s" % (string.strip(self.abso)) - - def __aepack__(self): - return pack(self.abso, 'abso') - -def IsOrdinal(x): - return isinstance(x, Ordinal) - -class NOrdinal(Ordinal): - # The class attribute 'abso' must be set in a subclass - - def __init__(self): - Ordinal.__init__(self, self.abso) - -class Logical: - """An AE logical expression object""" - - def __init__(self, logc, term): - self.logc = "%-4.4s" % str(logc) - self.term = term - - def __repr__(self): - return "Logical(%r, %r)" % (self.logc, self.term) - - def __str__(self): - if type(self.term) == ListType and len(self.term) == 2: - return "%s %s %s" % (nice(self.term[0]), - string.strip(self.logc), - nice(self.term[1])) - else: - return "%s(%s)" % (string.strip(self.logc), nice(self.term)) - - def __aepack__(self): - return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi') - -def IsLogical(x): - return isinstance(x, Logical) - -class StyledText: - """An AE object respresenting text in a certain style""" - - def __init__(self, style, text): - self.style = style - self.text = text - - def __repr__(self): - return "StyledText(%r, %r)" % (self.style, self.text) - - def __str__(self): - return self.text - - def __aepack__(self): - return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT') - -def IsStyledText(x): - return isinstance(x, StyledText) - -class AEText: - """An AE text object with style, script and language specified""" - - def __init__(self, script, style, text): - self.script = script - self.style = style - self.text = text - - def __repr__(self): - return "AEText(%r, %r, %r)" % (self.script, self.style, self.text) - - def __str__(self): - return self.text - - def __aepack__(self): - return pack({keyAEScriptTag: self.script, keyAEStyles: self.style, - keyAEText: self.text}, typeAEText) - -def IsAEText(x): - return isinstance(x, AEText) - -class IntlText: - """A text object with script and language specified""" - - def __init__(self, script, language, text): - self.script = script - self.language = language - self.text = text - - def __repr__(self): - return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text) - - def __str__(self): - return self.text - - def __aepack__(self): - return pack(struct.pack('hh', self.script, self.language)+self.text, - typeIntlText) - -def IsIntlText(x): - return isinstance(x, IntlText) - -class IntlWritingCode: - """An object representing script and language""" - - def __init__(self, script, language): - self.script = script - self.language = language - - def __repr__(self): - return "IntlWritingCode(%r, %r)" % (self.script, self.language) - - def __str__(self): - return "script system %d, language %d"%(self.script, self.language) - - def __aepack__(self): - return pack(struct.pack('hh', self.script, self.language), - typeIntlWritingCode) - -def IsIntlWritingCode(x): - return isinstance(x, IntlWritingCode) - -class QDPoint: - """A point""" - - def __init__(self, v, h): - self.v = v - self.h = h - - def __repr__(self): - return "QDPoint(%r, %r)" % (self.v, self.h) - - def __str__(self): - return "(%d, %d)"%(self.v, self.h) - - def __aepack__(self): - return pack(struct.pack('hh', self.v, self.h), - typeQDPoint) - -def IsQDPoint(x): - return isinstance(x, QDPoint) - -class QDRectangle: - """A rectangle""" - - def __init__(self, v0, h0, v1, h1): - self.v0 = v0 - self.h0 = h0 - self.v1 = v1 - self.h1 = h1 - - def __repr__(self): - return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1) - - def __str__(self): - return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1) - - def __aepack__(self): - return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1), - typeQDRectangle) - -def IsQDRectangle(x): - return isinstance(x, QDRectangle) - -class RGBColor: - """An RGB color""" - - def __init__(self, r, g, b): - self.r = r - self.g = g - self.b = b - - def __repr__(self): - return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b) - - def __str__(self): - return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b) - - def __aepack__(self): - return pack(struct.pack('hhh', self.r, self.g, self.b), - typeRGBColor) - -def IsRGBColor(x): - return isinstance(x, RGBColor) - -class ObjectSpecifier: - - """A class for constructing and manipulation AE object specifiers in python. - - An object specifier is actually a record with four fields: - - key type description - --- ---- ----------- - - 'want' type 4-char class code of thing we want, - e.g. word, paragraph or property - - 'form' enum how we specify which 'want' thing(s) we want, - e.g. by index, by range, by name, or by property specifier - - 'seld' any which thing(s) we want, - e.g. its index, its name, or its property specifier - - 'from' object the object in which it is contained, - or null, meaning look for it in the application - - Note that we don't call this class plain "Object", since that name - is likely to be used by the application. - """ - - def __init__(self, want, form, seld, fr = None): - self.want = want - self.form = form - self.seld = seld - self.fr = fr - - def __repr__(self): - s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld) - if self.fr: - s = s + ", %r)" % (self.fr,) - else: - s = s + ")" - return s - - def __aepack__(self): - return pack({'want': mktype(self.want), - 'form': mkenum(self.form), - 'seld': self.seld, - 'from': self.fr}, - 'obj ') - -def IsObjectSpecifier(x): - return isinstance(x, ObjectSpecifier) - - -# Backwards compatibility, sigh... -class Property(ObjectSpecifier): - - def __init__(self, which, fr = None, want='prop'): - ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr) - - def __repr__(self): - if self.fr: - return "Property(%r, %r)" % (self.seld.type, self.fr) - else: - return "Property(%r)" % (self.seld.type,) - - def __str__(self): - if self.fr: - return "Property %s of %s" % (str(self.seld), str(self.fr)) - else: - return "Property %s" % str(self.seld) - - -class NProperty(ObjectSpecifier): - # Subclasses *must* self baseclass attributes: - # want is the type of this property - # which is the property name of this property - - def __init__(self, fr = None): - #try: - # dummy = self.want - #except: - # self.want = 'prop' - self.want = 'prop' - ObjectSpecifier.__init__(self, self.want, 'prop', - mktype(self.which), fr) - - def __repr__(self): - rv = "Property(%r" % (self.seld.type,) - if self.fr: - rv = rv + ", fr=%r" % (self.fr,) - if self.want != 'prop': - rv = rv + ", want=%r" % (self.want,) - return rv + ")" - - def __str__(self): - if self.fr: - return "Property %s of %s" % (str(self.seld), str(self.fr)) - else: - return "Property %s" % str(self.seld) - - -class SelectableItem(ObjectSpecifier): - - def __init__(self, want, seld, fr = None): - t = type(seld) - if t == StringType: - form = 'name' - elif IsRange(seld): - form = 'rang' - elif IsComparison(seld) or IsLogical(seld): - form = 'test' - elif t == TupleType: - # Breakout: specify both form and seld in a tuple - # (if you want ID or rele or somesuch) - form, seld = seld - else: - form = 'indx' - ObjectSpecifier.__init__(self, want, form, seld, fr) - - -class ComponentItem(SelectableItem): - # Derived classes *must* set the *class attribute* 'want' to some constant - # Also, dictionaries _propdict and _elemdict must be set to map property - # and element names to the correct classes - - _propdict = {} - _elemdict = {} - def __init__(self, which, fr = None): - SelectableItem.__init__(self, self.want, which, fr) - - def __repr__(self): - if not self.fr: - return "%s(%r)" % (self.__class__.__name__, self.seld) - return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr) - - def __str__(self): - seld = self.seld - if type(seld) == StringType: - ss = repr(seld) - elif IsRange(seld): - start, stop = seld.start, seld.stop - if type(start) == InstanceType == type(stop) and \ - start.__class__ == self.__class__ == stop.__class__: - ss = str(start.seld) + " thru " + str(stop.seld) - else: - ss = str(seld) - else: - ss = str(seld) - s = "%s %s" % (self.__class__.__name__, ss) - if self.fr: s = s + " of %s" % str(self.fr) - return s - - def __getattr__(self, name): - if self._elemdict.has_key(name): - cls = self._elemdict[name] - return DelayedComponentItem(cls, self) - if self._propdict.has_key(name): - cls = self._propdict[name] - return cls(self) - raise AttributeError, name - - -class DelayedComponentItem: - def __init__(self, compclass, fr): - self.compclass = compclass - self.fr = fr - - def __call__(self, which): - return self.compclass(which, self.fr) - - def __repr__(self): - return "%s(???, %r)" % (self.__class__.__name__, self.fr) - - def __str__(self): - return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr)) - -template = """ -class %s(ComponentItem): want = '%s' -""" - -exec template % ("Text", 'text') -exec template % ("Character", 'cha ') -exec template % ("Word", 'cwor') -exec template % ("Line", 'clin') -exec template % ("paragraph", 'cpar') -exec template % ("Window", 'cwin') -exec template % ("Document", 'docu') -exec template % ("File", 'file') -exec template % ("InsertionPoint", 'cins') diff --git a/sys/lib/python/plat-mac/applesingle.py b/sys/lib/python/plat-mac/applesingle.py deleted file mode 100644 index 76bdb0691..000000000 --- a/sys/lib/python/plat-mac/applesingle.py +++ /dev/null @@ -1,137 +0,0 @@ -r"""Routines to decode AppleSingle files -""" -import struct -import sys -try: - import MacOS - import Carbon.File -except: - class MacOS: - def openrf(path, mode): - return open(path + '.rsrc', mode) - openrf = classmethod(openrf) - class Carbon: - class File: - class FSSpec: - pass - class FSRef: - pass - class Alias: - pass - -# all of the errors in this module are really errors in the input -# so I think it should test positive against ValueError. -class Error(ValueError): - pass - -# File header format: magic, version, unused, number of entries -AS_HEADER_FORMAT=">LL16sh" -AS_HEADER_LENGTH=26 -# The flag words for AppleSingle -AS_MAGIC=0x00051600 -AS_VERSION=0x00020000 - -# Entry header format: id, offset, length -AS_ENTRY_FORMAT=">lll" -AS_ENTRY_LENGTH=12 - -# The id values -AS_DATAFORK=1 -AS_RESOURCEFORK=2 -AS_IGNORE=(3,4,5,6,8,9,10,11,12,13,14,15) - -class AppleSingle(object): - datafork = None - resourcefork = None - - def __init__(self, fileobj, verbose=False): - header = fileobj.read(AS_HEADER_LENGTH) - try: - magic, version, ig, nentry = struct.unpack(AS_HEADER_FORMAT, header) - except ValueError, arg: - raise Error, "Unpack header error: %s" % (arg,) - if verbose: - print 'Magic: 0x%8.8x' % (magic,) - print 'Version: 0x%8.8x' % (version,) - print 'Entries: %d' % (nentry,) - if magic != AS_MAGIC: - raise Error, "Unknown AppleSingle magic number 0x%8.8x" % (magic,) - if version != AS_VERSION: - raise Error, "Unknown AppleSingle version number 0x%8.8x" % (version,) - if nentry <= 0: - raise Error, "AppleSingle file contains no forks" - headers = [fileobj.read(AS_ENTRY_LENGTH) for i in xrange(nentry)] - self.forks = [] - for hdr in headers: - try: - restype, offset, length = struct.unpack(AS_ENTRY_FORMAT, hdr) - except ValueError, arg: - raise Error, "Unpack entry error: %s" % (arg,) - if verbose: - print "Fork %d, offset %d, length %d" % (restype, offset, length) - fileobj.seek(offset) - data = fileobj.read(length) - if len(data) != length: - raise Error, "Short read: expected %d bytes got %d" % (length, len(data)) - self.forks.append((restype, data)) - if restype == AS_DATAFORK: - self.datafork = data - elif restype == AS_RESOURCEFORK: - self.resourcefork = data - - def tofile(self, path, resonly=False): - outfile = open(path, 'wb') - data = False - if resonly: - if self.resourcefork is None: - raise Error, "No resource fork found" - fp = open(path, 'wb') - fp.write(self.resourcefork) - fp.close() - elif (self.resourcefork is None and self.datafork is None): - raise Error, "No useful forks found" - else: - if self.datafork is not None: - fp = open(path, 'wb') - fp.write(self.datafork) - fp.close() - if self.resourcefork is not None: - fp = MacOS.openrf(path, '*wb') - fp.write(self.resourcefork) - fp.close() - -def decode(infile, outpath, resonly=False, verbose=False): - """decode(infile, outpath [, resonly=False, verbose=False]) - - Creates a decoded file from an AppleSingle encoded file. - If resonly is True, then it will create a regular file at - outpath containing only the resource fork from infile. - Otherwise it will create an AppleDouble file at outpath - with the data and resource forks from infile. On platforms - without the MacOS module, it will create inpath and inpath+'.rsrc' - with the data and resource forks respectively. - - """ - if not hasattr(infile, 'read'): - if isinstance(infile, Carbon.File.Alias): - infile = infile.ResolveAlias()[0] - if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)): - infile = infile.as_pathname() - infile = open(infile, 'rb') - - asfile = AppleSingle(infile, verbose=verbose) - asfile.tofile(outpath, resonly=resonly) - -def _test(): - if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4: - print 'Usage: applesingle.py [-r] applesinglefile decodedfile' - sys.exit(1) - if sys.argv[1] == '-r': - resonly = True - del sys.argv[1] - else: - resonly = False - decode(sys.argv[1], sys.argv[2], resonly=resonly) - -if __name__ == '__main__': - _test() diff --git a/sys/lib/python/plat-mac/appletrawmain.py b/sys/lib/python/plat-mac/appletrawmain.py deleted file mode 100644 index 1be918790..000000000 --- a/sys/lib/python/plat-mac/appletrawmain.py +++ /dev/null @@ -1,63 +0,0 @@ -# Emulate sys.argv and run __main__.py or __main__.pyc in an environment that -# is as close to "normal" as possible. -# -# This script is put into __rawmain__.pyc for applets that need argv -# emulation, by BuildApplet and friends. -# -import argvemulator -import os -import sys -import marshal - -# -# Make sure we have an argv[0], and make _dir point to the Resources -# directory. -# -if not sys.argv or sys.argv[0][:1] == '-': - # Insert our (guessed) name. - _dir = os.path.split(sys.executable)[0] # removes "python" - _dir = os.path.split(_dir)[0] # Removes "MacOS" - _dir = os.path.join(_dir, 'Resources') - sys.argv.insert(0, '__rawmain__') -else: - _dir = os.path.split(sys.argv[0])[0] -# -# Add the Resources directory to the path. This is where files installed -# by BuildApplet.py with the --extra option show up, and if those files are -# modules this sys.path modification is necessary to be able to import them. -# -sys.path.insert(0, _dir) -# -# Create sys.argv -# -argvemulator.ArgvCollector().mainloop() -# -# Find the real main program to run -# -__file__ = os.path.join(_dir, '__main__.py') -if os.path.exists(__file__): - # - # Setup something resembling a normal environment and go. - # - sys.argv[0] = __file__ - del argvemulator, os, sys, _dir - execfile(__file__) -else: - __file__ = os.path.join(_dir, '__main__.pyc') - if os.path.exists(__file__): - # - # If we have only a .pyc file we read the code object from that - # - sys.argv[0] = __file__ - _fp = open(__file__, 'rb') - _fp.read(8) - __code__ = marshal.load(_fp) - # - # Again, we create an almost-normal environment (only __code__ is - # funny) and go. - # - del argvemulator, os, sys, marshal, _dir, _fp - exec __code__ - else: - sys.stderr.write("%s: neither __main__.py nor __main__.pyc found\n"%sys.argv[0]) - sys.exit(1) diff --git a/sys/lib/python/plat-mac/appletrunner.py b/sys/lib/python/plat-mac/appletrunner.py deleted file mode 100755 index 8d46c2ad2..000000000 --- a/sys/lib/python/plat-mac/appletrunner.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -# This file is meant as an executable script for running applets. -# BuildApplet will use it as the main executable in the .app bundle if -# we are not running in a framework build. - -import os -import sys -for name in ["__rawmain__.py", "__rawmain__.pyc", "__main__.py", "__main__.pyc"]: - realmain = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), - "Resources", name) - if os.path.exists(realmain): - break -else: - sys.stderr.write("%s: cannot find applet main program\n" % sys.argv[0]) - sys.exit(1) -sys.argv.insert(1, realmain) -os.execve(sys.executable, sys.argv, os.environ) diff --git a/sys/lib/python/plat-mac/argvemulator.py b/sys/lib/python/plat-mac/argvemulator.py deleted file mode 100644 index 2d66f1c74..000000000 --- a/sys/lib/python/plat-mac/argvemulator.py +++ /dev/null @@ -1,89 +0,0 @@ -"""argvemulator - create sys.argv from OSA events. Used by applets that -want unix-style arguments. -""" - -import sys -import traceback -from Carbon import AE -from Carbon.AppleEvents import * -from Carbon import Evt -from Carbon import File -from Carbon.Events import * -import aetools - -class ArgvCollector: - - """A minimal FrameWork.Application-like class""" - - def __init__(self): - self.quitting = 0 - # Remove the funny -psn_xxx_xxx argument - if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn': - del sys.argv[1] - - AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp) - AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles) - - def close(self): - AE.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication) - AE.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments) - - def mainloop(self, mask = highLevelEventMask, timeout = 1*60): - # Note: this is not the right way to run an event loop in OSX or even - # "recent" versions of MacOS9. This is however code that has proven - # itself. - stoptime = Evt.TickCount() + timeout - while not self.quitting and Evt.TickCount() < stoptime: - self._dooneevent(mask, timeout) - - if not self.quitting: - print "argvemulator: timeout waiting for arguments" - - self.close() - - def _dooneevent(self, mask = highLevelEventMask, timeout = 1*60): - got, event = Evt.WaitNextEvent(mask, timeout) - if got: - self._lowlevelhandler(event) - - def _lowlevelhandler(self, event): - what, message, when, where, modifiers = event - h, v = where - if what == kHighLevelEvent: - try: - AE.AEProcessAppleEvent(event) - except AE.Error, err: - msg = "High Level Event: %r %r" % (hex(message), hex(h | (v<<16))) - print 'AE error: ', err - print 'in', msg - traceback.print_exc() - return - else: - print "Unhandled event:", event - - - def _quit(self): - self.quitting = 1 - - def __runapp(self, requestevent, replyevent): - self._quit() - - def __openfiles(self, requestevent, replyevent): - try: - listdesc = requestevent.AEGetParamDesc(keyDirectObject, typeAEList) - for i in range(listdesc.AECountItems()): - aliasdesc = listdesc.AEGetNthDesc(i+1, typeAlias)[1] - alias = File.Alias(rawdata=aliasdesc.data) - fsref = alias.FSResolveAlias(None)[0] - pathname = fsref.as_pathname() - sys.argv.append(pathname) - except Exception, e: - print "argvemulator.py warning: can't unpack an open document event" - import traceback - traceback.print_exc() - - self._quit() - -if __name__ == '__main__': - ArgvCollector().mainloop() - print "sys.argv=", sys.argv diff --git a/sys/lib/python/plat-mac/bgenlocations.py b/sys/lib/python/plat-mac/bgenlocations.py deleted file mode 100644 index e7fa35407..000000000 --- a/sys/lib/python/plat-mac/bgenlocations.py +++ /dev/null @@ -1,55 +0,0 @@ -# -# Local customizations for generating the Carbon interface modules. -# Edit this file to reflect where things should be on your system. -# Note that pathnames are unix-style for OSX MachoPython/unix-Python, -# but mac-style for MacPython, whether running on OS9 or OSX. -# - -import sys, os - -Error = "bgenlocations.Error" -# -# Where bgen is. For unix-Python bgen isn't installed, so you have to refer to -# the source tree here. -BGENDIR="/Users/jack/src/python/Tools/bgen/bgen" - -# -# Where to find the Universal Header include files. If you have CodeWarrior -# installed you can use the Universal Headers from there, otherwise you can -# download them from the Apple website. Bgen can handle both unix- and mac-style -# end of lines, so don't worry about that. -# -INCLUDEDIR="/Users/jack/src/Universal/Interfaces/CIncludes" - -# -# Where to put the python definitions files. Note that, on unix-Python, -# if you want to commit your changes to the CVS repository this should refer to -# your source directory, not your installed directory. -# -TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon" - -# Creator for C files: -CREATOR="CWIE" - -# The previous definitions can be overriden by creating a module -# bgenlocationscustomize.py and putting it in site-packages (or anywere else -# on sys.path, actually) -try: - from bgenlocationscustomize import * -except ImportError: - pass - -if not os.path.exists(BGENDIR): - raise Error, "Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR -if not os.path.exists(INCLUDEDIR): - raise Error, "Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR -if not os.path.exists(TOOLBOXDIR): - raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR - -# Sigh, due to the way these are used make sure they end with : or /. -if BGENDIR[-1] != os.sep: - BGENDIR = BGENDIR + os.sep -if INCLUDEDIR[-1] != os.sep: - INCLUDEDIR = INCLUDEDIR + os.sep -if TOOLBOXDIR[-1] != os.sep: - TOOLBOXDIR = TOOLBOXDIR + os.sep diff --git a/sys/lib/python/plat-mac/buildtools.py b/sys/lib/python/plat-mac/buildtools.py deleted file mode 100644 index c83e21802..000000000 --- a/sys/lib/python/plat-mac/buildtools.py +++ /dev/null @@ -1,420 +0,0 @@ -"""tools for BuildApplet and BuildApplication""" - -import sys -import os -import string -import imp -import marshal -from Carbon import Res -import Carbon.Files -import Carbon.File -import MacOS -import macostools -import macresource -import EasyDialogs -import shutil - - -BuildError = "BuildError" - -# .pyc file (and 'PYC ' resource magic number) -MAGIC = imp.get_magic() - -# Template file (searched on sys.path) -TEMPLATE = "PythonInterpreter" - -# Specification of our resource -RESTYPE = 'PYC ' -RESNAME = '__main__' - -# A resource with this name sets the "owner" (creator) of the destination -# It should also have ID=0. Either of these alone is not enough. -OWNERNAME = "owner resource" - -# Default applet creator code -DEFAULT_APPLET_CREATOR="Pyta" - -# OpenResFile mode parameters -READ = 1 -WRITE = 2 - -# Parameter for FSOpenResourceFile -RESOURCE_FORK_NAME=Carbon.File.FSGetResourceForkName() - -def findtemplate(template=None): - """Locate the applet template along sys.path""" - if MacOS.runtimemodel == 'macho': - return None - if not template: - template=TEMPLATE - for p in sys.path: - file = os.path.join(p, template) - try: - file, d1, d2 = Carbon.File.FSResolveAliasFile(file, 1) - break - except (Carbon.File.Error, ValueError): - continue - else: - raise BuildError, "Template %r not found on sys.path" % (template,) - file = file.as_pathname() - return file - -def process(template, filename, destname, copy_codefragment=0, - rsrcname=None, others=[], raw=0, progress="default", destroot=""): - - if progress == "default": - progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120) - progress.label("Compiling...") - progress.inc(0) - # check for the script name being longer than 32 chars. This may trigger a bug - # on OSX that can destroy your sourcefile. - if '#' in os.path.split(filename)[1]: - raise BuildError, "BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename - # Read the source and compile it - # (there's no point overwriting the destination if it has a syntax error) - - fp = open(filename, 'rU') - text = fp.read() - fp.close() - try: - code = compile(text + '\n', filename, "exec") - except SyntaxError, arg: - raise BuildError, "Syntax error in script %s: %s" % (filename, arg) - except EOFError: - raise BuildError, "End-of-file in script %s" % (filename,) - - # Set the destination file name. Note that basename - # does contain the whole filepath, only a .py is stripped. - - if string.lower(filename[-3:]) == ".py": - basename = filename[:-3] - if MacOS.runtimemodel != 'macho' and not destname: - destname = basename - else: - basename = filename - - if not destname: - if MacOS.runtimemodel == 'macho': - destname = basename + '.app' - else: - destname = basename + '.applet' - if not rsrcname: - rsrcname = basename + '.rsrc' - - # Try removing the output file. This fails in MachO, but it should - # do any harm. - try: - os.remove(destname) - except os.error: - pass - process_common(template, progress, code, rsrcname, destname, 0, - copy_codefragment, raw, others, filename, destroot) - - -def update(template, filename, output): - if MacOS.runtimemodel == 'macho': - raise BuildError, "No updating yet for MachO applets" - if progress: - progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120) - else: - progress = None - if not output: - output = filename + ' (updated)' - - # Try removing the output file - try: - os.remove(output) - except os.error: - pass - process_common(template, progress, None, filename, output, 1, 1) - - -def process_common(template, progress, code, rsrcname, destname, is_update, - copy_codefragment, raw=0, others=[], filename=None, destroot=""): - if MacOS.runtimemodel == 'macho': - return process_common_macho(template, progress, code, rsrcname, destname, - is_update, raw, others, filename, destroot) - if others: - raise BuildError, "Extra files only allowed for MachoPython applets" - # Create FSSpecs for the various files - template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1) - template = template_fsr.as_pathname() - - # Copy data (not resources, yet) from the template - if progress: - progress.label("Copy data fork...") - progress.set(10) - - if copy_codefragment: - tmpl = open(template, "rb") - dest = open(destname, "wb") - data = tmpl.read() - if data: - dest.write(data) - dest.close() - tmpl.close() - del dest - del tmpl - - # Open the output resource fork - - if progress: - progress.label("Copy resources...") - progress.set(20) - try: - output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) - except MacOS.Error: - destdir, destfile = os.path.split(destname) - Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME) - output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) - - # Copy the resources from the target specific resource template, if any - typesfound, ownertype = [], None - try: - input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ) - except (MacOS.Error, ValueError): - pass - if progress: - progress.inc(50) - else: - if is_update: - skip_oldfile = ['cfrg'] - else: - skip_oldfile = [] - typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress) - Res.CloseResFile(input) - - # Check which resource-types we should not copy from the template - skiptypes = [] - if 'vers' in typesfound: skiptypes.append('vers') - if 'SIZE' in typesfound: skiptypes.append('SIZE') - if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', - 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] - if not copy_codefragment: - skiptypes.append('cfrg') -## skipowner = (ownertype <> None) - - # Copy the resources from the template - - input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ) - dummy, tmplowner = copyres(input, output, skiptypes, 1, progress) - - Res.CloseResFile(input) -## if ownertype == None: -## raise BuildError, "No owner resource found in either resource file or template" - # Make sure we're manipulating the output resource file now - - Res.UseResFile(output) - - if ownertype == None: - # No owner resource in the template. We have skipped the - # Python owner resource, so we have to add our own. The relevant - # bundle stuff is already included in the interpret/applet template. - newres = Res.Resource('\0') - newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource") - ownertype = DEFAULT_APPLET_CREATOR - - if code: - # Delete any existing 'PYC ' resource named __main__ - - try: - res = Res.Get1NamedResource(RESTYPE, RESNAME) - res.RemoveResource() - except Res.Error: - pass - - # Create the raw data for the resource from the code object - if progress: - progress.label("Write PYC resource...") - progress.set(120) - - data = marshal.dumps(code) - del code - data = (MAGIC + '\0\0\0\0') + data - - # Create the resource and write it - - id = 0 - while id < 128: - id = Res.Unique1ID(RESTYPE) - res = Res.Resource(data) - res.AddResource(RESTYPE, id, RESNAME) - attrs = res.GetResAttrs() - attrs = attrs | 0x04 # set preload - res.SetResAttrs(attrs) - res.WriteResource() - res.ReleaseResource() - - # Close the output file - - Res.CloseResFile(output) - - # Now set the creator, type and bundle bit of the destination. - # Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+) - dest_fss = Carbon.File.FSSpec(destname) - dest_finfo = dest_fss.FSpGetFInfo() - dest_finfo.Creator = ownertype - dest_finfo.Type = 'APPL' - dest_finfo.Flags = dest_finfo.Flags | Carbon.Files.kHasBundle | Carbon.Files.kIsShared - dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited - dest_fss.FSpSetFInfo(dest_finfo) - - macostools.touched(destname) - if progress: - progress.label("Done.") - progress.inc(0) - -def process_common_macho(template, progress, code, rsrcname, destname, is_update, - raw=0, others=[], filename=None, destroot=""): - # Check that we have a filename - if filename is None: - raise BuildError, "Need source filename on MacOSX" - # First make sure the name ends in ".app" - if destname[-4:] != '.app': - destname = destname + '.app' - # Now deduce the short name - destdir, shortname = os.path.split(destname) - if shortname[-4:] == '.app': - # Strip the .app suffix - shortname = shortname[:-4] - # And deduce the .plist and .icns names - plistname = None - icnsname = None - if rsrcname and rsrcname[-5:] == '.rsrc': - tmp = rsrcname[:-5] - plistname = tmp + '.plist' - if os.path.exists(plistname): - icnsname = tmp + '.icns' - if not os.path.exists(icnsname): - icnsname = None - else: - plistname = None - if not icnsname: - dft_icnsname = os.path.join(sys.prefix, 'Resources/Python.app/Contents/Resources/PythonApplet.icns') - if os.path.exists(dft_icnsname): - icnsname = dft_icnsname - if not os.path.exists(rsrcname): - rsrcname = None - if progress: - progress.label('Creating bundle...') - import bundlebuilder - builder = bundlebuilder.AppBuilder(verbosity=0) - builder.mainprogram = filename - builder.builddir = destdir - builder.name = shortname - builder.destroot = destroot - if rsrcname: - realrsrcname = macresource.resource_pathname(rsrcname) - builder.files.append((realrsrcname, - os.path.join('Contents/Resources', os.path.basename(rsrcname)))) - for o in others: - if type(o) == str: - builder.resources.append(o) - else: - builder.files.append(o) - if plistname: - import plistlib - builder.plist = plistlib.Plist.fromFile(plistname) - if icnsname: - builder.iconfile = icnsname - if not raw: - builder.argv_emulation = 1 - builder.setup() - builder.build() - if progress: - progress.label('Done.') - progress.inc(0) - -## macostools.touched(dest_fss) - -# Copy resources between two resource file descriptors. -# skip a resource named '__main__' or (if skipowner is set) with ID zero. -# Also skip resources with a type listed in skiptypes. -# -def copyres(input, output, skiptypes, skipowner, progress=None): - ctor = None - alltypes = [] - Res.UseResFile(input) - ntypes = Res.Count1Types() - progress_type_inc = 50/ntypes - for itype in range(1, 1+ntypes): - type = Res.Get1IndType(itype) - if type in skiptypes: - continue - alltypes.append(type) - nresources = Res.Count1Resources(type) - progress_cur_inc = progress_type_inc/nresources - for ires in range(1, 1+nresources): - res = Res.Get1IndResource(type, ires) - id, type, name = res.GetResInfo() - lcname = string.lower(name) - - if lcname == OWNERNAME and id == 0: - if skipowner: - continue # Skip this one - else: - ctor = type - size = res.size - attrs = res.GetResAttrs() - if progress: - progress.label("Copy %s %d %s"%(type, id, name)) - progress.inc(progress_cur_inc) - res.LoadResource() - res.DetachResource() - Res.UseResFile(output) - try: - res2 = Res.Get1Resource(type, id) - except MacOS.Error: - res2 = None - if res2: - if progress: - progress.label("Overwrite %s %d %s"%(type, id, name)) - progress.inc(0) - res2.RemoveResource() - res.AddResource(type, id, name) - res.WriteResource() - attrs = attrs | res.GetResAttrs() - res.SetResAttrs(attrs) - Res.UseResFile(input) - return alltypes, ctor - -def copyapptree(srctree, dsttree, exceptlist=[], progress=None): - names = [] - if os.path.exists(dsttree): - shutil.rmtree(dsttree) - os.mkdir(dsttree) - todo = os.listdir(srctree) - while todo: - this, todo = todo[0], todo[1:] - if this in exceptlist: - continue - thispath = os.path.join(srctree, this) - if os.path.isdir(thispath): - thiscontent = os.listdir(thispath) - for t in thiscontent: - todo.append(os.path.join(this, t)) - names.append(this) - for this in names: - srcpath = os.path.join(srctree, this) - dstpath = os.path.join(dsttree, this) - if os.path.isdir(srcpath): - os.mkdir(dstpath) - elif os.path.islink(srcpath): - endpoint = os.readlink(srcpath) - os.symlink(endpoint, dstpath) - else: - if progress: - progress.label('Copy '+this) - progress.inc(0) - shutil.copy2(srcpath, dstpath) - -def writepycfile(codeobject, cfile): - import marshal - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') # MAGIC placeholder, written later - fc.write('\0\0\0\0') # Timestap placeholder, not needed - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() diff --git a/sys/lib/python/plat-mac/bundlebuilder.py b/sys/lib/python/plat-mac/bundlebuilder.py deleted file mode 100755 index 266b8455a..000000000 --- a/sys/lib/python/plat-mac/bundlebuilder.py +++ /dev/null @@ -1,934 +0,0 @@ -#! /usr/bin/env python - -"""\ -bundlebuilder.py -- Tools to assemble MacOS X (application) bundles. - -This module contains two classes to build so called "bundles" for -MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass -specialized in building application bundles. - -[Bundle|App]Builder objects are instantiated with a bunch of keyword -arguments, and have a build() method that will do all the work. See -the class doc strings for a description of the constructor arguments. - -The module contains a main program that can be used in two ways: - - % python bundlebuilder.py [options] build - % python buildapp.py [options] build - -Where "buildapp.py" is a user-supplied setup.py-like script following -this model: - - from bundlebuilder import buildapp - buildapp() - -""" - - -__all__ = ["BundleBuilder", "BundleBuilderError", "AppBuilder", "buildapp"] - - -import sys -import os, errno, shutil -import imp, marshal -import re -from copy import deepcopy -import getopt -from plistlib import Plist -from types import FunctionType as function - -class BundleBuilderError(Exception): pass - - -class Defaults: - - """Class attributes that don't start with an underscore and are - not functions or classmethods are (deep)copied to self.__dict__. - This allows for mutable default values. - """ - - def __init__(self, **kwargs): - defaults = self._getDefaults() - defaults.update(kwargs) - self.__dict__.update(defaults) - - def _getDefaults(cls): - defaults = {} - for base in cls.__bases__: - if hasattr(base, "_getDefaults"): - defaults.update(base._getDefaults()) - for name, value in cls.__dict__.items(): - if name[0] != "_" and not isinstance(value, - (function, classmethod)): - defaults[name] = deepcopy(value) - return defaults - _getDefaults = classmethod(_getDefaults) - - -class BundleBuilder(Defaults): - - """BundleBuilder is a barebones class for assembling bundles. It - knows nothing about executables or icons, it only copies files - and creates the PkgInfo and Info.plist files. - """ - - # (Note that Defaults.__init__ (deep)copies these values to - # instance variables. Mutable defaults are therefore safe.) - - # Name of the bundle, with or without extension. - name = None - - # The property list ("plist") - plist = Plist(CFBundleDevelopmentRegion = "English", - CFBundleInfoDictionaryVersion = "6.0") - - # The type of the bundle. - type = "BNDL" - # The creator code of the bundle. - creator = None - - # the CFBundleIdentifier (this is used for the preferences file name) - bundle_id = None - - # List of files that have to be copied to /Contents/Resources. - resources = [] - - # List of (src, dest) tuples; dest should be a path relative to the bundle - # (eg. "Contents/Resources/MyStuff/SomeFile.ext). - files = [] - - # List of shared libraries (dylibs, Frameworks) to bundle with the app - # will be placed in Contents/Frameworks - libs = [] - - # Directory where the bundle will be assembled. - builddir = "build" - - # Make symlinks instead copying files. This is handy during debugging, but - # makes the bundle non-distributable. - symlink = 0 - - # Verbosity level. - verbosity = 1 - - # Destination root directory - destroot = "" - - def setup(self): - # XXX rethink self.name munging, this is brittle. - self.name, ext = os.path.splitext(self.name) - if not ext: - ext = ".bundle" - bundleextension = ext - # misc (derived) attributes - self.bundlepath = pathjoin(self.builddir, self.name + bundleextension) - - plist = self.plist - plist.CFBundleName = self.name - plist.CFBundlePackageType = self.type - if self.creator is None: - if hasattr(plist, "CFBundleSignature"): - self.creator = plist.CFBundleSignature - else: - self.creator = "????" - plist.CFBundleSignature = self.creator - if self.bundle_id: - plist.CFBundleIdentifier = self.bundle_id - elif not hasattr(plist, "CFBundleIdentifier"): - plist.CFBundleIdentifier = self.name - - def build(self): - """Build the bundle.""" - builddir = self.builddir - if builddir and not os.path.exists(builddir): - os.mkdir(builddir) - self.message("Building %s" % repr(self.bundlepath), 1) - if os.path.exists(self.bundlepath): - shutil.rmtree(self.bundlepath) - if os.path.exists(self.bundlepath + '~'): - shutil.rmtree(self.bundlepath + '~') - bp = self.bundlepath - - # Create the app bundle in a temporary location and then - # rename the completed bundle. This way the Finder will - # never see an incomplete bundle (where it might pick up - # and cache the wrong meta data) - self.bundlepath = bp + '~' - try: - os.mkdir(self.bundlepath) - self.preProcess() - self._copyFiles() - self._addMetaFiles() - self.postProcess() - os.rename(self.bundlepath, bp) - finally: - self.bundlepath = bp - self.message("Done.", 1) - - def preProcess(self): - """Hook for subclasses.""" - pass - def postProcess(self): - """Hook for subclasses.""" - pass - - def _addMetaFiles(self): - contents = pathjoin(self.bundlepath, "Contents") - makedirs(contents) - # - # Write Contents/PkgInfo - assert len(self.type) == len(self.creator) == 4, \ - "type and creator must be 4-byte strings." - pkginfo = pathjoin(contents, "PkgInfo") - f = open(pkginfo, "wb") - f.write(self.type + self.creator) - f.close() - # - # Write Contents/Info.plist - infoplist = pathjoin(contents, "Info.plist") - self.plist.write(infoplist) - - def _copyFiles(self): - files = self.files[:] - for path in self.resources: - files.append((path, pathjoin("Contents", "Resources", - os.path.basename(path)))) - for path in self.libs: - files.append((path, pathjoin("Contents", "Frameworks", - os.path.basename(path)))) - if self.symlink: - self.message("Making symbolic links", 1) - msg = "Making symlink from" - else: - self.message("Copying files", 1) - msg = "Copying" - files.sort() - for src, dst in files: - if os.path.isdir(src): - self.message("%s %s/ to %s/" % (msg, src, dst), 2) - else: - self.message("%s %s to %s" % (msg, src, dst), 2) - dst = pathjoin(self.bundlepath, dst) - if self.symlink: - symlink(src, dst, mkdirs=1) - else: - copy(src, dst, mkdirs=1) - - def message(self, msg, level=0): - if level <= self.verbosity: - indent = "" - if level > 1: - indent = (level - 1) * " " - sys.stderr.write(indent + msg + "\n") - - def report(self): - # XXX something decent - pass - - -if __debug__: - PYC_EXT = ".pyc" -else: - PYC_EXT = ".pyo" - -MAGIC = imp.get_magic() -USE_ZIPIMPORT = "zipimport" in sys.builtin_module_names - -# For standalone apps, we have our own minimal site.py. We don't need -# all the cruft of the real site.py. -SITE_PY = """\ -import sys -if not %(semi_standalone)s: - del sys.path[1:] # sys.path[0] is Contents/Resources/ -""" - -if USE_ZIPIMPORT: - ZIP_ARCHIVE = "Modules.zip" - SITE_PY += "sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE - def getPycData(fullname, code, ispkg): - if ispkg: - fullname += ".__init__" - path = fullname.replace(".", os.sep) + PYC_EXT - return path, MAGIC + '\0\0\0\0' + marshal.dumps(code) - -# -# Extension modules can't be in the modules zip archive, so a placeholder -# is added instead, that loads the extension from a specified location. -# -EXT_LOADER = """\ -def __load(): - import imp, sys, os - for p in sys.path: - path = os.path.join(p, "%(filename)s") - if os.path.exists(path): - break - else: - assert 0, "file not found: %(filename)s" - mod = imp.load_dynamic("%(name)s", path) - -__load() -del __load -""" - -MAYMISS_MODULES = ['mac', 'os2', 'nt', 'ntpath', 'dos', 'dospath', - 'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize', - 'org.python.core', 'riscos', 'riscosenviron', 'riscospath' -] - -STRIP_EXEC = "/usr/bin/strip" - -# -# We're using a stock interpreter to run the app, yet we need -# a way to pass the Python main program to the interpreter. The -# bootstrapping script fires up the interpreter with the right -# arguments. os.execve() is used as OSX doesn't like us to -# start a real new process. Also, the executable name must match -# the CFBundleExecutable value in the Info.plist, so we lie -# deliberately with argv[0]. The actual Python executable is -# passed in an environment variable so we can "repair" -# sys.executable later. -# -BOOTSTRAP_SCRIPT = """\ -#!%(hashbang)s - -import sys, os -execdir = os.path.dirname(sys.argv[0]) -executable = os.path.join(execdir, "%(executable)s") -resdir = os.path.join(os.path.dirname(execdir), "Resources") -libdir = os.path.join(os.path.dirname(execdir), "Frameworks") -mainprogram = os.path.join(resdir, "%(mainprogram)s") - -sys.argv.insert(1, mainprogram) -if %(standalone)s or %(semi_standalone)s: - os.environ["PYTHONPATH"] = resdir - if %(standalone)s: - os.environ["PYTHONHOME"] = resdir -else: - pypath = os.getenv("PYTHONPATH", "") - if pypath: - pypath = ":" + pypath - os.environ["PYTHONPATH"] = resdir + pypath -os.environ["PYTHONEXECUTABLE"] = executable -os.environ["DYLD_LIBRARY_PATH"] = libdir -os.environ["DYLD_FRAMEWORK_PATH"] = libdir -os.execve(executable, sys.argv, os.environ) -""" - - -# -# Optional wrapper that converts "dropped files" into sys.argv values. -# -ARGV_EMULATOR = """\ -import argvemulator, os - -argvemulator.ArgvCollector().mainloop() -execfile(os.path.join(os.path.split(__file__)[0], "%(realmainprogram)s")) -""" - -# -# When building a standalone app with Python.framework, we need to copy -# a subset from Python.framework to the bundle. The following list -# specifies exactly what items we'll copy. -# -PYTHONFRAMEWORKGOODIES = [ - "Python", # the Python core library - "Resources/English.lproj", - "Resources/Info.plist", - "Resources/version.plist", -] - -def isFramework(): - return sys.exec_prefix.find("Python.framework") > 0 - - -LIB = os.path.join(sys.prefix, "lib", "python" + sys.version[:3]) -SITE_PACKAGES = os.path.join(LIB, "site-packages") - - -class AppBuilder(BundleBuilder): - - # Override type of the bundle. - type = "APPL" - - # platform, name of the subfolder of Contents that contains the executable. - platform = "MacOS" - - # A Python main program. If this argument is given, the main - # executable in the bundle will be a small wrapper that invokes - # the main program. (XXX Discuss why.) - mainprogram = None - - # The main executable. If a Python main program is specified - # the executable will be copied to Resources and be invoked - # by the wrapper program mentioned above. Otherwise it will - # simply be used as the main executable. - executable = None - - # The name of the main nib, for Cocoa apps. *Must* be specified - # when building a Cocoa app. - nibname = None - - # The name of the icon file to be copied to Resources and used for - # the Finder icon. - iconfile = None - - # Symlink the executable instead of copying it. - symlink_exec = 0 - - # If True, build standalone app. - standalone = 0 - - # If True, build semi-standalone app (only includes third-party modules). - semi_standalone = 0 - - # If set, use this for #! lines in stead of sys.executable - python = None - - # If True, add a real main program that emulates sys.argv before calling - # mainprogram - argv_emulation = 0 - - # The following attributes are only used when building a standalone app. - - # Exclude these modules. - excludeModules = [] - - # Include these modules. - includeModules = [] - - # Include these packages. - includePackages = [] - - # Strip binaries from debug info. - strip = 0 - - # Found Python modules: [(name, codeobject, ispkg), ...] - pymodules = [] - - # Modules that modulefinder couldn't find: - missingModules = [] - maybeMissingModules = [] - - def setup(self): - if ((self.standalone or self.semi_standalone) - and self.mainprogram is None): - raise BundleBuilderError, ("must specify 'mainprogram' when " - "building a standalone application.") - if self.mainprogram is None and self.executable is None: - raise BundleBuilderError, ("must specify either or both of " - "'executable' and 'mainprogram'") - - self.execdir = pathjoin("Contents", self.platform) - - if self.name is not None: - pass - elif self.mainprogram is not None: - self.name = os.path.splitext(os.path.basename(self.mainprogram))[0] - elif executable is not None: - self.name = os.path.splitext(os.path.basename(self.executable))[0] - if self.name[-4:] != ".app": - self.name += ".app" - - if self.executable is None: - if not self.standalone and not isFramework(): - self.symlink_exec = 1 - if self.python: - self.executable = self.python - else: - self.executable = sys.executable - - if self.nibname: - self.plist.NSMainNibFile = self.nibname - if not hasattr(self.plist, "NSPrincipalClass"): - self.plist.NSPrincipalClass = "NSApplication" - - if self.standalone and isFramework(): - self.addPythonFramework() - - BundleBuilder.setup(self) - - self.plist.CFBundleExecutable = self.name - - if self.standalone or self.semi_standalone: - self.findDependencies() - - def preProcess(self): - resdir = "Contents/Resources" - if self.executable is not None: - if self.mainprogram is None: - execname = self.name - else: - execname = os.path.basename(self.executable) - execpath = pathjoin(self.execdir, execname) - if not self.symlink_exec: - self.files.append((self.destroot + self.executable, execpath)) - self.execpath = execpath - - if self.mainprogram is not None: - mainprogram = os.path.basename(self.mainprogram) - self.files.append((self.mainprogram, pathjoin(resdir, mainprogram))) - if self.argv_emulation: - # Change the main program, and create the helper main program (which - # does argv collection and then calls the real main). - # Also update the included modules (if we're creating a standalone - # program) and the plist - realmainprogram = mainprogram - mainprogram = '__argvemulator_' + mainprogram - resdirpath = pathjoin(self.bundlepath, resdir) - mainprogrampath = pathjoin(resdirpath, mainprogram) - makedirs(resdirpath) - open(mainprogrampath, "w").write(ARGV_EMULATOR % locals()) - if self.standalone or self.semi_standalone: - self.includeModules.append("argvemulator") - self.includeModules.append("os") - if not self.plist.has_key("CFBundleDocumentTypes"): - self.plist["CFBundleDocumentTypes"] = [ - { "CFBundleTypeOSTypes" : [ - "****", - "fold", - "disk"], - "CFBundleTypeRole": "Viewer"}] - # Write bootstrap script - executable = os.path.basename(self.executable) - execdir = pathjoin(self.bundlepath, self.execdir) - bootstrappath = pathjoin(execdir, self.name) - makedirs(execdir) - if self.standalone or self.semi_standalone: - # XXX we're screwed when the end user has deleted - # /usr/bin/python - hashbang = "/usr/bin/python" - elif self.python: - hashbang = self.python - else: - hashbang = os.path.realpath(sys.executable) - standalone = self.standalone - semi_standalone = self.semi_standalone - open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) - os.chmod(bootstrappath, 0775) - - if self.iconfile is not None: - iconbase = os.path.basename(self.iconfile) - self.plist.CFBundleIconFile = iconbase - self.files.append((self.iconfile, pathjoin(resdir, iconbase))) - - def postProcess(self): - if self.standalone or self.semi_standalone: - self.addPythonModules() - if self.strip and not self.symlink: - self.stripBinaries() - - if self.symlink_exec and self.executable: - self.message("Symlinking executable %s to %s" % (self.executable, - self.execpath), 2) - dst = pathjoin(self.bundlepath, self.execpath) - makedirs(os.path.dirname(dst)) - os.symlink(os.path.abspath(self.executable), dst) - - if self.missingModules or self.maybeMissingModules: - self.reportMissing() - - def addPythonFramework(self): - # If we're building a standalone app with Python.framework, - # include a minimal subset of Python.framework, *unless* - # Python.framework was specified manually in self.libs. - for lib in self.libs: - if os.path.basename(lib) == "Python.framework": - # a Python.framework was specified as a library - return - - frameworkpath = sys.exec_prefix[:sys.exec_prefix.find( - "Python.framework") + len("Python.framework")] - - version = sys.version[:3] - frameworkpath = pathjoin(frameworkpath, "Versions", version) - destbase = pathjoin("Contents", "Frameworks", "Python.framework", - "Versions", version) - for item in PYTHONFRAMEWORKGOODIES: - src = pathjoin(frameworkpath, item) - dst = pathjoin(destbase, item) - self.files.append((src, dst)) - - def _getSiteCode(self): - return compile(SITE_PY % {"semi_standalone": self.semi_standalone}, - "<-bundlebuilder.py->", "exec") - - def addPythonModules(self): - self.message("Adding Python modules", 1) - - if USE_ZIPIMPORT: - # Create a zip file containing all modules as pyc. - import zipfile - relpath = pathjoin("Contents", "Resources", ZIP_ARCHIVE) - abspath = pathjoin(self.bundlepath, relpath) - zf = zipfile.ZipFile(abspath, "w", zipfile.ZIP_DEFLATED) - for name, code, ispkg in self.pymodules: - self.message("Adding Python module %s" % name, 2) - path, pyc = getPycData(name, code, ispkg) - zf.writestr(path, pyc) - zf.close() - # add site.pyc - sitepath = pathjoin(self.bundlepath, "Contents", "Resources", - "site" + PYC_EXT) - writePyc(self._getSiteCode(), sitepath) - else: - # Create individual .pyc files. - for name, code, ispkg in self.pymodules: - if ispkg: - name += ".__init__" - path = name.split(".") - path = pathjoin("Contents", "Resources", *path) + PYC_EXT - - if ispkg: - self.message("Adding Python package %s" % path, 2) - else: - self.message("Adding Python module %s" % path, 2) - - abspath = pathjoin(self.bundlepath, path) - makedirs(os.path.dirname(abspath)) - writePyc(code, abspath) - - def stripBinaries(self): - if not os.path.exists(STRIP_EXEC): - self.message("Error: can't strip binaries: no strip program at " - "%s" % STRIP_EXEC, 0) - else: - import stat - self.message("Stripping binaries", 1) - def walk(top): - for name in os.listdir(top): - path = pathjoin(top, name) - if os.path.islink(path): - continue - if os.path.isdir(path): - walk(path) - else: - mod = os.stat(path)[stat.ST_MODE] - if not (mod & 0100): - continue - relpath = path[len(self.bundlepath):] - self.message("Stripping %s" % relpath, 2) - inf, outf = os.popen4("%s -S \"%s\"" % - (STRIP_EXEC, path)) - output = outf.read().strip() - if output: - # usually not a real problem, like when we're - # trying to strip a script - self.message("Problem stripping %s:" % relpath, 3) - self.message(output, 3) - walk(self.bundlepath) - - def findDependencies(self): - self.message("Finding module dependencies", 1) - import modulefinder - mf = modulefinder.ModuleFinder(excludes=self.excludeModules) - if USE_ZIPIMPORT: - # zipimport imports zlib, must add it manually - mf.import_hook("zlib") - # manually add our own site.py - site = mf.add_module("site") - site.__code__ = self._getSiteCode() - mf.scan_code(site.__code__, site) - - # warnings.py gets imported implicitly from C - mf.import_hook("warnings") - - includeModules = self.includeModules[:] - for name in self.includePackages: - includeModules.extend(findPackageContents(name).keys()) - for name in includeModules: - try: - mf.import_hook(name) - except ImportError: - self.missingModules.append(name) - - mf.run_script(self.mainprogram) - modules = mf.modules.items() - modules.sort() - for name, mod in modules: - path = mod.__file__ - if path and self.semi_standalone: - # skip the standard library - if path.startswith(LIB) and not path.startswith(SITE_PACKAGES): - continue - if path and mod.__code__ is None: - # C extension - filename = os.path.basename(path) - pathitems = name.split(".")[:-1] + [filename] - dstpath = pathjoin(*pathitems) - if USE_ZIPIMPORT: - if name != "zlib": - # neatly pack all extension modules in a subdirectory, - # except zlib, since it's neccesary for bootstrapping. - dstpath = pathjoin("ExtensionModules", dstpath) - # Python modules are stored in a Zip archive, but put - # extensions in Contents/Resources/. Add a tiny "loader" - # program in the Zip archive. Due to Thomas Heller. - source = EXT_LOADER % {"name": name, "filename": dstpath} - code = compile(source, "" % name, "exec") - mod.__code__ = code - self.files.append((path, pathjoin("Contents", "Resources", dstpath))) - if mod.__code__ is not None: - ispkg = mod.__path__ is not None - if not USE_ZIPIMPORT or name != "site": - # Our site.py is doing the bootstrapping, so we must - # include a real .pyc file if USE_ZIPIMPORT is True. - self.pymodules.append((name, mod.__code__, ispkg)) - - if hasattr(mf, "any_missing_maybe"): - missing, maybe = mf.any_missing_maybe() - else: - missing = mf.any_missing() - maybe = [] - self.missingModules.extend(missing) - self.maybeMissingModules.extend(maybe) - - def reportMissing(self): - missing = [name for name in self.missingModules - if name not in MAYMISS_MODULES] - if self.maybeMissingModules: - maybe = self.maybeMissingModules - else: - maybe = [name for name in missing if "." in name] - missing = [name for name in missing if "." not in name] - missing.sort() - maybe.sort() - if maybe: - self.message("Warning: couldn't find the following submodules:", 1) - self.message(" (Note that these could be false alarms -- " - "it's not always", 1) - self.message(" possible to distinguish between \"from package " - "import submodule\" ", 1) - self.message(" and \"from package import name\")", 1) - for name in maybe: - self.message(" ? " + name, 1) - if missing: - self.message("Warning: couldn't find the following modules:", 1) - for name in missing: - self.message(" ? " + name, 1) - - def report(self): - # XXX something decent - import pprint - pprint.pprint(self.__dict__) - if self.standalone or self.semi_standalone: - self.reportMissing() - -# -# Utilities. -# - -SUFFIXES = [_suf for _suf, _mode, _tp in imp.get_suffixes()] -identifierRE = re.compile(r"[_a-zA-z][_a-zA-Z0-9]*$") - -def findPackageContents(name, searchpath=None): - head = name.split(".")[-1] - if identifierRE.match(head) is None: - return {} - try: - fp, path, (ext, mode, tp) = imp.find_module(head, searchpath) - except ImportError: - return {} - modules = {name: None} - if tp == imp.PKG_DIRECTORY and path: - files = os.listdir(path) - for sub in files: - sub, ext = os.path.splitext(sub) - fullname = name + "." + sub - if sub != "__init__" and fullname not in modules: - modules.update(findPackageContents(fullname, [path])) - return modules - -def writePyc(code, path): - f = open(path, "wb") - f.write(MAGIC) - f.write("\0" * 4) # don't bother about a time stamp - marshal.dump(code, f) - f.close() - -def copy(src, dst, mkdirs=0): - """Copy a file or a directory.""" - if mkdirs: - makedirs(os.path.dirname(dst)) - if os.path.isdir(src): - shutil.copytree(src, dst, symlinks=1) - else: - shutil.copy2(src, dst) - -def copytodir(src, dstdir): - """Copy a file or a directory to an existing directory.""" - dst = pathjoin(dstdir, os.path.basename(src)) - copy(src, dst) - -def makedirs(dir): - """Make all directories leading up to 'dir' including the leaf - directory. Don't moan if any path element already exists.""" - try: - os.makedirs(dir) - except OSError, why: - if why.errno != errno.EEXIST: - raise - -def symlink(src, dst, mkdirs=0): - """Copy a file or a directory.""" - if not os.path.exists(src): - raise IOError, "No such file or directory: '%s'" % src - if mkdirs: - makedirs(os.path.dirname(dst)) - os.symlink(os.path.abspath(src), dst) - -def pathjoin(*args): - """Safe wrapper for os.path.join: asserts that all but the first - argument are relative paths.""" - for seg in args[1:]: - assert seg[0] != "/" - return os.path.join(*args) - - -cmdline_doc = """\ -Usage: - python bundlebuilder.py [options] command - python mybuildscript.py [options] command - -Commands: - build build the application - report print a report - -Options: - -b, --builddir=DIR the build directory; defaults to "build" - -n, --name=NAME application name - -r, --resource=FILE extra file or folder to be copied to Resources - -f, --file=SRC:DST extra file or folder to be copied into the bundle; - DST must be a path relative to the bundle root - -e, --executable=FILE the executable to be used - -m, --mainprogram=FILE the Python main program - -a, --argv add a wrapper main program to create sys.argv - -p, --plist=FILE .plist file (default: generate one) - --nib=NAME main nib name - -c, --creator=CCCC 4-char creator code (default: '????') - --iconfile=FILE filename of the icon (an .icns file) to be used - as the Finder icon - --bundle-id=ID the CFBundleIdentifier, in reverse-dns format - (eg. org.python.BuildApplet; this is used for - the preferences file name) - -l, --link symlink files/folder instead of copying them - --link-exec symlink the executable instead of copying it - --standalone build a standalone application, which is fully - independent of a Python installation - --semi-standalone build a standalone application, which depends on - an installed Python, yet includes all third-party - modules. - --python=FILE Python to use in #! line in stead of current Python - --lib=FILE shared library or framework to be copied into - the bundle - -x, --exclude=MODULE exclude module (with --(semi-)standalone) - -i, --include=MODULE include module (with --(semi-)standalone) - --package=PACKAGE include a whole package (with --(semi-)standalone) - --strip strip binaries (remove debug info) - -v, --verbose increase verbosity level - -q, --quiet decrease verbosity level - -h, --help print this message -""" - -def usage(msg=None): - if msg: - print msg - print cmdline_doc - sys.exit(1) - -def main(builder=None): - if builder is None: - builder = AppBuilder(verbosity=1) - - shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa" - longopts = ("builddir=", "name=", "resource=", "file=", "executable=", - "mainprogram=", "creator=", "nib=", "plist=", "link", - "link-exec", "help", "verbose", "quiet", "argv", "standalone", - "exclude=", "include=", "package=", "strip", "iconfile=", - "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=") - - try: - options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) - except getopt.error: - usage() - - for opt, arg in options: - if opt in ('-b', '--builddir'): - builder.builddir = arg - elif opt in ('-n', '--name'): - builder.name = arg - elif opt in ('-r', '--resource'): - builder.resources.append(os.path.normpath(arg)) - elif opt in ('-f', '--file'): - srcdst = arg.split(':') - if len(srcdst) != 2: - usage("-f or --file argument must be two paths, " - "separated by a colon") - builder.files.append(srcdst) - elif opt in ('-e', '--executable'): - builder.executable = arg - elif opt in ('-m', '--mainprogram'): - builder.mainprogram = arg - elif opt in ('-a', '--argv'): - builder.argv_emulation = 1 - elif opt in ('-c', '--creator'): - builder.creator = arg - elif opt == '--bundle-id': - builder.bundle_id = arg - elif opt == '--iconfile': - builder.iconfile = arg - elif opt == "--lib": - builder.libs.append(os.path.normpath(arg)) - elif opt == "--nib": - builder.nibname = arg - elif opt in ('-p', '--plist'): - builder.plist = Plist.fromFile(arg) - elif opt in ('-l', '--link'): - builder.symlink = 1 - elif opt == '--link-exec': - builder.symlink_exec = 1 - elif opt in ('-h', '--help'): - usage() - elif opt in ('-v', '--verbose'): - builder.verbosity += 1 - elif opt in ('-q', '--quiet'): - builder.verbosity -= 1 - elif opt == '--standalone': - builder.standalone = 1 - elif opt == '--semi-standalone': - builder.semi_standalone = 1 - elif opt == '--python': - builder.python = arg - elif opt in ('-x', '--exclude'): - builder.excludeModules.append(arg) - elif opt in ('-i', '--include'): - builder.includeModules.append(arg) - elif opt == '--package': - builder.includePackages.append(arg) - elif opt == '--strip': - builder.strip = 1 - elif opt == '--destroot': - builder.destroot = arg - - if len(args) != 1: - usage("Must specify one command ('build', 'report' or 'help')") - command = args[0] - - if command == "build": - builder.setup() - builder.build() - elif command == "report": - builder.setup() - builder.report() - elif command == "help": - usage() - else: - usage("Unknown command '%s'" % command) - - -def buildapp(**kwargs): - builder = AppBuilder(**kwargs) - main(builder) - - -if __name__ == "__main__": - main() diff --git a/sys/lib/python/plat-mac/cfmfile.py b/sys/lib/python/plat-mac/cfmfile.py deleted file mode 100644 index fd1a3e86c..000000000 --- a/sys/lib/python/plat-mac/cfmfile.py +++ /dev/null @@ -1,183 +0,0 @@ -"""codefragments.py -- wrapper to modify code fragments.""" - -# (c) 1998, Just van Rossum, Letterror - -__version__ = "0.8b3" -__author__ = "jvr" - -import Carbon.File -import struct -from Carbon import Res -import os -import sys - -DEBUG = 0 - -error = "cfm.error" - -BUFSIZE = 0x80000 - -def mergecfmfiles(srclist, dst, architecture = 'fat'): - """Merge all files in srclist into a new file dst. - - If architecture is given, only code fragments of that type will be used: - "pwpc" for PPC, "m68k" for cfm68k. This does not work for "classic" - 68k code, since it does not use code fragments to begin with. - If architecture is None, all fragments will be used, enabling FAT binaries. - """ - - srclist = list(srclist) - for i in range(len(srclist)): - srclist[i] = Carbon.File.pathname(srclist[i]) - dst = Carbon.File.pathname(dst) - - dstfile = open(dst, "wb") - rf = Res.FSpOpenResFile(dst, 3) - try: - dstcfrg = CfrgResource() - for src in srclist: - srccfrg = CfrgResource(src) - for frag in srccfrg.fragments: - if frag.architecture == 'pwpc' and architecture == 'm68k': - continue - if frag.architecture == 'm68k' and architecture == 'pwpc': - continue - dstcfrg.append(frag) - - frag.copydata(dstfile) - - cfrgres = Res.Resource(dstcfrg.build()) - Res.UseResFile(rf) - cfrgres.AddResource('cfrg', 0, "") - finally: - dstfile.close() - rf = Res.CloseResFile(rf) - - -class CfrgResource: - - def __init__(self, path = None): - self.version = 1 - self.fragments = [] - self.path = path - if path is not None and os.path.exists(path): - currentresref = Res.CurResFile() - resref = Res.FSpOpenResFile(path, 1) - Res.UseResFile(resref) - try: - try: - data = Res.Get1Resource('cfrg', 0).data - except Res.Error: - raise Res.Error, "no 'cfrg' resource found", sys.exc_traceback - finally: - Res.CloseResFile(resref) - Res.UseResFile(currentresref) - self.parse(data) - if self.version <> 1: - raise error, "unknown 'cfrg' resource format" - - def parse(self, data): - (res1, res2, self.version, - res3, res4, res5, res6, - self.memberCount) = struct.unpack("8l", data[:32]) - data = data[32:] - while data: - frag = FragmentDescriptor(self.path, data) - data = data[frag.memberSize:] - self.fragments.append(frag) - - def build(self): - self.memberCount = len(self.fragments) - data = struct.pack("8l", 0, 0, self.version, 0, 0, 0, 0, self.memberCount) - for frag in self.fragments: - data = data + frag.build() - return data - - def append(self, frag): - self.fragments.append(frag) - - -class FragmentDescriptor: - - def __init__(self, path, data = None): - self.path = path - if data is not None: - self.parse(data) - - def parse(self, data): - self.architecture = data[:4] - ( self.updatelevel, - self.currentVersion, - self.oldDefVersion, - self.stacksize, - self.applibdir, - self.fragtype, - self.where, - self.offset, - self.length, - self.res1, self.res2, - self.memberSize,) = struct.unpack("4lhBB4lh", data[4:42]) - pname = data[42:self.memberSize] - self.name = pname[1:1+ord(pname[0])] - - def build(self): - data = self.architecture - data = data + struct.pack("4lhBB4l", - self.updatelevel, - self.currentVersion, - self.oldDefVersion, - self.stacksize, - self.applibdir, - self.fragtype, - self.where, - self.offset, - self.length, - self.res1, self.res2) - self.memberSize = len(data) + 2 + 1 + len(self.name) - # pad to 4 byte boundaries - if self.memberSize % 4: - self.memberSize = self.memberSize + 4 - (self.memberSize % 4) - data = data + struct.pack("hb", self.memberSize, len(self.name)) - data = data + self.name - data = data + '\000' * (self.memberSize - len(data)) - return data - - def getfragment(self): - if self.where <> 1: - raise error, "can't read fragment, unsupported location" - f = open(self.path, "rb") - f.seek(self.offset) - if self.length: - frag = f.read(self.length) - else: - frag = f.read() - f.close() - return frag - - def copydata(self, outfile): - if self.where <> 1: - raise error, "can't read fragment, unsupported location" - infile = open(self.path, "rb") - if self.length == 0: - infile.seek(0, 2) - self.length = infile.tell() - - # Position input file and record new offset from output file - infile.seek(self.offset) - - # pad to 16 byte boundaries - offset = outfile.tell() - if offset % 16: - offset = offset + 16 - (offset % 16) - outfile.seek(offset) - self.offset = offset - - l = self.length - while l: - if l > BUFSIZE: - outfile.write(infile.read(BUFSIZE)) - l = l - BUFSIZE - else: - outfile.write(infile.read(l)) - l = 0 - infile.close() diff --git a/sys/lib/python/plat-mac/dialogs.rsrc b/sys/lib/python/plat-mac/dialogs.rsrc deleted file mode 100644 index 0107493b5..000000000 Binary files a/sys/lib/python/plat-mac/dialogs.rsrc and /dev/null differ diff --git a/sys/lib/python/plat-mac/errors.rsrc b/sys/lib/python/plat-mac/errors.rsrc deleted file mode 100644 index 61c487e17..000000000 Binary files a/sys/lib/python/plat-mac/errors.rsrc and /dev/null differ diff --git a/sys/lib/python/plat-mac/findertools.py b/sys/lib/python/plat-mac/findertools.py deleted file mode 100644 index 54b1bdec0..000000000 --- a/sys/lib/python/plat-mac/findertools.py +++ /dev/null @@ -1,831 +0,0 @@ -"""Utility routines depending on the finder, -a combination of code by Jack Jansen and erik@letterror.com. - -Most events have been captured from -Lasso Capture AE and than translated to python code. - -IMPORTANT -Note that the processes() function returns different values -depending on the OS version it is running on. On MacOS 9 -the Finder returns the process *names* which can then be -used to find out more about them. On MacOS 8.6 and earlier -the Finder returns a code which does not seem to work. -So bottom line: the processes() stuff does not work on < MacOS9 - -Mostly written by erik@letterror.com -""" -import Finder -from Carbon import AppleEvents -import aetools -import MacOS -import sys -import Carbon.File -import Carbon.Folder -import aetypes -from types import * - -__version__ = '1.1' -Error = 'findertools.Error' - -_finder_talker = None - -def _getfinder(): - """returns basic (recyclable) Finder AE interface object""" - global _finder_talker - if not _finder_talker: - _finder_talker = Finder.Finder() - _finder_talker.send_flags = ( _finder_talker.send_flags | - AppleEvents.kAECanInteract | AppleEvents.kAECanSwitchLayer) - return _finder_talker - -def launch(file): - """Open a file thru the finder. Specify file by name or fsspec""" - finder = _getfinder() - fss = Carbon.File.FSSpec(file) - return finder.open(fss) - -def Print(file): - """Print a file thru the finder. Specify file by name or fsspec""" - finder = _getfinder() - fss = Carbon.File.FSSpec(file) - return finder._print(fss) - -def copy(src, dstdir): - """Copy a file to a folder""" - finder = _getfinder() - if type(src) == type([]): - src_fss = [] - for s in src: - src_fss.append(Carbon.File.FSSpec(s)) - else: - src_fss = Carbon.File.FSSpec(src) - dst_fss = Carbon.File.FSSpec(dstdir) - return finder.duplicate(src_fss, to=dst_fss) - -def move(src, dstdir): - """Move a file to a folder""" - finder = _getfinder() - if type(src) == type([]): - src_fss = [] - for s in src: - src_fss.append(Carbon.File.FSSpec(s)) - else: - src_fss = Carbon.File.FSSpec(src) - dst_fss = Carbon.File.FSSpec(dstdir) - return finder.move(src_fss, to=dst_fss) - -def sleep(): - """Put the mac to sleep""" - finder = _getfinder() - finder.sleep() - -def shutdown(): - """Shut the mac down""" - finder = _getfinder() - finder.shut_down() - -def restart(): - """Restart the mac""" - finder = _getfinder() - finder.restart() - - -#--------------------------------------------------- -# Additional findertools -# - -def reveal(file): - """Reveal a file in the finder. Specify file by name, fsref or fsspec.""" - finder = _getfinder() - fsr = Carbon.File.FSRef(file) - file_alias = fsr.FSNewAliasMinimal() - return finder.reveal(file_alias) - -def select(file): - """select a file in the finder. Specify file by name, fsref or fsspec.""" - finder = _getfinder() - fsr = Carbon.File.FSRef(file) - file_alias = fsr.FSNewAliasMinimal() - return finder.select(file_alias) - -def update(file): - """Update the display of the specified object(s) to match - their on-disk representation. Specify file by name, fsref or fsspec.""" - finder = _getfinder() - fsr = Carbon.File.FSRef(file) - file_alias = fsr.FSNewAliasMinimal() - return finder.update(file_alias) - - -#--------------------------------------------------- -# More findertools -# - -def comment(object, comment=None): - """comment: get or set the Finder-comment of the item, displayed in the 'Get Info' window.""" - object = Carbon.File.FSRef(object) - object_alias = object.FSNewAliasMonimal() - if comment == None: - return _getcomment(object_alias) - else: - return _setcomment(object_alias, comment) - -def _setcomment(object_alias, comment): - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('comt'), fr=aeobj_00) - args['----'] = aeobj_01 - args["data"] = comment - _reply, args, attrs = finder.send("core", "setd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def _getcomment(object_alias): - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('comt'), fr=aeobj_00) - args['----'] = aeobj_01 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - - -#--------------------------------------------------- -# Get information about current processes in the Finder. - -def processes(): - """processes returns a list of all active processes running on this computer and their creators.""" - finder = _getfinder() - args = {} - attrs = {} - processnames = [] - processnumbers = [] - creators = [] - partitions = [] - used = [] - ## get the processnames or else the processnumbers - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="indx", seld=aetypes.Unknown('abso', "all "), fr=None) - _reply, args, attrs = finder.send('core', 'getd', args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - p = [] - if args.has_key('----'): - p = args['----'] - for proc in p: - if hasattr(proc, 'seld'): - # it has a real name - processnames.append(proc.seld) - elif hasattr(proc, 'type'): - if proc.type == "psn ": - # it has a process number - processnumbers.append(proc.data) - ## get the creators - args = {} - attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="indx", seld=aetypes.Unknown('abso', "all "), fr=None) - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fcrt'), fr=aeobj_0) - _reply, args, attrs = finder.send('core', 'getd', args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(_arg) - if args.has_key('----'): - p = args['----'] - creators = p[:] - ## concatenate in one dict - result = [] - if len(processnames) > len(processnumbers): - data = processnames - else: - data = processnumbers - for i in range(len(creators)): - result.append((data[i], creators[i])) - return result - -class _process: - pass - -def isactiveprocess(processname): - """Check of processname is active. MacOS9""" - all = processes() - ok = 0 - for n, c in all: - if n == processname: - return 1 - return 0 - -def processinfo(processname): - """Return an object with all process properties as attributes for processname. MacOS9""" - p = _process() - - if processname == "Finder": - p.partition = None - p.used = None - else: - p.partition = _processproperty(processname, 'appt') - p.used = _processproperty(processname, 'pusd') - p.visible = _processproperty(processname, 'pvis') #Is the process' layer visible? - p.frontmost = _processproperty(processname, 'pisf') #Is the process the frontmost process? - p.file = _processproperty(processname, 'file') #the file from which the process was launched - p.filetype = _processproperty(processname, 'asty') #the OSType of the file type of the process - p.creatortype = _processproperty(processname, 'fcrt') #the OSType of the creator of the process (the signature) - p.accepthighlevel = _processproperty(processname, 'revt') #Is the process high-level event aware (accepts open application, open document, print document, and quit)? - p.hasscripting = _processproperty(processname, 'hscr') #Does the process have a scripting terminology, i.e., can it be scripted? - return p - -def _processproperty(processname, property): - """return the partition size and memory used for processname""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="name", seld=processname, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type(property), fr=aeobj_00) - args['----'] = aeobj_01 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - - -#--------------------------------------------------- -# Mess around with Finder windows. - -def openwindow(object): - """Open a Finder window for object, Specify object by name or fsspec.""" - finder = _getfinder() - object = Carbon.File.FSRef(object) - object_alias = object.FSNewAliasMinimal() - args = {} - attrs = {} - _code = 'aevt' - _subcode = 'odoc' - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None) - args['----'] = aeobj_0 - _reply, args, attrs = finder.send(_code, _subcode, args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - -def closewindow(object): - """Close a Finder window for folder, Specify by path.""" - finder = _getfinder() - object = Carbon.File.FSRef(object) - object_alias = object.FSNewAliasMinimal() - args = {} - attrs = {} - _code = 'core' - _subcode = 'clos' - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None) - args['----'] = aeobj_0 - _reply, args, attrs = finder.send(_code, _subcode, args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - -def location(object, pos=None): - """Set the position of a Finder window for folder to pos=(w, h). Specify file by name or fsspec. - If pos=None, location will return the current position of the object.""" - object = Carbon.File.FSRef(object) - object_alias = object.FSNewAliasMinimal() - if not pos: - return _getlocation(object_alias) - return _setlocation(object_alias, pos) - -def _setlocation(object_alias, (x, y)): - """_setlocation: Set the location of the icon for the object.""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_00) - args['----'] = aeobj_01 - args["data"] = [x, y] - _reply, args, attrs = finder.send("core", "setd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - return (x,y) - -def _getlocation(object_alias): - """_getlocation: get the location of the icon for the object.""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_00) - args['----'] = aeobj_01 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - pos = args['----'] - return pos.h, pos.v - -def label(object, index=None): - """label: set or get the label of the item. Specify file by name or fsspec.""" - object = Carbon.File.FSRef(object) - object_alias = object.FSNewAliasMinimal() - if index == None: - return _getlabel(object_alias) - if index < 0 or index > 7: - index = 0 - return _setlabel(object_alias, index) - -def _getlabel(object_alias): - """label: Get the label for the object.""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('labi'), fr=aeobj_00) - args['----'] = aeobj_01 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def _setlabel(object_alias, index): - """label: Set the label for the object.""" - finder = _getfinder() - args = {} - attrs = {} - _code = 'core' - _subcode = 'setd' - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="alis", seld=object_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('labi'), fr=aeobj_0) - args['----'] = aeobj_1 - args["data"] = index - _reply, args, attrs = finder.send(_code, _subcode, args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - return index - -def windowview(folder, view=None): - """windowview: Set the view of the window for the folder. Specify file by name or fsspec. - 0 = by icon (default) - 1 = by name - 2 = by button - """ - fsr = Carbon.File.FSRef(folder) - folder_alias = fsr.FSNewAliasMinimal() - if view == None: - return _getwindowview(folder_alias) - return _setwindowview(folder_alias, view) - -def _setwindowview(folder_alias, view=0): - """set the windowview""" - attrs = {} - args = {} - if view == 1: - _v = aetypes.Type('pnam') - elif view == 2: - _v = aetypes.Type('lgbu') - else: - _v = aetypes.Type('iimg') - finder = _getfinder() - aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'), - form = 'alis', seld = folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), - form = 'prop', seld = aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), - form = 'prop', seld = aetypes.Type('pvew'), fr=aeobj_1) - aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), - form = 'prop', seld = _v, fr=None) - _code = 'core' - _subcode = 'setd' - args['----'] = aeobj_2 - args['data'] = aeobj_3 - _reply, args, attrs = finder.send(_code, _subcode, args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def _getwindowview(folder_alias): - """get the windowview""" - attrs = {} - args = {} - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_00) - aeobj_02 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('pvew'), fr=aeobj_01) - args['----'] = aeobj_02 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - views = {'iimg':0, 'pnam':1, 'lgbu':2} - if args.has_key('----'): - return views[args['----'].enum] - -def windowsize(folder, size=None): - """Set the size of a Finder window for folder to size=(w, h), Specify by path. - If size=None, windowsize will return the current size of the window. - Specify file by name or fsspec. - """ - fsr = Carbon.File.FSRef(folder) - folder_alias = fsr.FSNewAliasMinimal() - openwindow(fsr) - if not size: - return _getwindowsize(folder_alias) - return _setwindowsize(folder_alias, size) - -def _setwindowsize(folder_alias, (w, h)): - """Set the size of a Finder window for folder to (w, h)""" - finder = _getfinder() - args = {} - attrs = {} - _code = 'core' - _subcode = 'setd' - aevar00 = [w, h] - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), - form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1) - args['----'] = aeobj_2 - args["data"] = aevar00 - _reply, args, attrs = finder.send(_code, _subcode, args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - return (w, h) - -def _getwindowsize(folder_alias): - """Set the size of a Finder window for folder to (w, h)""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), - form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('posn'), fr=aeobj_1) - args['----'] = aeobj_2 - _reply, args, attrs = finder.send('core', 'getd', args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def windowposition(folder, pos=None): - """Set the position of a Finder window for folder to pos=(w, h).""" - fsr = Carbon.File.FSRef(folder) - folder_alias = fsr.FSNewAliasMinimal() - openwindow(fsr) - if not pos: - return _getwindowposition(folder_alias) - if type(pos) == InstanceType: - # pos might be a QDPoint object as returned by _getwindowposition - pos = (pos.h, pos.v) - return _setwindowposition(folder_alias, pos) - -def _setwindowposition(folder_alias, (x, y)): - """Set the size of a Finder window for folder to (w, h).""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), - form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('posn'), fr=aeobj_1) - args['----'] = aeobj_2 - args["data"] = [x, y] - _reply, args, attrs = finder.send('core', 'setd', args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def _getwindowposition(folder_alias): - """Get the size of a Finder window for folder, Specify by path.""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), - form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1) - args['----'] = aeobj_2 - _reply, args, attrs = finder.send('core', 'getd', args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def icon(object, icondata=None): - """icon sets the icon of object, if no icondata is given, - icon will return an AE object with binary data for the current icon. - If left untouched, this data can be used to paste the icon on another file. - Development opportunity: get and set the data as PICT.""" - fsr = Carbon.File.FSRef(object) - object_alias = fsr.FSNewAliasMinimal() - if icondata == None: - return _geticon(object_alias) - return _seticon(object_alias, icondata) - -def _geticon(object_alias): - """get the icondata for object. Binary data of some sort.""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), - form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00) - args['----'] = aeobj_01 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def _seticon(object_alias, icondata): - """set the icondata for object, formatted as produced by _geticon()""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), - form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), - form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00) - args['----'] = aeobj_01 - args["data"] = icondata - _reply, args, attrs = finder.send("core", "setd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'].data - - -#--------------------------------------------------- -# Volumes and servers. - -def mountvolume(volume, server=None, username=None, password=None): - """mount a volume, local or on a server on AppleTalk. - Note: mounting a ASIP server requires a different operation. - server is the name of the server where the volume belongs - username, password belong to a registered user of the volume.""" - finder = _getfinder() - args = {} - attrs = {} - if password: - args["PASS"] = password - if username: - args["USER"] = username - if server: - args["SRVR"] = server - args['----'] = volume - _reply, args, attrs = finder.send("aevt", "mvol", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def unmountvolume(volume): - """unmount a volume that's on the desktop""" - putaway(volume) - -def putaway(object): - """puth the object away, whereever it came from.""" - finder = _getfinder() - args = {} - attrs = {} - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('cdis'), form="name", seld=object, fr=None) - _reply, args, attrs = talker.send("fndr", "ptwy", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - - -#--------------------------------------------------- -# Miscellaneous functions -# - -def volumelevel(level): - """set the audio output level, parameter between 0 (silent) and 7 (full blast)""" - finder = _getfinder() - args = {} - attrs = {} - if level < 0: - level = 0 - elif level > 7: - level = 7 - args['----'] = level - _reply, args, attrs = finder.send("aevt", "stvl", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def OSversion(): - """return the version of the system software""" - finder = _getfinder() - args = {} - attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('ver2'), fr=None) - args['----'] = aeobj_00 - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - return args['----'] - -def filesharing(): - """return the current status of filesharing and whether it is starting up or not: - -1 file sharing is off and not starting up - 0 file sharing is off and starting up - 1 file sharing is on""" - status = -1 - finder = _getfinder() - # see if it is on - args = {} - attrs = {} - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fshr'), fr=None) - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - if args['----'] == 0: - status = -1 - else: - status = 1 - # is it starting up perchance? - args = {} - attrs = {} - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fsup'), fr=None) - _reply, args, attrs = finder.send("core", "getd", args, attrs) - if args.has_key('errn'): - raise Error, aetools.decodeerror(args) - if args.has_key('----'): - if args['----'] == 1: - status = 0 - return status - -def movetotrash(path): - """move the object to the trash""" - fss = Carbon.File.FSSpec(path) - trashfolder = Carbon.Folder.FSFindFolder(fss.as_tuple()[0], 'trsh', 0) - move(path, trashfolder) - -def emptytrash(): - """empty the trash""" - finder = _getfinder() - args = {} - attrs = {} - args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('trsh'), fr=None) - _reply, args, attrs = finder.send("fndr", "empt", args, attrs) - if args.has_key('errn'): - raise aetools.Error, aetools.decodeerror(args) - - -def _test(): - import EasyDialogs - print 'Original findertools functionality test...' - print 'Testing launch...' - pathname = EasyDialogs.AskFileForOpen('File to launch:') - if pathname: - result = launch(pathname) - if result: - print 'Result: ', result - print 'Press return-', - sys.stdin.readline() - print 'Testing print...' - pathname = EasyDialogs.AskFileForOpen('File to print:') - if pathname: - result = Print(pathname) - if result: - print 'Result: ', result - print 'Press return-', - sys.stdin.readline() - print 'Testing copy...' - pathname = EasyDialogs.AskFileForOpen('File to copy:') - if pathname: - destdir = EasyDialogs.AskFolder('Destination:') - if destdir: - result = copy(pathname, destdir) - if result: - print 'Result:', result - print 'Press return-', - sys.stdin.readline() - print 'Testing move...' - pathname = EasyDialogs.AskFileForOpen('File to move:') - if pathname: - destdir = EasyDialogs.AskFolder('Destination:') - if destdir: - result = move(pathname, destdir) - if result: - print 'Result:', result - print 'Press return-', - sys.stdin.readline() - print 'Testing sleep...' - if EasyDialogs.AskYesNoCancel('Sleep?') > 0: - result = sleep() - if result: - print 'Result:', result - print 'Press return-', - sys.stdin.readline() - print 'Testing shutdown...' - if EasyDialogs.AskYesNoCancel('Shut down?') > 0: - result = shutdown() - if result: - print 'Result:', result - print 'Press return-', - sys.stdin.readline() - print 'Testing restart...' - if EasyDialogs.AskYesNoCancel('Restart?') > 0: - result = restart() - if result: - print 'Result:', result - print 'Press return-', - sys.stdin.readline() - -def _test2(): - print '\nmorefindertools version %s\nTests coming up...' %__version__ - import os - import random - - # miscellaneous - print '\tfilesharing on?', filesharing() # is file sharing on, off, starting up? - print '\tOS version', OSversion() # the version of the system software - - # set the soundvolume in a simple way - print '\tSystem beep volume' - for i in range(0, 7): - volumelevel(i) - MacOS.SysBeep() - - # Finder's windows, file location, file attributes - open("@findertoolstest", "w") - f = "@findertoolstest" - reveal(f) # reveal this file in a Finder window - select(f) # select this file - - base, file = os.path.split(f) - closewindow(base) # close the window this file is in (opened by reveal) - openwindow(base) # open it again - windowview(base, 1) # set the view by list - - label(f, 2) # set the label of this file to something orange - print '\tlabel', label(f) # get the label of this file - - # the file location only works in a window with icon view! - print 'Random locations for an icon' - windowview(base, 0) # set the view by icon - windowsize(base, (600, 600)) - for i in range(50): - location(f, (random.randint(10, 590), random.randint(10, 590))) - - windowsize(base, (200, 400)) - windowview(base, 1) # set the view by icon - - orgpos = windowposition(base) - print 'Animated window location' - for i in range(10): - pos = (100+i*10, 100+i*10) - windowposition(base, pos) - print '\twindow position', pos - windowposition(base, orgpos) # park it where it was before - - print 'Put a comment in file', f, ':' - print '\t', comment(f) # print the Finder comment this file has - s = 'This is a comment no one reads!' - comment(f, s) # set the Finder comment - -def _test3(): - print 'MacOS9 or better specific functions' - # processes - pr = processes() # return a list of tuples with (active_processname, creatorcode) - print 'Return a list of current active processes:' - for p in pr: - print '\t', p - - # get attributes of the first process in the list - print 'Attributes of the first process in the list:' - pinfo = processinfo(pr[0][0]) - print '\t', pr[0][0] - print '\t\tmemory partition', pinfo.partition # the memory allocated to this process - print '\t\tmemory used', pinfo.used # the memory actuall used by this process - print '\t\tis visible', pinfo.visible # is the process visible to the user - print '\t\tis frontmost', pinfo.frontmost # is the process the front most one? - print '\t\thas scripting', pinfo.hasscripting # is the process scriptable? - print '\t\taccepts high level events', pinfo.accepthighlevel # does the process accept high level appleevents? - -if __name__ == '__main__': - _test() - _test2() - _test3() diff --git a/sys/lib/python/plat-mac/gensuitemodule.py b/sys/lib/python/plat-mac/gensuitemodule.py deleted file mode 100644 index 87132c57f..000000000 --- a/sys/lib/python/plat-mac/gensuitemodule.py +++ /dev/null @@ -1,1213 +0,0 @@ -""" -gensuitemodule - Generate an AE suite module from an aete/aeut resource - -Based on aete.py. - -Reading and understanding this code is left as an exercise to the reader. -""" - -import MacOS -import EasyDialogs -import os -import string -import sys -import types -import StringIO -import keyword -import macresource -import aetools -import distutils.sysconfig -import OSATerminology -from Carbon.Res import * -import Carbon.Folder -import MacOS -import getopt -import plistlib - -_MAC_LIB_FOLDER=os.path.dirname(aetools.__file__) -DEFAULT_STANDARD_PACKAGEFOLDER=os.path.join(_MAC_LIB_FOLDER, 'lib-scriptpackages') -DEFAULT_USER_PACKAGEFOLDER=distutils.sysconfig.get_python_lib() - -def usage(): - sys.stderr.write("Usage: %s [opts] application-or-resource-file\n" % sys.argv[0]) - sys.stderr.write("""Options: ---output pkgdir Pathname of the output package (short: -o) ---resource Parse resource file in stead of launching application (-r) ---base package Use another base package in stead of default StdSuites (-b) ---edit old=new Edit suite names, use empty new to skip a suite (-e) ---creator code Set creator code for package (-c) ---dump Dump aete resource to stdout in stead of creating module (-d) ---verbose Tell us what happens (-v) -""") - sys.exit(1) - -def main(): - if len(sys.argv) > 1: - SHORTOPTS = "rb:o:e:c:dv" - LONGOPTS = ("resource", "base=", "output=", "edit=", "creator=", "dump", "verbose") - try: - opts, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) - except getopt.GetoptError: - usage() - - process_func = processfile - basepkgname = 'StdSuites' - output = None - edit_modnames = [] - creatorsignature = None - dump = None - verbose = None - - for o, a in opts: - if o in ('-r', '--resource'): - process_func = processfile_fromresource - if o in ('-b', '--base'): - basepkgname = a - if o in ('-o', '--output'): - output = a - if o in ('-e', '--edit'): - split = a.split('=') - if len(split) != 2: - usage() - edit_modnames.append(split) - if o in ('-c', '--creator'): - if len(a) != 4: - sys.stderr.write("creator must be 4-char string\n") - sys.exit(1) - creatorsignature = a - if o in ('-d', '--dump'): - dump = sys.stdout - if o in ('-v', '--verbose'): - verbose = sys.stderr - - - if output and len(args) > 1: - sys.stderr.write("%s: cannot specify --output with multiple inputs\n" % sys.argv[0]) - sys.exit(1) - - for filename in args: - process_func(filename, output=output, basepkgname=basepkgname, - edit_modnames=edit_modnames, creatorsignature=creatorsignature, - dump=dump, verbose=verbose) - else: - main_interactive() - -def main_interactive(interact=0, basepkgname='StdSuites'): - if interact: - # Ask for save-filename for each module - edit_modnames = None - else: - # Use default filenames for each module - edit_modnames = [] - appsfolder = Carbon.Folder.FSFindFolder(-32765, 'apps', 0) - filename = EasyDialogs.AskFileForOpen( - message='Select scriptable application', - dialogOptionFlags=0x1056, # allow selection of .app bundles - defaultLocation=appsfolder) - if not filename: - return - if not is_scriptable(filename): - if EasyDialogs.AskYesNoCancel( - "Warning: application does not seem scriptable", - yes="Continue", default=2, no="") <= 0: - return - try: - processfile(filename, edit_modnames=edit_modnames, basepkgname=basepkgname, - verbose=sys.stderr) - except MacOS.Error, arg: - print "Error getting terminology:", arg - print "Retry, manually parsing resources" - processfile_fromresource(filename, edit_modnames=edit_modnames, - basepkgname=basepkgname, verbose=sys.stderr) - -def is_scriptable(application): - """Return true if the application is scriptable""" - if os.path.isdir(application): - plistfile = os.path.join(application, 'Contents', 'Info.plist') - if not os.path.exists(plistfile): - return False - plist = plistlib.Plist.fromFile(plistfile) - return plist.get('NSAppleScriptEnabled', False) - # If it is a file test for an aete/aeut resource. - currf = CurResFile() - try: - refno = macresource.open_pathname(application) - except MacOS.Error: - return False - UseResFile(refno) - n_terminology = Count1Resources('aete') + Count1Resources('aeut') + \ - Count1Resources('scsz') + Count1Resources('osiz') - CloseResFile(refno) - UseResFile(currf) - return n_terminology > 0 - -def processfile_fromresource(fullname, output=None, basepkgname=None, - edit_modnames=None, creatorsignature=None, dump=None, verbose=None): - """Process all resources in a single file""" - if not is_scriptable(fullname) and verbose: - print >>verbose, "Warning: app does not seem scriptable: %s" % fullname - cur = CurResFile() - if verbose: - print >>verbose, "Processing", fullname - rf = macresource.open_pathname(fullname) - try: - UseResFile(rf) - resources = [] - for i in range(Count1Resources('aete')): - res = Get1IndResource('aete', 1+i) - resources.append(res) - for i in range(Count1Resources('aeut')): - res = Get1IndResource('aeut', 1+i) - resources.append(res) - if verbose: - print >>verbose, "\nLISTING aete+aeut RESOURCES IN", repr(fullname) - aetelist = [] - for res in resources: - if verbose: - print >>verbose, "decoding", res.GetResInfo(), "..." - data = res.data - aete = decode(data, verbose) - aetelist.append((aete, res.GetResInfo())) - finally: - if rf <> cur: - CloseResFile(rf) - UseResFile(cur) - # switch back (needed for dialogs in Python) - UseResFile(cur) - if dump: - dumpaetelist(aetelist, dump) - compileaetelist(aetelist, fullname, output=output, - basepkgname=basepkgname, edit_modnames=edit_modnames, - creatorsignature=creatorsignature, verbose=verbose) - -def processfile(fullname, output=None, basepkgname=None, - edit_modnames=None, creatorsignature=None, dump=None, - verbose=None): - """Ask an application for its terminology and process that""" - if not is_scriptable(fullname) and verbose: - print >>verbose, "Warning: app does not seem scriptable: %s" % fullname - if verbose: - print >>verbose, "\nASKING FOR aete DICTIONARY IN", repr(fullname) - try: - aedescobj, launched = OSATerminology.GetAppTerminology(fullname) - except MacOS.Error, arg: - if arg[0] in (-1701, -192): # errAEDescNotFound, resNotFound - if verbose: - print >>verbose, "GetAppTerminology failed with errAEDescNotFound/resNotFound, trying manually" - aedata, sig = getappterminology(fullname, verbose=verbose) - if not creatorsignature: - creatorsignature = sig - else: - raise - else: - if launched: - if verbose: - print >>verbose, "Launched", fullname - raw = aetools.unpack(aedescobj) - if not raw: - if verbose: - print >>verbose, 'Unpack returned empty value:', raw - return - if not raw[0].data: - if verbose: - print >>verbose, 'Unpack returned value without data:', raw - return - aedata = raw[0] - aete = decode(aedata.data, verbose) - if dump: - dumpaetelist([aete], dump) - return - compileaete(aete, None, fullname, output=output, basepkgname=basepkgname, - creatorsignature=creatorsignature, edit_modnames=edit_modnames, - verbose=verbose) - -def getappterminology(fullname, verbose=None): - """Get application terminology by sending an AppleEvent""" - # First check that we actually can send AppleEvents - if not MacOS.WMAvailable(): - raise RuntimeError, "Cannot send AppleEvents, no access to window manager" - # Next, a workaround for a bug in MacOS 10.2: sending events will hang unless - # you have created an event loop first. - import Carbon.Evt - Carbon.Evt.WaitNextEvent(0,0) - if os.path.isdir(fullname): - # Now get the signature of the application, hoping it is a bundle - pkginfo = os.path.join(fullname, 'Contents', 'PkgInfo') - if not os.path.exists(pkginfo): - raise RuntimeError, "No PkgInfo file found" - tp_cr = open(pkginfo, 'rb').read() - cr = tp_cr[4:8] - else: - # Assume it is a file - cr, tp = MacOS.GetCreatorAndType(fullname) - # Let's talk to it and ask for its AETE - talker = aetools.TalkTo(cr) - try: - talker._start() - except (MacOS.Error, aetools.Error), arg: - if verbose: - print >>verbose, 'Warning: start() failed, continuing anyway:', arg - reply = talker.send("ascr", "gdte") - #reply2 = talker.send("ascr", "gdut") - # Now pick the bits out of the return that we need. - return reply[1]['----'], cr - - -def compileaetelist(aetelist, fullname, output=None, basepkgname=None, - edit_modnames=None, creatorsignature=None, verbose=None): - for aete, resinfo in aetelist: - compileaete(aete, resinfo, fullname, output=output, - basepkgname=basepkgname, edit_modnames=edit_modnames, - creatorsignature=creatorsignature, verbose=verbose) - -def dumpaetelist(aetelist, output): - import pprint - pprint.pprint(aetelist, output) - -def decode(data, verbose=None): - """Decode a resource into a python data structure""" - f = StringIO.StringIO(data) - aete = generic(getaete, f) - aete = simplify(aete) - processed = f.tell() - unprocessed = len(f.read()) - total = f.tell() - if unprocessed and verbose: - verbose.write("%d processed + %d unprocessed = %d total\n" % - (processed, unprocessed, total)) - return aete - -def simplify(item): - """Recursively replace singleton tuples by their constituent item""" - if type(item) is types.ListType: - return map(simplify, item) - elif type(item) == types.TupleType and len(item) == 2: - return simplify(item[1]) - else: - return item - - -# Here follows the aete resource decoder. -# It is presented bottom-up instead of top-down because there are direct -# references to the lower-level part-decoders from the high-level part-decoders. - -def getbyte(f, *args): - c = f.read(1) - if not c: - raise EOFError, 'in getbyte' + str(args) - return ord(c) - -def getword(f, *args): - getalign(f) - s = f.read(2) - if len(s) < 2: - raise EOFError, 'in getword' + str(args) - return (ord(s[0])<<8) | ord(s[1]) - -def getlong(f, *args): - getalign(f) - s = f.read(4) - if len(s) < 4: - raise EOFError, 'in getlong' + str(args) - return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3]) - -def getostype(f, *args): - getalign(f) - s = f.read(4) - if len(s) < 4: - raise EOFError, 'in getostype' + str(args) - return s - -def getpstr(f, *args): - c = f.read(1) - if len(c) < 1: - raise EOFError, 'in getpstr[1]' + str(args) - nbytes = ord(c) - if nbytes == 0: return '' - s = f.read(nbytes) - if len(s) < nbytes: - raise EOFError, 'in getpstr[2]' + str(args) - return s - -def getalign(f): - if f.tell() & 1: - c = f.read(1) - ##if c <> '\0': - ## print align:', repr(c) - -def getlist(f, description, getitem): - count = getword(f) - list = [] - for i in range(count): - list.append(generic(getitem, f)) - getalign(f) - return list - -def alt_generic(what, f, *args): - print "generic", repr(what), args - res = vageneric(what, f, args) - print '->', repr(res) - return res - -def generic(what, f, *args): - if type(what) == types.FunctionType: - return apply(what, (f,) + args) - if type(what) == types.ListType: - record = [] - for thing in what: - item = apply(generic, thing[:1] + (f,) + thing[1:]) - record.append((thing[1], item)) - return record - return "BAD GENERIC ARGS: %r" % (what,) - -getdata = [ - (getostype, "type"), - (getpstr, "description"), - (getword, "flags") - ] -getargument = [ - (getpstr, "name"), - (getostype, "keyword"), - (getdata, "what") - ] -getevent = [ - (getpstr, "name"), - (getpstr, "description"), - (getostype, "suite code"), - (getostype, "event code"), - (getdata, "returns"), - (getdata, "accepts"), - (getlist, "optional arguments", getargument) - ] -getproperty = [ - (getpstr, "name"), - (getostype, "code"), - (getdata, "what") - ] -getelement = [ - (getostype, "type"), - (getlist, "keyform", getostype) - ] -getclass = [ - (getpstr, "name"), - (getostype, "class code"), - (getpstr, "description"), - (getlist, "properties", getproperty), - (getlist, "elements", getelement) - ] -getcomparison = [ - (getpstr, "operator name"), - (getostype, "operator ID"), - (getpstr, "operator comment"), - ] -getenumerator = [ - (getpstr, "enumerator name"), - (getostype, "enumerator ID"), - (getpstr, "enumerator comment") - ] -getenumeration = [ - (getostype, "enumeration ID"), - (getlist, "enumerator", getenumerator) - ] -getsuite = [ - (getpstr, "suite name"), - (getpstr, "suite description"), - (getostype, "suite ID"), - (getword, "suite level"), - (getword, "suite version"), - (getlist, "events", getevent), - (getlist, "classes", getclass), - (getlist, "comparisons", getcomparison), - (getlist, "enumerations", getenumeration) - ] -getaete = [ - (getword, "major/minor version in BCD"), - (getword, "language code"), - (getword, "script code"), - (getlist, "suites", getsuite) - ] - -def compileaete(aete, resinfo, fname, output=None, basepkgname=None, - edit_modnames=None, creatorsignature=None, verbose=None): - """Generate code for a full aete resource. fname passed for doc purposes""" - [version, language, script, suites] = aete - major, minor = divmod(version, 256) - if not creatorsignature: - creatorsignature, dummy = MacOS.GetCreatorAndType(fname) - packagename = identify(os.path.splitext(os.path.basename(fname))[0]) - if language: - packagename = packagename+'_lang%d'%language - if script: - packagename = packagename+'_script%d'%script - if len(packagename) > 27: - packagename = packagename[:27] - if output: - # XXXX Put this in site-packages if it isn't a full pathname? - if not os.path.exists(output): - os.mkdir(output) - pathname = output - else: - pathname = EasyDialogs.AskFolder(message='Create and select package folder for %s'%packagename, - defaultLocation=DEFAULT_USER_PACKAGEFOLDER) - output = pathname - if not pathname: - return - packagename = os.path.split(os.path.normpath(pathname))[1] - if not basepkgname: - basepkgname = EasyDialogs.AskFolder(message='Package folder for base suite (usually StdSuites)', - defaultLocation=DEFAULT_STANDARD_PACKAGEFOLDER) - if basepkgname: - dirname, basepkgname = os.path.split(os.path.normpath(basepkgname)) - if dirname and not dirname in sys.path: - sys.path.insert(0, dirname) - basepackage = __import__(basepkgname) - else: - basepackage = None - suitelist = [] - allprecompinfo = [] - allsuites = [] - for suite in suites: - compiler = SuiteCompiler(suite, basepackage, output, edit_modnames, verbose) - code, modname, precompinfo = compiler.precompilesuite() - if not code: - continue - allprecompinfo = allprecompinfo + precompinfo - suiteinfo = suite, pathname, modname - suitelist.append((code, modname)) - allsuites.append(compiler) - for compiler in allsuites: - compiler.compilesuite(major, minor, language, script, fname, allprecompinfo) - initfilename = os.path.join(output, '__init__.py') - fp = open(initfilename, 'w') - MacOS.SetCreatorAndType(initfilename, 'Pyth', 'TEXT') - fp.write('"""\n') - fp.write("Package generated from %s\n"%ascii(fname)) - if resinfo: - fp.write("Resource %s resid %d %s\n"%(ascii(resinfo[1]), resinfo[0], ascii(resinfo[2]))) - fp.write('"""\n') - fp.write('import aetools\n') - fp.write('Error = aetools.Error\n') - suitelist.sort() - for code, modname in suitelist: - fp.write("import %s\n" % modname) - fp.write("\n\n_code_to_module = {\n") - for code, modname in suitelist: - fp.write(" '%s' : %s,\n"%(ascii(code), modname)) - fp.write("}\n\n") - fp.write("\n\n_code_to_fullname = {\n") - for code, modname in suitelist: - fp.write(" '%s' : ('%s.%s', '%s'),\n"%(ascii(code), packagename, modname, modname)) - fp.write("}\n\n") - for code, modname in suitelist: - fp.write("from %s import *\n"%modname) - - # Generate property dicts and element dicts for all types declared in this module - fp.write("\ndef getbaseclasses(v):\n") - fp.write(" if not getattr(v, '_propdict', None):\n") - fp.write(" v._propdict = {}\n") - fp.write(" v._elemdict = {}\n") - fp.write(" for superclassname in getattr(v, '_superclassnames', []):\n") - fp.write(" superclass = eval(superclassname)\n") - fp.write(" getbaseclasses(superclass)\n") - fp.write(" v._propdict.update(getattr(superclass, '_propdict', {}))\n") - fp.write(" v._elemdict.update(getattr(superclass, '_elemdict', {}))\n") - fp.write(" v._propdict.update(getattr(v, '_privpropdict', {}))\n") - fp.write(" v._elemdict.update(getattr(v, '_privelemdict', {}))\n") - fp.write("\n") - fp.write("import StdSuites\n") - allprecompinfo.sort() - if allprecompinfo: - fp.write("\n#\n# Set property and element dictionaries now that all classes have been defined\n#\n") - for codenamemapper in allprecompinfo: - for k, v in codenamemapper.getall('class'): - fp.write("getbaseclasses(%s)\n" % v) - - # Generate a code-to-name mapper for all of the types (classes) declared in this module - application_class = None - if allprecompinfo: - fp.write("\n#\n# Indices of types declared in this module\n#\n") - fp.write("_classdeclarations = {\n") - for codenamemapper in allprecompinfo: - for k, v in codenamemapper.getall('class'): - fp.write(" %r : %s,\n" % (k, v)) - if k == 'capp': - application_class = v - fp.write("}\n") - - - if suitelist: - fp.write("\n\nclass %s(%s_Events"%(packagename, suitelist[0][1])) - for code, modname in suitelist[1:]: - fp.write(",\n %s_Events"%modname) - fp.write(",\n aetools.TalkTo):\n") - fp.write(" _signature = %r\n\n"%(creatorsignature,)) - fp.write(" _moduleName = '%s'\n\n"%packagename) - if application_class: - fp.write(" _elemdict = %s._elemdict\n" % application_class) - fp.write(" _propdict = %s._propdict\n" % application_class) - fp.close() - -class SuiteCompiler: - def __init__(self, suite, basepackage, output, edit_modnames, verbose): - self.suite = suite - self.basepackage = basepackage - self.edit_modnames = edit_modnames - self.output = output - self.verbose = verbose - - # Set by precompilesuite - self.pathname = None - self.modname = None - - # Set by compilesuite - self.fp = None - self.basemodule = None - self.enumsneeded = {} - - def precompilesuite(self): - """Parse a single suite without generating the output. This step is needed - so we can resolve recursive references by suites to enums/comps/etc declared - in other suites""" - [name, desc, code, level, version, events, classes, comps, enums] = self.suite - - modname = identify(name) - if len(modname) > 28: - modname = modname[:27] - if self.edit_modnames is None: - self.pathname = EasyDialogs.AskFileForSave(message='Python output file', - savedFileName=modname+'.py') - else: - for old, new in self.edit_modnames: - if old == modname: - modname = new - if modname: - self.pathname = os.path.join(self.output, modname + '.py') - else: - self.pathname = None - if not self.pathname: - return None, None, None - - self.modname = os.path.splitext(os.path.split(self.pathname)[1])[0] - - if self.basepackage and self.basepackage._code_to_module.has_key(code): - # We are an extension of a baseclass (usually an application extending - # Standard_Suite or so). Import everything from our base module - basemodule = self.basepackage._code_to_module[code] - else: - # We are not an extension. - basemodule = None - - self.enumsneeded = {} - for event in events: - self.findenumsinevent(event) - - objc = ObjectCompiler(None, self.modname, basemodule, interact=(self.edit_modnames is None), - verbose=self.verbose) - for cls in classes: - objc.compileclass(cls) - for cls in classes: - objc.fillclasspropsandelems(cls) - for comp in comps: - objc.compilecomparison(comp) - for enum in enums: - objc.compileenumeration(enum) - - for enum in self.enumsneeded.keys(): - objc.checkforenum(enum) - - objc.dumpindex() - - precompinfo = objc.getprecompinfo(self.modname) - - return code, self.modname, precompinfo - - def compilesuite(self, major, minor, language, script, fname, precompinfo): - """Generate code for a single suite""" - [name, desc, code, level, version, events, classes, comps, enums] = self.suite - # Sort various lists, so re-generated source is easier compared - def class_sorter(k1, k2): - """Sort classes by code, and make sure main class sorts before synonyms""" - # [name, code, desc, properties, elements] = cls - if k1[1] < k2[1]: return -1 - if k1[1] > k2[1]: return 1 - if not k2[3] or k2[3][0][1] == 'c@#!': - # This is a synonym, the other one is better - return -1 - if not k1[3] or k1[3][0][1] == 'c@#!': - # This is a synonym, the other one is better - return 1 - return 0 - - events.sort() - classes.sort(class_sorter) - comps.sort() - enums.sort() - - self.fp = fp = open(self.pathname, 'w') - MacOS.SetCreatorAndType(self.pathname, 'Pyth', 'TEXT') - - fp.write('"""Suite %s: %s\n' % (ascii(name), ascii(desc))) - fp.write("Level %d, version %d\n\n" % (level, version)) - fp.write("Generated from %s\n"%ascii(fname)) - fp.write("AETE/AEUT resource version %d/%d, language %d, script %d\n" % \ - (major, minor, language, script)) - fp.write('"""\n\n') - - fp.write('import aetools\n') - fp.write('import MacOS\n\n') - fp.write("_code = %r\n\n"% (code,)) - if self.basepackage and self.basepackage._code_to_module.has_key(code): - # We are an extension of a baseclass (usually an application extending - # Standard_Suite or so). Import everything from our base module - fp.write('from %s import *\n'%self.basepackage._code_to_fullname[code][0]) - basemodule = self.basepackage._code_to_module[code] - elif self.basepackage and self.basepackage._code_to_module.has_key(code.lower()): - # This is needed by CodeWarrior and some others. - fp.write('from %s import *\n'%self.basepackage._code_to_fullname[code.lower()][0]) - basemodule = self.basepackage._code_to_module[code.lower()] - else: - # We are not an extension. - basemodule = None - self.basemodule = basemodule - self.compileclassheader() - - self.enumsneeded = {} - if events: - for event in events: - self.compileevent(event) - else: - fp.write(" pass\n\n") - - objc = ObjectCompiler(fp, self.modname, basemodule, precompinfo, interact=(self.edit_modnames is None), - verbose=self.verbose) - for cls in classes: - objc.compileclass(cls) - for cls in classes: - objc.fillclasspropsandelems(cls) - for comp in comps: - objc.compilecomparison(comp) - for enum in enums: - objc.compileenumeration(enum) - - for enum in self.enumsneeded.keys(): - objc.checkforenum(enum) - - objc.dumpindex() - - def compileclassheader(self): - """Generate class boilerplate""" - classname = '%s_Events'%self.modname - if self.basemodule: - modshortname = string.split(self.basemodule.__name__, '.')[-1] - baseclassname = '%s_Events'%modshortname - self.fp.write("class %s(%s):\n\n"%(classname, baseclassname)) - else: - self.fp.write("class %s:\n\n"%classname) - - def compileevent(self, event): - """Generate code for a single event""" - [name, desc, code, subcode, returns, accepts, arguments] = event - fp = self.fp - funcname = identify(name) - # - # generate name->keyword map - # - if arguments: - fp.write(" _argmap_%s = {\n"%funcname) - for a in arguments: - fp.write(" %r : %r,\n"%(identify(a[0]), a[1])) - fp.write(" }\n\n") - - # - # Generate function header - # - has_arg = (not is_null(accepts)) - opt_arg = (has_arg and is_optional(accepts)) - - fp.write(" def %s(self, "%funcname) - if has_arg: - if not opt_arg: - fp.write("_object, ") # Include direct object, if it has one - else: - fp.write("_object=None, ") # Also include if it is optional - else: - fp.write("_no_object=None, ") # For argument checking - fp.write("_attributes={}, **_arguments):\n") # include attribute dict and args - # - # Generate doc string (important, since it may be the only - # available documentation, due to our name-remaping) - # - fp.write(' """%s: %s\n'%(ascii(name), ascii(desc))) - if has_arg: - fp.write(" Required argument: %s\n"%getdatadoc(accepts)) - elif opt_arg: - fp.write(" Optional argument: %s\n"%getdatadoc(accepts)) - for arg in arguments: - fp.write(" Keyword argument %s: %s\n"%(identify(arg[0]), - getdatadoc(arg[2]))) - fp.write(" Keyword argument _attributes: AppleEvent attribute dictionary\n") - if not is_null(returns): - fp.write(" Returns: %s\n"%getdatadoc(returns)) - fp.write(' """\n') - # - # Fiddle the args so everything ends up in 'arguments' dictionary - # - fp.write(" _code = %r\n"% (code,)) - fp.write(" _subcode = %r\n\n"% (subcode,)) - # - # Do keyword name substitution - # - if arguments: - fp.write(" aetools.keysubst(_arguments, self._argmap_%s)\n"%funcname) - else: - fp.write(" if _arguments: raise TypeError, 'No optional args expected'\n") - # - # Stuff required arg (if there is one) into arguments - # - if has_arg: - fp.write(" _arguments['----'] = _object\n") - elif opt_arg: - fp.write(" if _object:\n") - fp.write(" _arguments['----'] = _object\n") - else: - fp.write(" if _no_object != None: raise TypeError, 'No direct arg expected'\n") - fp.write("\n") - # - # Do enum-name substitution - # - for a in arguments: - if is_enum(a[2]): - kname = a[1] - ename = a[2][0] - if ename <> '****': - fp.write(" aetools.enumsubst(_arguments, %r, _Enum_%s)\n" % - (kname, identify(ename))) - self.enumsneeded[ename] = 1 - fp.write("\n") - # - # Do the transaction - # - fp.write(" _reply, _arguments, _attributes = self.send(_code, _subcode,\n") - fp.write(" _arguments, _attributes)\n") - # - # Error handling - # - fp.write(" if _arguments.get('errn', 0):\n") - fp.write(" raise aetools.Error, aetools.decodeerror(_arguments)\n") - fp.write(" # XXXX Optionally decode result\n") - # - # Decode result - # - fp.write(" if _arguments.has_key('----'):\n") - if is_enum(returns): - fp.write(" # XXXX Should do enum remapping here...\n") - fp.write(" return _arguments['----']\n") - fp.write("\n") - - def findenumsinevent(self, event): - """Find all enums for a single event""" - [name, desc, code, subcode, returns, accepts, arguments] = event - for a in arguments: - if is_enum(a[2]): - ename = a[2][0] - if ename <> '****': - self.enumsneeded[ename] = 1 - -# -# This class stores the code<->name translations for a single module. It is used -# to keep the information while we're compiling the module, but we also keep these objects -# around so if one suite refers to, say, an enum in another suite we know where to -# find it. Finally, if we really can't find a code, the user can add modules by -# hand. -# -class CodeNameMapper: - - def __init__(self, interact=1, verbose=None): - self.code2name = { - "property" : {}, - "class" : {}, - "enum" : {}, - "comparison" : {}, - } - self.name2code = { - "property" : {}, - "class" : {}, - "enum" : {}, - "comparison" : {}, - } - self.modulename = None - self.star_imported = 0 - self.can_interact = interact - self.verbose = verbose - - def addnamecode(self, type, name, code): - self.name2code[type][name] = code - if not self.code2name[type].has_key(code): - self.code2name[type][code] = name - - def hasname(self, name): - for dict in self.name2code.values(): - if dict.has_key(name): - return True - return False - - def hascode(self, type, code): - return self.code2name[type].has_key(code) - - def findcodename(self, type, code): - if not self.hascode(type, code): - return None, None, None - name = self.code2name[type][code] - if self.modulename and not self.star_imported: - qualname = '%s.%s'%(self.modulename, name) - else: - qualname = name - return name, qualname, self.modulename - - def getall(self, type): - return self.code2name[type].items() - - def addmodule(self, module, name, star_imported): - self.modulename = name - self.star_imported = star_imported - for code, name in module._propdeclarations.items(): - self.addnamecode('property', name, code) - for code, name in module._classdeclarations.items(): - self.addnamecode('class', name, code) - for code in module._enumdeclarations.keys(): - self.addnamecode('enum', '_Enum_'+identify(code), code) - for code, name in module._compdeclarations.items(): - self.addnamecode('comparison', name, code) - - def prepareforexport(self, name=None): - if not self.modulename: - self.modulename = name - return self - -class ObjectCompiler: - def __init__(self, fp, modname, basesuite, othernamemappers=None, interact=1, - verbose=None): - self.fp = fp - self.verbose = verbose - self.basesuite = basesuite - self.can_interact = interact - self.modulename = modname - self.namemappers = [CodeNameMapper(self.can_interact, self.verbose)] - if othernamemappers: - self.othernamemappers = othernamemappers[:] - else: - self.othernamemappers = [] - if basesuite: - basemapper = CodeNameMapper(self.can_interact, self.verbose) - basemapper.addmodule(basesuite, '', 1) - self.namemappers.append(basemapper) - - def getprecompinfo(self, modname): - list = [] - for mapper in self.namemappers: - emapper = mapper.prepareforexport(modname) - if emapper: - list.append(emapper) - return list - - def findcodename(self, type, code): - while 1: - # First try: check whether we already know about this code. - for mapper in self.namemappers: - if mapper.hascode(type, code): - return mapper.findcodename(type, code) - # Second try: maybe one of the other modules knows about it. - for mapper in self.othernamemappers: - if mapper.hascode(type, code): - self.othernamemappers.remove(mapper) - self.namemappers.append(mapper) - if self.fp: - self.fp.write("import %s\n"%mapper.modulename) - break - else: - # If all this has failed we ask the user for a guess on where it could - # be and retry. - if self.fp: - m = self.askdefinitionmodule(type, code) - else: - m = None - if not m: return None, None, None - mapper = CodeNameMapper(self.can_interact, self.verbose) - mapper.addmodule(m, m.__name__, 0) - self.namemappers.append(mapper) - - def hasname(self, name): - for mapper in self.othernamemappers: - if mapper.hasname(name) and mapper.modulename != self.modulename: - if self.verbose: - print >>self.verbose, "Duplicate Python identifier:", name, self.modulename, mapper.modulename - return True - return False - - def askdefinitionmodule(self, type, code): - if not self.can_interact: - if self.verbose: - print >>self.verbose, "** No definition for %s '%s' found" % (type, code) - return None - path = EasyDialogs.AskFileForSave(message='Where is %s %s declared?'%(type, code)) - if not path: return - path, file = os.path.split(path) - modname = os.path.splitext(file)[0] - if not path in sys.path: - sys.path.insert(0, path) - m = __import__(modname) - self.fp.write("import %s\n"%modname) - return m - - def compileclass(self, cls): - [name, code, desc, properties, elements] = cls - pname = identify(name) - if self.namemappers[0].hascode('class', code): - # plural forms and such - othername, dummy, dummy = self.namemappers[0].findcodename('class', code) - if self.fp: - self.fp.write("\n%s = %s\n"%(pname, othername)) - else: - if self.fp: - self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) - self.fp.write(' """%s - %s """\n' % (ascii(name), ascii(desc))) - self.fp.write(' want = %r\n' % (code,)) - self.namemappers[0].addnamecode('class', pname, code) - is_application_class = (code == 'capp') - properties.sort() - for prop in properties: - self.compileproperty(prop, is_application_class) - elements.sort() - for elem in elements: - self.compileelement(elem) - - def compileproperty(self, prop, is_application_class=False): - [name, code, what] = prop - if code == 'c@#!': - # Something silly with plurals. Skip it. - return - pname = identify(name) - if self.namemappers[0].hascode('property', code): - # plural forms and such - othername, dummy, dummy = self.namemappers[0].findcodename('property', code) - if pname == othername: - return - if self.fp: - self.fp.write("\n_Prop_%s = _Prop_%s\n"%(pname, othername)) - else: - if self.fp: - self.fp.write("class _Prop_%s(aetools.NProperty):\n" % pname) - self.fp.write(' """%s - %s """\n' % (ascii(name), ascii(what[1]))) - self.fp.write(" which = %r\n" % (code,)) - self.fp.write(" want = %r\n" % (what[0],)) - self.namemappers[0].addnamecode('property', pname, code) - if is_application_class and self.fp: - self.fp.write("%s = _Prop_%s()\n" % (pname, pname)) - - def compileelement(self, elem): - [code, keyform] = elem - if self.fp: - self.fp.write("# element %r as %s\n" % (code, keyform)) - - def fillclasspropsandelems(self, cls): - [name, code, desc, properties, elements] = cls - cname = identify(name) - if self.namemappers[0].hascode('class', code) and \ - self.namemappers[0].findcodename('class', code)[0] != cname: - # This is an other name (plural or so) for something else. Skip. - if self.fp and (elements or len(properties) > 1 or (len(properties) == 1 and - properties[0][1] != 'c@#!')): - if self.verbose: - print >>self.verbose, '** Skip multiple %s of %s (code %r)' % (cname, self.namemappers[0].findcodename('class', code)[0], code) - raise RuntimeError, "About to skip non-empty class" - return - plist = [] - elist = [] - superclasses = [] - for prop in properties: - [pname, pcode, what] = prop - if pcode == "c@#^": - superclasses.append(what) - if pcode == 'c@#!': - continue - pname = identify(pname) - plist.append(pname) - - superclassnames = [] - for superclass in superclasses: - superId, superDesc, dummy = superclass - superclassname, fullyqualifiedname, module = self.findcodename("class", superId) - # I don't think this is correct: - if superclassname == cname: - pass # superclassnames.append(fullyqualifiedname) - else: - superclassnames.append(superclassname) - - if self.fp: - self.fp.write("%s._superclassnames = %r\n"%(cname, superclassnames)) - - for elem in elements: - [ecode, keyform] = elem - if ecode == 'c@#!': - continue - name, ename, module = self.findcodename('class', ecode) - if not name: - if self.fp: - self.fp.write("# XXXX %s element %r not found!!\n"%(cname, ecode)) - else: - elist.append((name, ename)) - - plist.sort() - elist.sort() - - if self.fp: - self.fp.write("%s._privpropdict = {\n"%cname) - for n in plist: - self.fp.write(" '%s' : _Prop_%s,\n"%(n, n)) - self.fp.write("}\n") - self.fp.write("%s._privelemdict = {\n"%cname) - for n, fulln in elist: - self.fp.write(" '%s' : %s,\n"%(n, fulln)) - self.fp.write("}\n") - - def compilecomparison(self, comp): - [name, code, comment] = comp - iname = identify(name) - self.namemappers[0].addnamecode('comparison', iname, code) - if self.fp: - self.fp.write("class %s(aetools.NComparison):\n" % iname) - self.fp.write(' """%s - %s """\n' % (ascii(name), ascii(comment))) - - def compileenumeration(self, enum): - [code, items] = enum - name = "_Enum_%s" % identify(code) - if self.fp: - self.fp.write("%s = {\n" % name) - for item in items: - self.compileenumerator(item) - self.fp.write("}\n\n") - self.namemappers[0].addnamecode('enum', name, code) - return code - - def compileenumerator(self, item): - [name, code, desc] = item - self.fp.write(" %r : %r,\t# %s\n" % (identify(name), code, ascii(desc))) - - def checkforenum(self, enum): - """This enum code is used by an event. Make sure it's available""" - name, fullname, module = self.findcodename('enum', enum) - if not name: - if self.fp: - self.fp.write("_Enum_%s = None # XXXX enum %s not found!!\n"%(identify(enum), ascii(enum))) - return - if module: - if self.fp: - self.fp.write("from %s import %s\n"%(module, name)) - - def dumpindex(self): - if not self.fp: - return - self.fp.write("\n#\n# Indices of types declared in this module\n#\n") - - self.fp.write("_classdeclarations = {\n") - classlist = self.namemappers[0].getall('class') - classlist.sort() - for k, v in classlist: - self.fp.write(" %r : %s,\n" % (k, v)) - self.fp.write("}\n") - - self.fp.write("\n_propdeclarations = {\n") - proplist = self.namemappers[0].getall('property') - proplist.sort() - for k, v in proplist: - self.fp.write(" %r : _Prop_%s,\n" % (k, v)) - self.fp.write("}\n") - - self.fp.write("\n_compdeclarations = {\n") - complist = self.namemappers[0].getall('comparison') - complist.sort() - for k, v in complist: - self.fp.write(" %r : %s,\n" % (k, v)) - self.fp.write("}\n") - - self.fp.write("\n_enumdeclarations = {\n") - enumlist = self.namemappers[0].getall('enum') - enumlist.sort() - for k, v in enumlist: - self.fp.write(" %r : %s,\n" % (k, v)) - self.fp.write("}\n") - -def compiledata(data): - [type, description, flags] = data - return "%r -- %r %s" % (type, description, compiledataflags(flags)) - -def is_null(data): - return data[0] == 'null' - -def is_optional(data): - return (data[2] & 0x8000) - -def is_enum(data): - return (data[2] & 0x2000) - -def getdatadoc(data): - [type, descr, flags] = data - if descr: - return ascii(descr) - if type == '****': - return 'anything' - if type == 'obj ': - return 'an AE object reference' - return "undocumented, typecode %r"%(type,) - -dataflagdict = {15: "optional", 14: "list", 13: "enum", 12: "mutable"} -def compiledataflags(flags): - bits = [] - for i in range(16): - if flags & (1<>8) & 0xff) + chr(numstr & 0xff) - for i in data: - rv = rv + _code_default(i) - return rv - -def _code_fontrecord(data, key): - size, face, name = data - return chr((size>>8) & 0xff) + chr(size & 0xff) + chr(face & 0xff) + \ - chr(0) + _code_default(name) - -def _code_boolean(data, key): - print 'XXXX boolean:', repr(data) - return chr(data) - -def _code_text(data, key): - return data - -def _code_charset(data, key): - return data[0] + data[1] - -def _code_appspec(data, key): - return data[0] + _code_default(data[1]) - -_decoder_table = { - "ArchieAll" : (_decode_multistr , _code_multistr), - "UMichAll" : (_decode_multistr , _code_multistr), - "InfoMacAll" : (_decode_multistr , _code_multistr), - "ListFont" : (_decode_fontrecord , _code_fontrecord), - "ScreenFont" : (_decode_fontrecord , _code_fontrecord), - "PrinterFont" : (_decode_fontrecord , _code_fontrecord), -# "DownloadFolder" : (_decode_filespec , _code_filespec), - "Signature": (_decode_text , _code_text), - "Plan" : (_decode_text , _code_text), - "MailHeaders" : (_decode_text , _code_text), - "NewsHeaders" : (_decode_text , _code_text), -# "Mapping" - "CharacterSet" : (_decode_charset , _code_charset), - "Helper\245" : (_decode_appspec , _code_appspec), -# "Services" : (_decode_services, ????), - "NewMailFlashIcon" : (_decode_boolean , _code_boolean), - "NewMailDialog" : (_decode_boolean , _code_boolean), - "NewMailPlaySound" : (_decode_boolean , _code_boolean), -# "WebBackgroundColor" : _decode_color, - "NoProxyDomains" : (_decode_multistr , _code_multistr), - "UseHTTPProxy" : (_decode_boolean , _code_boolean), - "UseGopherProxy": (_decode_boolean , _code_boolean), - "UseFTPProxy" : (_decode_boolean , _code_boolean), - "UsePassiveFTP" : (_decode_boolean , _code_boolean), -} - -def _decode(data, key): - if '\245' in key: - key2 = key[:string.index(key, '\245')+1] - else: - key2 = key - if _decoder_table.has_key(key2): - decoder = _decoder_table[key2][0] - else: - decoder = _decode_default - return decoder(data, key) - -def _code(data, key): - if type(data) == _ICOpaqueDataType: - return data.data - if '\245' in key: - key2 = key[:string.index(key, '\245')+1] - else: - key2 = key - if _decoder_table.has_key(key2): - coder = _decoder_table[key2][1] - else: - coder = _code_default - return coder(data, key) - -class IC: - def __init__(self, signature='Pyth', ic=None): - if ic: - self.ic = ic - else: - self.ic = icglue.ICStart(signature) - if hasattr(self.ic, 'ICFindConfigFile'): - self.ic.ICFindConfigFile() - self.h = Res.Resource('') - - def keys(self): - rv = [] - self.ic.ICBegin(icReadOnlyPerm) - num = self.ic.ICCountPref() - for i in range(num): - rv.append(self.ic.ICGetIndPref(i+1)) - self.ic.ICEnd() - return rv - - def has_key(self, key): - return self.__contains__(key) - - def __contains__(self, key): - try: - dummy = self.ic.ICFindPrefHandle(key, self.h) - except icglue.error: - return 0 - return 1 - - def __getitem__(self, key): - attr = self.ic.ICFindPrefHandle(key, self.h) - return _decode(self.h.data, key) - - def __setitem__(self, key, value): - value = _code(value, key) - self.ic.ICSetPref(key, ICattr_no_change, value) - - def launchurl(self, url, hint=""): - # Work around a bug in ICLaunchURL: file:/foo does - # not work but file:///foo does. - if url[:6] == 'file:/' and url[6] != '/': - url = 'file:///' + url[6:] - self.ic.ICLaunchURL(hint, url, 0, len(url)) - - def parseurl(self, data, start=None, end=None, hint=""): - if start == None: - selStart = 0 - selEnd = len(data) - else: - selStart = selEnd = start - if end != None: - selEnd = end - selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h) - return self.h.data, selStart, selEnd - - def mapfile(self, file): - if type(file) != type(''): - file = file.as_tuple()[2] - return self.ic.ICMapFilename(file) - - def maptypecreator(self, type, creator, filename=""): - return self.ic.ICMapTypeCreator(type, creator, filename) - - def settypecreator(self, file): - file = Carbon.File.pathname(file) - record = self.mapfile(os.path.split(file)[1]) - MacOS.SetCreatorAndType(file, record[2], record[1]) - macostools.touched(fss) - -# Convenience routines -_dft_ic = None - -def launchurl(url, hint=""): - global _dft_ic - if _dft_ic == None: _dft_ic = IC() - return _dft_ic.launchurl(url, hint) - -def parseurl(data, start=None, end=None, hint=""): - global _dft_ic - if _dft_ic == None: _dft_ic = IC() - return _dft_ic.parseurl(data, start, end, hint) - -def mapfile(filename): - global _dft_ic - if _dft_ic == None: _dft_ic = IC() - return _dft_ic.mapfile(filename) - -def maptypecreator(type, creator, filename=""): - global _dft_ic - if _dft_ic == None: _dft_ic = IC() - return _dft_ic.maptypecreator(type, creator, filename) - -def settypecreator(file): - global _dft_ic - if _dft_ic == None: _dft_ic = IC() - return _dft_ic.settypecreator(file) - -def _test(): - ic = IC() - for k in ic.keys(): - try: - v = ic[k] - except error: - v = '????' - print k, '\t', v - sys.exit(1) - -if __name__ == '__main__': - _test() diff --git a/sys/lib/python/plat-mac/icopen.py b/sys/lib/python/plat-mac/icopen.py deleted file mode 100644 index eea608379..000000000 --- a/sys/lib/python/plat-mac/icopen.py +++ /dev/null @@ -1,66 +0,0 @@ -"""icopen patch - -OVERVIEW - -icopen patches MacOS Python to use the Internet Config file mappings to select -the type and creator for a file. - -Version 1 released to the public domain 3 November 1999 -by Oliver Steele (steele@cs.brandeis.edu). - -DETAILS - -This patch causes files created by Python's open(filename, 'w') command (and -by functions and scripts that call it) to set the type and creator of the file -to the type and creator associated with filename's extension (the -portion of the filename after the last period), according to Internet Config. -Thus, a script that creates a file foo.html will create one that opens in whatever -browser you've set to handle *.html files, and so on. - -Python IDE uses its own algorithm to select the type and creator for saved -editor windows, so this patch won't effect their types. - -As of System 8.6 at least, Internet Config is built into the system, and the -file mappings are accessed from the Advanced pane of the Internet control -panel. User Mode (in the Edit menu) needs to be set to Advanced in order to -access this pane. - -INSTALLATION - -Put this file in your Python path, and create a file named {Python}:sitecustomize.py -that contains: - import icopen - -(If {Python}:sitecustomizer.py already exists, just add the 'import' line to it.) - -The next time you launch PythonInterpreter or Python IDE, the patch will take -effect. -""" - -import __builtin__ - -_builtin_open = globals().get('_builtin_open', __builtin__.open) - -def _open_with_typer(*args): - file = _builtin_open(*args) - filename = args[0] - mode = 'r' - if args[1:]: - mode = args[1] - if mode[0] == 'w': - from ic import error, settypecreator - try: - settypecreator(filename) - except error: - pass - return file - -__builtin__.open = _open_with_typer - -""" -open('test.py') -_open_with_typer('test.py', 'w') -_open_with_typer('test.txt', 'w') -_open_with_typer('test.html', 'w') -_open_with_typer('test.foo', 'w') -""" diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py deleted file mode 100644 index 0fd562b95..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py +++ /dev/null @@ -1,682 +0,0 @@ -"""Suite CodeWarrior suite: Terms for scripting the CodeWarrior IDE -Level 0, version 0 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'CWIE' - -class CodeWarrior_suite_Events: - - _argmap_add = { - 'new' : 'kocl', - 'with_data' : 'data', - 'to_targets' : 'TTGT', - 'to_group' : 'TGRP', - } - - def add(self, _object, _attributes={}, **_arguments): - """add: add elements to a project or target - Required argument: an AE object reference - Keyword argument new: the class of the new element or elements to add - Keyword argument with_data: the initial data for the element or elements - Keyword argument to_targets: the targets to which the new element or elements will be added - Keyword argument to_group: the group to which the new element or elements will be added - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'ADDF' - - aetools.keysubst(_arguments, self._argmap_add) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def build(self, _no_object=None, _attributes={}, **_arguments): - """build: build a project or target (equivalent of the Make menu command) - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'MAKE' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def check(self, _object=None, _attributes={}, **_arguments): - """check: check the syntax of a file in a project or target - Required argument: the file or files to be checked - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'CHEK' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def compile_file(self, _object=None, _attributes={}, **_arguments): - """compile file: compile a file in a project or target - Required argument: the file or files to be compiled - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'COMP' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def disassemble_file(self, _object=None, _attributes={}, **_arguments): - """disassemble file: disassemble a file in a project or target - Required argument: the file or files to be disassembled - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'DASM' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_export = { - 'in_' : 'kfil', - } - - def export(self, _no_object=None, _attributes={}, **_arguments): - """export: Export the project file as an XML file - Keyword argument in_: the XML file in which to export the project - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'EXPT' - - aetools.keysubst(_arguments, self._argmap_export) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def remove_object_code(self, _no_object=None, _attributes={}, **_arguments): - """remove object code: remove object code from a project or target - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'RMOB' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def remove_target_files(self, _object, _attributes={}, **_arguments): - """remove target files: remove files from a target - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'RMFL' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run_target(self, _no_object=None, _attributes={}, **_arguments): - """run target: run a project or target - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'RUN ' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def touch_file(self, _object=None, _attributes={}, **_arguments): - """touch file: touch a file in a project or target for compilation - Required argument: the file or files to be touched - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'TOCH' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def update(self, _no_object=None, _attributes={}, **_arguments): - """update: bring a project or target up to date - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'CWIE' - _subcode = 'UP2D' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class single_class_browser(aetools.ComponentItem): - """single class browser - a single class browser """ - want = '1BRW' -class _Prop_inherits(aetools.NProperty): - """inherits - all properties and elements of the given class are inherited by this class. """ - which = 'c@#^' - want = 'TXTD' - -single_class_browsers = single_class_browser - -class single_class_hierarchy(aetools.ComponentItem): - """single class hierarchy - a single class hierarchy document """ - want = '1HIR' - -single_class_hierarchies = single_class_hierarchy - -class class_browser(aetools.ComponentItem): - """class browser - a class browser """ - want = 'BROW' - -class_browsers = class_browser - -class file_compare_document(aetools.ComponentItem): - """file compare document - a file compare document """ - want = 'COMP' - -file_compare_documents = file_compare_document - -class catalog_document(aetools.ComponentItem): - """catalog document - a browser catalog document """ - want = 'CTLG' - -catalog_documents = catalog_document - -class editor_document(aetools.ComponentItem): - """editor document - an editor document """ - want = 'EDIT' - -editor_documents = editor_document - -class class_hierarchy(aetools.ComponentItem): - """class hierarchy - a class hierarchy document """ - want = 'HIER' - -class_hierarchies = class_hierarchy - -class project_inspector(aetools.ComponentItem): - """project inspector - the project inspector """ - want = 'INSP' - -project_inspectors = project_inspector - -class message_document(aetools.ComponentItem): - """message document - a message document """ - want = 'MSSG' - -message_documents = message_document - -class build_progress_document(aetools.ComponentItem): - """build progress document - a build progress document """ - want = 'PRGS' - -build_progress_documents = build_progress_document - -class project_document(aetools.ComponentItem): - """project document - a project document """ - want = 'PRJD' -class _Prop_current_target(aetools.NProperty): - """current target - the current target """ - which = 'CURT' - want = 'TRGT' -# element 'TRGT' as ['indx', 'name', 'test', 'rang'] - -project_documents = project_document - -class subtarget(aetools.ComponentItem): - """subtarget - a target that is prerequisite for another target """ - want = 'SBTG' -class _Prop_link_against_output(aetools.NProperty): - """link against output - is the output of this subtarget linked into its dependent target? """ - which = 'LNKO' - want = 'bool' -class _Prop_target(aetools.NProperty): - """target - the target that is dependent on this subtarget """ - which = 'TrgT' - want = 'TRGT' - -subtargets = subtarget - -class target_file(aetools.ComponentItem): - """target file - a source or header file in a target """ - want = 'SRCF' -class _Prop_code_size(aetools.NProperty): - """code size - the size of the code (in bytes) produced by compiling this source file """ - which = 'CSZE' - want = 'long' -class _Prop_compiled_date(aetools.NProperty): - """compiled date - the date and this source file was last compiled """ - which = 'CMPD' - want = 'ldt ' -class _Prop_data_size(aetools.NProperty): - """data size - the size of the date (in bytes) produced by compiling this source file """ - which = 'DSZE' - want = 'long' -class _Prop_debug(aetools.NProperty): - """debug - is debugging information generated for this source file? """ - which = 'DBUG' - want = 'bool' -class _Prop_dependents(aetools.NProperty): - """dependents - the source files that need this source file in order to build """ - which = 'DPND' - want = 'list' -class _Prop_id(aetools.NProperty): - """id - the unique ID number of the target file """ - which = 'ID ' - want = 'long' -class _Prop_init_before(aetools.NProperty): - """init before - is the \xd4initialize before\xd5 flag set for this shared library? """ - which = 'INIT' - want = 'bool' -class _Prop_link_index(aetools.NProperty): - """link index - the index of the source file in its target\xd5s link order (-1 if source file is not in link order) """ - which = 'LIDX' - want = 'long' -class _Prop_linked(aetools.NProperty): - """linked - is the source file in the link order of its target? """ - which = 'LINK' - want = 'bool' -class _Prop_location(aetools.NProperty): - """location - the location of the target file on disk """ - which = 'FILE' - want = 'fss ' -class _Prop_merge_output(aetools.NProperty): - """merge output - is this shared library merged into another code fragment? """ - which = 'MRGE' - want = 'bool' -class _Prop_modified_date(aetools.NProperty): - """modified date - the date and time this source file was last modified """ - which = 'MODD' - want = 'ldt ' -class _Prop_path(aetools.NProperty): - """path - the path of the source file on disk """ - which = 'Path' - want = 'itxt' -class _Prop_prerequisites(aetools.NProperty): - """prerequisites - the source files needed to build this source file """ - which = 'PRER' - want = 'list' -class _Prop_type(aetools.NProperty): - """type - the type of source file """ - which = 'FTYP' - want = 'FTYP' -class _Prop_weak_link(aetools.NProperty): - """weak link - is this shared library linked weakly? """ - which = 'WEAK' - want = 'bool' - -target_files = target_file - -class symbol_browser(aetools.ComponentItem): - """symbol browser - a symbol browser """ - want = 'SYMB' - -symbol_browsers = symbol_browser - -class ToolServer_worksheet(aetools.ComponentItem): - """ToolServer worksheet - a ToolServer worksheet """ - want = 'TOOL' - -ToolServer_worksheets = ToolServer_worksheet - -class target(aetools.ComponentItem): - """target - a target in a project """ - want = 'TRGT' -class _Prop_name(aetools.NProperty): - """name - """ - which = 'pnam' - want = 'itxt' -class _Prop_project_document(aetools.NProperty): - """project document - the project document that contains this target """ - which = 'PrjD' - want = 'PRJD' -# element 'SBTG' as ['indx', 'test', 'rang'] -# element 'SRCF' as ['indx', 'test', 'rang'] - -targets = target - -class text_document(aetools.ComponentItem): - """text document - a document that contains text """ - want = 'TXTD' -class _Prop_modified(aetools.NProperty): - """modified - Has the document been modified since the last save? """ - which = 'imod' - want = 'bool' -class _Prop_selection(aetools.NProperty): - """selection - the selection visible to the user """ - which = 'sele' - want = 'csel' -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cins' as ['rele'] -# element 'clin' as ['indx', 'rang', 'rele'] -# element 'ctxt' as ['rang'] - -text_documents = text_document -single_class_browser._superclassnames = ['text_document'] -single_class_browser._privpropdict = { - 'inherits' : _Prop_inherits, -} -single_class_browser._privelemdict = { -} -import Standard_Suite -single_class_hierarchy._superclassnames = ['document'] -single_class_hierarchy._privpropdict = { - 'inherits' : _Prop_inherits, -} -single_class_hierarchy._privelemdict = { -} -class_browser._superclassnames = ['text_document'] -class_browser._privpropdict = { - 'inherits' : _Prop_inherits, -} -class_browser._privelemdict = { -} -file_compare_document._superclassnames = ['text_document'] -file_compare_document._privpropdict = { - 'inherits' : _Prop_inherits, -} -file_compare_document._privelemdict = { -} -catalog_document._superclassnames = ['text_document'] -catalog_document._privpropdict = { - 'inherits' : _Prop_inherits, -} -catalog_document._privelemdict = { -} -editor_document._superclassnames = ['text_document'] -editor_document._privpropdict = { - 'inherits' : _Prop_inherits, -} -editor_document._privelemdict = { -} -class_hierarchy._superclassnames = ['document'] -class_hierarchy._privpropdict = { - 'inherits' : _Prop_inherits, -} -class_hierarchy._privelemdict = { -} -project_inspector._superclassnames = ['document'] -project_inspector._privpropdict = { - 'inherits' : _Prop_inherits, -} -project_inspector._privelemdict = { -} -message_document._superclassnames = ['text_document'] -message_document._privpropdict = { - 'inherits' : _Prop_inherits, -} -message_document._privelemdict = { -} -build_progress_document._superclassnames = ['document'] -build_progress_document._privpropdict = { - 'inherits' : _Prop_inherits, -} -build_progress_document._privelemdict = { -} -project_document._superclassnames = ['document'] -project_document._privpropdict = { - 'current_target' : _Prop_current_target, - 'inherits' : _Prop_inherits, -} -project_document._privelemdict = { - 'target' : target, -} -subtarget._superclassnames = ['target'] -subtarget._privpropdict = { - 'inherits' : _Prop_inherits, - 'link_against_output' : _Prop_link_against_output, - 'target' : _Prop_target, -} -subtarget._privelemdict = { -} -target_file._superclassnames = [] -target_file._privpropdict = { - 'code_size' : _Prop_code_size, - 'compiled_date' : _Prop_compiled_date, - 'data_size' : _Prop_data_size, - 'debug' : _Prop_debug, - 'dependents' : _Prop_dependents, - 'id' : _Prop_id, - 'init_before' : _Prop_init_before, - 'link_index' : _Prop_link_index, - 'linked' : _Prop_linked, - 'location' : _Prop_location, - 'merge_output' : _Prop_merge_output, - 'modified_date' : _Prop_modified_date, - 'path' : _Prop_path, - 'prerequisites' : _Prop_prerequisites, - 'type' : _Prop_type, - 'weak_link' : _Prop_weak_link, -} -target_file._privelemdict = { -} -symbol_browser._superclassnames = ['text_document'] -symbol_browser._privpropdict = { - 'inherits' : _Prop_inherits, -} -symbol_browser._privelemdict = { -} -ToolServer_worksheet._superclassnames = ['text_document'] -ToolServer_worksheet._privpropdict = { - 'inherits' : _Prop_inherits, -} -ToolServer_worksheet._privelemdict = { -} -target._superclassnames = [] -target._privpropdict = { - 'name' : _Prop_name, - 'project_document' : _Prop_project_document, -} -target._privelemdict = { - 'subtarget' : subtarget, - 'target_file' : target_file, -} -text_document._superclassnames = ['document'] -text_document._privpropdict = { - 'inherits' : _Prop_inherits, - 'modified' : _Prop_modified, - 'selection' : _Prop_selection, -} -text_document._privelemdict = { - 'character' : Standard_Suite.character, - 'insertion_point' : Standard_Suite.insertion_point, - 'line' : Standard_Suite.line, - 'text' : Standard_Suite.text, -} -_Enum_DKND = { - 'project' : 'PRJD', # a project document - 'editor_document' : 'EDIT', # an editor document - 'message' : 'MSSG', # a message document - 'file_compare' : 'COMP', # a file compare document - 'catalog_document' : 'CTLG', # a browser catalog - 'class_browser' : 'BROW', # a class browser document - 'single_class_browser' : '1BRW', # a single class browser document - 'symbol_browser' : 'SYMB', # a symbol browser document - 'class_hierarchy' : 'HIER', # a class hierarchy document - 'single_class_hierarchy' : '1HIR', # a single class hierarchy document - 'project_inspector' : 'INSP', # a project inspector - 'ToolServer_worksheet' : 'TOOL', # the ToolServer worksheet - 'build_progress_document' : 'PRGS', # the build progress window -} - -_Enum_FTYP = { - 'library_file' : 'LIBF', # a library file - 'project_file' : 'PRJF', # a project file - 'resource_file' : 'RESF', # a resource file - 'text_file' : 'TXTF', # a text file - 'unknown_file' : 'UNKN', # unknown file type -} - -_Enum_Inte = { - 'never_interact' : 'eNvr', # never allow user interactions - 'interact_with_self' : 'eInS', # allow user interaction only when an AppleEvent is sent from within CodeWarrior - 'interact_with_local' : 'eInL', # allow user interaction when AppleEvents are sent from applications on the same machine (default) - 'interact_with_all' : 'eInA', # allow user interaction from both local and remote AppleEvents -} - -_Enum_PERM = { - 'read_write' : 'RdWr', # the file is open with read/write permission - 'read_only' : 'Read', # the file is open with read/only permission - 'checked_out_read_write' : 'CkRW', # the file is checked out with read/write permission - 'checked_out_read_only' : 'CkRO', # the file is checked out with read/only permission - 'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission - 'locked' : 'Lock', # the file is locked on disk - 'none' : 'LNNO', # the file is new -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - '1BRW' : single_class_browser, - '1HIR' : single_class_hierarchy, - 'BROW' : class_browser, - 'COMP' : file_compare_document, - 'CTLG' : catalog_document, - 'EDIT' : editor_document, - 'HIER' : class_hierarchy, - 'INSP' : project_inspector, - 'MSSG' : message_document, - 'PRGS' : build_progress_document, - 'PRJD' : project_document, - 'SBTG' : subtarget, - 'SRCF' : target_file, - 'SYMB' : symbol_browser, - 'TOOL' : ToolServer_worksheet, - 'TRGT' : target, - 'TXTD' : text_document, -} - -_propdeclarations = { - 'CMPD' : _Prop_compiled_date, - 'CSZE' : _Prop_code_size, - 'CURT' : _Prop_current_target, - 'DBUG' : _Prop_debug, - 'DPND' : _Prop_dependents, - 'DSZE' : _Prop_data_size, - 'FILE' : _Prop_location, - 'FTYP' : _Prop_type, - 'ID ' : _Prop_id, - 'INIT' : _Prop_init_before, - 'LIDX' : _Prop_link_index, - 'LINK' : _Prop_linked, - 'LNKO' : _Prop_link_against_output, - 'MODD' : _Prop_modified_date, - 'MRGE' : _Prop_merge_output, - 'PRER' : _Prop_prerequisites, - 'Path' : _Prop_path, - 'PrjD' : _Prop_project_document, - 'TrgT' : _Prop_target, - 'WEAK' : _Prop_weak_link, - 'c@#^' : _Prop_inherits, - 'imod' : _Prop_modified, - 'pnam' : _Prop_name, - 'sele' : _Prop_selection, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'DKND' : _Enum_DKND, - 'FTYP' : _Enum_FTYP, - 'Inte' : _Enum_Inte, - 'PERM' : _Enum_PERM, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py deleted file mode 100644 index 909cdc0fe..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py +++ /dev/null @@ -1,2373 +0,0 @@ -"""Suite Metrowerks Shell Suite: Events supported by the Metrowerks Project Shell -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'MMPR' - -class Metrowerks_Shell_Suite_Events: - - _argmap_Add_Files = { - 'To_Segment' : 'Segm', - } - - def Add_Files(self, _object, _attributes={}, **_arguments): - """Add Files: Add the specified file(s) to the current project - Required argument: List of files to add - Keyword argument To_Segment: Segment number into which to add the file(s) - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Error code for each file added - """ - _code = 'MMPR' - _subcode = 'AddF' - - aetools.keysubst(_arguments, self._argmap_Add_Files) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Check_Syntax = { - 'ExternalEditor' : 'Errs', - } - - def Check_Syntax(self, _object, _attributes={}, **_arguments): - """Check Syntax: Check the syntax of the specified file(s) - Required argument: List of files to check the syntax of - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors for each file whose syntax was checked - """ - _code = 'MMPR' - _subcode = 'Chek' - - aetools.keysubst(_arguments, self._argmap_Check_Syntax) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Close_Project(self, _no_object=None, _attributes={}, **_arguments): - """Close Project: Close the current project - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'ClsP' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Close_Window = { - 'Saving' : 'savo', - } - - def Close_Window(self, _object, _attributes={}, **_arguments): - """Close Window: Close the windows showing the specified files - Required argument: The files to close - Keyword argument Saving: Whether to save changes to each file before closing its window - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'ClsW' - - aetools.keysubst(_arguments, self._argmap_Close_Window) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Compile = { - 'ExternalEditor' : 'Errs', - } - - def Compile(self, _object, _attributes={}, **_arguments): - """Compile: Compile the specified file(s) - Required argument: List of files to compile - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors for each file compiled - """ - _code = 'MMPR' - _subcode = 'Comp' - - aetools.keysubst(_arguments, self._argmap_Compile) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Create_Project = { - 'from_stationery' : 'Tmpl', - } - - def Create_Project(self, _object, _attributes={}, **_arguments): - """Create Project: Create a new project file - Required argument: New project file specifier - Keyword argument from_stationery: undocumented, typecode 'alis' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'NewP' - - aetools.keysubst(_arguments, self._argmap_Create_Project) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_Definition(self, _object, _attributes={}, **_arguments): - """Get Definition: Returns the location(s) of a globally scoped function or data object. - Required argument: undocumented, typecode 'TEXT' - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'FDef' - """ - _code = 'MMPR' - _subcode = 'GDef' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_Open_Documents(self, _no_object=None, _attributes={}, **_arguments): - """Get Open Documents: Returns the list of open documents - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The list of documents - """ - _code = 'MMPR' - _subcode = 'GDoc' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Get_Preferences = { - 'of' : 'PRec', - 'from_panel' : 'PNam', - } - - def Get_Preferences(self, _no_object=None, _attributes={}, **_arguments): - """Get Preferences: Get the preferences for the current project - Keyword argument of: Names of requested preferences - Keyword argument from_panel: Name of the preference panel - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The requested preferences - """ - _code = 'MMPR' - _subcode = 'Gref' - - aetools.keysubst(_arguments, self._argmap_Get_Preferences) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Get_Project_File = { - 'Segment' : 'Segm', - } - - def Get_Project_File(self, _object, _attributes={}, **_arguments): - """Get Project File: Returns a description of a file in the project window. - Required argument: The index of the file within its segment. - Keyword argument Segment: The segment containing the file. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'SrcF' - """ - _code = 'MMPR' - _subcode = 'GFil' - - aetools.keysubst(_arguments, self._argmap_Get_Project_File) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_Project_Specifier(self, _no_object=None, _attributes={}, **_arguments): - """Get Project Specifier: Return the File Specifier for the current project - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: File Specifier for the current project - """ - _code = 'MMPR' - _subcode = 'GetP' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_Segments(self, _no_object=None, _attributes={}, **_arguments): - """Get Segments: Returns a description of each segment in the project. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'Seg ' - """ - _code = 'MMPR' - _subcode = 'GSeg' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_member_function_names(self, _object, _attributes={}, **_arguments): - """Get member function names: Returns a list containing the names of all the member functions of a class object - Required argument: must be a class object - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'list' - """ - _code = 'MMPR' - _subcode = 'MbFN' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_nonsimple_classes(self, _no_object=None, _attributes={}, **_arguments): - """Get nonsimple classes: Returns an alphabetical list of classes with member functions, bases classes, or subclasses - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'list' - """ - _code = 'MMPR' - _subcode = 'NsCl' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Goto_Function(self, _object, _attributes={}, **_arguments): - """Goto Function: Goto Specified Function Name - Required argument: undocumented, typecode 'TEXT' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'GoFn' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Goto_Line(self, _object, _attributes={}, **_arguments): - """Goto Line: Goto Specified Line Number - Required argument: The requested source file line number - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'GoLn' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Is_In_Project(self, _object, _attributes={}, **_arguments): - """Is In Project: Whether or not the specified file(s) is in the current project - Required argument: List of files to check for project membership - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Result code for each file - """ - _code = 'MMPR' - _subcode = 'FInP' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Make_Project = { - 'ExternalEditor' : 'Errs', - } - - def Make_Project(self, _no_object=None, _attributes={}, **_arguments): - """Make Project: Make the current project - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors that occurred while making the project - """ - _code = 'MMPR' - _subcode = 'Make' - - aetools.keysubst(_arguments, self._argmap_Make_Project) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Open_browser(self, _object, _attributes={}, **_arguments): - """Open browser: Display a class, member function, or data member object in a single class browser window - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'Brow' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Precompile = { - 'Saving_As' : 'Targ', - 'ExternalEditor' : 'Errs', - } - - def Precompile(self, _object, _attributes={}, **_arguments): - """Precompile: Precompile the specified file to the specified destination file - Required argument: File to precompile - Keyword argument Saving_As: Destination file for precompiled header - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors for the precompiled file - """ - _code = 'MMPR' - _subcode = 'PreC' - - aetools.keysubst(_arguments, self._argmap_Precompile) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Preprocess = { - 'ExternalEditor' : 'Errs', - } - - def Preprocess(self, _object, _attributes={}, **_arguments): - """Preprocess: Preprocesses the specified file(s) - Required argument: undocumented, typecode 'alis' - Keyword argument ExternalEditor: undocumented, typecode 'bool' - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors for each preprocessed file - """ - _code = 'MMPR' - _subcode = 'PreP' - - aetools.keysubst(_arguments, self._argmap_Preprocess) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Remove_Binaries(self, _no_object=None, _attributes={}, **_arguments): - """Remove Binaries: Remove the binary object code from the current project - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'RemB' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Remove_Files(self, _object, _attributes={}, **_arguments): - """Remove Files: Remove the specified file(s) from the current project - Required argument: List of files to remove - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Error code for each file removed - """ - _code = 'MMPR' - _subcode = 'RemF' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Reset_File_Paths(self, _no_object=None, _attributes={}, **_arguments): - """Reset File Paths: Resets access paths for all files belonging to open project. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'ReFP' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Run_Project = { - 'ExternalEditor' : 'Errs', - 'SourceDebugger' : 'DeBg', - } - - def Run_Project(self, _no_object=None, _attributes={}, **_arguments): - """Run Project: Run the current project - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument SourceDebugger: Run the application under the control of the source-level debugger - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors that occurred when running the project - """ - _code = 'MMPR' - _subcode = 'RunP' - - aetools.keysubst(_arguments, self._argmap_Run_Project) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Save_Error_Window_As(self, _object, _attributes={}, **_arguments): - """Save Error Window As: Saves the Errors & Warnings window as a text file - Required argument: Destination file for Save Message Window As - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'SvMs' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Set_Current_Target(self, _object=None, _attributes={}, **_arguments): - """Set Current Target: Set the current target of a project - Required argument: Name of target - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'STrg' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Set_Default_Project(self, _object, _attributes={}, **_arguments): - """Set Default Project: Set the default project - Required argument: Name of project - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'SDfP' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Set_Modification_Date = { - 'to' : 'MDat', - } - - def Set_Modification_Date(self, _object, _attributes={}, **_arguments): - """Set Modification Date: Changes the internal modification date of the specified file(s) - Required argument: List of files - Keyword argument to: undocumented, typecode 'ldt ' - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Error code for each modified file - """ - _code = 'MMPR' - _subcode = 'SMod' - - aetools.keysubst(_arguments, self._argmap_Set_Modification_Date) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Set_Preferences = { - 'of_panel' : 'PNam', - 'to' : 'PRec', - } - - def Set_Preferences(self, _no_object=None, _attributes={}, **_arguments): - """Set Preferences: Set the preferences for the current project - Keyword argument of_panel: Name of the preference panel - Keyword argument to: Preferences settings - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'Pref' - - aetools.keysubst(_arguments, self._argmap_Set_Preferences) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Set_Project_File = { - 'to' : 'SrcS', - } - - def Set_Project_File(self, _object, _attributes={}, **_arguments): - """Set Project File: Changes the settings for a given file in the project. - Required argument: The name of the file - Keyword argument to: The new settings for the file - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'SFil' - - aetools.keysubst(_arguments, self._argmap_Set_Project_File) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Set_Segment = { - 'to' : 'Segm', - } - - def Set_Segment(self, _object, _attributes={}, **_arguments): - """Set Segment: Changes the name and attributes of a segment. - Required argument: The segment to change - Keyword argument to: The new name and attributes for the segment. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MMPR' - _subcode = 'SSeg' - - aetools.keysubst(_arguments, self._argmap_Set_Segment) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Touch(self, _object, _attributes={}, **_arguments): - """Touch: Force recompilation of the specified file(s) - Required argument: List of files to compile - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Error code for each file touched - """ - _code = 'MMPR' - _subcode = 'Toch' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Update_Project = { - 'ExternalEditor' : 'Errs', - } - - def Update_Project(self, _no_object=None, _attributes={}, **_arguments): - """Update Project: Update the current project - Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller? - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Errors that occurred while updating the project - """ - _code = 'MMPR' - _subcode = 'UpdP' - - aetools.keysubst(_arguments, self._argmap_Update_Project) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class Browser_Coloring(aetools.ComponentItem): - """Browser Coloring - Colors for Browser symbols. """ - want = 'BRKW' -class _Prop_Browser_Keywords(aetools.NProperty): - """Browser Keywords - Mark Browser symbols with color. """ - which = 'BW00' - want = 'bool' -class _Prop_Classes_Color(aetools.NProperty): - """Classes Color - The color for classes. """ - which = 'BW01' - want = 'cRGB' -class _Prop_Constants_Color(aetools.NProperty): - """Constants Color - The color for constants. """ - which = 'BW02' - want = 'cRGB' -class _Prop_Enums_Color(aetools.NProperty): - """Enums Color - The color for enums. """ - which = 'BW03' - want = 'cRGB' -class _Prop_Functions_Color(aetools.NProperty): - """Functions Color - Set color for functions. """ - which = 'BW04' - want = 'cRGB' -class _Prop_Globals_Color(aetools.NProperty): - """Globals Color - The color for globals """ - which = 'BW05' - want = 'cRGB' -class _Prop_Macros_Color(aetools.NProperty): - """Macros Color - The color for macros. """ - which = 'BW06' - want = 'cRGB' -class _Prop_Template_Commands_in_Menu(aetools.NProperty): - """Template Commands in Menu - Include template commands in context menus """ - which = 'BW10' - want = 'bool' -class _Prop_Templates_Color(aetools.NProperty): - """Templates Color - Set color for templates. """ - which = 'BW07' - want = 'cRGB' -class _Prop_Typedefs_Color(aetools.NProperty): - """Typedefs Color - The color for typedefs. """ - which = 'BW08' - want = 'cRGB' - -class Build_Settings(aetools.ComponentItem): - """Build Settings - Build Settings preferences. """ - want = 'BSTG' -class _Prop_Build_Before_Running(aetools.NProperty): - """Build Before Running - Build the target before running. """ - which = 'BX04' - want = 'BXbr' -class _Prop_Compiler_Thread_Stack_Size(aetools.NProperty): - """Compiler Thread Stack Size - Compiler Thread Stack Size """ - which = 'BX06' - want = 'long' -class _Prop_Completion_Sound(aetools.NProperty): - """Completion Sound - Play a sound when finished a Bring Up To Date or Make command. """ - which = 'BX01' - want = 'bool' -class _Prop_Failure_Sound(aetools.NProperty): - """Failure Sound - The sound CodeWarrior plays when it cannot finish a Bring Up To Date or Make command. """ - which = 'BX03' - want = 'TEXT' -class _Prop_Include_Cache_Size(aetools.NProperty): - """Include Cache Size - Include file cache size. """ - which = 'BX05' - want = 'long' -class _Prop_Save_Before_Building(aetools.NProperty): - """Save Before Building - Save open editor files before build operations """ - which = 'BX07' - want = 'bool' -class _Prop_Success_Sound(aetools.NProperty): - """Success Sound - The sound CodeWarrior plays when it successfully finishes a Bring Up To Date or Make command. """ - which = 'BX02' - want = 'TEXT' - -class base_class(aetools.ComponentItem): - """base class - A base class or super class of a class """ - want = 'BsCl' -class _Prop_access(aetools.NProperty): - """access - """ - which = 'Acce' - want = 'Acce' -class _Prop_class_(aetools.NProperty): - """class - The class object corresponding to this base class """ - which = 'Clas' - want = 'obj ' -class _Prop_virtual(aetools.NProperty): - """virtual - """ - which = 'Virt' - want = 'bool' - -base_classes = base_class - -class Custom_Keywords(aetools.ComponentItem): - """Custom Keywords - """ - want = 'CUKW' -class _Prop_Custom_Color_1(aetools.NProperty): - """Custom Color 1 - The color for the first set of custom keywords. """ - which = 'GH05' - want = 'cRGB' -class _Prop_Custom_Color_2(aetools.NProperty): - """Custom Color 2 - The color for the second set custom keywords. """ - which = 'GH06' - want = 'cRGB' -class _Prop_Custom_Color_3(aetools.NProperty): - """Custom Color 3 - The color for the third set of custom keywords. """ - which = 'GH07' - want = 'cRGB' -class _Prop_Custom_Color_4(aetools.NProperty): - """Custom Color 4 - The color for the fourth set of custom keywords. """ - which = 'GH08' - want = 'cRGB' - -class browser_catalog(aetools.ComponentItem): - """browser catalog - The browser symbol catalog for the current project """ - want = 'Cata' -# element 'Clas' as ['indx', 'name'] - -class class_(aetools.ComponentItem): - """class - A class, struct, or record type in the current project. """ - want = 'Clas' -class _Prop_all_subclasses(aetools.NProperty): - """all subclasses - the classes directly or indirectly derived from this class """ - which = 'SubA' - want = 'Clas' -class _Prop_declaration_end_offset(aetools.NProperty): - """declaration end offset - End of class declaration """ - which = 'DcEn' - want = 'long' -class _Prop_declaration_file(aetools.NProperty): - """declaration file - Source file containing the class declaration """ - which = 'DcFl' - want = 'fss ' -class _Prop_declaration_start_offset(aetools.NProperty): - """declaration start offset - Start of class declaration source code """ - which = 'DcSt' - want = 'long' -class _Prop_language(aetools.NProperty): - """language - Implementation language of this class """ - which = 'Lang' - want = 'Lang' -class _Prop_name(aetools.NProperty): - """name - """ - which = 'pnam' - want = 'TEXT' -class _Prop_subclasses(aetools.NProperty): - """subclasses - the immediate subclasses of this class """ - which = 'SubC' - want = 'Clas' -# element 'BsCl' as ['indx'] -# element 'DtMb' as ['indx', 'name'] -# element 'MbFn' as ['indx', 'name'] - -classes = class_ - -class Debugger_Display(aetools.ComponentItem): - """Debugger Display - Debugger Display preferences """ - want = 'DbDS' -class _Prop_Default_Array_Size(aetools.NProperty): - """Default Array Size - Controls whether CodeWarrior uses its own integrated editor or an external application for editing text files. """ - which = 'Db08' - want = 'shor' -class _Prop_Show_As_Decimal(aetools.NProperty): - """Show As Decimal - Show variable values as decimal by default """ - which = 'Db10' - want = 'bool' -class _Prop_Show_Locals(aetools.NProperty): - """Show Locals - Show locals by default """ - which = 'Db09' - want = 'bool' -class _Prop_Show_Variable_Types(aetools.NProperty): - """Show Variable Types - Show variable types by default. """ - which = 'Db01' - want = 'bool' -class _Prop_Sort_By_Method(aetools.NProperty): - """Sort By Method - Sort functions by method. """ - which = 'Db02' - want = 'bool' -class _Prop_Threads_in_Window(aetools.NProperty): - """Threads in Window - Show threads in separate windows. """ - which = 'Db04' - want = 'bool' -class _Prop_Use_RTTI(aetools.NProperty): - """Use RTTI - Enable RunTime Type Information. """ - which = 'Db03' - want = 'bool' -class _Prop_Variable_Changed_Hilite(aetools.NProperty): - """Variable Changed Hilite - Variable changed hilite color. """ - which = 'Db07' - want = 'cRGB' -class _Prop_Variable_Hints(aetools.NProperty): - """Variable Hints - Show variable hints. """ - which = 'Db05' - want = 'bool' -class _Prop_Watchpoint_Hilite(aetools.NProperty): - """Watchpoint Hilite - Watchpoint hilite color. """ - which = 'Db06' - want = 'cRGB' - -class Debugger_Global(aetools.ComponentItem): - """Debugger Global - Debugger Global preferences """ - want = 'DbGL' -class _Prop_Auto_Target_Libraries(aetools.NProperty): - """Auto Target Libraries - Automatically target libraries when debugging """ - which = 'Dg11' - want = 'bool' -class _Prop_Cache_Edited_Files(aetools.NProperty): - """Cache Edited Files - Cache edit files between debug sessions """ - which = 'Dg12' - want = 'bool' -class _Prop_Confirm_Kill(aetools.NProperty): - """Confirm Kill - Confirm the \xd4killing\xd5 of the process. """ - which = 'Dg04' - want = 'bool' -class _Prop_Dont_Step_in_Runtime(aetools.NProperty): - """Dont Step in Runtime - Don\xd5t step into runtime code when debugging. """ - which = 'Dg07' - want = 'bool' -class _Prop_File_Cache_Duration(aetools.NProperty): - """File Cache Duration - Duration to keep files in cache (in days) """ - which = 'Dg13' - want = 'shor' -class _Prop_Ignore_Mod_Dates(aetools.NProperty): - """Ignore Mod Dates - Ignore modification dates of files. """ - which = 'Dg01' - want = 'bool' -class _Prop_Launch_Apps_on_Open(aetools.NProperty): - """Launch Apps on Open - Launch applications on the opening of sym files. """ - which = 'Dg03' - want = 'bool' -class _Prop_Open_All_Classes(aetools.NProperty): - """Open All Classes - Open all Java class files. """ - which = 'Dg02' - want = 'bool' -class _Prop_Select_Stack_Crawl(aetools.NProperty): - """Select Stack Crawl - Select the stack crawl. """ - which = 'Dg06' - want = 'bool' -class _Prop_Stop_at_Main(aetools.NProperty): - """Stop at Main - Stop to debug on the main() function. """ - which = 'Dg05' - want = 'bool' - -class Debugger_Target(aetools.ComponentItem): - """Debugger Target - Debugger Target preferences """ - want = 'DbTG' -class _Prop_Cache_symbolics(aetools.NProperty): - """Cache symbolics - Cache symbolics between runs when executable doesn\xd5t change, else release symbolics files after killing process. """ - which = 'Dt15' - want = 'bool' -class _Prop_Data_Update_Interval(aetools.NProperty): - """Data Update Interval - How often to update the data while running (in seconds) """ - which = 'Dt09' - want = 'long' -class _Prop_Log_System_Messages(aetools.NProperty): - """Log System Messages - Log all system messages while debugging. """ - which = 'Dt02' - want = 'bool' -class _Prop_Relocated_Executable_Path(aetools.NProperty): - """Relocated Executable Path - Path to location of relocated libraries, code resources or remote debugging folder """ - which = 'Dt10' - want = 'RlPt' -class _Prop_Stop_at_temp_breakpoint(aetools.NProperty): - """Stop at temp breakpoint - Stop at a temp breakpoint on program launch. Set breakpoint type in Temp Breakpoint Type AppleEvent. """ - which = 'Dt13' - want = 'bool' -class _Prop_Temp_Breakpoint_Type(aetools.NProperty): - """Temp Breakpoint Type - Type of temp breakpoint to set on program launch. """ - which = 'Dt16' - want = 'TmpB' -class _Prop_Temp_breakpoint_names(aetools.NProperty): - """Temp breakpoint names - Comma separated list of names to attempt to stop at on program launch. First symbol to resolve in list is the temp BP that will be set. """ - which = 'Dt14' - want = 'ctxt' -class _Prop_Update_Data_While_Running(aetools.NProperty): - """Update Data While Running - Should pause to update data while running """ - which = 'Dt08' - want = 'bool' - -class Debugger_Windowing(aetools.ComponentItem): - """Debugger Windowing - """ - want = 'DbWN' -class _Prop_Debugging_Start_Action(aetools.NProperty): - """Debugging Start Action - What action to take when debug session starts """ - which = 'Dw01' - want = 'DbSA' -class _Prop_Do_Nothing_To_Projects(aetools.NProperty): - """Do Nothing To Projects - Suppress debugging start action for project windows """ - which = 'Dw02' - want = 'bool' - -class data_member(aetools.ComponentItem): - """data member - A class data member or field """ - want = 'DtMb' -class _Prop_static(aetools.NProperty): - """static - """ - which = 'Stat' - want = 'bool' - -data_members = data_member - -class Editor(aetools.ComponentItem): - """Editor - """ - want = 'EDTR' -class _Prop_Background_Color(aetools.NProperty): - """Background Color - Color of the background of editor windows. """ - which = 'ED13' - want = 'cRGB' -class _Prop_Balance(aetools.NProperty): - """Balance - Flash the matching opening bracket when you type a closing bracket. """ - which = 'ED03' - want = 'bool' -class _Prop_Context_Popup_Delay(aetools.NProperty): - """Context Popup Delay - The amount of time, in sixtieths of a second, before the context popup is displayed if you click and hold on a browser symbol. """ - which = 'ED14' - want = 'long' -class _Prop_Default_Text_File_Format(aetools.NProperty): - """Default Text File Format - Default text file format (i.e. which type of line endings to use) """ - which = 'ED17' - want = 'TxtF' -class _Prop_Dynamic_Scroll(aetools.NProperty): - """Dynamic Scroll - Display a window\xd5s contents as you move the scroll box. """ - which = 'ED02' - want = 'bool' -class _Prop_Flash_Delay(aetools.NProperty): - """Flash Delay - The amount of time, in sixtieths of a second, the editor highlights a matching bracket. """ - which = 'ED01' - want = 'long' -class _Prop_Left_Margin_Line_Select(aetools.NProperty): - """Left Margin Line Select - Clicking in the left margin selects lines """ - which = 'ED16' - want = 'bool' -class _Prop_Main_Text_Color(aetools.NProperty): - """Main Text Color - Main, default, color for text. """ - which = 'ED12' - want = 'cRGB' -class _Prop_Relaxed_C_Popup_Parsing(aetools.NProperty): - """Relaxed C Popup Parsing - Relax the function parser for C source files """ - which = 'ED15' - want = 'bool' -class _Prop_Remember_Font(aetools.NProperty): - """Remember Font - Display a source file with its own font settings. """ - which = 'ED08' - want = 'bool' -class _Prop_Remember_Selection(aetools.NProperty): - """Remember Selection - Restore the previous selection in a file when you open it. """ - which = 'ED09' - want = 'bool' -class _Prop_Remember_Window(aetools.NProperty): - """Remember Window - Restore the last size and position for a source file window when you open it. """ - which = 'ED10' - want = 'bool' -class _Prop_Sort_Function_Popup(aetools.NProperty): - """Sort Function Popup - """ - which = 'ED06' - want = 'bool' -class _Prop_Use_Drag__26__Drop_Editing(aetools.NProperty): - """Use Drag & Drop Editing - Use Drag & Drop text editing. """ - which = 'ED04' - want = 'bool' -class _Prop_Use_Multiple_Undo(aetools.NProperty): - """Use Multiple Undo - """ - which = 'ED07' - want = 'bool' - -class Environment_Variable(aetools.ComponentItem): - """Environment Variable - Environment variable for host OS """ - want = 'EnvV' -class _Prop_value(aetools.NProperty): - """value - Value of the environment variable """ - which = 'Valu' - want = 'TEXT' - -class Error_Information(aetools.ComponentItem): - """Error Information - Describes a single error or warning from the compiler or the linker. """ - want = 'ErrM' -class _Prop_disk_file(aetools.NProperty): - """disk file - The file where the error occurred. May not be returned for certain kinds of errors (eg, link errors). """ - which = 'file' - want = 'fss ' -class _Prop_lineNumber(aetools.NProperty): - """lineNumber - The line in the file where the error occurred. May not be returned for certain kinds of errors (eg, link errors). """ - which = 'ErrL' - want = 'long' -class _Prop_message(aetools.NProperty): - """message - The error or warning message. """ - which = 'ErrS' - want = 'TEXT' -class _Prop_messageKind(aetools.NProperty): - """messageKind - The type of error or warning. """ - which = 'ErrT' - want = 'ErrT' - -class Function_Information(aetools.ComponentItem): - """Function Information - Describes the location of any function or global data definition within the current project. """ - want = 'FDef' - -class File_Mappings(aetools.ComponentItem): - """File Mappings - Mappings of extensions & file types to compilers """ - want = 'FLMP' -class _Prop_Mappings(aetools.NProperty): - """Mappings - """ - which = 'FMps' - want = 'FMap' - -class File_Mapping(aetools.ComponentItem): - """File Mapping - """ - want = 'FMap' -class _Prop_Compiler(aetools.NProperty): - """Compiler - """ - which = 'TA07' - want = 'TEXT' -class _Prop_Extension(aetools.NProperty): - """Extension - """ - which = 'TA02' - want = 'TEXT' -class _Prop_File_Type(aetools.NProperty): - """File Type - """ - which = 'PR04' - want = 'TEXT' -class _Prop_Ignored_by_Make(aetools.NProperty): - """Ignored by Make - """ - which = 'TA06' - want = 'bool' -class _Prop_Launchable(aetools.NProperty): - """Launchable - """ - which = 'TA05' - want = 'bool' -class _Prop_Precompiled(aetools.NProperty): - """Precompiled - """ - which = 'TA03' - want = 'bool' -class _Prop_Resource_File(aetools.NProperty): - """Resource File - """ - which = 'TA04' - want = 'bool' - -class Global_Source_Trees(aetools.ComponentItem): - """Global Source Trees - Globally-defined source tree roots """ - want = 'GSTs' -class _Prop_Source_Trees(aetools.NProperty): - """Source Trees - List of source tree roots """ - which = 'ST01' - want = 'SrcT' - -class Extras(aetools.ComponentItem): - """Extras - """ - want = 'GXTR' -class _Prop_Automatic_Toolbar_Help(aetools.NProperty): - """Automatic Toolbar Help - Automatically show balloon help in toolbar after delay """ - which = 'EX19' - want = 'bool' -class _Prop_External_Reference(aetools.NProperty): - """External Reference - Which on-line function reference to use. """ - which = 'EX08' - want = 'RefP' -class _Prop_Full_Screen_Zoom(aetools.NProperty): - """Full Screen Zoom - Zoom windows to the full screen width. """ - which = 'EX07' - want = 'bool' -class _Prop_Recent_Editor_Count(aetools.NProperty): - """Recent Editor Count - Maximum number of editor documents to show in the \xd2Open Recent\xd3 menu """ - which = 'EX16' - want = 'shor' -class _Prop_Recent_Project_Count(aetools.NProperty): - """Recent Project Count - Maximum number of project documents to show in the \xd2Open Recent\xd3 menu """ - which = 'EX17' - want = 'shor' -class _Prop_Use_Editor_Extensions(aetools.NProperty): - """Use Editor Extensions - Controls the use of the Editor Extensions menu """ - which = 'EX10' - want = 'bool' -class _Prop_Use_External_Editor(aetools.NProperty): - """Use External Editor - Controls whether CodeWarrior uses its own integrated editor or an external application for editing text files. """ - which = 'EX11' - want = 'bool' -class _Prop_Use_Script_Menu(aetools.NProperty): - """Use Script Menu - Controls the use of the AppleScript menu """ - which = 'EX12' - want = 'bool' -class _Prop_Use_ToolServer_Menu(aetools.NProperty): - """Use ToolServer Menu - Controls the use of the ToolServer menu """ - which = 'EX18' - want = 'bool' - -class Build_Extras(aetools.ComponentItem): - """Build Extras - """ - want = 'LXTR' -class _Prop_Browser_Active(aetools.NProperty): - """Browser Active - Allow the collection of browser information. """ - which = 'EX09' - want = 'bool' -class _Prop_Cache_Subproject_Data(aetools.NProperty): - """Cache Subproject Data - """ - which = 'EX31' - want = 'bool' -class _Prop_Dump_Browser_Info(aetools.NProperty): - """Dump Browser Info - """ - which = 'EX30' - want = 'bool' -class _Prop_Modification_Date_Caching(aetools.NProperty): - """Modification Date Caching - """ - which = 'EX04' - want = 'bool' - -class member_function(aetools.ComponentItem): - """member function - A class member function or method. """ - want = 'MbFn' -class _Prop_implementation_end_offset(aetools.NProperty): - """implementation end offset - end of member function definition """ - which = 'DfEn' - want = 'long' -class _Prop_implementation_file(aetools.NProperty): - """implementation file - Source file containing the member function definition """ - which = 'DfFl' - want = 'fss ' -class _Prop_implementation_start_offset(aetools.NProperty): - """implementation start offset - start of member function definition source code """ - which = 'DfSt' - want = 'long' - -member_functions = member_function - -class Access_Paths(aetools.ComponentItem): - """Access Paths - Contains the definitions of a project\xd5s access (search) paths. """ - want = 'PATH' -class _Prop_Always_Full_Search(aetools.NProperty): - """Always Full Search - To force the compiler to search for system includes like it searches for user includes. """ - which = 'PA02' - want = 'bool' -class _Prop_Convert_Paths(aetools.NProperty): - """Convert Paths - Enables conversion of DOS & Unix-style relative paths when searching for files. """ - which = 'PA04' - want = 'bool' -class _Prop_Require_Framework_Includes(aetools.NProperty): - """Require Framework Includes - Causes the IDE to only look in the framework access paths if a Mac OS X framework style include (i.e. ) is used. """ - which = 'PA05' - want = 'bool' -class _Prop_System_Paths(aetools.NProperty): - """System Paths - To add an access path for the include files. (Not supported in Pascal) """ - which = 'PA03' - want = 'PInf' -class _Prop_User_Paths(aetools.NProperty): - """User Paths - To add an access path for the source files. """ - which = 'PA01' - want = 'PInf' - -class Path_Information(aetools.ComponentItem): - """Path Information - Contains all of the parameters that describe an access path. """ - want = 'PInf' -class _Prop_format(aetools.NProperty): - """format - Format of the a """ - which = 'Frmt' - want = 'PthF' -class _Prop_framework(aetools.NProperty): - """framework - Is the path a Mac OS X framework style path? (This flag is readable but not writeable from AppleScript.) """ - which = 'Frmw' - want = 'bool' -class _Prop_host_flags(aetools.NProperty): - """host flags - Bit fields enabling the access path for each host OS (1 = Mac OS, 2 = Windows) """ - which = 'HstF' - want = 'long' -class _Prop_origin(aetools.NProperty): - """origin - """ - which = 'Orig' - want = 'PPrm' -class _Prop_recursive(aetools.NProperty): - """recursive - Will the path be searched recursively? (Default is true) """ - which = 'Recu' - want = 'bool' -class _Prop_root(aetools.NProperty): - """root - Name of the root of the relative path. Pre-defined values are \xd2Absolute\xd3, \xd2Project\xd3, \xd2CodeWarrior\xd3, and \xd2System\xd3. Anything else is a user-defined root. """ - which = 'Root' - want = 'TEXT' - -class Plugin_Settings(aetools.ComponentItem): - """Plugin Settings - Settings for plugin tools """ - want = 'PSTG' -class _Prop_Disable_Third_Party_COM_Plugins(aetools.NProperty): - """Disable Third Party COM Plugins - Disable COM plugins from third parties """ - which = 'PX02' - want = 'bool' -class _Prop_Plugin_Diagnostics_Level(aetools.NProperty): - """Plugin Diagnostics Level - Plugin Diagnostics Level is for those who are developing plugins for the IDE and need to debug them. """ - which = 'PX01' - want = 'PXdg' - -class Runtime_Settings(aetools.ComponentItem): - """Runtime Settings - Runtime settings """ - want = 'RSTG' -class _Prop_Command_Line_Arguments(aetools.NProperty): - """Command Line Arguments - Extra command line args to pass to executable """ - which = 'RS02' - want = 'TEXT' -class _Prop_Environment_Variables(aetools.NProperty): - """Environment Variables - Environment variables to use when running the executable """ - which = 'RS04' - want = 'EnvV' -class _Prop_Host_Application(aetools.NProperty): - """Host Application - Host application for running/debugging libraries and code resources """ - which = 'RS01' - want = 'RlPt' -class _Prop_Working_Directory(aetools.NProperty): - """Working Directory - Working directory to use when running the executable """ - which = 'RS03' - want = 'TEXT' - -class Relative_Path(aetools.ComponentItem): - """Relative Path - Relative path from some root """ - want = 'RlPt' - -class Shielded_Folder(aetools.ComponentItem): - """Shielded Folder - """ - want = 'SFit' -class _Prop_Expression_To_Match(aetools.NProperty): - """Expression To Match - Regular expression which describes folders to skip """ - which = 'SF01' - want = 'TEXT' -class _Prop_Skip_Find_And_Compare_Operations(aetools.NProperty): - """Skip Find And Compare Operations - Matching folders will be skipped during find and compare operations """ - which = 'SF03' - want = 'bool' -class _Prop_Skip_Project_Operations(aetools.NProperty): - """Skip Project Operations - Matching folders will be skipped during project operations """ - which = 'SF02' - want = 'bool' - -class Shielded_Folders(aetools.ComponentItem): - """Shielded Folders - Folders skipped when performing project and find-and-compare operations """ - want = 'SHFL' -class _Prop_Shielded_Items(aetools.NProperty): - """Shielded Items - """ - which = 'SFis' - want = 'SFit' - -class Syntax_Coloring(aetools.ComponentItem): - """Syntax Coloring - """ - want = 'SNTX' -class _Prop_Comment_Color(aetools.NProperty): - """Comment Color - The color for comments. """ - which = 'GH02' - want = 'cRGB' -class _Prop_Keyword_Color(aetools.NProperty): - """Keyword Color - The color for language keywords. """ - which = 'GH03' - want = 'cRGB' -class _Prop_String_Color(aetools.NProperty): - """String Color - The color for strings. """ - which = 'GH04' - want = 'cRGB' -class _Prop_Syntax_Coloring(aetools.NProperty): - """Syntax Coloring - Mark keywords and comments with color. """ - which = 'GH01' - want = 'bool' - -class Segment(aetools.ComponentItem): - """Segment - A segment or group in the project """ - want = 'Seg ' -class _Prop_filecount(aetools.NProperty): - """filecount - """ - which = 'NumF' - want = 'shor' -class _Prop_seg_2d_locked(aetools.NProperty): - """seg-locked - Is the segment locked ? [68K only] """ - which = 'PLck' - want = 'bool' -class _Prop_seg_2d_preloaded(aetools.NProperty): - """seg-preloaded - Is the segment preloaded ? [68K only] """ - which = 'Prel' - want = 'bool' -class _Prop_seg_2d_protected(aetools.NProperty): - """seg-protected - Is the segment protected ? [68K only] """ - which = 'Prot' - want = 'bool' -class _Prop_seg_2d_purgeable(aetools.NProperty): - """seg-purgeable - Is the segment purgeable ? [68K only] """ - which = 'Purg' - want = 'bool' -class _Prop_seg_2d_system_heap(aetools.NProperty): - """seg-system heap - Is the segment loaded into the system heap ? [68K only] """ - which = 'SysH' - want = 'bool' - -class ProjectFile(aetools.ComponentItem): - """ProjectFile - A file contained in a project """ - want = 'SrcF' -class _Prop_codesize(aetools.NProperty): - """codesize - The size of this file\xd5s code. """ - which = 'CSiz' - want = 'long' -class _Prop_datasize(aetools.NProperty): - """datasize - The size of this file\xd5s data. """ - which = 'DSiz' - want = 'long' -class _Prop_filetype(aetools.NProperty): - """filetype - What kind of file is this ? """ - which = 'SrcT' - want = 'SrcT' -class _Prop_includes(aetools.NProperty): - """includes - """ - which = 'IncF' - want = 'fss ' -class _Prop_initialize_before(aetools.NProperty): - """initialize before - Initialize the shared library before the main application. """ - which = 'Bfor' - want = 'bool' -class _Prop_symbols(aetools.NProperty): - """symbols - Are debugging symbols generated for this file ? """ - which = 'SymG' - want = 'bool' -class _Prop_up_to_date(aetools.NProperty): - """up to date - Has the file been compiled since its last modification ? """ - which = 'UpTD' - want = 'bool' -class _Prop_weak_link(aetools.NProperty): - """weak link - Is this file imported weakly into the project ? [PowerPC only] """ - which = 'Weak' - want = 'bool' - -class Source_Tree(aetools.ComponentItem): - """Source Tree - User-defined source tree root """ - want = 'SrcT' -class _Prop_path(aetools.NProperty): - """path - path for the user-defined source tree root """ - which = 'Path' - want = 'TEXT' -class _Prop_path_kind(aetools.NProperty): - """path kind - kind of path """ - which = 'Kind' - want = 'STKd' - -class Target_Settings(aetools.ComponentItem): - """Target Settings - Contains the definitions of a project\xd5s target. """ - want = 'TARG' -class _Prop_Linker(aetools.NProperty): - """Linker - The name of the current linker. """ - which = 'TA01' - want = 'TEXT' -class _Prop_Output_Directory_Location(aetools.NProperty): - """Output Directory Location - Location of output directory """ - which = 'TA16' - want = 'RlPt' -class _Prop_Output_Directory_Origin(aetools.NProperty): - """Output Directory Origin - Origin of path to output directory. Usage of this property is deprecated. Use the \xd2Output Directory Location\xd3 property instead. """ - which = 'TA12' - want = 'PPrm' -class _Prop_Output_Directory_Path(aetools.NProperty): - """Output Directory Path - Path to output directory. Usage of this property is deprecated. Use the \xd2Output Directory Location\xd3 property instead. """ - which = 'TA11' - want = 'TEXT' -class _Prop_Post_Linker(aetools.NProperty): - """Post Linker - """ - which = 'TA09' - want = 'TEXT' -class _Prop_Pre_Linker(aetools.NProperty): - """Pre Linker - """ - which = 'TA13' - want = 'TEXT' -class _Prop_Target_Name(aetools.NProperty): - """Target Name - """ - which = 'TA10' - want = 'TEXT' -class _Prop_Use_Relative_Paths(aetools.NProperty): - """Use Relative Paths - Save project entries using relative paths """ - which = 'TA15' - want = 'bool' - -class Target_Source_Trees(aetools.ComponentItem): - """Target Source Trees - Target-specific user-defined source tree roots """ - want = 'TSTs' - -class VCS_Setup(aetools.ComponentItem): - """VCS Setup - The version control system preferences. """ - want = 'VCSs' -class _Prop_Always_Prompt(aetools.NProperty): - """Always Prompt - Always show login dialog """ - which = 'VC07' - want = 'bool' -class _Prop_Auto_Connect(aetools.NProperty): - """Auto Connect - Automatically connect to database when starting. """ - which = 'VC05' - want = 'bool' -class _Prop_Connection_Method(aetools.NProperty): - """Connection Method - Name of Version Control System to use. """ - which = 'VC02' - want = 'TEXT' -class _Prop_Database_Path(aetools.NProperty): - """Database Path - Path to the VCS database. """ - which = 'VC09' - want = 'RlPt' -class _Prop_Local_Path(aetools.NProperty): - """Local Path - Path to the local root """ - which = 'VC10' - want = 'RlPt' -class _Prop_Mount_Volume(aetools.NProperty): - """Mount Volume - Attempt to mount the database volume if it isn't available. """ - which = 'VC08' - want = 'bool' -class _Prop_Password(aetools.NProperty): - """Password - The password for the VCS. """ - which = 'VC04' - want = 'TEXT' -class _Prop_Store_Password(aetools.NProperty): - """Store Password - Store the password. """ - which = 'VC06' - want = 'bool' -class _Prop_Use_Global_Settings(aetools.NProperty): - """Use Global Settings - Use the global VCS settings by default """ - which = 'VC11' - want = 'bool' -class _Prop_Username(aetools.NProperty): - """Username - The user name for the VCS. """ - which = 'VC03' - want = 'TEXT' -class _Prop_VCS_Active(aetools.NProperty): - """VCS Active - Use Version Control """ - which = 'VC01' - want = 'bool' - -class Font(aetools.ComponentItem): - """Font - """ - want = 'mFNT' -class _Prop_Auto_Indent(aetools.NProperty): - """Auto Indent - Indent new lines automatically. """ - which = 'FN01' - want = 'bool' -class _Prop_Tab_Indents_Selection(aetools.NProperty): - """Tab Indents Selection - Tab indents selection when multiple lines are selected """ - which = 'FN03' - want = 'bool' -class _Prop_Tab_Inserts_Spaces(aetools.NProperty): - """Tab Inserts Spaces - Insert spaces instead of tab character """ - which = 'FN04' - want = 'bool' -class _Prop_Tab_Size(aetools.NProperty): - """Tab Size - """ - which = 'FN02' - want = 'shor' -class _Prop_Text_Font(aetools.NProperty): - """Text Font - The font used in editing windows. """ - which = 'ptxf' - want = 'TEXT' -class _Prop_Text_Size(aetools.NProperty): - """Text Size - The size of the text in an editing window. """ - which = 'ptps' - want = 'shor' -Browser_Coloring._superclassnames = [] -Browser_Coloring._privpropdict = { - 'Browser_Keywords' : _Prop_Browser_Keywords, - 'Classes_Color' : _Prop_Classes_Color, - 'Constants_Color' : _Prop_Constants_Color, - 'Enums_Color' : _Prop_Enums_Color, - 'Functions_Color' : _Prop_Functions_Color, - 'Globals_Color' : _Prop_Globals_Color, - 'Macros_Color' : _Prop_Macros_Color, - 'Template_Commands_in_Menu' : _Prop_Template_Commands_in_Menu, - 'Templates_Color' : _Prop_Templates_Color, - 'Typedefs_Color' : _Prop_Typedefs_Color, -} -Browser_Coloring._privelemdict = { -} -Build_Settings._superclassnames = [] -Build_Settings._privpropdict = { - 'Build_Before_Running' : _Prop_Build_Before_Running, - 'Compiler_Thread_Stack_Size' : _Prop_Compiler_Thread_Stack_Size, - 'Completion_Sound' : _Prop_Completion_Sound, - 'Failure_Sound' : _Prop_Failure_Sound, - 'Include_Cache_Size' : _Prop_Include_Cache_Size, - 'Save_Before_Building' : _Prop_Save_Before_Building, - 'Success_Sound' : _Prop_Success_Sound, -} -Build_Settings._privelemdict = { -} -base_class._superclassnames = [] -base_class._privpropdict = { - 'access' : _Prop_access, - 'class_' : _Prop_class_, - 'virtual' : _Prop_virtual, -} -base_class._privelemdict = { -} -Custom_Keywords._superclassnames = [] -Custom_Keywords._privpropdict = { - 'Custom_Color_1' : _Prop_Custom_Color_1, - 'Custom_Color_2' : _Prop_Custom_Color_2, - 'Custom_Color_3' : _Prop_Custom_Color_3, - 'Custom_Color_4' : _Prop_Custom_Color_4, -} -Custom_Keywords._privelemdict = { -} -browser_catalog._superclassnames = [] -browser_catalog._privpropdict = { -} -browser_catalog._privelemdict = { - 'class_' : class_, -} -class_._superclassnames = [] -class_._privpropdict = { - 'all_subclasses' : _Prop_all_subclasses, - 'declaration_end_offset' : _Prop_declaration_end_offset, - 'declaration_file' : _Prop_declaration_file, - 'declaration_start_offset' : _Prop_declaration_start_offset, - 'language' : _Prop_language, - 'name' : _Prop_name, - 'subclasses' : _Prop_subclasses, -} -class_._privelemdict = { - 'base_class' : base_class, - 'data_member' : data_member, - 'member_function' : member_function, -} -Debugger_Display._superclassnames = [] -Debugger_Display._privpropdict = { - 'Default_Array_Size' : _Prop_Default_Array_Size, - 'Show_As_Decimal' : _Prop_Show_As_Decimal, - 'Show_Locals' : _Prop_Show_Locals, - 'Show_Variable_Types' : _Prop_Show_Variable_Types, - 'Sort_By_Method' : _Prop_Sort_By_Method, - 'Threads_in_Window' : _Prop_Threads_in_Window, - 'Use_RTTI' : _Prop_Use_RTTI, - 'Variable_Changed_Hilite' : _Prop_Variable_Changed_Hilite, - 'Variable_Hints' : _Prop_Variable_Hints, - 'Watchpoint_Hilite' : _Prop_Watchpoint_Hilite, -} -Debugger_Display._privelemdict = { -} -Debugger_Global._superclassnames = [] -Debugger_Global._privpropdict = { - 'Auto_Target_Libraries' : _Prop_Auto_Target_Libraries, - 'Cache_Edited_Files' : _Prop_Cache_Edited_Files, - 'Confirm_Kill' : _Prop_Confirm_Kill, - 'Dont_Step_in_Runtime' : _Prop_Dont_Step_in_Runtime, - 'File_Cache_Duration' : _Prop_File_Cache_Duration, - 'Ignore_Mod_Dates' : _Prop_Ignore_Mod_Dates, - 'Launch_Apps_on_Open' : _Prop_Launch_Apps_on_Open, - 'Open_All_Classes' : _Prop_Open_All_Classes, - 'Select_Stack_Crawl' : _Prop_Select_Stack_Crawl, - 'Stop_at_Main' : _Prop_Stop_at_Main, -} -Debugger_Global._privelemdict = { -} -Debugger_Target._superclassnames = [] -Debugger_Target._privpropdict = { - 'Auto_Target_Libraries' : _Prop_Auto_Target_Libraries, - 'Cache_symbolics' : _Prop_Cache_symbolics, - 'Data_Update_Interval' : _Prop_Data_Update_Interval, - 'Log_System_Messages' : _Prop_Log_System_Messages, - 'Relocated_Executable_Path' : _Prop_Relocated_Executable_Path, - 'Stop_at_temp_breakpoint' : _Prop_Stop_at_temp_breakpoint, - 'Temp_Breakpoint_Type' : _Prop_Temp_Breakpoint_Type, - 'Temp_breakpoint_names' : _Prop_Temp_breakpoint_names, - 'Update_Data_While_Running' : _Prop_Update_Data_While_Running, -} -Debugger_Target._privelemdict = { -} -Debugger_Windowing._superclassnames = [] -Debugger_Windowing._privpropdict = { - 'Debugging_Start_Action' : _Prop_Debugging_Start_Action, - 'Do_Nothing_To_Projects' : _Prop_Do_Nothing_To_Projects, -} -Debugger_Windowing._privelemdict = { -} -data_member._superclassnames = [] -data_member._privpropdict = { - 'access' : _Prop_access, - 'declaration_end_offset' : _Prop_declaration_end_offset, - 'declaration_start_offset' : _Prop_declaration_start_offset, - 'name' : _Prop_name, - 'static' : _Prop_static, -} -data_member._privelemdict = { -} -Editor._superclassnames = [] -Editor._privpropdict = { - 'Background_Color' : _Prop_Background_Color, - 'Balance' : _Prop_Balance, - 'Context_Popup_Delay' : _Prop_Context_Popup_Delay, - 'Default_Text_File_Format' : _Prop_Default_Text_File_Format, - 'Dynamic_Scroll' : _Prop_Dynamic_Scroll, - 'Flash_Delay' : _Prop_Flash_Delay, - 'Left_Margin_Line_Select' : _Prop_Left_Margin_Line_Select, - 'Main_Text_Color' : _Prop_Main_Text_Color, - 'Relaxed_C_Popup_Parsing' : _Prop_Relaxed_C_Popup_Parsing, - 'Remember_Font' : _Prop_Remember_Font, - 'Remember_Selection' : _Prop_Remember_Selection, - 'Remember_Window' : _Prop_Remember_Window, - 'Sort_Function_Popup' : _Prop_Sort_Function_Popup, - 'Use_Drag__26__Drop_Editing' : _Prop_Use_Drag__26__Drop_Editing, - 'Use_Multiple_Undo' : _Prop_Use_Multiple_Undo, -} -Editor._privelemdict = { -} -Environment_Variable._superclassnames = [] -Environment_Variable._privpropdict = { - 'name' : _Prop_name, - 'value' : _Prop_value, -} -Environment_Variable._privelemdict = { -} -Error_Information._superclassnames = [] -Error_Information._privpropdict = { - 'disk_file' : _Prop_disk_file, - 'lineNumber' : _Prop_lineNumber, - 'message' : _Prop_message, - 'messageKind' : _Prop_messageKind, -} -Error_Information._privelemdict = { -} -Function_Information._superclassnames = [] -Function_Information._privpropdict = { - 'disk_file' : _Prop_disk_file, - 'lineNumber' : _Prop_lineNumber, -} -Function_Information._privelemdict = { -} -File_Mappings._superclassnames = [] -File_Mappings._privpropdict = { - 'Mappings' : _Prop_Mappings, -} -File_Mappings._privelemdict = { -} -File_Mapping._superclassnames = [] -File_Mapping._privpropdict = { - 'Compiler' : _Prop_Compiler, - 'Extension' : _Prop_Extension, - 'File_Type' : _Prop_File_Type, - 'Ignored_by_Make' : _Prop_Ignored_by_Make, - 'Launchable' : _Prop_Launchable, - 'Precompiled' : _Prop_Precompiled, - 'Resource_File' : _Prop_Resource_File, -} -File_Mapping._privelemdict = { -} -Global_Source_Trees._superclassnames = [] -Global_Source_Trees._privpropdict = { - 'Source_Trees' : _Prop_Source_Trees, -} -Global_Source_Trees._privelemdict = { -} -Extras._superclassnames = [] -Extras._privpropdict = { - 'Automatic_Toolbar_Help' : _Prop_Automatic_Toolbar_Help, - 'External_Reference' : _Prop_External_Reference, - 'Full_Screen_Zoom' : _Prop_Full_Screen_Zoom, - 'Recent_Editor_Count' : _Prop_Recent_Editor_Count, - 'Recent_Project_Count' : _Prop_Recent_Project_Count, - 'Use_Editor_Extensions' : _Prop_Use_Editor_Extensions, - 'Use_External_Editor' : _Prop_Use_External_Editor, - 'Use_Script_Menu' : _Prop_Use_Script_Menu, - 'Use_ToolServer_Menu' : _Prop_Use_ToolServer_Menu, -} -Extras._privelemdict = { -} -Build_Extras._superclassnames = [] -Build_Extras._privpropdict = { - 'Browser_Active' : _Prop_Browser_Active, - 'Cache_Subproject_Data' : _Prop_Cache_Subproject_Data, - 'Dump_Browser_Info' : _Prop_Dump_Browser_Info, - 'Modification_Date_Caching' : _Prop_Modification_Date_Caching, -} -Build_Extras._privelemdict = { -} -member_function._superclassnames = [] -member_function._privpropdict = { - 'access' : _Prop_access, - 'declaration_end_offset' : _Prop_declaration_end_offset, - 'declaration_file' : _Prop_declaration_file, - 'declaration_start_offset' : _Prop_declaration_start_offset, - 'implementation_end_offset' : _Prop_implementation_end_offset, - 'implementation_file' : _Prop_implementation_file, - 'implementation_start_offset' : _Prop_implementation_start_offset, - 'name' : _Prop_name, - 'static' : _Prop_static, - 'virtual' : _Prop_virtual, -} -member_function._privelemdict = { -} -Access_Paths._superclassnames = [] -Access_Paths._privpropdict = { - 'Always_Full_Search' : _Prop_Always_Full_Search, - 'Convert_Paths' : _Prop_Convert_Paths, - 'Require_Framework_Includes' : _Prop_Require_Framework_Includes, - 'System_Paths' : _Prop_System_Paths, - 'User_Paths' : _Prop_User_Paths, -} -Access_Paths._privelemdict = { -} -Path_Information._superclassnames = [] -Path_Information._privpropdict = { - 'format' : _Prop_format, - 'framework' : _Prop_framework, - 'host_flags' : _Prop_host_flags, - 'name' : _Prop_name, - 'origin' : _Prop_origin, - 'recursive' : _Prop_recursive, - 'root' : _Prop_root, -} -Path_Information._privelemdict = { -} -Plugin_Settings._superclassnames = [] -Plugin_Settings._privpropdict = { - 'Disable_Third_Party_COM_Plugins' : _Prop_Disable_Third_Party_COM_Plugins, - 'Plugin_Diagnostics_Level' : _Prop_Plugin_Diagnostics_Level, -} -Plugin_Settings._privelemdict = { -} -Runtime_Settings._superclassnames = [] -Runtime_Settings._privpropdict = { - 'Command_Line_Arguments' : _Prop_Command_Line_Arguments, - 'Environment_Variables' : _Prop_Environment_Variables, - 'Host_Application' : _Prop_Host_Application, - 'Working_Directory' : _Prop_Working_Directory, -} -Runtime_Settings._privelemdict = { -} -Relative_Path._superclassnames = [] -Relative_Path._privpropdict = { - 'format' : _Prop_format, - 'name' : _Prop_name, - 'origin' : _Prop_origin, - 'root' : _Prop_root, -} -Relative_Path._privelemdict = { -} -Shielded_Folder._superclassnames = [] -Shielded_Folder._privpropdict = { - 'Expression_To_Match' : _Prop_Expression_To_Match, - 'Skip_Find_And_Compare_Operations' : _Prop_Skip_Find_And_Compare_Operations, - 'Skip_Project_Operations' : _Prop_Skip_Project_Operations, -} -Shielded_Folder._privelemdict = { -} -Shielded_Folders._superclassnames = [] -Shielded_Folders._privpropdict = { - 'Shielded_Items' : _Prop_Shielded_Items, -} -Shielded_Folders._privelemdict = { -} -Syntax_Coloring._superclassnames = [] -Syntax_Coloring._privpropdict = { - 'Comment_Color' : _Prop_Comment_Color, - 'Custom_Color_1' : _Prop_Custom_Color_1, - 'Custom_Color_2' : _Prop_Custom_Color_2, - 'Custom_Color_3' : _Prop_Custom_Color_3, - 'Custom_Color_4' : _Prop_Custom_Color_4, - 'Keyword_Color' : _Prop_Keyword_Color, - 'String_Color' : _Prop_String_Color, - 'Syntax_Coloring' : _Prop_Syntax_Coloring, -} -Syntax_Coloring._privelemdict = { -} -Segment._superclassnames = [] -Segment._privpropdict = { - 'filecount' : _Prop_filecount, - 'name' : _Prop_name, - 'seg_2d_locked' : _Prop_seg_2d_locked, - 'seg_2d_preloaded' : _Prop_seg_2d_preloaded, - 'seg_2d_protected' : _Prop_seg_2d_protected, - 'seg_2d_purgeable' : _Prop_seg_2d_purgeable, - 'seg_2d_system_heap' : _Prop_seg_2d_system_heap, -} -Segment._privelemdict = { -} -ProjectFile._superclassnames = [] -ProjectFile._privpropdict = { - 'codesize' : _Prop_codesize, - 'datasize' : _Prop_datasize, - 'disk_file' : _Prop_disk_file, - 'filetype' : _Prop_filetype, - 'includes' : _Prop_includes, - 'initialize_before' : _Prop_initialize_before, - 'name' : _Prop_name, - 'symbols' : _Prop_symbols, - 'up_to_date' : _Prop_up_to_date, - 'weak_link' : _Prop_weak_link, -} -ProjectFile._privelemdict = { -} -Source_Tree._superclassnames = [] -Source_Tree._privpropdict = { - 'format' : _Prop_format, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'path_kind' : _Prop_path_kind, -} -Source_Tree._privelemdict = { -} -Target_Settings._superclassnames = [] -Target_Settings._privpropdict = { - 'Linker' : _Prop_Linker, - 'Output_Directory_Location' : _Prop_Output_Directory_Location, - 'Output_Directory_Origin' : _Prop_Output_Directory_Origin, - 'Output_Directory_Path' : _Prop_Output_Directory_Path, - 'Post_Linker' : _Prop_Post_Linker, - 'Pre_Linker' : _Prop_Pre_Linker, - 'Target_Name' : _Prop_Target_Name, - 'Use_Relative_Paths' : _Prop_Use_Relative_Paths, -} -Target_Settings._privelemdict = { -} -Target_Source_Trees._superclassnames = [] -Target_Source_Trees._privpropdict = { - 'Source_Trees' : _Prop_Source_Trees, -} -Target_Source_Trees._privelemdict = { -} -VCS_Setup._superclassnames = [] -VCS_Setup._privpropdict = { - 'Always_Prompt' : _Prop_Always_Prompt, - 'Auto_Connect' : _Prop_Auto_Connect, - 'Connection_Method' : _Prop_Connection_Method, - 'Database_Path' : _Prop_Database_Path, - 'Local_Path' : _Prop_Local_Path, - 'Mount_Volume' : _Prop_Mount_Volume, - 'Password' : _Prop_Password, - 'Store_Password' : _Prop_Store_Password, - 'Use_Global_Settings' : _Prop_Use_Global_Settings, - 'Username' : _Prop_Username, - 'VCS_Active' : _Prop_VCS_Active, -} -VCS_Setup._privelemdict = { -} -Font._superclassnames = [] -Font._privpropdict = { - 'Auto_Indent' : _Prop_Auto_Indent, - 'Tab_Indents_Selection' : _Prop_Tab_Indents_Selection, - 'Tab_Inserts_Spaces' : _Prop_Tab_Inserts_Spaces, - 'Tab_Size' : _Prop_Tab_Size, - 'Text_Font' : _Prop_Text_Font, - 'Text_Size' : _Prop_Text_Size, -} -Font._privelemdict = { -} -_Enum_Acce = { - 'public' : 'Publ', # - 'protected' : 'Prot', # - 'private' : 'Priv', # -} - -_Enum_BXbr = { - 'Always_Build' : 'BXb1', # Always build the target before running. - 'Ask_Build' : 'BXb2', # Ask before building the target when running. - 'Never_Build' : 'BXb3', # Never before building the target before running. -} - -_Enum_DbSA = { - 'No_Action' : 'DSA1', # Don\xd5t do anything to non-debug windows - 'Hide_Windows' : 'DSA2', # Hide non-debugging windows - 'Collapse_Windows' : 'DSA3', # Collapse non-debugging windows - 'Close_Windows' : 'DSA4', # Close non-debugging windows -} - -_Enum_DgBL = { - 'Always' : 'DgB0', # Always build before debugging. - 'Never' : 'DgB1', # Never build before debugging. - 'Ask' : 'DgB2', # Ask about building before debugging. -} - -_Enum_ErrT = { - 'information' : 'ErIn', # - 'compiler_warning' : 'ErCW', # - 'compiler_error' : 'ErCE', # - 'definition' : 'ErDf', # - 'linker_warning' : 'ErLW', # - 'linker_error' : 'ErLE', # - 'find_result' : 'ErFn', # - 'generic_error' : 'ErGn', # -} - -_Enum_Inte = { - 'never_interact' : 'eNvr', # Never allow user interactions - 'interact_with_self' : 'eInS', # Allow user interaction only when an AppleEvent is sent from within CodeWarrior - 'interact_with_local' : 'eInL', # Allow user interaction when AppleEvents are sent from applications on the same machine (default) - 'interact_with_all' : 'eInA', # Allow user interaction from both local and remote AppleEvents -} - -_Enum_Lang = { - 'C' : 'LC ', # - 'C_2b__2b_' : 'LC++', # - 'Pascal' : 'LP ', # - 'Object_Pascal' : 'LP++', # - 'Java' : 'LJav', # - 'Assembler' : 'LAsm', # - 'Unknown' : 'L? ', # -} - -_Enum_PPrm = { - 'absolute' : 'Abso', # An absolute path name, including volume name. - 'project_relative' : 'PRel', # A path relative to the current project\xd5s folder. - 'shell_relative' : 'SRel', # A path relative to the CodeWarrior\xaa folder. - 'system_relative' : 'YRel', # A path relative to the system folder - 'root_relative' : 'RRel', # -} - -_Enum_PXdg = { - 'Diagnose_None' : 'PXd1', # No Plugin Diagnostics. - 'Diagnose_Errors' : 'PXd2', # Plugin Diagnostics for errors only. - 'Diagnose_All' : 'PXd3', # Plugin Diagnostics for everything. -} - -_Enum_PthF = { - 'Generic_Path' : 'PFGn', # - 'MacOS_Path' : 'PFMc', # MacOS path using colon as separator - 'Windows_Path' : 'PFWn', # Windows path using backslash as separator - 'Unix_Path' : 'PFUx', # Unix path using slash as separator -} - -_Enum_RefP = { - 'Think_Reference' : 'DanR', # - 'QuickView' : 'ALTV', # -} - -_Enum_STKd = { - 'Absolute_Path' : 'STK0', # The \xd2path\xd3 property is an absolute path to the location of the source tree. - 'Registry_Key' : 'STK1', # The \xd2path\xd3 property is the name of a registry key that contains the path to the root. - 'Environment_Variable' : 'STK2', # The \xd2path\xd3 property is the name of an environment variable that contains the path to the root. -} - -_Enum_SrcT = { - 'source' : 'FTxt', # A source file (.c, .cp, .p, etc). - 'unknown' : 'FUnk', # An unknown file type. -} - -_Enum_TmpB = { - 'User_Specified' : 'Usrs', # Use user specified symbols when setting temporary breakpoints on program launch. - 'Default' : 'Dflt', # Use system default symbols when setting temporary breakpoints on program launch. -} - -_Enum_TxtF = { - 'MacOS' : 'TxF0', # MacOS text format - 'DOS' : 'TxF1', # DOS text format - 'Unix' : 'TxF2', # Unix text format -} - -_Enum_savo = { - 'yes' : 'yes ', # Save changes - 'no' : 'no ', # Do not save changes - 'ask' : 'ask ', # Ask the user whether to save -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'BRKW' : Browser_Coloring, - 'BSTG' : Build_Settings, - 'BsCl' : base_class, - 'CUKW' : Custom_Keywords, - 'Cata' : browser_catalog, - 'Clas' : class_, - 'DbDS' : Debugger_Display, - 'DbGL' : Debugger_Global, - 'DbTG' : Debugger_Target, - 'DbWN' : Debugger_Windowing, - 'DtMb' : data_member, - 'EDTR' : Editor, - 'EnvV' : Environment_Variable, - 'ErrM' : Error_Information, - 'FDef' : Function_Information, - 'FLMP' : File_Mappings, - 'FMap' : File_Mapping, - 'GSTs' : Global_Source_Trees, - 'GXTR' : Extras, - 'LXTR' : Build_Extras, - 'MbFn' : member_function, - 'PATH' : Access_Paths, - 'PInf' : Path_Information, - 'PSTG' : Plugin_Settings, - 'RSTG' : Runtime_Settings, - 'RlPt' : Relative_Path, - 'SFit' : Shielded_Folder, - 'SHFL' : Shielded_Folders, - 'SNTX' : Syntax_Coloring, - 'Seg ' : Segment, - 'SrcF' : ProjectFile, - 'SrcT' : Source_Tree, - 'TARG' : Target_Settings, - 'TSTs' : Target_Source_Trees, - 'VCSs' : VCS_Setup, - 'mFNT' : Font, -} - -_propdeclarations = { - 'Acce' : _Prop_access, - 'BW00' : _Prop_Browser_Keywords, - 'BW01' : _Prop_Classes_Color, - 'BW02' : _Prop_Constants_Color, - 'BW03' : _Prop_Enums_Color, - 'BW04' : _Prop_Functions_Color, - 'BW05' : _Prop_Globals_Color, - 'BW06' : _Prop_Macros_Color, - 'BW07' : _Prop_Templates_Color, - 'BW08' : _Prop_Typedefs_Color, - 'BW10' : _Prop_Template_Commands_in_Menu, - 'BX01' : _Prop_Completion_Sound, - 'BX02' : _Prop_Success_Sound, - 'BX03' : _Prop_Failure_Sound, - 'BX04' : _Prop_Build_Before_Running, - 'BX05' : _Prop_Include_Cache_Size, - 'BX06' : _Prop_Compiler_Thread_Stack_Size, - 'BX07' : _Prop_Save_Before_Building, - 'Bfor' : _Prop_initialize_before, - 'CSiz' : _Prop_codesize, - 'Clas' : _Prop_class_, - 'DSiz' : _Prop_datasize, - 'Db01' : _Prop_Show_Variable_Types, - 'Db02' : _Prop_Sort_By_Method, - 'Db03' : _Prop_Use_RTTI, - 'Db04' : _Prop_Threads_in_Window, - 'Db05' : _Prop_Variable_Hints, - 'Db06' : _Prop_Watchpoint_Hilite, - 'Db07' : _Prop_Variable_Changed_Hilite, - 'Db08' : _Prop_Default_Array_Size, - 'Db09' : _Prop_Show_Locals, - 'Db10' : _Prop_Show_As_Decimal, - 'DcEn' : _Prop_declaration_end_offset, - 'DcFl' : _Prop_declaration_file, - 'DcSt' : _Prop_declaration_start_offset, - 'DfEn' : _Prop_implementation_end_offset, - 'DfFl' : _Prop_implementation_file, - 'DfSt' : _Prop_implementation_start_offset, - 'Dg01' : _Prop_Ignore_Mod_Dates, - 'Dg02' : _Prop_Open_All_Classes, - 'Dg03' : _Prop_Launch_Apps_on_Open, - 'Dg04' : _Prop_Confirm_Kill, - 'Dg05' : _Prop_Stop_at_Main, - 'Dg06' : _Prop_Select_Stack_Crawl, - 'Dg07' : _Prop_Dont_Step_in_Runtime, - 'Dg11' : _Prop_Auto_Target_Libraries, - 'Dg12' : _Prop_Cache_Edited_Files, - 'Dg13' : _Prop_File_Cache_Duration, - 'Dt02' : _Prop_Log_System_Messages, - 'Dt08' : _Prop_Update_Data_While_Running, - 'Dt09' : _Prop_Data_Update_Interval, - 'Dt10' : _Prop_Relocated_Executable_Path, - 'Dt13' : _Prop_Stop_at_temp_breakpoint, - 'Dt14' : _Prop_Temp_breakpoint_names, - 'Dt15' : _Prop_Cache_symbolics, - 'Dt16' : _Prop_Temp_Breakpoint_Type, - 'Dw01' : _Prop_Debugging_Start_Action, - 'Dw02' : _Prop_Do_Nothing_To_Projects, - 'ED01' : _Prop_Flash_Delay, - 'ED02' : _Prop_Dynamic_Scroll, - 'ED03' : _Prop_Balance, - 'ED04' : _Prop_Use_Drag__26__Drop_Editing, - 'ED06' : _Prop_Sort_Function_Popup, - 'ED07' : _Prop_Use_Multiple_Undo, - 'ED08' : _Prop_Remember_Font, - 'ED09' : _Prop_Remember_Selection, - 'ED10' : _Prop_Remember_Window, - 'ED12' : _Prop_Main_Text_Color, - 'ED13' : _Prop_Background_Color, - 'ED14' : _Prop_Context_Popup_Delay, - 'ED15' : _Prop_Relaxed_C_Popup_Parsing, - 'ED16' : _Prop_Left_Margin_Line_Select, - 'ED17' : _Prop_Default_Text_File_Format, - 'EX04' : _Prop_Modification_Date_Caching, - 'EX07' : _Prop_Full_Screen_Zoom, - 'EX08' : _Prop_External_Reference, - 'EX09' : _Prop_Browser_Active, - 'EX10' : _Prop_Use_Editor_Extensions, - 'EX11' : _Prop_Use_External_Editor, - 'EX12' : _Prop_Use_Script_Menu, - 'EX16' : _Prop_Recent_Editor_Count, - 'EX17' : _Prop_Recent_Project_Count, - 'EX18' : _Prop_Use_ToolServer_Menu, - 'EX19' : _Prop_Automatic_Toolbar_Help, - 'EX30' : _Prop_Dump_Browser_Info, - 'EX31' : _Prop_Cache_Subproject_Data, - 'ErrL' : _Prop_lineNumber, - 'ErrS' : _Prop_message, - 'ErrT' : _Prop_messageKind, - 'FMps' : _Prop_Mappings, - 'FN01' : _Prop_Auto_Indent, - 'FN02' : _Prop_Tab_Size, - 'FN03' : _Prop_Tab_Indents_Selection, - 'FN04' : _Prop_Tab_Inserts_Spaces, - 'Frmt' : _Prop_format, - 'Frmw' : _Prop_framework, - 'GH01' : _Prop_Syntax_Coloring, - 'GH02' : _Prop_Comment_Color, - 'GH03' : _Prop_Keyword_Color, - 'GH04' : _Prop_String_Color, - 'GH05' : _Prop_Custom_Color_1, - 'GH06' : _Prop_Custom_Color_2, - 'GH07' : _Prop_Custom_Color_3, - 'GH08' : _Prop_Custom_Color_4, - 'HstF' : _Prop_host_flags, - 'IncF' : _Prop_includes, - 'Kind' : _Prop_path_kind, - 'Lang' : _Prop_language, - 'NumF' : _Prop_filecount, - 'Orig' : _Prop_origin, - 'PA01' : _Prop_User_Paths, - 'PA02' : _Prop_Always_Full_Search, - 'PA03' : _Prop_System_Paths, - 'PA04' : _Prop_Convert_Paths, - 'PA05' : _Prop_Require_Framework_Includes, - 'PLck' : _Prop_seg_2d_locked, - 'PR04' : _Prop_File_Type, - 'PX01' : _Prop_Plugin_Diagnostics_Level, - 'PX02' : _Prop_Disable_Third_Party_COM_Plugins, - 'Path' : _Prop_path, - 'Prel' : _Prop_seg_2d_preloaded, - 'Prot' : _Prop_seg_2d_protected, - 'Purg' : _Prop_seg_2d_purgeable, - 'RS01' : _Prop_Host_Application, - 'RS02' : _Prop_Command_Line_Arguments, - 'RS03' : _Prop_Working_Directory, - 'RS04' : _Prop_Environment_Variables, - 'Recu' : _Prop_recursive, - 'Root' : _Prop_root, - 'SF01' : _Prop_Expression_To_Match, - 'SF02' : _Prop_Skip_Project_Operations, - 'SF03' : _Prop_Skip_Find_And_Compare_Operations, - 'SFis' : _Prop_Shielded_Items, - 'ST01' : _Prop_Source_Trees, - 'SrcT' : _Prop_filetype, - 'Stat' : _Prop_static, - 'SubA' : _Prop_all_subclasses, - 'SubC' : _Prop_subclasses, - 'SymG' : _Prop_symbols, - 'SysH' : _Prop_seg_2d_system_heap, - 'TA01' : _Prop_Linker, - 'TA02' : _Prop_Extension, - 'TA03' : _Prop_Precompiled, - 'TA04' : _Prop_Resource_File, - 'TA05' : _Prop_Launchable, - 'TA06' : _Prop_Ignored_by_Make, - 'TA07' : _Prop_Compiler, - 'TA09' : _Prop_Post_Linker, - 'TA10' : _Prop_Target_Name, - 'TA11' : _Prop_Output_Directory_Path, - 'TA12' : _Prop_Output_Directory_Origin, - 'TA13' : _Prop_Pre_Linker, - 'TA15' : _Prop_Use_Relative_Paths, - 'TA16' : _Prop_Output_Directory_Location, - 'UpTD' : _Prop_up_to_date, - 'VC01' : _Prop_VCS_Active, - 'VC02' : _Prop_Connection_Method, - 'VC03' : _Prop_Username, - 'VC04' : _Prop_Password, - 'VC05' : _Prop_Auto_Connect, - 'VC06' : _Prop_Store_Password, - 'VC07' : _Prop_Always_Prompt, - 'VC08' : _Prop_Mount_Volume, - 'VC09' : _Prop_Database_Path, - 'VC10' : _Prop_Local_Path, - 'VC11' : _Prop_Use_Global_Settings, - 'Valu' : _Prop_value, - 'Virt' : _Prop_virtual, - 'Weak' : _Prop_weak_link, - 'file' : _Prop_disk_file, - 'pnam' : _Prop_name, - 'ptps' : _Prop_Text_Size, - 'ptxf' : _Prop_Text_Font, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'Acce' : _Enum_Acce, - 'BXbr' : _Enum_BXbr, - 'DbSA' : _Enum_DbSA, - 'DgBL' : _Enum_DgBL, - 'ErrT' : _Enum_ErrT, - 'Inte' : _Enum_Inte, - 'Lang' : _Enum_Lang, - 'PPrm' : _Enum_PPrm, - 'PXdg' : _Enum_PXdg, - 'PthF' : _Enum_PthF, - 'RefP' : _Enum_RefP, - 'STKd' : _Enum_STKd, - 'SrcT' : _Enum_SrcT, - 'TmpB' : _Enum_TmpB, - 'TxtF' : _Enum_TxtF, - 'savo' : _Enum_savo, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Required.py b/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Required.py deleted file mode 100644 index b0749e873..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Required.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Suite Required: Terms that every application should support -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'reqd' - -from StdSuites.Required_Suite import * -class Required_Events(Required_Suite_Events): - - _argmap_open = { - 'converting' : 'Conv', - } - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument converting: Whether to convert project to latest version (yes/no; default is ask). - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - aetools.keysubst(_arguments, self._argmap_open) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'Conv', _Enum_Conv) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - -_Enum_Conv = { - 'yes' : 'yes ', # Convert the project if necessary on open - 'no' : 'no ', # Do not convert the project if needed on open -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'Conv' : _Enum_Conv, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py deleted file mode 100644 index ae277a276..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py +++ /dev/null @@ -1,408 +0,0 @@ -"""Suite Standard Suite: Common terms for most applications -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'CoRe' - -from StdSuites.Standard_Suite import * -class Standard_Suite_Events(Standard_Suite_Events): - - _argmap_close = { - 'saving' : 'savo', - 'saving_in' : 'kfil', - } - - def close(self, _object, _attributes={}, **_arguments): - """close: close an object - Required argument: the object to close - Keyword argument saving: specifies whether or not changes should be saved before closing - Keyword argument saving_in: the file in which to save the object - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - aetools.keysubst(_arguments, self._argmap_close) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_count = { - 'each' : 'kocl', - } - - def count(self, _object, _attributes={}, **_arguments): - """count: return the number of elements of a particular class within an object - Required argument: the object whose elements are to be counted - Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the number of elements - """ - _code = 'core' - _subcode = 'cnte' - - aetools.keysubst(_arguments, self._argmap_count) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_get = { - 'as' : 'rtyp', - } - - def get(self, _object, _attributes={}, **_arguments): - """get: get the data for an object - Required argument: the object whose data is to be returned - Keyword argument as: the desired types for the data, in order of preference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The data from the object - """ - _code = 'core' - _subcode = 'getd' - - aetools.keysubst(_arguments, self._argmap_get) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'new' : 'kocl', - 'as' : 'rtyp', - 'at' : 'insh', - 'with_data' : 'data', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: make a new element - Keyword argument new: the class of the new element\xd1keyword 'new' is optional in AppleScript - Keyword argument as: the desired types for the data, in order of preference - Keyword argument at: the location at which to insert the element - Keyword argument with_data: the initial data for the element - Keyword argument with_properties: the initial values for the properties of the element - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the new object(s) - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def select(self, _object=None, _attributes={}, **_arguments): - """select: select the specified object - Required argument: the object to select - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'slct' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_set = { - 'to' : 'data', - } - - def set(self, _object, _attributes={}, **_arguments): - """set: set an object's data - Required argument: the object to change - Keyword argument to: the new value - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - aetools.keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - an application program """ - want = 'capp' -class _Prop_user_interaction(aetools.NProperty): - """user interaction - user interaction level """ - which = 'inte' - want = 'Inte' -user_interaction = _Prop_user_interaction() -# element 'cwin' as ['indx', 'name', 'rang'] -# element 'docu' as ['indx', 'name', 'rang'] - -class character(aetools.ComponentItem): - """character - a character """ - want = 'cha ' -class _Prop_length(aetools.NProperty): - """length - length in characters of this object """ - which = 'pLen' - want = 'long' -class _Prop_offset(aetools.NProperty): - """offset - offset of a text object from the beginning of the document (first char has offset 1) """ - which = 'pOff' - want = 'long' - -class insertion_point(aetools.ComponentItem): - """insertion point - An insertion location between two objects """ - want = 'cins' - -class line(aetools.ComponentItem): - """line - lines of text """ - want = 'clin' -class _Prop_index(aetools.NProperty): - """index - index of a line object from the beginning of the document (first line has index 1) """ - which = 'pidx' - want = 'long' -# element 'cha ' as ['indx', 'rang', 'rele'] - -lines = line - -class selection_2d_object(aetools.ComponentItem): - """selection-object - the selection visible to the user """ - want = 'csel' -class _Prop_contents(aetools.NProperty): - """contents - the contents of the selection """ - which = 'pcnt' - want = 'type' -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'clin' as ['indx', 'rang', 'rele'] -# element 'ctxt' as ['rang'] - -class text(aetools.ComponentItem): - """text - Text """ - want = 'ctxt' -# element 'cha ' as ['indx', 'rele', 'rang'] -# element 'cins' as ['rele'] -# element 'clin' as ['indx', 'rang', 'rele'] -# element 'ctxt' as ['rang'] - -class window(aetools.ComponentItem): - """window - A window """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window """ - which = 'pbnd' - want = 'qdrt' -class _Prop_document(aetools.NProperty): - """document - the document that owns this window """ - which = 'docu' - want = 'docu' -class _Prop_name(aetools.NProperty): - """name - the title of the window """ - which = 'pnam' - want = 'itxt' -class _Prop_position(aetools.NProperty): - """position - upper left coordinates of window """ - which = 'ppos' - want = 'QDpt' -class _Prop_visible(aetools.NProperty): - """visible - is the window visible? """ - which = 'pvis' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Is the window zoomed? """ - which = 'pzum' - want = 'bool' - -windows = window - -class document(aetools.ComponentItem): - """document - a document """ - want = 'docu' -class _Prop_file_permissions(aetools.NProperty): - """file permissions - the file permissions for the document """ - which = 'PERM' - want = 'PERM' -class _Prop_kind(aetools.NProperty): - """kind - the kind of document """ - which = 'DKND' - want = 'DKND' -class _Prop_location(aetools.NProperty): - """location - the file of the document """ - which = 'FILE' - want = 'fss ' -class _Prop_window(aetools.NProperty): - """window - the window of the document. """ - which = 'cwin' - want = 'cwin' - -documents = document - -class files(aetools.ComponentItem): - """files - Every file """ - want = 'file' - -file = files -application._superclassnames = [] -application._privpropdict = { - 'user_interaction' : _Prop_user_interaction, -} -application._privelemdict = { - 'document' : document, - 'window' : window, -} -character._superclassnames = [] -character._privpropdict = { - 'length' : _Prop_length, - 'offset' : _Prop_offset, -} -character._privelemdict = { -} -insertion_point._superclassnames = [] -insertion_point._privpropdict = { - 'length' : _Prop_length, - 'offset' : _Prop_offset, -} -insertion_point._privelemdict = { -} -line._superclassnames = [] -line._privpropdict = { - 'index' : _Prop_index, - 'length' : _Prop_length, - 'offset' : _Prop_offset, -} -line._privelemdict = { - 'character' : character, -} -selection_2d_object._superclassnames = [] -selection_2d_object._privpropdict = { - 'contents' : _Prop_contents, - 'length' : _Prop_length, - 'offset' : _Prop_offset, -} -selection_2d_object._privelemdict = { - 'character' : character, - 'line' : line, - 'text' : text, -} -text._superclassnames = [] -text._privpropdict = { - 'length' : _Prop_length, - 'offset' : _Prop_offset, -} -text._privelemdict = { - 'character' : character, - 'insertion_point' : insertion_point, - 'line' : line, - 'text' : text, -} -window._superclassnames = [] -window._privpropdict = { - 'bounds' : _Prop_bounds, - 'document' : _Prop_document, - 'index' : _Prop_index, - 'name' : _Prop_name, - 'position' : _Prop_position, - 'visible' : _Prop_visible, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} -document._superclassnames = [] -document._privpropdict = { - 'file_permissions' : _Prop_file_permissions, - 'index' : _Prop_index, - 'kind' : _Prop_kind, - 'location' : _Prop_location, - 'name' : _Prop_name, - 'window' : _Prop_window, -} -document._privelemdict = { -} -files._superclassnames = [] -files._privpropdict = { -} -files._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cha ' : character, - 'cins' : insertion_point, - 'clin' : line, - 'csel' : selection_2d_object, - 'ctxt' : text, - 'cwin' : window, - 'docu' : document, - 'file' : files, -} - -_propdeclarations = { - 'DKND' : _Prop_kind, - 'FILE' : _Prop_location, - 'PERM' : _Prop_file_permissions, - 'cwin' : _Prop_window, - 'docu' : _Prop_document, - 'inte' : _Prop_user_interaction, - 'pLen' : _Prop_length, - 'pOff' : _Prop_offset, - 'pbnd' : _Prop_bounds, - 'pcnt' : _Prop_contents, - 'pidx' : _Prop_index, - 'pnam' : _Prop_name, - 'ppos' : _Prop_position, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py deleted file mode 100644 index 5ef7ca964..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py +++ /dev/null @@ -1,189 +0,0 @@ -""" -Package generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 -""" -import aetools -Error = aetools.Error -import CodeWarrior_suite -import Standard_Suite -import Metrowerks_Shell_Suite -import Required - - -_code_to_module = { - 'CWIE' : CodeWarrior_suite, - 'CoRe' : Standard_Suite, - 'MMPR' : Metrowerks_Shell_Suite, - 'reqd' : Required, -} - - - -_code_to_fullname = { - 'CWIE' : ('CodeWarrior.CodeWarrior_suite', 'CodeWarrior_suite'), - 'CoRe' : ('CodeWarrior.Standard_Suite', 'Standard_Suite'), - 'MMPR' : ('CodeWarrior.Metrowerks_Shell_Suite', 'Metrowerks_Shell_Suite'), - 'reqd' : ('CodeWarrior.Required', 'Required'), -} - -from CodeWarrior_suite import * -from Standard_Suite import * -from Metrowerks_Shell_Suite import * -from Required import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(character) -getbaseclasses(selection_2d_object) -getbaseclasses(application) -getbaseclasses(document) -getbaseclasses(text) -getbaseclasses(window) -getbaseclasses(file) -getbaseclasses(line) -getbaseclasses(insertion_point) -getbaseclasses(single_class_browser) -getbaseclasses(project_document) -getbaseclasses(symbol_browser) -getbaseclasses(editor_document) -getbaseclasses(file_compare_document) -getbaseclasses(class_browser) -getbaseclasses(subtarget) -getbaseclasses(message_document) -getbaseclasses(project_inspector) -getbaseclasses(text_document) -getbaseclasses(catalog_document) -getbaseclasses(class_hierarchy) -getbaseclasses(target) -getbaseclasses(build_progress_document) -getbaseclasses(target_file) -getbaseclasses(ToolServer_worksheet) -getbaseclasses(single_class_hierarchy) -getbaseclasses(File_Mapping) -getbaseclasses(browser_catalog) -getbaseclasses(Build_Settings) -getbaseclasses(ProjectFile) -getbaseclasses(VCS_Setup) -getbaseclasses(data_member) -getbaseclasses(Shielded_Folder) -getbaseclasses(Custom_Keywords) -getbaseclasses(Path_Information) -getbaseclasses(Segment) -getbaseclasses(Source_Tree) -getbaseclasses(Access_Paths) -getbaseclasses(Debugger_Windowing) -getbaseclasses(Relative_Path) -getbaseclasses(Environment_Variable) -getbaseclasses(base_class) -getbaseclasses(Debugger_Display) -getbaseclasses(Build_Extras) -getbaseclasses(Error_Information) -getbaseclasses(Editor) -getbaseclasses(Shielded_Folders) -getbaseclasses(Extras) -getbaseclasses(File_Mappings) -getbaseclasses(Function_Information) -getbaseclasses(Debugger_Target) -getbaseclasses(Syntax_Coloring) -getbaseclasses(class_) -getbaseclasses(Global_Source_Trees) -getbaseclasses(Target_Settings) -getbaseclasses(Debugger_Global) -getbaseclasses(member_function) -getbaseclasses(Runtime_Settings) -getbaseclasses(Plugin_Settings) -getbaseclasses(Browser_Coloring) -getbaseclasses(Font) -getbaseclasses(Target_Source_Trees) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cha ' : character, - 'csel' : selection_2d_object, - 'capp' : application, - 'docu' : document, - 'ctxt' : text, - 'cwin' : window, - 'file' : file, - 'clin' : line, - 'cins' : insertion_point, - '1BRW' : single_class_browser, - 'PRJD' : project_document, - 'SYMB' : symbol_browser, - 'EDIT' : editor_document, - 'COMP' : file_compare_document, - 'BROW' : class_browser, - 'SBTG' : subtarget, - 'MSSG' : message_document, - 'INSP' : project_inspector, - 'TXTD' : text_document, - 'CTLG' : catalog_document, - 'HIER' : class_hierarchy, - 'TRGT' : target, - 'PRGS' : build_progress_document, - 'SRCF' : target_file, - 'TOOL' : ToolServer_worksheet, - '1HIR' : single_class_hierarchy, - 'FMap' : File_Mapping, - 'Cata' : browser_catalog, - 'BSTG' : Build_Settings, - 'SrcF' : ProjectFile, - 'VCSs' : VCS_Setup, - 'DtMb' : data_member, - 'SFit' : Shielded_Folder, - 'CUKW' : Custom_Keywords, - 'PInf' : Path_Information, - 'Seg ' : Segment, - 'SrcT' : Source_Tree, - 'PATH' : Access_Paths, - 'DbWN' : Debugger_Windowing, - 'RlPt' : Relative_Path, - 'EnvV' : Environment_Variable, - 'BsCl' : base_class, - 'DbDS' : Debugger_Display, - 'LXTR' : Build_Extras, - 'ErrM' : Error_Information, - 'EDTR' : Editor, - 'SHFL' : Shielded_Folders, - 'GXTR' : Extras, - 'FLMP' : File_Mappings, - 'FDef' : Function_Information, - 'DbTG' : Debugger_Target, - 'SNTX' : Syntax_Coloring, - 'Clas' : class_, - 'GSTs' : Global_Source_Trees, - 'TARG' : Target_Settings, - 'DbGL' : Debugger_Global, - 'MbFn' : member_function, - 'RSTG' : Runtime_Settings, - 'PSTG' : Plugin_Settings, - 'BRKW' : Browser_Coloring, - 'mFNT' : Font, - 'TSTs' : Target_Source_Trees, -} - - -class CodeWarrior(CodeWarrior_suite_Events, - Standard_Suite_Events, - Metrowerks_Shell_Suite_Events, - Required_Events, - aetools.TalkTo): - _signature = 'CWIE' - - _moduleName = 'CodeWarrior' diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Microsoft_Internet_Explorer.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Microsoft_Internet_Explorer.py deleted file mode 100644 index bce9e7698..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Microsoft_Internet_Explorer.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Suite Microsoft Internet Explorer Suite: Events defined by Internet Explorer -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'MSIE' - -class Microsoft_Internet_Explorer_Events: - - def GetSource(self, _object=None, _attributes={}, **_arguments): - """GetSource: Get the HTML source of a browser window - Required argument: Window Identifier of window from which to get the source. No value means get the source from the frontmost window. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'TEXT' - """ - _code = 'MSIE' - _subcode = 'SORC' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def PrintBrowserWindow(self, _object=None, _attributes={}, **_arguments): - """PrintBrowserWindow: Print contents of browser window (HTML) - Required argument: Window Identifier of the window to print. No value means print the frontmost browser window. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'pWND' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_do_script = { - 'window' : 'WIND', - } - - def do_script(self, _object, _attributes={}, **_arguments): - """do script: Execute script commands - Required argument: JavaScript text to execute - Keyword argument window: optional Window Identifier (as supplied by the ListWindows event) specifying context in which to execute the script - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Return value - """ - _code = 'misc' - _subcode = 'dosc' - - aetools.keysubst(_arguments, self._argmap_do_script) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Netscape_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Netscape_Suite.py deleted file mode 100644 index c274e70d1..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Netscape_Suite.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Suite Netscape Suite: Events defined by Netscape -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'MOSS' - -class Netscape_Suite_Events: - - def Open_bookmark(self, _object=None, _attributes={}, **_arguments): - """Open bookmark: Opens a bookmark file - Required argument: If not available, reloads the current bookmark file - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'book' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py deleted file mode 100644 index 0a985d123..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py +++ /dev/null @@ -1,108 +0,0 @@ -"""Suite Required Suite: Events that every application should support -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'reqd' - -from StdSuites.Required_Suite import * -class Required_Suite_Events(Required_Suite_Events): - - def open(self, _object, _attributes={}, **_arguments): - """open: Open documents - Required argument: undocumented, typecode 'alis' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object, _attributes={}, **_arguments): - """print: Print documents - Required argument: undocumented, typecode 'alis' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit application - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'oapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py deleted file mode 100644 index 7ead98af9..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py +++ /dev/null @@ -1,72 +0,0 @@ -"""Suite Standard Suite: Common terms for most applications -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = '****' - -class Standard_Suite_Events: - - _argmap_get = { - 'as' : 'rtyp', - } - - def get(self, _object, _attributes={}, **_arguments): - """get: - Required argument: an AE object reference - Keyword argument as: undocumented, typecode 'type' - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'core' - _subcode = 'getd' - - aetools.keysubst(_arguments, self._argmap_get) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - An application program """ - want = 'capp' -class _Prop_selected_text(aetools.NProperty): - """selected text - the selected text """ - which = 'stxt' - want = 'TEXT' -selected_text = _Prop_selected_text() -application._superclassnames = [] -application._privpropdict = { - 'selected_text' : _Prop_selected_text, -} -application._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - -_propdeclarations = { - 'stxt' : _Prop_selected_text, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/URL_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/URL_Suite.py deleted file mode 100644 index e234546ce..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/URL_Suite.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Suite URL Suite: Standard suite for Uniform Resource Locators -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'GURL' - -class URL_Suite_Events: - - _argmap_GetURL = { - 'to' : 'dest', - } - - def GetURL(self, _object, _attributes={}, **_arguments): - """GetURL: Open the URL (and optionally save it to disk) - Required argument: URL to open - Keyword argument to: File into which to save resource located at URL. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'GURL' - _subcode = 'GURL' - - aetools.keysubst(_arguments, self._argmap_GetURL) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py deleted file mode 100644 index ff808eb96..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py +++ /dev/null @@ -1,226 +0,0 @@ -"""Suite Web Browser Suite: Class of events supported by Web Browser applications -Level 1, version 1 - -Generated from /Applications/Internet Explorer.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'WWW!' - -class Web_Browser_Suite_Events: - - def Activate(self, _object=None, _attributes={}, **_arguments): - """Activate: Activate Internet Explorer and optionally select window designated by Window Identifier. - Required argument: Window Identifier - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Window Identifier of window to activate - """ - _code = 'WWW!' - _subcode = 'ACTV' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def CloseAllWindows(self, _no_object=None, _attributes={}, **_arguments): - """CloseAllWindows: Closes all windows - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Success - """ - _code = 'WWW!' - _subcode = 'CLSA' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_CloseWindow = { - 'ID' : 'WIND', - 'Title' : 'TITL', - } - - def CloseWindow(self, _no_object=None, _attributes={}, **_arguments): - """CloseWindow: Close the window specified by either Window Identifier or Title. If no parameter is specified, close the top window. - Keyword argument ID: ID of the window to close. (Can use -1 for top window) - Keyword argument Title: Title of the window to close - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Success - """ - _code = 'WWW!' - _subcode = 'CLOS' - - aetools.keysubst(_arguments, self._argmap_CloseWindow) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def GetWindowInfo(self, _object, _attributes={}, **_arguments): - """GetWindowInfo: Returns a window info record (URL/Title) for the specified window. - Required argument: Window Identifier of the window - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: - """ - _code = 'WWW!' - _subcode = 'WNFO' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def ListWindows(self, _no_object=None, _attributes={}, **_arguments): - """ListWindows: Returns list of Window Identifiers for all open windows. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'list' - """ - _code = 'WWW!' - _subcode = 'LSTW' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_OpenURL = { - 'to' : 'INTO', - 'toWindow' : 'WIND', - 'Flags' : 'FLGS', - 'FormData' : 'POST', - 'MIME_Type' : 'MIME', - } - - def OpenURL(self, _object, _attributes={}, **_arguments): - """OpenURL: Retrieves URL off the Web. - Required argument: Fully-qualified URL - Keyword argument to: Target file for saving downloaded data - Keyword argument toWindow: Target window for resource at URL (-1 for top window, 0 for new window) - Keyword argument Flags: Valid Flags settings are: 1-Ignore the document cache; 2-Ignore the image cache; 4-Operate in background mode. - Keyword argument FormData: data to post - Keyword argument MIME_Type: MIME type of data being posted - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'OURL' - - aetools.keysubst(_arguments, self._argmap_OpenURL) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_ParseAnchor = { - 'withURL' : 'RELA', - } - - def ParseAnchor(self, _object, _attributes={}, **_arguments): - """ParseAnchor: Combines a base URL and a relative URL to produce a fully-qualified URL - Required argument: Base URL - Keyword argument withURL: Relative URL that is combined with the Base URL (in the direct object) to produce a fully-qualified URL. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Fully-qualified URL - """ - _code = 'WWW!' - _subcode = 'PRSA' - - aetools.keysubst(_arguments, self._argmap_ParseAnchor) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_ShowFile = { - 'MIME_Type' : 'MIME', - 'Window_Identifier' : 'WIND', - 'URL' : 'URL ', - } - - def ShowFile(self, _object, _attributes={}, **_arguments): - """ShowFile: FileSpec containing data of specified MIME type to be rendered in window specified by Window Identifier. - Required argument: The file - Keyword argument MIME_Type: MIME type - Keyword argument Window_Identifier: Identifier of the target window for the URL. (Can use -1 for top window) - Keyword argument URL: URL that allows this document to be reloaded. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'SHWF' - - aetools.keysubst(_arguments, self._argmap_ShowFile) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/__init__.py deleted file mode 100644 index a9b09b041..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Explorer/__init__.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -Package generated from /Applications/Internet Explorer.app -""" -import aetools -Error = aetools.Error -import Standard_Suite -import URL_Suite -import Netscape_Suite -import Microsoft_Internet_Explorer -import Web_Browser_Suite -import Required_Suite - - -_code_to_module = { - '****' : Standard_Suite, - 'GURL' : URL_Suite, - 'MOSS' : Netscape_Suite, - 'MSIE' : Microsoft_Internet_Explorer, - 'WWW!' : Web_Browser_Suite, - 'reqd' : Required_Suite, -} - - - -_code_to_fullname = { - '****' : ('Explorer.Standard_Suite', 'Standard_Suite'), - 'GURL' : ('Explorer.URL_Suite', 'URL_Suite'), - 'MOSS' : ('Explorer.Netscape_Suite', 'Netscape_Suite'), - 'MSIE' : ('Explorer.Microsoft_Internet_Explorer', 'Microsoft_Internet_Explorer'), - 'WWW!' : ('Explorer.Web_Browser_Suite', 'Web_Browser_Suite'), - 'reqd' : ('Explorer.Required_Suite', 'Required_Suite'), -} - -from Standard_Suite import * -from URL_Suite import * -from Netscape_Suite import * -from Microsoft_Internet_Explorer import * -from Web_Browser_Suite import * -from Required_Suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(application) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - - -class Explorer(Standard_Suite_Events, - URL_Suite_Events, - Netscape_Suite_Events, - Microsoft_Internet_Explorer_Events, - Web_Browser_Suite_Events, - Required_Suite_Events, - aetools.TalkTo): - _signature = 'MSIE' - - _moduleName = 'Explorer' - - _elemdict = application._elemdict - _propdict = application._propdict diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Containers_and_folders.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Containers_and_folders.py deleted file mode 100644 index e495ef496..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Containers_and_folders.py +++ /dev/null @@ -1,279 +0,0 @@ -"""Suite Containers and folders: Classes that can contain other file system items -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fndr' - -class Containers_and_folders_Events: - - pass - - -class disk(aetools.ComponentItem): - """disk - A disk """ - want = 'cdis' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from the container class """ - which = 'c@#^' - want = 'ctnr' -class _Prop_capacity(aetools.NProperty): - """capacity - the total number of bytes (free or used) on the disk """ - which = 'capa' - want = 'comp' -class _Prop_ejectable(aetools.NProperty): - """ejectable - Can the media be ejected (floppies, CD's, and so on)? """ - which = 'isej' - want = 'bool' -class _Prop_format(aetools.NProperty): - """format - the filesystem format of this disk """ - which = 'dfmt' - want = 'edfm' -class _Prop_free_space(aetools.NProperty): - """free space - the number of free bytes left on the disk """ - which = 'frsp' - want = 'comp' -class _Prop_ignore_privileges(aetools.NProperty): - """ignore privileges - Ignore permissions on this disk? """ - which = 'igpr' - want = 'bool' -class _Prop_local_volume(aetools.NProperty): - """local volume - Is the media a local volume (as opposed to a file server)? """ - which = 'isrv' - want = 'bool' -class _Prop_startup(aetools.NProperty): - """startup - Is this disk the boot disk? """ - which = 'istd' - want = 'bool' -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'name'] -# element 'ctnr' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] - -disks = disk - -class desktop_2d_object(aetools.ComponentItem): - """desktop-object - Desktop-object is the class of the \xd2desktop\xd3 object """ - want = 'cdsk' -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'cdis' as ['indx', 'name'] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'name'] -# element 'ctnr' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] - -class folder(aetools.ComponentItem): - """folder - A folder """ - want = 'cfol' -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'name'] -# element 'ctnr' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] - -folders = folder - -class container(aetools.ComponentItem): - """container - An item that contains other items """ - want = 'ctnr' -class _Prop_completely_expanded(aetools.NProperty): - """completely expanded - (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists) """ - which = 'pexc' - want = 'bool' -class _Prop_container_window(aetools.NProperty): - """container window - the container window for this folder """ - which = 'cwnd' - want = 'obj ' -class _Prop_entire_contents(aetools.NProperty): - """entire contents - the entire contents of the container, including the contents of its children """ - which = 'ects' - want = 'obj ' -class _Prop_expandable(aetools.NProperty): - """expandable - (NOT AVAILABLE YET) Is the container capable of being expanded as an outline? """ - which = 'pexa' - want = 'bool' -class _Prop_expanded(aetools.NProperty): - """expanded - (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists) """ - which = 'pexp' - want = 'bool' -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'name'] -# element 'ctnr' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] - -containers = container - -class trash_2d_object(aetools.ComponentItem): - """trash-object - Trash-object is the class of the \xd2trash\xd3 object """ - want = 'ctrs' -class _Prop_warns_before_emptying(aetools.NProperty): - """warns before emptying - Display a dialog when emptying the trash? """ - which = 'warn' - want = 'bool' -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'name'] -# element 'ctnr' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] -disk._superclassnames = ['container'] -import Files -import Finder_items -disk._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'capacity' : _Prop_capacity, - 'ejectable' : _Prop_ejectable, - 'format' : _Prop_format, - 'free_space' : _Prop_free_space, - 'ignore_privileges' : _Prop_ignore_privileges, - 'local_volume' : _Prop_local_volume, - 'startup' : _Prop_startup, -} -disk._privelemdict = { - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'container' : container, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, -} -desktop_2d_object._superclassnames = ['container'] -desktop_2d_object._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -desktop_2d_object._privelemdict = { - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'container' : container, - 'disk' : disk, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, -} -folder._superclassnames = ['container'] -folder._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -folder._privelemdict = { - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'container' : container, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, -} -container._superclassnames = ['item'] -container._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'completely_expanded' : _Prop_completely_expanded, - 'container_window' : _Prop_container_window, - 'entire_contents' : _Prop_entire_contents, - 'expandable' : _Prop_expandable, - 'expanded' : _Prop_expanded, -} -container._privelemdict = { - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'container' : container, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, -} -trash_2d_object._superclassnames = ['container'] -trash_2d_object._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'warns_before_emptying' : _Prop_warns_before_emptying, -} -trash_2d_object._privelemdict = { - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'container' : container, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cdis' : disk, - 'cdsk' : desktop_2d_object, - 'cfol' : folder, - 'ctnr' : container, - 'ctrs' : trash_2d_object, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'capa' : _Prop_capacity, - 'cwnd' : _Prop_container_window, - 'dfmt' : _Prop_format, - 'ects' : _Prop_entire_contents, - 'frsp' : _Prop_free_space, - 'igpr' : _Prop_ignore_privileges, - 'isej' : _Prop_ejectable, - 'isrv' : _Prop_local_volume, - 'istd' : _Prop_startup, - 'pexa' : _Prop_expandable, - 'pexc' : _Prop_completely_expanded, - 'pexp' : _Prop_expanded, - 'warn' : _Prop_warns_before_emptying, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Enumerations.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Enumerations.py deleted file mode 100644 index 558d7ff23..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Enumerations.py +++ /dev/null @@ -1,145 +0,0 @@ -"""Suite Enumerations: Enumerations for the Finder -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'tpnm' - -from StdSuites.Type_Names_Suite import * -class Enumerations_Events(Type_Names_Suite_Events): - - pass - -_Enum_earr = { - 'not_arranged' : 'narr', # - 'snap_to_grid' : 'grda', # - 'arranged_by_name' : 'nama', # - 'arranged_by_modification_date' : 'mdta', # - 'arranged_by_creation_date' : 'cdta', # - 'arranged_by_size' : 'siza', # - 'arranged_by_kind' : 'kina', # - 'arranged_by_label' : 'laba', # -} - -_Enum_ecvw = { - 'icon_view' : 'icnv', # - 'list_view' : 'lsvw', # - 'column_view' : 'clvw', # -} - -_Enum_edfm = { - 'Mac_OS_format' : 'dfhf', # - 'Mac_OS_Extended_format' : 'dfh+', # - 'UFS_format' : 'dfuf', # - 'NFS_format' : 'dfnf', # - 'audio_format' : 'dfau', # - 'ProDOS_format' : 'dfpr', # - 'MS_2d_DOS_format' : 'dfms', # - 'ISO_9660_format' : 'df96', # - 'High_Sierra_format' : 'dfhs', # - 'QuickTake_format' : 'dfqt', # - 'Apple_Photo_format' : 'dfph', # - 'AppleShare_format' : 'dfas', # - 'UDF_format' : 'dfud', # - 'WebDAV_format' : 'dfwd', # - 'FTP_format' : 'dfft', # - 'Packet_2d_written_UDF_format' : 'dfpu', # - 'unknown_format' : 'df??', # -} - -_Enum_elsv = { - 'name_column' : 'elsn', # - 'modification_date_column' : 'elsm', # - 'creation_date_column' : 'elsc', # - 'size_column' : 'elss', # - 'kind_column' : 'elsk', # - 'label_column' : 'elsl', # - 'version_column' : 'elsv', # - 'comment_column' : 'elsC', # -} - -_Enum_ipnl = { - 'General_Information_panel' : 'gpnl', # - 'Sharing_panel' : 'spnl', # - 'Memory_panel' : 'mpnl', # - 'Preview_panel' : 'vpnl', # - 'Application_panel' : 'apnl', # - 'Languages_panel' : 'pklg', # - 'Plugins_panel' : 'pkpg', # - 'Name__26__Extension_panel' : 'npnl', # - 'Comments_panel' : 'cpnl', # - 'Content_Index_panel' : 'cinl', # -} - -_Enum_isiz = { - 'mini' : 'miic', # - 'small' : 'smic', # - 'large' : 'lgic', # -} - -_Enum_lvic = { - 'small_icon' : 'smic', # - 'large_icon' : 'lgic', # -} - -_Enum_priv = { - 'read_only' : 'read', # - 'read_write' : 'rdwr', # - 'write_only' : 'writ', # - 'none' : 'none', # -} - -_Enum_sodr = { - 'normal' : 'snrm', # - 'reversed' : 'srvs', # -} - -_Enum_vwby = { - 'conflicts' : 'cflc', # - 'existing_items' : 'exsi', # - 'small_icon' : 'smic', # - 'icon' : 'iimg', # - 'name' : 'pnam', # - 'modification_date' : 'asmo', # - 'size' : 'ptsz', # - 'kind' : 'kind', # - 'comment' : 'comt', # - 'label' : 'labi', # - 'version' : 'vers', # - 'creation_date' : 'ascd', # - 'small_button' : 'smbu', # - 'large_button' : 'lgbu', # - 'grid' : 'grid', # - 'all' : 'kyal', # -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'earr' : _Enum_earr, - 'ecvw' : _Enum_ecvw, - 'edfm' : _Enum_edfm, - 'elsv' : _Enum_elsv, - 'ipnl' : _Enum_ipnl, - 'isiz' : _Enum_isiz, - 'lvic' : _Enum_lvic, - 'priv' : _Enum_priv, - 'sodr' : _Enum_sodr, - 'vwby' : _Enum_vwby, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Files.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Files.py deleted file mode 100644 index ddbe1bafb..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Files.py +++ /dev/null @@ -1,212 +0,0 @@ -"""Suite Files: Classes representing files -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fndr' - -class Files_Events: - - pass - - -class alias_file(aetools.ComponentItem): - """alias file - An alias file (created with \xd2Make Alias\xd3) """ - want = 'alia' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from the file class """ - which = 'c@#^' - want = 'file' -class _Prop_original_item(aetools.NProperty): - """original item - the original item pointed to by the alias """ - which = 'orig' - want = 'obj ' - -alias_files = alias_file - -class application_file(aetools.ComponentItem): - """application file - An application's file on disk """ - want = 'appf' -class _Prop_accepts_high_level_events(aetools.NProperty): - """accepts high level events - Is the application high-level event aware? (OBSOLETE: always returns true) """ - which = 'isab' - want = 'bool' -class _Prop_has_scripting_terminology(aetools.NProperty): - """has scripting terminology - Does the process have a scripting terminology, i.e., can it be scripted? """ - which = 'hscr' - want = 'bool' -class _Prop_minimum_size(aetools.NProperty): - """minimum size - the smallest memory size with which the application can be launched """ - which = 'mprt' - want = 'long' -class _Prop_opens_in_Classic(aetools.NProperty): - """opens in Classic - Should the application launch in the Classic environment? """ - which = 'Clsc' - want = 'bool' -class _Prop_preferred_size(aetools.NProperty): - """preferred size - the memory size with which the application will be launched """ - which = 'appt' - want = 'long' -class _Prop_suggested_size(aetools.NProperty): - """suggested size - the memory size with which the developer recommends the application be launched """ - which = 'sprt' - want = 'long' - -application_files = application_file - -class clipping(aetools.ComponentItem): - """clipping - A clipping """ - want = 'clpf' -class _Prop_clipping_window(aetools.NProperty): - """clipping window - (NOT AVAILABLE YET) the clipping window for this clipping """ - which = 'lwnd' - want = 'obj ' - -clippings = clipping - -class document_file(aetools.ComponentItem): - """document file - A document file """ - want = 'docf' - -document_files = document_file - -class file(aetools.ComponentItem): - """file - A file """ - want = 'file' -class _Prop_creator_type(aetools.NProperty): - """creator type - the OSType identifying the application that created the item """ - which = 'fcrt' - want = 'type' -class _Prop_file_type(aetools.NProperty): - """file type - the OSType identifying the type of data contained in the item """ - which = 'asty' - want = 'type' -class _Prop_product_version(aetools.NProperty): - """product version - the version of the product (visible at the top of the \xd2Get Info\xd3 window) """ - which = 'ver2' - want = 'utxt' -class _Prop_stationery(aetools.NProperty): - """stationery - Is the file a stationery pad? """ - which = 'pspd' - want = 'bool' -class _Prop_version(aetools.NProperty): - """version - the version of the file (visible at the bottom of the \xd2Get Info\xd3 window) """ - which = 'vers' - want = 'utxt' - -files = file - -class internet_location_file(aetools.ComponentItem): - """internet location file - An file containing an internet location """ - want = 'inlf' -class _Prop_location(aetools.NProperty): - """location - the internet location """ - which = 'iloc' - want = 'utxt' - -internet_location_files = internet_location_file - -class package(aetools.ComponentItem): - """package - A package """ - want = 'pack' - -packages = package -alias_file._superclassnames = ['file'] -alias_file._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'original_item' : _Prop_original_item, -} -alias_file._privelemdict = { -} -application_file._superclassnames = ['file'] -application_file._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'accepts_high_level_events' : _Prop_accepts_high_level_events, - 'has_scripting_terminology' : _Prop_has_scripting_terminology, - 'minimum_size' : _Prop_minimum_size, - 'opens_in_Classic' : _Prop_opens_in_Classic, - 'preferred_size' : _Prop_preferred_size, - 'suggested_size' : _Prop_suggested_size, -} -application_file._privelemdict = { -} -clipping._superclassnames = ['file'] -clipping._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'clipping_window' : _Prop_clipping_window, -} -clipping._privelemdict = { -} -document_file._superclassnames = ['file'] -document_file._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -document_file._privelemdict = { -} -import Finder_items -file._superclassnames = ['item'] -file._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'creator_type' : _Prop_creator_type, - 'file_type' : _Prop_file_type, - 'product_version' : _Prop_product_version, - 'stationery' : _Prop_stationery, - 'version' : _Prop_version, -} -file._privelemdict = { -} -internet_location_file._superclassnames = ['file'] -internet_location_file._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'location' : _Prop_location, -} -internet_location_file._privelemdict = { -} -package._superclassnames = ['item'] -package._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -package._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'alia' : alias_file, - 'appf' : application_file, - 'clpf' : clipping, - 'docf' : document_file, - 'file' : file, - 'inlf' : internet_location_file, - 'pack' : package, -} - -_propdeclarations = { - 'Clsc' : _Prop_opens_in_Classic, - 'appt' : _Prop_preferred_size, - 'asty' : _Prop_file_type, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'fcrt' : _Prop_creator_type, - 'hscr' : _Prop_has_scripting_terminology, - 'iloc' : _Prop_location, - 'isab' : _Prop_accepts_high_level_events, - 'lwnd' : _Prop_clipping_window, - 'mprt' : _Prop_minimum_size, - 'orig' : _Prop_original_item, - 'pspd' : _Prop_stationery, - 'sprt' : _Prop_suggested_size, - 'ver2' : _Prop_product_version, - 'vers' : _Prop_version, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py deleted file mode 100644 index c0a7b2005..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py +++ /dev/null @@ -1,207 +0,0 @@ -"""Suite Finder Basics: Commonly-used Finder commands and object classes -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fndr' - -class Finder_Basics_Events: - - def copy(self, _no_object=None, _attributes={}, **_arguments): - """copy: (NOT AVAILABLE YET) Copy the selected items to the clipboard (the Finder must be the front application) - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'copy' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_sort = { - 'by' : 'by ', - } - - def sort(self, _object, _attributes={}, **_arguments): - """sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list - Required argument: a list of finder objects to sort - Keyword argument by: the property to sort the items by (name, index, date, etc.) - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the sorted items in their new order - """ - _code = 'DATA' - _subcode = 'SORT' - - aetools.keysubst(_arguments, self._argmap_sort) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The Finder """ - want = 'capp' -class _Prop_Finder_preferences(aetools.NProperty): - """Finder preferences - (NOT AVAILABLE YET) Various preferences that apply to the Finder as a whole """ - which = 'pfrp' - want = 'cprf' -Finder_preferences = _Prop_Finder_preferences() -class _Prop_clipboard(aetools.NProperty): - """clipboard - (NOT AVAILABLE YET) the Finder\xd5s clipboard window """ - which = 'pcli' - want = 'obj ' -clipboard = _Prop_clipboard() -class _Prop_desktop(aetools.NProperty): - """desktop - the desktop """ - which = 'desk' - want = 'cdsk' -desktop = _Prop_desktop() -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is the Finder the frontmost process? """ - which = 'pisf' - want = 'bool' -frontmost = _Prop_frontmost() -class _Prop_home(aetools.NProperty): - """home - the home directory """ - which = 'home' - want = 'cfol' -home = _Prop_home() -class _Prop_insertion_location(aetools.NProperty): - """insertion location - the container in which a new folder would appear if \xd2New Folder\xd3 was selected """ - which = 'pins' - want = 'obj ' -insertion_location = _Prop_insertion_location() -class _Prop_name(aetools.NProperty): - """name - the Finder\xd5s name """ - which = 'pnam' - want = 'itxt' -name = _Prop_name() -class _Prop_product_version(aetools.NProperty): - """product version - the version of the System software running on this computer """ - which = 'ver2' - want = 'utxt' -product_version = _Prop_product_version() -class _Prop_selection(aetools.NProperty): - """selection - the selection in the frontmost Finder window """ - which = 'sele' - want = 'obj ' -selection = _Prop_selection() -class _Prop_startup_disk(aetools.NProperty): - """startup disk - the startup disk """ - which = 'sdsk' - want = 'cdis' -startup_disk = _Prop_startup_disk() -class _Prop_trash(aetools.NProperty): - """trash - the trash """ - which = 'trsh' - want = 'ctrs' -trash = _Prop_trash() -class _Prop_version(aetools.NProperty): - """version - the version of the Finder """ - which = 'vers' - want = 'utxt' -version = _Prop_version() -class _Prop_visible(aetools.NProperty): - """visible - Is the Finder\xd5s layer visible? """ - which = 'pvis' - want = 'bool' -visible = _Prop_visible() -# element 'alia' as ['indx', 'name'] -# element 'appf' as ['indx', 'name', 'ID '] -# element 'brow' as ['indx', 'ID '] -# element 'cdis' as ['indx', 'name', 'ID '] -# element 'cfol' as ['indx', 'name', 'ID '] -# element 'clpf' as ['indx', 'name'] -# element 'cobj' as ['indx', 'rele', 'name', 'rang', 'test'] -# element 'ctnr' as ['indx', 'name'] -# element 'cwin' as ['indx', 'name'] -# element 'docf' as ['indx', 'name'] -# element 'file' as ['indx', 'name'] -# element 'inlf' as ['indx', 'name'] -# element 'lwnd' as ['indx', 'name'] -# element 'pack' as ['indx', 'name'] -application._superclassnames = [] -import Files -import Window_classes -import Containers_and_folders -import Finder_items -application._privpropdict = { - 'Finder_preferences' : _Prop_Finder_preferences, - 'clipboard' : _Prop_clipboard, - 'desktop' : _Prop_desktop, - 'frontmost' : _Prop_frontmost, - 'home' : _Prop_home, - 'insertion_location' : _Prop_insertion_location, - 'name' : _Prop_name, - 'product_version' : _Prop_product_version, - 'selection' : _Prop_selection, - 'startup_disk' : _Prop_startup_disk, - 'trash' : _Prop_trash, - 'version' : _Prop_version, - 'visible' : _Prop_visible, -} -application._privelemdict = { - 'Finder_window' : Window_classes.Finder_window, - 'alias_file' : Files.alias_file, - 'application_file' : Files.application_file, - 'clipping' : Files.clipping, - 'clipping_window' : Window_classes.clipping_window, - 'container' : Containers_and_folders.container, - 'disk' : Containers_and_folders.disk, - 'document_file' : Files.document_file, - 'file' : Files.file, - 'folder' : Containers_and_folders.folder, - 'internet_location_file' : Files.internet_location_file, - 'item' : Finder_items.item, - 'package' : Files.package, - 'window' : Window_classes.window, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - -_propdeclarations = { - 'desk' : _Prop_desktop, - 'home' : _Prop_home, - 'pcli' : _Prop_clipboard, - 'pfrp' : _Prop_Finder_preferences, - 'pins' : _Prop_insertion_location, - 'pisf' : _Prop_frontmost, - 'pnam' : _Prop_name, - 'pvis' : _Prop_visible, - 'sdsk' : _Prop_startup_disk, - 'sele' : _Prop_selection, - 'trsh' : _Prop_trash, - 'ver2' : _Prop_product_version, - 'vers' : _Prop_version, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_items.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_items.py deleted file mode 100644 index 7120ea6c5..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Finder_items.py +++ /dev/null @@ -1,355 +0,0 @@ -"""Suite Finder items: Commands used with file system items, and basic item definition -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fndr' - -class Finder_items_Events: - - def add_to_favorites(self, _object, _attributes={}, **_arguments): - """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites - Required argument: the items to add to the collection of Favorites - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'ffav' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_clean_up = { - 'by' : 'by ', - } - - def clean_up(self, _object, _attributes={}, **_arguments): - """clean up: (NOT AVAILABLE YET) Arrange items in window nicely (only applies to open windows in icon view that are not kept arranged) - Required argument: the window to clean up - Keyword argument by: the order in which to clean up the objects (name, index, date, etc.) - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'fclu' - - aetools.keysubst(_arguments, self._argmap_clean_up) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def eject(self, _object=None, _attributes={}, **_arguments): - """eject: Eject the specified disk(s) - Required argument: the disk(s) to eject - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'ejct' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def empty(self, _object=None, _attributes={}, **_arguments): - """empty: Empty the trash - Required argument: \xd2empty\xd3 and \xd2empty trash\xd3 both do the same thing - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'empt' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def erase(self, _object, _attributes={}, **_arguments): - """erase: (NOT AVAILABLE) Erase the specified disk(s) - Required argument: the items to erase - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'fera' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def reveal(self, _object, _attributes={}, **_arguments): - """reveal: Bring the specified object(s) into view - Required argument: the object to be made visible - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'mvis' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_update = { - 'necessity' : 'nec?', - 'registering_applications' : 'reg?', - } - - def update(self, _object, _attributes={}, **_arguments): - """update: Update the display of the specified object(s) to match their on-disk representation - Required argument: the item to update - Keyword argument necessity: only update if necessary (i.e. a finder window is open). default is false - Keyword argument registering_applications: register applications. default is true - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'fupd' - - aetools.keysubst(_arguments, self._argmap_update) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class item(aetools.ComponentItem): - """item - An item """ - want = 'cobj' -class _Prop_bounds(aetools.NProperty): - """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """ - which = 'pbnd' - want = 'qdrt' -class _Prop_comment(aetools.NProperty): - """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """ - which = 'comt' - want = 'utxt' -class _Prop_container(aetools.NProperty): - """container - the container of the item """ - which = 'ctnr' - want = 'obj ' -class _Prop_creation_date(aetools.NProperty): - """creation date - the date on which the item was created """ - which = 'ascd' - want = 'ldt ' -class _Prop_description(aetools.NProperty): - """description - a description of the item """ - which = 'dscr' - want = 'utxt' -class _Prop_disk(aetools.NProperty): - """disk - the disk on which the item is stored """ - which = 'cdis' - want = 'obj ' -class _Prop_displayed_name(aetools.NProperty): - """displayed name - the user-visible name of the item """ - which = 'dnam' - want = 'utxt' -class _Prop_everyones_privileges(aetools.NProperty): - """everyones privileges - """ - which = 'gstp' - want = 'priv' -class _Prop_extension_hidden(aetools.NProperty): - """extension hidden - Is the item's extension hidden from the user? """ - which = 'hidx' - want = 'bool' -class _Prop_group(aetools.NProperty): - """group - the user or group that has special access to the container """ - which = 'sgrp' - want = 'utxt' -class _Prop_group_privileges(aetools.NProperty): - """group privileges - """ - which = 'gppr' - want = 'priv' -class _Prop_icon(aetools.NProperty): - """icon - the icon bitmap of the item """ - which = 'iimg' - want = 'ifam' -class _Prop_index(aetools.NProperty): - """index - the index in the front-to-back ordering within its container """ - which = 'pidx' - want = 'long' -class _Prop_information_window(aetools.NProperty): - """information window - the information window for the item """ - which = 'iwnd' - want = 'obj ' -class _Prop_kind(aetools.NProperty): - """kind - the kind of the item """ - which = 'kind' - want = 'utxt' -class _Prop_label_index(aetools.NProperty): - """label index - the label of the item """ - which = 'labi' - want = 'long' -class _Prop_locked(aetools.NProperty): - """locked - Is the file locked? """ - which = 'aslk' - want = 'bool' -class _Prop_modification_date(aetools.NProperty): - """modification date - the date on which the item was last modified """ - which = 'asmo' - want = 'ldt ' -class _Prop_name(aetools.NProperty): - """name - the name of the item """ - which = 'pnam' - want = 'utxt' -class _Prop_name_extension(aetools.NProperty): - """name extension - the name extension of the item (such as \xd2txt\xd3) """ - which = 'nmxt' - want = 'utxt' -class _Prop_owner(aetools.NProperty): - """owner - the user that owns the container """ - which = 'sown' - want = 'utxt' -class _Prop_owner_privileges(aetools.NProperty): - """owner privileges - """ - which = 'ownr' - want = 'priv' -class _Prop_physical_size(aetools.NProperty): - """physical size - the actual space used by the item on disk """ - which = 'phys' - want = 'comp' -class _Prop_position(aetools.NProperty): - """position - the position of the item within its parent window (can only be set for an item in a window viewed as icons or buttons) """ - which = 'posn' - want = 'QDpt' -class _Prop_properties(aetools.NProperty): - """properties - every property of an item """ - which = 'pALL' - want = 'reco' -class _Prop_size(aetools.NProperty): - """size - the logical size of the item """ - which = 'ptsz' - want = 'comp' -class _Prop_url(aetools.NProperty): - """url - the url of the item """ - which = 'pURL' - want = 'utxt' - -items = item -item._superclassnames = [] -item._privpropdict = { - 'bounds' : _Prop_bounds, - 'comment' : _Prop_comment, - 'container' : _Prop_container, - 'creation_date' : _Prop_creation_date, - 'description' : _Prop_description, - 'disk' : _Prop_disk, - 'displayed_name' : _Prop_displayed_name, - 'everyones_privileges' : _Prop_everyones_privileges, - 'extension_hidden' : _Prop_extension_hidden, - 'group' : _Prop_group, - 'group_privileges' : _Prop_group_privileges, - 'icon' : _Prop_icon, - 'index' : _Prop_index, - 'information_window' : _Prop_information_window, - 'kind' : _Prop_kind, - 'label_index' : _Prop_label_index, - 'locked' : _Prop_locked, - 'modification_date' : _Prop_modification_date, - 'name' : _Prop_name, - 'name_extension' : _Prop_name_extension, - 'owner' : _Prop_owner, - 'owner_privileges' : _Prop_owner_privileges, - 'physical_size' : _Prop_physical_size, - 'position' : _Prop_position, - 'properties' : _Prop_properties, - 'size' : _Prop_size, - 'url' : _Prop_url, -} -item._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cobj' : item, -} - -_propdeclarations = { - 'ascd' : _Prop_creation_date, - 'aslk' : _Prop_locked, - 'asmo' : _Prop_modification_date, - 'cdis' : _Prop_disk, - 'comt' : _Prop_comment, - 'ctnr' : _Prop_container, - 'dnam' : _Prop_displayed_name, - 'dscr' : _Prop_description, - 'gppr' : _Prop_group_privileges, - 'gstp' : _Prop_everyones_privileges, - 'hidx' : _Prop_extension_hidden, - 'iimg' : _Prop_icon, - 'iwnd' : _Prop_information_window, - 'kind' : _Prop_kind, - 'labi' : _Prop_label_index, - 'nmxt' : _Prop_name_extension, - 'ownr' : _Prop_owner_privileges, - 'pALL' : _Prop_properties, - 'pURL' : _Prop_url, - 'pbnd' : _Prop_bounds, - 'phys' : _Prop_physical_size, - 'pidx' : _Prop_index, - 'pnam' : _Prop_name, - 'posn' : _Prop_position, - 'ptsz' : _Prop_size, - 'sgrp' : _Prop_group, - 'sown' : _Prop_owner, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py deleted file mode 100644 index 69da62668..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py +++ /dev/null @@ -1,224 +0,0 @@ -"""Suite Legacy suite: Operations formerly handled by the Finder, but now automatically delegated to other applications -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fleg' - -class Legacy_suite_Events: - - def restart(self, _no_object=None, _attributes={}, **_arguments): - """restart: Restart the computer - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'rest' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def shut_down(self, _no_object=None, _attributes={}, **_arguments): - """shut down: Shut Down the computer - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'shut' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def sleep(self, _no_object=None, _attributes={}, **_arguments): - """sleep: Put the computer to sleep - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'slep' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The Finder """ - want = 'capp' -class _Prop_desktop_picture(aetools.NProperty): - """desktop picture - the desktop picture of the main monitor """ - which = 'dpic' - want = 'file' -desktop_picture = _Prop_desktop_picture() - -class application_process(aetools.ComponentItem): - """application process - A process launched from an application file """ - want = 'pcap' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from the process class """ - which = 'c@#^' - want = 'prcs' -class _Prop_application_file(aetools.NProperty): - """application file - the application file from which this process was launched """ - which = 'appf' - want = 'appf' - -application_processes = application_process - -class desk_accessory_process(aetools.ComponentItem): - """desk accessory process - A process launched from a desk accessory file """ - want = 'pcda' -class _Prop_desk_accessory_file(aetools.NProperty): - """desk accessory file - the desk accessory file from which this process was launched """ - which = 'dafi' - want = 'obj ' - -desk_accessory_processes = desk_accessory_process - -class process(aetools.ComponentItem): - """process - A process running on this computer """ - want = 'prcs' -class _Prop_accepts_high_level_events(aetools.NProperty): - """accepts high level events - Is the process high-level event aware (accepts open application, open document, print document, and quit)? """ - which = 'isab' - want = 'bool' -class _Prop_accepts_remote_events(aetools.NProperty): - """accepts remote events - Does the process accept remote events? """ - which = 'revt' - want = 'bool' -class _Prop_creator_type(aetools.NProperty): - """creator type - the OSType of the creator of the process (the signature) """ - which = 'fcrt' - want = 'type' -class _Prop_file(aetools.NProperty): - """file - the file from which the process was launched """ - which = 'file' - want = 'obj ' -class _Prop_file_type(aetools.NProperty): - """file type - the OSType of the file type of the process """ - which = 'asty' - want = 'type' -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is the process the frontmost process? """ - which = 'pisf' - want = 'bool' -class _Prop_has_scripting_terminology(aetools.NProperty): - """has scripting terminology - Does the process have a scripting terminology, i.e., can it be scripted? """ - which = 'hscr' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the name of the process """ - which = 'pnam' - want = 'itxt' -class _Prop_partition_space_used(aetools.NProperty): - """partition space used - the number of bytes currently used in the process' partition """ - which = 'pusd' - want = 'long' -class _Prop_total_partition_size(aetools.NProperty): - """total partition size - the size of the partition with which the process was launched """ - which = 'appt' - want = 'long' -class _Prop_visible(aetools.NProperty): - """visible - Is the process' layer visible? """ - which = 'pvis' - want = 'bool' - -processes = process -application._superclassnames = [] -application._privpropdict = { - 'desktop_picture' : _Prop_desktop_picture, -} -application._privelemdict = { -} -application_process._superclassnames = ['process'] -application_process._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'application_file' : _Prop_application_file, -} -application_process._privelemdict = { -} -desk_accessory_process._superclassnames = ['process'] -desk_accessory_process._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'desk_accessory_file' : _Prop_desk_accessory_file, -} -desk_accessory_process._privelemdict = { -} -process._superclassnames = [] -process._privpropdict = { - 'accepts_high_level_events' : _Prop_accepts_high_level_events, - 'accepts_remote_events' : _Prop_accepts_remote_events, - 'creator_type' : _Prop_creator_type, - 'file' : _Prop_file, - 'file_type' : _Prop_file_type, - 'frontmost' : _Prop_frontmost, - 'has_scripting_terminology' : _Prop_has_scripting_terminology, - 'name' : _Prop_name, - 'partition_space_used' : _Prop_partition_space_used, - 'total_partition_size' : _Prop_total_partition_size, - 'visible' : _Prop_visible, -} -process._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'pcap' : application_process, - 'pcda' : desk_accessory_process, - 'prcs' : process, -} - -_propdeclarations = { - 'appf' : _Prop_application_file, - 'appt' : _Prop_total_partition_size, - 'asty' : _Prop_file_type, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'dafi' : _Prop_desk_accessory_file, - 'dpic' : _Prop_desktop_picture, - 'fcrt' : _Prop_creator_type, - 'file' : _Prop_file, - 'hscr' : _Prop_has_scripting_terminology, - 'isab' : _Prop_accepts_high_level_events, - 'pisf' : _Prop_frontmost, - 'pnam' : _Prop_name, - 'pusd' : _Prop_partition_space_used, - 'pvis' : _Prop_visible, - 'revt' : _Prop_accepts_remote_events, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py deleted file mode 100644 index 830f58c83..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py +++ /dev/null @@ -1,335 +0,0 @@ -"""Suite Standard Suite: Common terms that most applications should support -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'CoRe' - -from StdSuites.Standard_Suite import * -class Standard_Suite_Events(Standard_Suite_Events): - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object - Required argument: the object to close - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_count = { - 'each' : 'kocl', - } - - def count(self, _object, _attributes={}, **_arguments): - """count: Return the number of elements of a particular class within an object - Required argument: the object whose elements are to be counted - Keyword argument each: the class of the elements to be counted - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the number of elements - """ - _code = 'core' - _subcode = 'cnte' - - aetools.keysubst(_arguments, self._argmap_count) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_data_size = { - 'as' : 'rtyp', - } - - def data_size(self, _object, _attributes={}, **_arguments): - """data size: Return the size in bytes of an object - Required argument: the object whose data size is to be returned - Keyword argument as: the data type for which the size is calculated - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the size of the object in bytes - """ - _code = 'core' - _subcode = 'dsiz' - - aetools.keysubst(_arguments, self._argmap_data_size) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def delete(self, _object, _attributes={}, **_arguments): - """delete: Move an item from its container to the trash - Required argument: the item to delete - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the item that was just deleted - """ - _code = 'core' - _subcode = 'delo' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_duplicate = { - 'to' : 'insh', - 'replacing' : 'alrp', - 'routing_suppressed' : 'rout', - } - - def duplicate(self, _object, _attributes={}, **_arguments): - """duplicate: Duplicate one or more object(s) - Required argument: the object(s) to duplicate - Keyword argument to: the new location for the object(s) - Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated - Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the duplicated object(s) - """ - _code = 'core' - _subcode = 'clon' - - aetools.keysubst(_arguments, self._argmap_duplicate) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'alrp', _Enum_bool) - aetools.enumsubst(_arguments, 'rout', _Enum_bool) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def exists(self, _object, _attributes={}, **_arguments): - """exists: Verify if an object exists - Required argument: the object in question - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: true if it exists, false if not - """ - _code = 'core' - _subcode = 'doex' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'new' : 'kocl', - 'at' : 'insh', - 'to' : 'to ', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: Make a new element - Keyword argument new: the class of the new element - Keyword argument at: the location at which to insert the element - Keyword argument to: when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window - Keyword argument with_properties: the initial values for the properties of the element - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the new object(s) - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_move = { - 'to' : 'insh', - 'replacing' : 'alrp', - 'positioned_at' : 'mvpl', - 'routing_suppressed' : 'rout', - } - - def move(self, _object, _attributes={}, **_arguments): - """move: Move object(s) to a new location - Required argument: the object(s) to move - Keyword argument to: the new location for the object(s) - Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved - Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items - Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the object(s) after they have been moved - """ - _code = 'core' - _subcode = 'move' - - aetools.keysubst(_arguments, self._argmap_move) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'alrp', _Enum_bool) - aetools.enumsubst(_arguments, 'mvpl', _Enum_list) - aetools.enumsubst(_arguments, 'rout', _Enum_bool) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_open = { - 'using' : 'usin', - 'with_properties' : 'prdt', - } - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument using: the application file to open the object with - Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - aetools.keysubst(_arguments, self._argmap_open) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_print_ = { - 'with_properties' : 'prdt', - } - - def print_(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: list of objects to print - Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - aetools.keysubst(_arguments, self._argmap_print_) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit the Finder - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def select(self, _object, _attributes={}, **_arguments): - """select: Select the specified object(s) - Required argument: the object to select - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'slct' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - -_Enum_list = None # XXXX enum list not found!! -_Enum_bool = None # XXXX enum bool not found!! - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Type_Definitions.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Type_Definitions.py deleted file mode 100644 index 3e7d81799..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Type_Definitions.py +++ /dev/null @@ -1,346 +0,0 @@ -"""Suite Type Definitions: Definitions of records used in scripting the Finder -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'tpdf' - -class Type_Definitions_Events: - - pass - - -class alias_list(aetools.ComponentItem): - """alias list - A list of aliases. Use \xd4as alias list\xd5 when a list of aliases is needed (instead of a list of file system item references). """ - want = 'alst' - -class label(aetools.ComponentItem): - """label - (NOT AVAILABLE YET) A Finder label (name and color) """ - want = 'clbl' -class _Prop_color(aetools.NProperty): - """color - the color associated with the label """ - which = 'colr' - want = 'cRGB' -class _Prop_index(aetools.NProperty): - """index - the index in the front-to-back ordering within its container """ - which = 'pidx' - want = 'long' -class _Prop_name(aetools.NProperty): - """name - the name associated with the label """ - which = 'pnam' - want = 'utxt' - -class preferences(aetools.ComponentItem): - """preferences - (NOT AVAILABLE, SUBJECT TO CHANGE) The Finder Preferences """ - want = 'cprf' -class _Prop_button_view_arrangement(aetools.NProperty): - """button view arrangement - the method of arrangement of icons in default Finder button view windows """ - which = 'barr' - want = 'earr' -class _Prop_button_view_icon_size(aetools.NProperty): - """button view icon size - the size of icons displayed in Finder button view windows. """ - which = 'bisz' - want = 'long' -class _Prop_calculates_folder_sizes(aetools.NProperty): - """calculates folder sizes - Are folder sizes calculated and displayed in Finder list view windows? """ - which = 'sfsz' - want = 'bool' -class _Prop_delay_before_springing(aetools.NProperty): - """delay before springing - the delay before springing open a container in ticks (1/60th of a second) (12 is shortest delay, 60 is longest delay) """ - which = 'dela' - want = 'shor' -class _Prop_list_view_icon_size(aetools.NProperty): - """list view icon size - the size of icons displayed in Finder list view windows. """ - which = 'lisz' - want = 'long' -class _Prop_shows_comments(aetools.NProperty): - """shows comments - Are comments displayed in default Finder list view windows? """ - which = 'scom' - want = 'bool' -class _Prop_shows_creation_date(aetools.NProperty): - """shows creation date - Are creation dates displayed in default Finder list view windows? """ - which = 'scda' - want = 'bool' -class _Prop_shows_kind(aetools.NProperty): - """shows kind - Are document kinds displayed in default Finder list view windows? """ - which = 'sknd' - want = 'bool' -class _Prop_shows_label(aetools.NProperty): - """shows label - Are labels displayed in default Finder list view windows? """ - which = 'slbl' - want = 'bool' -class _Prop_shows_modification_date(aetools.NProperty): - """shows modification date - Are modification dates displayed in default Finder list view windows? """ - which = 'sdat' - want = 'bool' -class _Prop_shows_size(aetools.NProperty): - """shows size - Are file sizes displayed in default Finder list view windows? """ - which = 'ssiz' - want = 'bool' -class _Prop_shows_version(aetools.NProperty): - """shows version - Are file versions displayed in default Finder list view windows? """ - which = 'svrs' - want = 'bool' -class _Prop_spatial_view_arrangement(aetools.NProperty): - """spatial view arrangement - the method of arrangement of icons in default Finder spatial view windows """ - which = 'iarr' - want = 'earr' -class _Prop_spatial_view_icon_size(aetools.NProperty): - """spatial view icon size - the size of icons displayed in Finder spatial view windows. """ - which = 'iisz' - want = 'long' -class _Prop_spring_open_folders(aetools.NProperty): - """spring open folders - Spring open folders after the specified delay? """ - which = 'sprg' - want = 'bool' -class _Prop_uses_relative_dates(aetools.NProperty): - """uses relative dates - Are relative dates (e.g., today, yesterday) shown in Finder list view windows? """ - which = 'urdt' - want = 'bool' -class _Prop_uses_simple_menus(aetools.NProperty): - """uses simple menus - Use simplified Finder menus? """ - which = 'usme' - want = 'bool' -class _Prop_uses_wide_grid(aetools.NProperty): - """uses wide grid - Space icons on a wide grid? """ - which = 'uswg' - want = 'bool' -class _Prop_view_font(aetools.NProperty): - """view font - the id of the font used in Finder views. """ - which = 'vfnt' - want = 'long' -class _Prop_view_font_size(aetools.NProperty): - """view font size - the size of the font used in Finder views """ - which = 'vfsz' - want = 'long' -class _Prop_window(aetools.NProperty): - """window - the window that would open if Finder preferences was opened """ - which = 'cwin' - want = 'pwnd' -# element 'clbl' as ['indx', 'name'] - -class icon_view_options(aetools.ComponentItem): - """icon view options - the icon view options """ - want = 'icop' - -_Prop_arrangement = _Prop_spatial_view_arrangement -class _Prop_icon_size(aetools.NProperty): - """icon size - the size of icons displayed in the icon view """ - which = 'lvis' - want = 'shor' - -class icon_family(aetools.ComponentItem): - """icon family - (NOT AVAILABLE YET) A family of icons """ - want = 'ifam' -class _Prop_large_32_bit_icon(aetools.NProperty): - """large 32 bit icon - the large 32-bit color icon """ - which = 'il32' - want = 'il32' -class _Prop_large_4_bit_icon(aetools.NProperty): - """large 4 bit icon - the large 4-bit color icon """ - which = 'icl4' - want = 'icl4' -class _Prop_large_8_bit_icon(aetools.NProperty): - """large 8 bit icon - the large 8-bit color icon """ - which = 'icl8' - want = 'icl8' -class _Prop_large_8_bit_mask(aetools.NProperty): - """large 8 bit mask - the large 8-bit mask for large 32-bit icons """ - which = 'l8mk' - want = 'l8mk' -class _Prop_large_monochrome_icon_and_mask(aetools.NProperty): - """large monochrome icon and mask - the large black-and-white icon and the mask for large icons """ - which = 'ICN#' - want = 'ICN#' -class _Prop_small_32_bit_icon(aetools.NProperty): - """small 32 bit icon - the small 32-bit color icon """ - which = 'is32' - want = 'is32' -class _Prop_small_4_bit_icon(aetools.NProperty): - """small 4 bit icon - the small 4-bit color icon """ - which = 'ics4' - want = 'ics4' -class _Prop_small_8_bit_icon(aetools.NProperty): - """small 8 bit icon - the small 8-bit color icon """ - which = 'ics8' - want = 'ics8' - -_Prop_small_8_bit_mask = _Prop_small_8_bit_icon -class _Prop_small_monochrome_icon_and_mask(aetools.NProperty): - """small monochrome icon and mask - the small black-and-white icon and the mask for small icons """ - which = 'ics#' - want = 'ics#' - -class column(aetools.ComponentItem): - """column - a column of a list view """ - want = 'lvcl' -class _Prop_sort_direction(aetools.NProperty): - """sort direction - The direction in which the window is sorted """ - which = 'sord' - want = 'sodr' -class _Prop_visible(aetools.NProperty): - """visible - is this column visible """ - which = 'pvis' - want = 'bool' -class _Prop_width(aetools.NProperty): - """width - the width of this column """ - which = 'clwd' - want = 'shor' - -columns = column - -class list_view_options(aetools.ComponentItem): - """list view options - the list view options """ - want = 'lvop' -class _Prop_sort_column(aetools.NProperty): - """sort column - the column that the list view is sorted on """ - which = 'srtc' - want = 'lvcl' -# element 'lvcl' as ['indx', 'rele', 'rang', 'test'] -alias_list._superclassnames = [] -alias_list._privpropdict = { -} -alias_list._privelemdict = { -} -label._superclassnames = [] -label._privpropdict = { - 'color' : _Prop_color, - 'index' : _Prop_index, - 'name' : _Prop_name, -} -label._privelemdict = { -} -preferences._superclassnames = [] -preferences._privpropdict = { - 'button_view_arrangement' : _Prop_button_view_arrangement, - 'button_view_icon_size' : _Prop_button_view_icon_size, - 'calculates_folder_sizes' : _Prop_calculates_folder_sizes, - 'delay_before_springing' : _Prop_delay_before_springing, - 'list_view_icon_size' : _Prop_list_view_icon_size, - 'shows_comments' : _Prop_shows_comments, - 'shows_creation_date' : _Prop_shows_creation_date, - 'shows_kind' : _Prop_shows_kind, - 'shows_label' : _Prop_shows_label, - 'shows_modification_date' : _Prop_shows_modification_date, - 'shows_size' : _Prop_shows_size, - 'shows_version' : _Prop_shows_version, - 'spatial_view_arrangement' : _Prop_spatial_view_arrangement, - 'spatial_view_icon_size' : _Prop_spatial_view_icon_size, - 'spring_open_folders' : _Prop_spring_open_folders, - 'uses_relative_dates' : _Prop_uses_relative_dates, - 'uses_simple_menus' : _Prop_uses_simple_menus, - 'uses_wide_grid' : _Prop_uses_wide_grid, - 'view_font' : _Prop_view_font, - 'view_font_size' : _Prop_view_font_size, - 'window' : _Prop_window, -} -preferences._privelemdict = { - 'label' : label, -} -icon_view_options._superclassnames = [] -icon_view_options._privpropdict = { - 'arrangement' : _Prop_arrangement, - 'icon_size' : _Prop_icon_size, -} -icon_view_options._privelemdict = { -} -icon_family._superclassnames = [] -icon_family._privpropdict = { - 'large_32_bit_icon' : _Prop_large_32_bit_icon, - 'large_4_bit_icon' : _Prop_large_4_bit_icon, - 'large_8_bit_icon' : _Prop_large_8_bit_icon, - 'large_8_bit_mask' : _Prop_large_8_bit_mask, - 'large_monochrome_icon_and_mask' : _Prop_large_monochrome_icon_and_mask, - 'small_32_bit_icon' : _Prop_small_32_bit_icon, - 'small_4_bit_icon' : _Prop_small_4_bit_icon, - 'small_8_bit_icon' : _Prop_small_8_bit_icon, - 'small_8_bit_mask' : _Prop_small_8_bit_mask, - 'small_monochrome_icon_and_mask' : _Prop_small_monochrome_icon_and_mask, -} -icon_family._privelemdict = { -} -column._superclassnames = [] -column._privpropdict = { - 'index' : _Prop_index, - 'name' : _Prop_name, - 'sort_direction' : _Prop_sort_direction, - 'visible' : _Prop_visible, - 'width' : _Prop_width, -} -column._privelemdict = { -} -list_view_options._superclassnames = [] -list_view_options._privpropdict = { - 'calculates_folder_sizes' : _Prop_calculates_folder_sizes, - 'icon_size' : _Prop_icon_size, - 'sort_column' : _Prop_sort_column, - 'uses_relative_dates' : _Prop_uses_relative_dates, -} -list_view_options._privelemdict = { - 'column' : column, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'alst' : alias_list, - 'clbl' : label, - 'cprf' : preferences, - 'icop' : icon_view_options, - 'ifam' : icon_family, - 'lvcl' : column, - 'lvop' : list_view_options, -} - -_propdeclarations = { - 'ICN#' : _Prop_large_monochrome_icon_and_mask, - 'barr' : _Prop_button_view_arrangement, - 'bisz' : _Prop_button_view_icon_size, - 'clwd' : _Prop_width, - 'colr' : _Prop_color, - 'cwin' : _Prop_window, - 'dela' : _Prop_delay_before_springing, - 'iarr' : _Prop_spatial_view_arrangement, - 'icl4' : _Prop_large_4_bit_icon, - 'icl8' : _Prop_large_8_bit_icon, - 'ics#' : _Prop_small_monochrome_icon_and_mask, - 'ics4' : _Prop_small_4_bit_icon, - 'ics8' : _Prop_small_8_bit_icon, - 'iisz' : _Prop_spatial_view_icon_size, - 'il32' : _Prop_large_32_bit_icon, - 'is32' : _Prop_small_32_bit_icon, - 'l8mk' : _Prop_large_8_bit_mask, - 'lisz' : _Prop_list_view_icon_size, - 'lvis' : _Prop_icon_size, - 'pidx' : _Prop_index, - 'pnam' : _Prop_name, - 'pvis' : _Prop_visible, - 'scda' : _Prop_shows_creation_date, - 'scom' : _Prop_shows_comments, - 'sdat' : _Prop_shows_modification_date, - 'sfsz' : _Prop_calculates_folder_sizes, - 'sknd' : _Prop_shows_kind, - 'slbl' : _Prop_shows_label, - 'sord' : _Prop_sort_direction, - 'sprg' : _Prop_spring_open_folders, - 'srtc' : _Prop_sort_column, - 'ssiz' : _Prop_shows_size, - 'svrs' : _Prop_shows_version, - 'urdt' : _Prop_uses_relative_dates, - 'usme' : _Prop_uses_simple_menus, - 'uswg' : _Prop_uses_wide_grid, - 'vfnt' : _Prop_view_font, - 'vfsz' : _Prop_view_font_size, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Window_classes.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Window_classes.py deleted file mode 100644 index 496968a64..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/Window_classes.py +++ /dev/null @@ -1,229 +0,0 @@ -"""Suite Window classes: Classes representing windows -Level 1, version 1 - -Generated from /System/Library/CoreServices/Finder.app -AETE/AEUT resource version 0/144, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'fndr' - -class Window_classes_Events: - - pass - - -class Finder_window(aetools.ComponentItem): - """Finder window - A file viewer window """ - want = 'brow' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from the window class """ - which = 'c@#^' - want = 'cwin' -class _Prop_current_view(aetools.NProperty): - """current view - the current view for the container window """ - which = 'pvew' - want = 'ecvw' -class _Prop_icon_view_options(aetools.NProperty): - """icon view options - the icon view options for the container window """ - which = 'icop' - want = 'icop' -class _Prop_list_view_options(aetools.NProperty): - """list view options - the list view options for the container window """ - which = 'lvop' - want = 'lvop' -class _Prop_target(aetools.NProperty): - """target - the container at which this file viewer is targeted """ - which = 'fvtg' - want = 'obj ' - -Finder_windows = Finder_window - -class window(aetools.ComponentItem): - """window - A window """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window """ - which = 'pbnd' - want = 'qdrt' -class _Prop_closeable(aetools.NProperty): - """closeable - Does the window have a close box? """ - which = 'hclb' - want = 'bool' -class _Prop_collapsed(aetools.NProperty): - """collapsed - Is the window collapsed """ - which = 'wshd' - want = 'bool' -class _Prop_floating(aetools.NProperty): - """floating - Does the window have a title bar? """ - which = 'isfl' - want = 'bool' -class _Prop_id(aetools.NProperty): - """id - the unique id for this window """ - which = 'ID ' - want = 'magn' -class _Prop_index(aetools.NProperty): - """index - the number of the window in the front-to-back layer ordering """ - which = 'pidx' - want = 'long' -class _Prop_modal(aetools.NProperty): - """modal - Is the window modal? """ - which = 'pmod' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the name of the window """ - which = 'pnam' - want = 'utxt' -class _Prop_position(aetools.NProperty): - """position - the upper left position of the window """ - which = 'posn' - want = 'QDpt' -class _Prop_properties(aetools.NProperty): - """properties - every property of a window """ - which = 'pALL' - want = 'reco' -class _Prop_resizable(aetools.NProperty): - """resizable - Is the window resizable? """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Does the window have a title bar? """ - which = 'ptit' - want = 'bool' -class _Prop_visible(aetools.NProperty): - """visible - Is the window visible (always true for open Finder windows)? """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Is the window zoomable? """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Is the window zoomed? """ - which = 'pzum' - want = 'bool' -class _Prop_zoomed_full_size(aetools.NProperty): - """zoomed full size - Is the window zoomed to the full size of the screen? (can only be set, not read) """ - which = 'zumf' - want = 'bool' - -windows = window - -class information_window(aetools.ComponentItem): - """information window - An inspector window (opened by \xd2Show Info\xd3) """ - want = 'iwnd' -class _Prop_current_panel(aetools.NProperty): - """current panel - the current panel in the information window """ - which = 'panl' - want = 'ipnl' -class _Prop_item(aetools.NProperty): - """item - the item from which this window was opened """ - which = 'cobj' - want = 'obj ' - -class clipping_window(aetools.ComponentItem): - """clipping window - The window containing a clipping """ - want = 'lwnd' - -clipping_windows = clipping_window - -class preferences_window(aetools.ComponentItem): - """preferences window - (NOT AVAILABLE YET) The Finder Preferences window """ - want = 'pwnd' -Finder_window._superclassnames = ['window'] -Finder_window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'current_view' : _Prop_current_view, - 'icon_view_options' : _Prop_icon_view_options, - 'list_view_options' : _Prop_list_view_options, - 'target' : _Prop_target, -} -Finder_window._privelemdict = { -} -window._superclassnames = [] -window._privpropdict = { - 'bounds' : _Prop_bounds, - 'closeable' : _Prop_closeable, - 'collapsed' : _Prop_collapsed, - 'floating' : _Prop_floating, - 'id' : _Prop_id, - 'index' : _Prop_index, - 'modal' : _Prop_modal, - 'name' : _Prop_name, - 'position' : _Prop_position, - 'properties' : _Prop_properties, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, - 'zoomed_full_size' : _Prop_zoomed_full_size, -} -window._privelemdict = { -} -information_window._superclassnames = ['window'] -information_window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'current_panel' : _Prop_current_panel, - 'item' : _Prop_item, -} -information_window._privelemdict = { -} -clipping_window._superclassnames = ['window'] -clipping_window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -clipping_window._privelemdict = { -} -preferences_window._superclassnames = ['window'] -preferences_window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'current_panel' : _Prop_current_panel, -} -preferences_window._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'brow' : Finder_window, - 'cwin' : window, - 'iwnd' : information_window, - 'lwnd' : clipping_window, - 'pwnd' : preferences_window, -} - -_propdeclarations = { - 'ID ' : _Prop_id, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'cobj' : _Prop_item, - 'fvtg' : _Prop_target, - 'hclb' : _Prop_closeable, - 'icop' : _Prop_icon_view_options, - 'isfl' : _Prop_floating, - 'iszm' : _Prop_zoomable, - 'lvop' : _Prop_list_view_options, - 'pALL' : _Prop_properties, - 'panl' : _Prop_current_panel, - 'pbnd' : _Prop_bounds, - 'pidx' : _Prop_index, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'posn' : _Prop_position, - 'prsz' : _Prop_resizable, - 'ptit' : _Prop_titled, - 'pvew' : _Prop_current_view, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, - 'wshd' : _Prop_collapsed, - 'zumf' : _Prop_zoomed_full_size, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/Finder/__init__.py deleted file mode 100644 index 8782a4f81..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Finder/__init__.py +++ /dev/null @@ -1,233 +0,0 @@ -""" -Package generated from /System/Library/CoreServices/Finder.app -""" -import aetools -Error = aetools.Error -import Standard_Suite -import Legacy_suite -import Containers_and_folders -import Files -import Finder_Basics -import Finder_items -import Window_classes -import Type_Definitions -import Enumerations - - -_code_to_module = { - 'CoRe' : Standard_Suite, - 'fleg' : Legacy_suite, - 'fndr' : Containers_and_folders, - 'fndr' : Files, - 'fndr' : Finder_Basics, - 'fndr' : Finder_items, - 'fndr' : Window_classes, - 'tpdf' : Type_Definitions, - 'tpnm' : Enumerations, -} - - - -_code_to_fullname = { - 'CoRe' : ('Finder.Standard_Suite', 'Standard_Suite'), - 'fleg' : ('Finder.Legacy_suite', 'Legacy_suite'), - 'fndr' : ('Finder.Containers_and_folders', 'Containers_and_folders'), - 'fndr' : ('Finder.Files', 'Files'), - 'fndr' : ('Finder.Finder_Basics', 'Finder_Basics'), - 'fndr' : ('Finder.Finder_items', 'Finder_items'), - 'fndr' : ('Finder.Window_classes', 'Window_classes'), - 'tpdf' : ('Finder.Type_Definitions', 'Type_Definitions'), - 'tpnm' : ('Finder.Enumerations', 'Enumerations'), -} - -from Standard_Suite import * -from Legacy_suite import * -from Containers_and_folders import * -from Files import * -from Finder_Basics import * -from Finder_items import * -from Window_classes import * -from Type_Definitions import * -from Enumerations import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(StdSuites.Type_Names_Suite.small_integer) -getbaseclasses(StdSuites.Type_Names_Suite.system_dictionary) -getbaseclasses(StdSuites.Type_Names_Suite.color_table) -getbaseclasses(StdSuites.Type_Names_Suite.fixed_point) -getbaseclasses(StdSuites.Type_Names_Suite.string) -getbaseclasses(StdSuites.Type_Names_Suite.type_element_info) -getbaseclasses(StdSuites.Type_Names_Suite.machine_location) -getbaseclasses(StdSuites.Type_Names_Suite.PostScript_picture) -getbaseclasses(StdSuites.Type_Names_Suite.type_property_info) -getbaseclasses(StdSuites.Type_Names_Suite.menu_item) -getbaseclasses(StdSuites.Type_Names_Suite.scrap_styles) -getbaseclasses(StdSuites.Type_Names_Suite.fixed_rectangle) -getbaseclasses(StdSuites.Type_Names_Suite.null) -getbaseclasses(StdSuites.Type_Names_Suite.type_event_info) -getbaseclasses(StdSuites.Type_Names_Suite.rotation) -getbaseclasses(StdSuites.Type_Names_Suite.long_fixed_rectangle) -getbaseclasses(StdSuites.Type_Names_Suite.long_point) -getbaseclasses(StdSuites.Type_Names_Suite.target_id) -getbaseclasses(StdSuites.Type_Names_Suite.type_suite_info) -getbaseclasses(StdSuites.Type_Names_Suite.type_parameter_info) -getbaseclasses(StdSuites.Type_Names_Suite.long_fixed_point) -getbaseclasses(StdSuites.Type_Names_Suite.bounding_rectangle) -getbaseclasses(StdSuites.Type_Names_Suite.TIFF_picture) -getbaseclasses(StdSuites.Type_Names_Suite.long_fixed) -getbaseclasses(StdSuites.Type_Names_Suite.version) -getbaseclasses(StdSuites.Type_Names_Suite.RGB16_color) -getbaseclasses(StdSuites.Type_Names_Suite.double_integer) -getbaseclasses(StdSuites.Type_Names_Suite.location_reference) -getbaseclasses(StdSuites.Type_Names_Suite.point) -getbaseclasses(StdSuites.Type_Names_Suite.application_dictionary) -getbaseclasses(StdSuites.Type_Names_Suite.unsigned_integer) -getbaseclasses(StdSuites.Type_Names_Suite.menu) -getbaseclasses(StdSuites.Type_Names_Suite.small_real) -getbaseclasses(StdSuites.Type_Names_Suite.fixed) -getbaseclasses(StdSuites.Type_Names_Suite.type_class_info) -getbaseclasses(StdSuites.Type_Names_Suite.RGB96_color) -getbaseclasses(StdSuites.Type_Names_Suite.dash_style) -getbaseclasses(StdSuites.Type_Names_Suite.pixel_map_record) -getbaseclasses(StdSuites.Type_Names_Suite.extended_real) -getbaseclasses(StdSuites.Type_Names_Suite.long_rectangle) -getbaseclasses(process) -getbaseclasses(application_process) -getbaseclasses(desk_accessory_process) -getbaseclasses(application) -getbaseclasses(trash_2d_object) -getbaseclasses(desktop_2d_object) -getbaseclasses(container) -getbaseclasses(folder) -getbaseclasses(disk) -getbaseclasses(application) -getbaseclasses(alias_file) -getbaseclasses(package) -getbaseclasses(file) -getbaseclasses(application_file) -getbaseclasses(internet_location_file) -getbaseclasses(document_file) -getbaseclasses(clipping) -getbaseclasses(preferences_window) -getbaseclasses(Finder_window) -getbaseclasses(window) -getbaseclasses(clipping_window) -getbaseclasses(information_window) -getbaseclasses(item) -getbaseclasses(icon_view_options) -getbaseclasses(preferences) -getbaseclasses(alias_list) -getbaseclasses(icon_family) -getbaseclasses(label) -getbaseclasses(column) -getbaseclasses(list_view_options) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'shor' : StdSuites.Type_Names_Suite.small_integer, - 'aeut' : StdSuites.Type_Names_Suite.system_dictionary, - 'clrt' : StdSuites.Type_Names_Suite.color_table, - 'fpnt' : StdSuites.Type_Names_Suite.fixed_point, - 'TEXT' : StdSuites.Type_Names_Suite.string, - 'elin' : StdSuites.Type_Names_Suite.type_element_info, - 'mLoc' : StdSuites.Type_Names_Suite.machine_location, - 'EPS ' : StdSuites.Type_Names_Suite.PostScript_picture, - 'pinf' : StdSuites.Type_Names_Suite.type_property_info, - 'cmen' : StdSuites.Type_Names_Suite.menu_item, - 'styl' : StdSuites.Type_Names_Suite.scrap_styles, - 'frct' : StdSuites.Type_Names_Suite.fixed_rectangle, - 'null' : StdSuites.Type_Names_Suite.null, - 'evin' : StdSuites.Type_Names_Suite.type_event_info, - 'trot' : StdSuites.Type_Names_Suite.rotation, - 'lfrc' : StdSuites.Type_Names_Suite.long_fixed_rectangle, - 'lpnt' : StdSuites.Type_Names_Suite.long_point, - 'targ' : StdSuites.Type_Names_Suite.target_id, - 'suin' : StdSuites.Type_Names_Suite.type_suite_info, - 'pmin' : StdSuites.Type_Names_Suite.type_parameter_info, - 'lfpt' : StdSuites.Type_Names_Suite.long_fixed_point, - 'qdrt' : StdSuites.Type_Names_Suite.bounding_rectangle, - 'TIFF' : StdSuites.Type_Names_Suite.TIFF_picture, - 'lfxd' : StdSuites.Type_Names_Suite.long_fixed, - 'vers' : StdSuites.Type_Names_Suite.version, - 'tr16' : StdSuites.Type_Names_Suite.RGB16_color, - 'comp' : StdSuites.Type_Names_Suite.double_integer, - 'insl' : StdSuites.Type_Names_Suite.location_reference, - 'QDpt' : StdSuites.Type_Names_Suite.point, - 'aete' : StdSuites.Type_Names_Suite.application_dictionary, - 'magn' : StdSuites.Type_Names_Suite.unsigned_integer, - 'cmnu' : StdSuites.Type_Names_Suite.menu, - 'sing' : StdSuites.Type_Names_Suite.small_real, - 'fixd' : StdSuites.Type_Names_Suite.fixed, - 'gcli' : StdSuites.Type_Names_Suite.type_class_info, - 'tr96' : StdSuites.Type_Names_Suite.RGB96_color, - 'tdas' : StdSuites.Type_Names_Suite.dash_style, - 'tpmm' : StdSuites.Type_Names_Suite.pixel_map_record, - 'exte' : StdSuites.Type_Names_Suite.extended_real, - 'lrct' : StdSuites.Type_Names_Suite.long_rectangle, - 'prcs' : process, - 'pcap' : application_process, - 'pcda' : desk_accessory_process, - 'capp' : application, - 'ctrs' : trash_2d_object, - 'cdsk' : desktop_2d_object, - 'ctnr' : container, - 'cfol' : folder, - 'cdis' : disk, - 'capp' : application, - 'alia' : alias_file, - 'pack' : package, - 'file' : file, - 'appf' : application_file, - 'inlf' : internet_location_file, - 'docf' : document_file, - 'clpf' : clipping, - 'pwnd' : preferences_window, - 'brow' : Finder_window, - 'cwin' : window, - 'lwnd' : clipping_window, - 'iwnd' : information_window, - 'cobj' : item, - 'icop' : icon_view_options, - 'cprf' : preferences, - 'alst' : alias_list, - 'ifam' : icon_family, - 'clbl' : label, - 'lvcl' : column, - 'lvop' : list_view_options, -} - - -class Finder(Standard_Suite_Events, - Legacy_suite_Events, - Containers_and_folders_Events, - Files_Events, - Finder_Basics_Events, - Finder_items_Events, - Window_classes_Events, - Type_Definitions_Events, - Enumerations_Events, - aetools.TalkTo): - _signature = 'MACS' - - _moduleName = 'Finder' - - _elemdict = application._elemdict - _propdict = application._propdict diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py deleted file mode 100644 index f4aea730c..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py +++ /dev/null @@ -1,269 +0,0 @@ -"""Suite Mozilla suite: Experimental Mozilla suite -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'MOSS' - -class Mozilla_suite_Events: - - def Get_Import_Data(self, _no_object=None, _attributes={}, **_arguments): - """Get Import Data: Returns a structure containing information that is of use to an external module in importing data from an external mail application into Communicator. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: vRefNum and dirID of profile folder (2+4 bytes), vRefNum and DirID of the local mail folder (2+4 bytes), window type of front window (0 if none, \xd4Brwz\xd5 browser, \xd4Addr\xd5 addressbook, \xd4Mesg\xd5 messenger, etc., 4 bytes) - """ - _code = 'MOSS' - _subcode = 'Impt' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_Profile_Name(self, _no_object=None, _attributes={}, **_arguments): - """Get Profile Name: Get the current User Profile - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Name of the current profile, like \xd2Joe Bloggs\xd3. This is the name of the profile folder in the Netscape Users folder. - """ - _code = 'MOSS' - _subcode = 'upro' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Get_workingURL(self, _no_object=None, _attributes={}, **_arguments): - """Get workingURL: Get the path to the running application in URL format. This will allow a script to construct a relative URL - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Will return text of the from \xd2FILE://foo/applicationname\xd3 - """ - _code = 'MOSS' - _subcode = 'wurl' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Go = { - 'direction' : 'dire', - } - - def Go(self, _object, _attributes={}, **_arguments): - """Go: navigate a window: back, forward, again(reload), home) - Required argument: window - Keyword argument direction: undocumented, typecode 'dire' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'gogo' - - aetools.keysubst(_arguments, self._argmap_Go) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'dire', _Enum_dire) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Handle_command(self, _object, _attributes={}, **_arguments): - """Handle command: Handle a command - Required argument: The command to handle - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'hcmd' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Open_Address_Book(self, _no_object=None, _attributes={}, **_arguments): - """Open Address Book: Opens the address book - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'addr' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Open_Component(self, _object, _attributes={}, **_arguments): - """Open Component: Open a Communicator component - Required argument: The component to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'cpnt' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Open_Profile_Manager(self, _no_object=None, _attributes={}, **_arguments): - """Open Profile Manager: Open the user profile manager (obsolete) - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'prfl' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def Open_bookmark(self, _object=None, _attributes={}, **_arguments): - """Open bookmark: Reads in a bookmark file - Required argument: If not available, reloads the current bookmark file - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'book' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Read_help_file = { - 'with_index' : 'idid', - 'search_text' : 'sear', - } - - def Read_help_file(self, _object, _attributes={}, **_arguments): - """Read help file: Reads in the help file (file should be in the help file format) - Required argument: undocumented, typecode 'alis' - Keyword argument with_index: Index to the help file. Defaults to \xd4DEFAULT\xd5) - Keyword argument search_text: Optional text to search for - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'MOSS' - _subcode = 'help' - - aetools.keysubst(_arguments, self._argmap_Read_help_file) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - -_Enum_comp = { - 'Navigator' : 'navg', # The Navigator component - 'InBox' : 'inbx', # The InBox component - 'Newsgroups' : 'colb', # The Newsgroups component - 'Composer' : 'cpsr', # The Page Composer component - 'Conference' : 'conf', # The Conference Component - 'Calendar' : 'cald', # The Calendar Component -} - -_Enum_dire = { - 'again' : 'agai', # Again (reload) - 'home' : 'home', # Home - 'backward' : 'prev', # Previous page - 'forward' : 'next', # Next page -} - -_Enum_ncmd = { - 'Get_new_mail' : '\x00\x00\x04W', # - 'Send_queued_messages' : '\x00\x00\x04X', # - 'Read_newsgroups' : '\x00\x00\x04\x04', # - 'Show_Inbox' : '\x00\x00\x04\x05', # - 'Show_Bookmarks_window' : '\x00\x00\x04\x06', # - 'Show_History_window' : '\x00\x00\x04\x07', # - 'Show_Address_Book_window' : '\x00\x00\x04\t', # -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'comp' : _Enum_comp, - 'dire' : _Enum_dire, - 'ncmd' : _Enum_ncmd, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py deleted file mode 100644 index 7767305cb..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py +++ /dev/null @@ -1,86 +0,0 @@ -"""Suite PowerPlant: -Level 0, version 0 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'ppnt' - -class PowerPlant_Events: - - _argmap_SwitchTellTarget = { - 'to' : 'data', - } - - def SwitchTellTarget(self, _no_object=None, _attributes={}, **_arguments): - """SwitchTellTarget: Makes an object the \xd2focus\xd3 of AppleEvents - Keyword argument to: reference to new focus of AppleEvents - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ppnt' - _subcode = 'sttg' - - aetools.keysubst(_arguments, self._argmap_SwitchTellTarget) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_select = { - 'data' : 'data', - } - - def select(self, _object, _attributes={}, **_arguments): - """select: Sets the present selection - Required argument: object to select or container of sub-objects to select - Keyword argument data: sub-object(s) to select - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'slct' - - aetools.keysubst(_arguments, self._argmap_select) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - -_Enum_dbac = { - 'DoNothing' : '\x00\x00\x00\x00', # No debugging action is taken. - 'PostAlert' : '\x00\x00\x00\x01', # Post an alert. - 'LowLevelDebugger' : '\x00\x00\x00\x02', # Break into the low level debugger (MacsBug). - 'SourceDebugger' : '\x00\x00\x00\x03', # Break into the source level debugger (if source debugger is executing). -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'dbac' : _Enum_dbac, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Required_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Required_suite.py deleted file mode 100644 index b5c411048..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Required_suite.py +++ /dev/null @@ -1,108 +0,0 @@ -"""Suite Required suite: -Level 0, version 0 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'reqd' - -from StdSuites.Required_Suite import * -class Required_suite_Events(Required_Suite_Events): - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: list of objects to print - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit Navigator - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: Sent to an application when it is double-clicked - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'oapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py deleted file mode 100644 index 5c3e92789..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py +++ /dev/null @@ -1,243 +0,0 @@ -"""Suite Standard Suite: Common terms for most applications -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'CoRe' - -from StdSuites.Standard_Suite import * -class Standard_Suite_Events(Standard_Suite_Events): - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object - Required argument: the objects to close - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def data_size(self, _object, _attributes={}, **_arguments): - """data size: Return the size in bytes of an object - Required argument: the object whose data size is to be returned - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the size of the object in bytes - """ - _code = 'core' - _subcode = 'dsiz' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def get(self, _object, _attributes={}, **_arguments): - """get: Get the data for an object - Required argument: the object whose data is to be returned - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The data from the object - """ - _code = 'core' - _subcode = 'getd' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_set = { - 'to' : 'data', - } - - def set(self, _object, _attributes={}, **_arguments): - """set: Set an object\xd5s data - Required argument: the object to change - Keyword argument to: the new value - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - aetools.keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - An application program """ - want = 'capp' -class _Prop_alert_application(aetools.NProperty): - """alert application - Most of the alerts will be sent to this application using yet unspecified AE interface. We need a few alert boxes: alert, confirm and notify. Any ideas on how to design this event? mailto:atotic@netscape.com. I\xd5d like to conform to the standard. """ - which = 'ALAP' - want = 'type' -alert_application = _Prop_alert_application() -class _Prop_kiosk_mode(aetools.NProperty): - """kiosk mode - Kiosk mode leaves very few menus enabled """ - which = 'KOSK' - want = 'long' -kiosk_mode = _Prop_kiosk_mode() -# element 'cwin' as ['indx', 'name', 'ID '] - -class window(aetools.ComponentItem): - """window - A Window """ - want = 'cwin' -class _Prop_URL(aetools.NProperty): - """URL - Current URL """ - which = 'curl' - want = 'TEXT' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window """ - which = 'pbnd' - want = 'qdrt' -class _Prop_busy(aetools.NProperty): - """busy - Is window loading something right now. 2, window is busy and will reject load requests. 1, window is busy, but will interrupt outstanding loads """ - which = 'busy' - want = 'long' -class _Prop_closeable(aetools.NProperty): - """closeable - Does the window have a close box? """ - which = 'hclb' - want = 'bool' -class _Prop_floating(aetools.NProperty): - """floating - Does the window float? """ - which = 'isfl' - want = 'bool' -class _Prop_index(aetools.NProperty): - """index - the number of the window """ - which = 'pidx' - want = 'long' -class _Prop_modal(aetools.NProperty): - """modal - Is the window modal? """ - which = 'pmod' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the title of the window """ - which = 'pnam' - want = 'itxt' -class _Prop_position(aetools.NProperty): - """position - upper left coordinates of window """ - which = 'ppos' - want = 'QDpt' -class _Prop_resizable(aetools.NProperty): - """resizable - Is the window resizable? """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Does the window have a title bar? """ - which = 'ptit' - want = 'bool' -class _Prop_unique_ID(aetools.NProperty): - """unique ID - Window\xd5s unique ID (a bridge between WWW! suite window id\xd5s and standard AE windows) """ - which = 'wiid' - want = 'long' -class _Prop_visible(aetools.NProperty): - """visible - is the window visible? """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Is the window zoomable? """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Is the window zoomed? """ - which = 'pzum' - want = 'bool' -application._superclassnames = [] -application._privpropdict = { - 'alert_application' : _Prop_alert_application, - 'kiosk_mode' : _Prop_kiosk_mode, -} -application._privelemdict = { - 'window' : window, -} -window._superclassnames = [] -window._privpropdict = { - 'URL' : _Prop_URL, - 'bounds' : _Prop_bounds, - 'busy' : _Prop_busy, - 'closeable' : _Prop_closeable, - 'floating' : _Prop_floating, - 'index' : _Prop_index, - 'modal' : _Prop_modal, - 'name' : _Prop_name, - 'position' : _Prop_position, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'unique_ID' : _Prop_unique_ID, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cwin' : window, -} - -_propdeclarations = { - 'ALAP' : _Prop_alert_application, - 'KOSK' : _Prop_kiosk_mode, - 'busy' : _Prop_busy, - 'curl' : _Prop_URL, - 'hclb' : _Prop_closeable, - 'isfl' : _Prop_floating, - 'iszm' : _Prop_zoomable, - 'pbnd' : _Prop_bounds, - 'pidx' : _Prop_index, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'ppos' : _Prop_position, - 'prsz' : _Prop_resizable, - 'ptit' : _Prop_titled, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, - 'wiid' : _Prop_unique_ID, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py deleted file mode 100644 index de4a01c9e..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Suite Standard URL suite: Mac URL standard, supported by many apps - - -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'GURL' - -class Standard_URL_suite_Events: - - _argmap_GetURL = { - 'to' : 'dest', - 'inside' : 'HWIN', - 'from_' : 'refe', - } - - def GetURL(self, _object, _attributes={}, **_arguments): - """GetURL: Loads the URL (optionally to disk) - Required argument: The url - Keyword argument to: file the URL should be loaded into - Keyword argument inside: Window the URL should be loaded to - Keyword argument from_: Referrer, to be sent with the HTTP request - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'GURL' - _subcode = 'GURL' - - aetools.keysubst(_arguments, self._argmap_GetURL) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Text.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Text.py deleted file mode 100644 index 2360d949a..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/Text.py +++ /dev/null @@ -1,122 +0,0 @@ -"""Suite Text: -Level 0, version 0 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'TEXT' - -from StdSuites.Text_Suite import * -class Text_Events(Text_Suite_Events): - - pass - - -class text(aetools.ComponentItem): - """text - independent text view objects """ - want = 'ctxt' -class _Prop_beginning(aetools.NProperty): - """beginning - Beginning of element """ - which = 'bgng' - want = 'obj ' -class _Prop_end(aetools.NProperty): - """end - Ending of element """ - which = 'end ' - want = 'obj ' -class _Prop_infront(aetools.NProperty): - """infront - Immediately before element """ - which = 'pBef' - want = 'obj ' -class _Prop_justbehind(aetools.NProperty): - """justbehind - Immediately after element """ - which = 'pAft' - want = 'obj ' -class _Prop_updateLevel(aetools.NProperty): - """updateLevel - updating level. Can only be incremented or decremented. Do so only in a try block -- if the level is greater than zero, visual text updating will cease. """ - which = 'pUpL' - want = 'long' -# element 'stys' as ['indx', 'name'] - -class styleset(aetools.ComponentItem): - """styleset - A style \xd2set\xd3 that may be used repeatedly in text objects. """ - want = 'stys' -class _Prop_color(aetools.NProperty): - """color - the color """ - which = 'colr' - want = 'RGB ' -class _Prop_font(aetools.NProperty): - """font - font name """ - which = 'font' - want = 'TEXT' -class _Prop_name(aetools.NProperty): - """name - style name """ - which = 'pnam' - want = 'TEXT' -class _Prop_size(aetools.NProperty): - """size - the size in points """ - which = 'ptsz' - want = 'long' -class _Prop_style(aetools.NProperty): - """style - the text styles or face attributes """ - which = 'txst' - want = 'tsty' -class _Prop_writing_code(aetools.NProperty): - """writing code - the script system and language """ - which = 'psct' - want = 'tsty' - -stylesets = styleset -text._superclassnames = [] -text._privpropdict = { - 'beginning' : _Prop_beginning, - 'end' : _Prop_end, - 'infront' : _Prop_infront, - 'justbehind' : _Prop_justbehind, - 'updateLevel' : _Prop_updateLevel, -} -text._privelemdict = { - 'styleset' : styleset, -} -styleset._superclassnames = [] -styleset._privpropdict = { - 'color' : _Prop_color, - 'font' : _Prop_font, - 'name' : _Prop_name, - 'size' : _Prop_size, - 'style' : _Prop_style, - 'writing_code' : _Prop_writing_code, -} -styleset._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'ctxt' : text, - 'stys' : styleset, -} - -_propdeclarations = { - 'bgng' : _Prop_beginning, - 'colr' : _Prop_color, - 'end ' : _Prop_end, - 'font' : _Prop_font, - 'pAft' : _Prop_justbehind, - 'pBef' : _Prop_infront, - 'pUpL' : _Prop_updateLevel, - 'pnam' : _Prop_name, - 'psct' : _Prop_writing_code, - 'ptsz' : _Prop_size, - 'txst' : _Prop_style, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py deleted file mode 100644 index 06cbfa7ac..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py +++ /dev/null @@ -1,426 +0,0 @@ -"""Suite WorldWideWeb suite, as defined in Spyglass spec.: -Level 1, version 1 - -Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'WWW!' - -class WorldWideWeb_suite_Events: - - _argmap_OpenURL = { - 'to' : 'INTO', - 'toWindow' : 'WIND', - 'flags' : 'FLGS', - 'post_data' : 'POST', - 'post_type' : 'MIME', - 'progressApp' : 'PROG', - } - - def OpenURL(self, _object, _attributes={}, **_arguments): - """OpenURL: Opens a URL. Allows for more options than GetURL event - Required argument: URL - Keyword argument to: file destination - Keyword argument toWindow: window iD - Keyword argument flags: Binary: any combination of 1, 2 and 4 is allowed: 1 and 2 mean force reload the document. 4 is ignored - Keyword argument post_data: Form posting data - Keyword argument post_type: MIME type of the posting data. Defaults to application/x-www-form-urlencoded - Keyword argument progressApp: Application that will display progress - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: ID of the loading window - """ - _code = 'WWW!' - _subcode = 'OURL' - - aetools.keysubst(_arguments, self._argmap_OpenURL) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_ShowFile = { - 'MIME_type' : 'MIME', - 'Window_ID' : 'WIND', - 'URL' : 'URL ', - } - - def ShowFile(self, _object, _attributes={}, **_arguments): - """ShowFile: Similar to OpenDocuments, except that it specifies the parent URL, and MIME type of the file - Required argument: File to open - Keyword argument MIME_type: MIME type - Keyword argument Window_ID: Window to open the file in - Keyword argument URL: Use this as a base URL - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Window ID of the loaded window. 0 means ShowFile failed, FFFFFFF means that data was not appropriate type to display in the browser. - """ - _code = 'WWW!' - _subcode = 'SHWF' - - aetools.keysubst(_arguments, self._argmap_ShowFile) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_cancel_progress = { - 'in_window' : 'WIND', - } - - def cancel_progress(self, _object=None, _attributes={}, **_arguments): - """cancel progress: Interrupts the download of the document in the given window - Required argument: progress ID, obtained from the progress app - Keyword argument in_window: window ID of the progress to cancel - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'CNCL' - - aetools.keysubst(_arguments, self._argmap_cancel_progress) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def find_URL(self, _object, _attributes={}, **_arguments): - """find URL: If the file was downloaded by Netscape, you can call FindURL to find out the URL used to download the file. - Required argument: File spec - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The URL - """ - _code = 'WWW!' - _subcode = 'FURL' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def get_window_info(self, _object=None, _attributes={}, **_arguments): - """get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty. - Required argument: window ID - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: undocumented, typecode 'list' - """ - _code = 'WWW!' - _subcode = 'WNFO' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def list_windows(self, _no_object=None, _attributes={}, **_arguments): - """list windows: Lists the IDs of all the hypertext windows - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: List of unique IDs of all the hypertext windows - """ - _code = 'WWW!' - _subcode = 'LSTW' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_parse_anchor = { - 'relative_to' : 'RELA', - } - - def parse_anchor(self, _object, _attributes={}, **_arguments): - """parse anchor: Resolves the relative URL - Required argument: Main URL - Keyword argument relative_to: Relative URL - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Parsed URL - """ - _code = 'WWW!' - _subcode = 'PRSA' - - aetools.keysubst(_arguments, self._argmap_parse_anchor) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def register_URL_echo(self, _object=None, _attributes={}, **_arguments): - """register URL echo: Registers the \xd2echo\xd3 application. Each download from now on will be echoed to this application. - Required argument: Application signature - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'RGUE' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_register_protocol = { - 'for_protocol' : 'PROT', - } - - def register_protocol(self, _object=None, _attributes={}, **_arguments): - """register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event. - Required argument: Application sig - Keyword argument for_protocol: protocol prefix: \xd2finger:\xd3, \xd2file\xd3, - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: TRUE if registration has been successful - """ - _code = 'WWW!' - _subcode = 'RGPR' - - aetools.keysubst(_arguments, self._argmap_register_protocol) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_register_viewer = { - 'MIME_type' : 'MIME', - 'with_file_type' : 'FTYP', - } - - def register_viewer(self, _object, _attributes={}, **_arguments): - """register viewer: Registers an application as a \xd4special\xd5 viewer for this MIME type. The application will be launched with ViewDoc events - Required argument: Application sig - Keyword argument MIME_type: MIME type viewer is registering for - Keyword argument with_file_type: Mac file type for the downloaded files - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: TRUE if registration has been successful - """ - _code = 'WWW!' - _subcode = 'RGVW' - - aetools.keysubst(_arguments, self._argmap_register_viewer) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_register_window_close = { - 'for_window' : 'WIND', - } - - def register_window_close(self, _object=None, _attributes={}, **_arguments): - """register window close: Netscape will notify registered application when this window closes - Required argument: Application signature - Keyword argument for_window: window ID - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: true if successful - """ - _code = 'WWW!' - _subcode = 'RGWC' - - aetools.keysubst(_arguments, self._argmap_register_window_close) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def unregister_URL_echo(self, _object, _attributes={}, **_arguments): - """unregister URL echo: cancels URL echo - Required argument: application signature - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'UNRU' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_unregister_protocol = { - 'for_protocol' : 'PROT', - } - - def unregister_protocol(self, _object=None, _attributes={}, **_arguments): - """unregister protocol: reverses the effects of \xd2register protocol\xd3 - Required argument: Application sig. - Keyword argument for_protocol: protocol prefix. If none, unregister for all protocols - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: TRUE if successful - """ - _code = 'WWW!' - _subcode = 'UNRP' - - aetools.keysubst(_arguments, self._argmap_unregister_protocol) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_unregister_viewer = { - 'MIME_type' : 'MIME', - } - - def unregister_viewer(self, _object, _attributes={}, **_arguments): - """unregister viewer: Revert to the old way of handling this MIME type - Required argument: Application sig - Keyword argument MIME_type: MIME type to be unregistered - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: TRUE if the event was successful - """ - _code = 'WWW!' - _subcode = 'UNRV' - - aetools.keysubst(_arguments, self._argmap_unregister_viewer) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_unregister_window_close = { - 'for_window' : 'WIND', - } - - def unregister_window_close(self, _object=None, _attributes={}, **_arguments): - """unregister window close: Undo for register window close - Required argument: Application signature - Keyword argument for_window: window ID - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: true if successful - """ - _code = 'WWW!' - _subcode = 'UNRC' - - aetools.keysubst(_arguments, self._argmap_unregister_window_close) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def webActivate(self, _object=None, _attributes={}, **_arguments): - """webActivate: Makes Netscape the frontmost application, and selects a given window. This event is here for suite completeness/ cross-platform compatibility only, you should use standard AppleEvents instead. - Required argument: window to bring to front - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'WWW!' - _subcode = 'ACTV' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/__init__.py deleted file mode 100644 index 0dc5398a0..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Netscape/__init__.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -Package generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 -""" -import aetools -Error = aetools.Error -import Standard_Suite -import Standard_URL_suite -import Mozilla_suite -import Text -import WorldWideWeb_suite -import PowerPlant -import Required_suite - - -_code_to_module = { - 'CoRe' : Standard_Suite, - 'GURL' : Standard_URL_suite, - 'MOSS' : Mozilla_suite, - 'TEXT' : Text, - 'WWW!' : WorldWideWeb_suite, - 'ppnt' : PowerPlant, - 'reqd' : Required_suite, -} - - - -_code_to_fullname = { - 'CoRe' : ('Netscape.Standard_Suite', 'Standard_Suite'), - 'GURL' : ('Netscape.Standard_URL_suite', 'Standard_URL_suite'), - 'MOSS' : ('Netscape.Mozilla_suite', 'Mozilla_suite'), - 'TEXT' : ('Netscape.Text', 'Text'), - 'WWW!' : ('Netscape.WorldWideWeb_suite', 'WorldWideWeb_suite'), - 'ppnt' : ('Netscape.PowerPlant', 'PowerPlant'), - 'reqd' : ('Netscape.Required_suite', 'Required_suite'), -} - -from Standard_Suite import * -from Standard_URL_suite import * -from Mozilla_suite import * -from Text import * -from WorldWideWeb_suite import * -from PowerPlant import * -from Required_suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(text) -getbaseclasses(styleset) -getbaseclasses(StdSuites.Text_Suite.character) -getbaseclasses(StdSuites.Text_Suite.text_flow) -getbaseclasses(StdSuites.Text_Suite.word) -getbaseclasses(StdSuites.Text_Suite.paragraph) -getbaseclasses(StdSuites.Text_Suite.text_style_info) -getbaseclasses(StdSuites.Text_Suite.line) -getbaseclasses(StdSuites.Text_Suite.text) -getbaseclasses(window) -getbaseclasses(application) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'ctxt' : text, - 'stys' : styleset, - 'cha ' : StdSuites.Text_Suite.character, - 'cflo' : StdSuites.Text_Suite.text_flow, - 'cwor' : StdSuites.Text_Suite.word, - 'cpar' : StdSuites.Text_Suite.paragraph, - 'tsty' : StdSuites.Text_Suite.text_style_info, - 'clin' : StdSuites.Text_Suite.line, - 'ctxt' : StdSuites.Text_Suite.text, - 'cwin' : window, - 'capp' : application, -} - - -class Netscape(Standard_Suite_Events, - Standard_URL_suite_Events, - Mozilla_suite_Events, - Text_Events, - WorldWideWeb_suite_Events, - PowerPlant_Events, - Required_suite_Events, - aetools.TalkTo): - _signature = 'MOSS' - - _moduleName = 'Netscape' - - _elemdict = application._elemdict - _propdict = application._propdict diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py deleted file mode 100644 index 574043d4a..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py +++ /dev/null @@ -1,2215 +0,0 @@ -"""Suite AppleScript Suite: Standard terms for AppleScript -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'ascr' - -class AppleScript_Suite_Events: - - def _26_(self, _object, _attributes={}, **_arguments): - """&: Concatenation - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'ccat' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _2a_(self, _object, _attributes={}, **_arguments): - """*: Multiplication - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '* ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _2b_(self, _object, _attributes={}, **_arguments): - """+: Addition - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '+ ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _2d_(self, _object, _attributes={}, **_arguments): - """-: Subtraction - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '- ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _3c_(self, _object, _attributes={}, **_arguments): - """<: Less than - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '< ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _3d_(self, _object, _attributes={}, **_arguments): - """=: Equality - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '= ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _3e_(self, _object, _attributes={}, **_arguments): - """>: Greater than - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '> ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_Call_a5_subroutine = { - 'at' : 'at ', - 'from_' : 'from', - 'for_' : 'for ', - 'to' : 'to ', - 'thru' : 'thru', - 'through' : 'thgh', - 'by' : 'by ', - 'on' : 'on ', - 'into' : 'into', - 'onto' : 'onto', - 'between' : 'btwn', - 'against' : 'agst', - 'out_of' : 'outo', - 'instead_of' : 'isto', - 'aside_from' : 'asdf', - 'around' : 'arnd', - 'beside' : 'bsid', - 'beneath' : 'bnth', - 'under' : 'undr', - 'over' : 'over', - 'above' : 'abve', - 'below' : 'belw', - 'apart_from' : 'aprt', - 'about' : 'abou', - 'since' : 'snce', - 'given' : 'givn', - 'with' : 'with', - 'without' : 'wout', - } - - def Call_a5_subroutine(self, _object=None, _attributes={}, **_arguments): - """Call\xa5subroutine: A subroutine call - Required argument: anything - Keyword argument at: a preposition - Keyword argument from_: a preposition - Keyword argument for_: a preposition - Keyword argument to: a preposition - Keyword argument thru: a preposition - Keyword argument through: a preposition - Keyword argument by: a preposition - Keyword argument on: a preposition - Keyword argument into: a preposition - Keyword argument onto: a preposition - Keyword argument between: a preposition - Keyword argument against: a preposition - Keyword argument out_of: a preposition - Keyword argument instead_of: a preposition - Keyword argument aside_from: a preposition - Keyword argument around: a preposition - Keyword argument beside: a preposition - Keyword argument beneath: a preposition - Keyword argument under: a preposition - Keyword argument over: a preposition - Keyword argument above: a preposition - Keyword argument below: a preposition - Keyword argument apart_from: a preposition - Keyword argument about: a preposition - Keyword argument since: a preposition - Keyword argument given: parameter:value pairs, comma-separated - Keyword argument with: formal parameter set to true if matching actual parameter is provided - Keyword argument without: formal parameter set to false if matching actual parmeter is provided - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'psbr' - - aetools.keysubst(_arguments, self._argmap_Call_a5_subroutine) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _5e_(self, _object, _attributes={}, **_arguments): - """^: Exponentiation - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '^ ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def activate(self, _no_object=None, _attributes={}, **_arguments): - """activate: Bring the targeted application program to the front - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'actv' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def and_(self, _object, _attributes={}, **_arguments): - """and: Logical conjunction - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'AND ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def as(self, _object, _attributes={}, **_arguments): - """as: Coercion - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'coer' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def contains(self, _object, _attributes={}, **_arguments): - """contains: Containment - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'cont' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def div(self, _object, _attributes={}, **_arguments): - """div: Quotient - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'div ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def end_tell(self, _no_object=None, _attributes={}, **_arguments): - """end tell: Record or log an \xd4end tell\xd5 statement - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ascr' - _subcode = 'tend' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def ends_with(self, _object, _attributes={}, **_arguments): - """ends with: Ends with - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'ends' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_error = { - 'number' : 'errn', - 'partial_result' : 'ptlr', - 'from_' : 'erob', - 'to' : 'errt', - } - - def error(self, _object=None, _attributes={}, **_arguments): - """error: Raise an error - Required argument: anything - Keyword argument number: an error number - Keyword argument partial_result: any partial result occurring before the error - Keyword argument from_: the object that caused the error - Keyword argument to: the desired class for a failed coercion - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ascr' - _subcode = 'err ' - - aetools.keysubst(_arguments, self._argmap_error) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def idle(self, _no_object=None, _attributes={}, **_arguments): - """idle: Sent to a script application when it is idle - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the number of seconds to wait for next idle event - """ - _code = 'misc' - _subcode = 'idle' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def launch(self, _no_object=None, _attributes={}, **_arguments): - """launch: Start an application for scripting - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ascr' - _subcode = 'noop' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def log(self, _object, _attributes={}, **_arguments): - """log: Cause a comment to be logged - Required argument: undocumented, typecode 'TEXT' - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ascr' - _subcode = 'cmnt' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def mod(self, _object, _attributes={}, **_arguments): - """mod: Remainder - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'mod ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def negate(self, _object, _attributes={}, **_arguments): - """negate: Numeric negation - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'neg ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def not_(self, _object, _attributes={}, **_arguments): - """not: Logical negation - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'NOT ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def or_(self, _object, _attributes={}, **_arguments): - """or: Logical disjunction - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'OR ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def start_log(self, _no_object=None, _attributes={}, **_arguments): - """start log: Start event logging in the script editor - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ToyS' - _subcode = 'log1' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def starts_with(self, _object, _attributes={}, **_arguments): - """starts with: Starts with - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = 'bgwt' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def stop_log(self, _no_object=None, _attributes={}, **_arguments): - """stop log: Stop event logging in the script editor - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ToyS' - _subcode = 'log0' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def tell(self, _no_object=None, _attributes={}, **_arguments): - """tell: Record or log a \xd4tell\xd5 statement - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'ascr' - _subcode = 'tell' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _ad_(self, _object, _attributes={}, **_arguments): - """\xad: Inequality - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '\xad ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _b2_(self, _object, _attributes={}, **_arguments): - """\xb2: Less than or equal to - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '<= ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _b3_(self, _object, _attributes={}, **_arguments): - """\xb3: Greater than or equal to - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '>= ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _d6_(self, _object, _attributes={}, **_arguments): - """\xd6: Division - Required argument: an AE object reference - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: anything - """ - _code = 'ascr' - _subcode = '/ ' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class anything(aetools.ComponentItem): - """anything - any class or reference """ - want = '****' - -class pictures(aetools.ComponentItem): - """pictures - """ - want = 'PICT' - -picture = pictures - -class styled_text(aetools.ComponentItem): - """styled text - text with font, size, and style information """ - want = 'STXT' - -styled_text = styled_text - -class strings(aetools.ComponentItem): - """strings - """ - want = 'TEXT' - -string = strings - -class alias(aetools.ComponentItem): - """alias - a file on a disk or server. The file must exist when you check the syntax of your script. """ - want = 'alis' -class _Prop_POSIX_path(aetools.NProperty): - """POSIX path - the POSIX path of the file """ - which = 'psxp' - want = 'TEXT' - -aliases = alias - -class April(aetools.ComponentItem): - """April - the month of April """ - want = 'apr ' - -class August(aetools.ComponentItem): - """August - the month of August """ - want = 'aug ' - -class booleans(aetools.ComponentItem): - """booleans - """ - want = 'bool' - -boolean = booleans - -class RGB_colors(aetools.ComponentItem): - """RGB colors - """ - want = 'cRGB' - -RGB_color = RGB_colors - -class application(aetools.ComponentItem): - """application - specifies global properties of AppleScript """ - want = 'capp' -class _Prop_AppleScript(aetools.NProperty): - """AppleScript - the top-level script object """ - which = 'ascr' - want = 'scpt' -AppleScript = _Prop_AppleScript() -class _Prop_days(aetools.NProperty): - """days - the number of seconds in a day """ - which = 'days' - want = 'long' -days = _Prop_days() -class _Prop_hours(aetools.NProperty): - """hours - the number of seconds in an hour """ - which = 'hour' - want = 'long' -hours = _Prop_hours() -class _Prop_minutes(aetools.NProperty): - """minutes - the number of seconds in a minute """ - which = 'min ' - want = 'long' -minutes = _Prop_minutes() -class _Prop_pi(aetools.NProperty): - """pi - the constant pi """ - which = 'pi ' - want = 'doub' -pi = _Prop_pi() -class _Prop_print_depth(aetools.NProperty): - """print depth - the maximum depth to print """ - which = 'prdp' - want = 'long' -print_depth = _Prop_print_depth() -class _Prop_print_length(aetools.NProperty): - """print length - the maximum length to print """ - which = 'prln' - want = 'long' -print_length = _Prop_print_length() -class _Prop_result(aetools.NProperty): - """result - the last result of evaluation """ - which = 'rslt' - want = '****' -result = _Prop_result() -class _Prop_return_(aetools.NProperty): - """return - a return character """ - which = 'ret ' - want = 'cha ' -return_ = _Prop_return_() -class _Prop_space(aetools.NProperty): - """space - a space character """ - which = 'spac' - want = 'cha ' -space = _Prop_space() -class _Prop_tab(aetools.NProperty): - """tab - a tab character """ - which = 'tab ' - want = 'cha ' -tab = _Prop_tab() -class _Prop_text_item_delimiters(aetools.NProperty): - """text item delimiters - the text item delimiters of a string """ - which = 'txdl' - want = 'list' -text_item_delimiters = _Prop_text_item_delimiters() -class _Prop_weeks(aetools.NProperty): - """weeks - the number of seconds in a week """ - which = 'week' - want = 'long' -weeks = _Prop_weeks() - -applications = application - -app = application - -class upper_case(aetools.ComponentItem): - """upper case - Text with lower case converted to upper case """ - want = 'case' - -class cubic_centimeters(aetools.ComponentItem): - """cubic centimeters - a volume measurement in SI cubic centimeters """ - want = 'ccmt' - -cubic_centimetres = cubic_centimeters - -class cubic_feet(aetools.ComponentItem): - """cubic feet - a volume measurement in Imperial cubic feet """ - want = 'cfet' - -class characters(aetools.ComponentItem): - """characters - """ - want = 'cha ' - -character = characters - -class writing_code_info(aetools.ComponentItem): - """writing code info - script code and language code of text run """ - want = 'citl' -class _Prop_language_code(aetools.NProperty): - """language code - the language code for the text """ - which = 'plcd' - want = 'shor' -class _Prop_script_code(aetools.NProperty): - """script code - the script code for the text """ - which = 'pscd' - want = 'shor' - -writing_code_infos = writing_code_info - -class text_items(aetools.ComponentItem): - """text items - """ - want = 'citm' - -text_item = text_items - -class cubic_meters(aetools.ComponentItem): - """cubic meters - a volume measurement in SI cubic meters """ - want = 'cmet' - -cubic_metres = cubic_meters - -class centimeters(aetools.ComponentItem): - """centimeters - a distance measurement in SI centimeters """ - want = 'cmtr' - -centimetres = centimeters - -class item(aetools.ComponentItem): - """item - An item of any type """ - want = 'cobj' -class _Prop_id(aetools.NProperty): - """id - the unique ID number of this object """ - which = 'ID ' - want = 'long' - -items = item - -class C_strings(aetools.ComponentItem): - """C strings - """ - want = 'cstr' - -C_string = C_strings - -class text(aetools.ComponentItem): - """text - text with language and style information """ - want = 'ctxt' - -class cubic_inches(aetools.ComponentItem): - """cubic inches - a volume measurement in Imperial cubic inches """ - want = 'cuin' - -class cubic_yards(aetools.ComponentItem): - """cubic yards - a distance measurement in Imperial cubic yards """ - want = 'cyrd' - -class December(aetools.ComponentItem): - """December - the month of December """ - want = 'dec ' - -class degrees_Celsius(aetools.ComponentItem): - """degrees Celsius - a temperature measurement in SI degrees Celsius """ - want = 'degc' - -class degrees_Fahrenheit(aetools.ComponentItem): - """degrees Fahrenheit - a temperature measurement in degrees Fahrenheit """ - want = 'degf' - -class degrees_Kelvin(aetools.ComponentItem): - """degrees Kelvin - a temperature measurement in degrees Kelvin """ - want = 'degk' - -class reals(aetools.ComponentItem): - """reals - """ - want = 'doub' - -real = reals - -class encoded_strings(aetools.ComponentItem): - """encoded strings - """ - want = 'encs' - -encoded_string = encoded_strings - -class constants(aetools.ComponentItem): - """constants - """ - want = 'enum' - -constant = constants - -class events(aetools.ComponentItem): - """events - """ - want = 'evnt' - -event = events - -class February(aetools.ComponentItem): - """February - the month of February """ - want = 'feb ' - -class feet(aetools.ComponentItem): - """feet - a distance measurement in Imperial feet """ - want = 'feet' - -class Friday(aetools.ComponentItem): - """Friday - Friday """ - want = 'fri ' - -class file_specification(aetools.ComponentItem): - """file specification - a file specification as used by the operating system """ - want = 'fss ' - -file_specifications = file_specification - -class gallons(aetools.ComponentItem): - """gallons - a volume measurement in Imperial gallons """ - want = 'galn' - -class grams(aetools.ComponentItem): - """grams - a mass measurement in SI meters """ - want = 'gram' - -class handlers(aetools.ComponentItem): - """handlers - """ - want = 'hand' - -handler = handlers - -class inches(aetools.ComponentItem): - """inches - a distance measurement in Imperial inches """ - want = 'inch' - -class international_text(aetools.ComponentItem): - """international text - text that begins with a writing code """ - want = 'itxt' - -international_text = international_text - -class January(aetools.ComponentItem): - """January - the month of January """ - want = 'jan ' - -class July(aetools.ComponentItem): - """July - the month of July """ - want = 'jul ' - -class June(aetools.ComponentItem): - """June - the month of June """ - want = 'jun ' - -class reference_forms(aetools.ComponentItem): - """reference forms - """ - want = 'kfrm' - -reference_form = reference_forms - -class kilograms(aetools.ComponentItem): - """kilograms - a mass measurement in SI kilograms """ - want = 'kgrm' - -class kilometers(aetools.ComponentItem): - """kilometers - a distance measurement in SI kilometers """ - want = 'kmtr' - -kilometres = kilometers - -class keystroke(aetools.ComponentItem): - """keystroke - a press of a key combination on a Macintosh keyboard """ - want = 'kprs' -class _Prop_key(aetools.NProperty): - """key - the character for the key was pressed (ignoring modifiers) """ - which = 'kMsg' - want = 'cha ' -class _Prop_key_kind(aetools.NProperty): - """key kind - the kind of key that was pressed """ - which = 'kknd' - want = 'ekst' -class _Prop_modifiers(aetools.NProperty): - """modifiers - the modifier keys pressed in combination """ - which = 'kMod' - want = 'eMds' - -keystrokes = keystroke - -class pounds(aetools.ComponentItem): - """pounds - a weight measurement in SI meters """ - want = 'lbs ' - -class date(aetools.ComponentItem): - """date - Absolute date and time values """ - want = 'ldt ' -class _Prop_date_string(aetools.NProperty): - """date string - the date portion of a date-time value as text """ - which = 'dstr' - want = 'TEXT' -class _Prop_day(aetools.NProperty): - """day - the day of the month of a date """ - which = 'day ' - want = 'long' -class _Prop_month(aetools.NProperty): - """month - the month of a date """ - which = 'mnth' - want = 'mnth' -class _Prop_time(aetools.NProperty): - """time - the time since midnight of a date """ - which = 'time' - want = 'long' -class _Prop_time_string(aetools.NProperty): - """time string - the time portion of a date-time value as text """ - which = 'tstr' - want = 'TEXT' -class _Prop_weekday(aetools.NProperty): - """weekday - the day of a week of a date """ - which = 'wkdy' - want = 'wkdy' -class _Prop_year(aetools.NProperty): - """year - the year of a date """ - which = 'year' - want = 'long' - -dates = date - -class list(aetools.ComponentItem): - """list - An ordered collection of items """ - want = 'list' -class _Prop_length(aetools.NProperty): - """length - the length of a list """ - which = 'leng' - want = 'long' -class _Prop_rest(aetools.NProperty): - """rest - all items of the list excluding first """ - which = 'rest' - want = 'list' -class _Prop_reverse(aetools.NProperty): - """reverse - the items of the list in reverse order """ - which = 'rvse' - want = 'list' - -lists = list - -class liters(aetools.ComponentItem): - """liters - a volume measurement in SI liters """ - want = 'litr' - -litres = liters - -class linked_list(aetools.ComponentItem): - """linked list - An ordered collection of items """ - want = 'llst' - -linked_lists = linked_list - -class integers(aetools.ComponentItem): - """integers - """ - want = 'long' - -integer = integers - -class list_or_record(aetools.ComponentItem): - """list or record - a list or record """ - want = 'lr ' - -class list_2c__record_or_text(aetools.ComponentItem): - """list, record or text - a list, record or text """ - want = 'lrs ' - -class list_or_string(aetools.ComponentItem): - """list or string - a list or string """ - want = 'ls ' - -class machines(aetools.ComponentItem): - """machines - """ - want = 'mach' - -machine = machines - -class March(aetools.ComponentItem): - """March - the month of March """ - want = 'mar ' - -class May(aetools.ComponentItem): - """May - the month of May """ - want = 'may ' - -class meters(aetools.ComponentItem): - """meters - a distance measurement in SI meters """ - want = 'metr' - -metres = meters - -class miles(aetools.ComponentItem): - """miles - a distance measurement in Imperial miles """ - want = 'mile' - -class months(aetools.ComponentItem): - """months - """ - want = 'mnth' - -month = months - -class Monday(aetools.ComponentItem): - """Monday - Monday """ - want = 'mon ' - -class missing_values(aetools.ComponentItem): - """missing values - """ - want = 'msng' - -missing_value = missing_values - -class number_or_date(aetools.ComponentItem): - """number or date - a number or date """ - want = 'nd ' - -class number_2c__date_or_text(aetools.ComponentItem): - """number, date or text - a number, date or text """ - want = 'nds ' - -class numbers(aetools.ComponentItem): - """numbers - """ - want = 'nmbr' - -number = numbers - -class November(aetools.ComponentItem): - """November - the month of November """ - want = 'nov ' - -class number_or_string(aetools.ComponentItem): - """number or string - a number or string """ - want = 'ns ' - -class references(aetools.ComponentItem): - """references - """ - want = 'obj ' - -reference = references - -class October(aetools.ComponentItem): - """October - the month of October """ - want = 'oct ' - -class ounces(aetools.ComponentItem): - """ounces - a weight measurement in SI meters """ - want = 'ozs ' - -class class_(aetools.ComponentItem): - """class - the type of a value """ - want = 'pcls' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from this class """ - which = 'c@#^' - want = 'type' - -classes = class_ - -class prepositions(aetools.ComponentItem): - """prepositions - """ - want = 'prep' - -preposition = prepositions - -class properties(aetools.ComponentItem): - """properties - """ - want = 'prop' - -property = properties - -class writing_code(aetools.ComponentItem): - """writing code - codes that identify the language and script system """ - want = 'psct' - -class Pascal_strings(aetools.ComponentItem): - """Pascal strings - """ - want = 'pstr' - -Pascal_string = Pascal_strings - -class quarts(aetools.ComponentItem): - """quarts - a volume measurement in Imperial quarts """ - want = 'qrts' - -class data(aetools.ComponentItem): - """data - an AppleScript raw data object """ - want = 'rdat' - -class records(aetools.ComponentItem): - """records - """ - want = 'reco' - -record = records - -class Saturday(aetools.ComponentItem): - """Saturday - Saturday """ - want = 'sat ' - -class seconds(aetools.ComponentItem): - """seconds - more than one second """ - want = 'scnd' - -class script(aetools.ComponentItem): - """script - An AppleScript script """ - want = 'scpt' -class _Prop_name(aetools.NProperty): - """name - the name of the script """ - which = 'pnam' - want = 'TEXT' -class _Prop_parent(aetools.NProperty): - """parent - its parent, i.e. the script that will handle events that this script doesn\xd5t """ - which = 'pare' - want = 'scpt' - -scripts = script - -class September(aetools.ComponentItem): - """September - the month of September """ - want = 'sep ' - -class alias_or_string(aetools.ComponentItem): - """alias or string - an alias or string """ - want = 'sf ' - -class sounds(aetools.ComponentItem): - """sounds - """ - want = 'snd ' - -sound = sounds - -class square_feet(aetools.ComponentItem): - """square feet - an area measurement in Imperial square feet """ - want = 'sqft' - -class square_kilometers(aetools.ComponentItem): - """square kilometers - an area measurement in SI square kilometers """ - want = 'sqkm' - -square_kilometres = square_kilometers - -class square_miles(aetools.ComponentItem): - """square miles - an area measurement in Imperial square miles """ - want = 'sqmi' - -class square_meters(aetools.ComponentItem): - """square meters - an area measurement in SI square meters """ - want = 'sqrm' - -square_metres = square_meters - -class square_yards(aetools.ComponentItem): - """square yards - an area measurement in Imperial square yards """ - want = 'sqyd' - -class styled_Clipboard_text(aetools.ComponentItem): - """styled Clipboard text - clipboard text with font, size, and style information """ - want = 'styl' - -styled_Clipboard_text = styled_Clipboard_text - -class Sunday(aetools.ComponentItem): - """Sunday - Sunday """ - want = 'sun ' - -class styled_Unicode_text(aetools.ComponentItem): - """styled Unicode text - styled text in the Unicode format """ - want = 'sutx' - -styled_Unicode_text = styled_Unicode_text - -class Thursday(aetools.ComponentItem): - """Thursday - Thursday """ - want = 'thu ' - -class Tuesday(aetools.ComponentItem): - """Tuesday - Tuesday """ - want = 'tue ' - -class type_class(aetools.ComponentItem): - """type class - the name of a particular class (or any four-character code) """ - want = 'type' - -class empty_ae_name_(aetools.ComponentItem): - """ - the undefined value """ - want = 'undf' - -class Unicode_text(aetools.ComponentItem): - """Unicode text - text in the Unicode format (cannot be viewed without conversion) """ - want = 'utxt' - -Unicode_text = Unicode_text - -class vector(aetools.ComponentItem): - """vector - An ordered collection of items """ - want = 'vect' - -vectors = vector - -class version(aetools.ComponentItem): - """version - a version value """ - want = 'vers' - -class Wednesday(aetools.ComponentItem): - """Wednesday - Wednesday """ - want = 'wed ' - -class weekdays(aetools.ComponentItem): - """weekdays - """ - want = 'wkdy' - -weekday = weekdays - -class yards(aetools.ComponentItem): - """yards - a distance measurement in Imperial yards """ - want = 'yard' - -class zones(aetools.ComponentItem): - """zones - """ - want = 'zone' - -zone = zones -anything._superclassnames = [] -anything._privpropdict = { -} -anything._privelemdict = { -} -pictures._superclassnames = [] -pictures._privpropdict = { -} -pictures._privelemdict = { -} -styled_text._superclassnames = [] -styled_text._privpropdict = { -} -styled_text._privelemdict = { -} -styled_text._superclassnames = [] -styled_text._privpropdict = { -} -styled_text._privelemdict = { -} -strings._superclassnames = [] -strings._privpropdict = { -} -strings._privelemdict = { -} -alias._superclassnames = [] -alias._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, -} -alias._privelemdict = { -} -April._superclassnames = [] -April._privpropdict = { -} -April._privelemdict = { -} -August._superclassnames = [] -August._privpropdict = { -} -August._privelemdict = { -} -booleans._superclassnames = [] -booleans._privpropdict = { -} -booleans._privelemdict = { -} -RGB_colors._superclassnames = [] -RGB_colors._privpropdict = { -} -RGB_colors._privelemdict = { -} -application._superclassnames = [] -application._privpropdict = { - 'AppleScript' : _Prop_AppleScript, - 'days' : _Prop_days, - 'hours' : _Prop_hours, - 'minutes' : _Prop_minutes, - 'pi' : _Prop_pi, - 'print_depth' : _Prop_print_depth, - 'print_length' : _Prop_print_length, - 'result' : _Prop_result, - 'return_' : _Prop_return_, - 'space' : _Prop_space, - 'tab' : _Prop_tab, - 'text_item_delimiters' : _Prop_text_item_delimiters, - 'weeks' : _Prop_weeks, -} -application._privelemdict = { -} -upper_case._superclassnames = [] -upper_case._privpropdict = { -} -upper_case._privelemdict = { -} -cubic_centimeters._superclassnames = [] -cubic_centimeters._privpropdict = { -} -cubic_centimeters._privelemdict = { -} -cubic_feet._superclassnames = [] -cubic_feet._privpropdict = { -} -cubic_feet._privelemdict = { -} -characters._superclassnames = [] -characters._privpropdict = { -} -characters._privelemdict = { -} -writing_code_info._superclassnames = [] -writing_code_info._privpropdict = { - 'language_code' : _Prop_language_code, - 'script_code' : _Prop_script_code, -} -writing_code_info._privelemdict = { -} -text_items._superclassnames = [] -text_items._privpropdict = { -} -text_items._privelemdict = { -} -cubic_meters._superclassnames = [] -cubic_meters._privpropdict = { -} -cubic_meters._privelemdict = { -} -centimeters._superclassnames = [] -centimeters._privpropdict = { -} -centimeters._privelemdict = { -} -item._superclassnames = [] -item._privpropdict = { - 'id' : _Prop_id, -} -item._privelemdict = { -} -C_strings._superclassnames = [] -C_strings._privpropdict = { -} -C_strings._privelemdict = { -} -text._superclassnames = [] -text._privpropdict = { -} -text._privelemdict = { -} -cubic_inches._superclassnames = [] -cubic_inches._privpropdict = { -} -cubic_inches._privelemdict = { -} -cubic_yards._superclassnames = [] -cubic_yards._privpropdict = { -} -cubic_yards._privelemdict = { -} -December._superclassnames = [] -December._privpropdict = { -} -December._privelemdict = { -} -degrees_Celsius._superclassnames = [] -degrees_Celsius._privpropdict = { -} -degrees_Celsius._privelemdict = { -} -degrees_Fahrenheit._superclassnames = [] -degrees_Fahrenheit._privpropdict = { -} -degrees_Fahrenheit._privelemdict = { -} -degrees_Kelvin._superclassnames = [] -degrees_Kelvin._privpropdict = { -} -degrees_Kelvin._privelemdict = { -} -reals._superclassnames = [] -reals._privpropdict = { -} -reals._privelemdict = { -} -encoded_strings._superclassnames = [] -encoded_strings._privpropdict = { -} -encoded_strings._privelemdict = { -} -constants._superclassnames = [] -constants._privpropdict = { -} -constants._privelemdict = { -} -events._superclassnames = [] -events._privpropdict = { -} -events._privelemdict = { -} -February._superclassnames = [] -February._privpropdict = { -} -February._privelemdict = { -} -feet._superclassnames = [] -feet._privpropdict = { -} -feet._privelemdict = { -} -Friday._superclassnames = [] -Friday._privpropdict = { -} -Friday._privelemdict = { -} -file_specification._superclassnames = [] -file_specification._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, -} -file_specification._privelemdict = { -} -gallons._superclassnames = [] -gallons._privpropdict = { -} -gallons._privelemdict = { -} -grams._superclassnames = [] -grams._privpropdict = { -} -grams._privelemdict = { -} -handlers._superclassnames = [] -handlers._privpropdict = { -} -handlers._privelemdict = { -} -inches._superclassnames = [] -inches._privpropdict = { -} -inches._privelemdict = { -} -international_text._superclassnames = [] -international_text._privpropdict = { -} -international_text._privelemdict = { -} -international_text._superclassnames = [] -international_text._privpropdict = { -} -international_text._privelemdict = { -} -January._superclassnames = [] -January._privpropdict = { -} -January._privelemdict = { -} -July._superclassnames = [] -July._privpropdict = { -} -July._privelemdict = { -} -June._superclassnames = [] -June._privpropdict = { -} -June._privelemdict = { -} -reference_forms._superclassnames = [] -reference_forms._privpropdict = { -} -reference_forms._privelemdict = { -} -kilograms._superclassnames = [] -kilograms._privpropdict = { -} -kilograms._privelemdict = { -} -kilometers._superclassnames = [] -kilometers._privpropdict = { -} -kilometers._privelemdict = { -} -keystroke._superclassnames = [] -keystroke._privpropdict = { - 'key' : _Prop_key, - 'key_kind' : _Prop_key_kind, - 'modifiers' : _Prop_modifiers, -} -keystroke._privelemdict = { -} -pounds._superclassnames = [] -pounds._privpropdict = { -} -pounds._privelemdict = { -} -date._superclassnames = [] -date._privpropdict = { - 'date_string' : _Prop_date_string, - 'day' : _Prop_day, - 'month' : _Prop_month, - 'time' : _Prop_time, - 'time_string' : _Prop_time_string, - 'weekday' : _Prop_weekday, - 'year' : _Prop_year, -} -date._privelemdict = { -} -list._superclassnames = [] -list._privpropdict = { - 'length' : _Prop_length, - 'rest' : _Prop_rest, - 'reverse' : _Prop_reverse, -} -list._privelemdict = { -} -liters._superclassnames = [] -liters._privpropdict = { -} -liters._privelemdict = { -} -linked_list._superclassnames = [] -linked_list._privpropdict = { - 'length' : _Prop_length, -} -linked_list._privelemdict = { -} -integers._superclassnames = [] -integers._privpropdict = { -} -integers._privelemdict = { -} -list_or_record._superclassnames = [] -list_or_record._privpropdict = { -} -list_or_record._privelemdict = { -} -list_2c__record_or_text._superclassnames = [] -list_2c__record_or_text._privpropdict = { -} -list_2c__record_or_text._privelemdict = { -} -list_or_string._superclassnames = [] -list_or_string._privpropdict = { -} -list_or_string._privelemdict = { -} -machines._superclassnames = [] -machines._privpropdict = { -} -machines._privelemdict = { -} -March._superclassnames = [] -March._privpropdict = { -} -March._privelemdict = { -} -May._superclassnames = [] -May._privpropdict = { -} -May._privelemdict = { -} -meters._superclassnames = [] -meters._privpropdict = { -} -meters._privelemdict = { -} -miles._superclassnames = [] -miles._privpropdict = { -} -miles._privelemdict = { -} -months._superclassnames = [] -months._privpropdict = { -} -months._privelemdict = { -} -Monday._superclassnames = [] -Monday._privpropdict = { -} -Monday._privelemdict = { -} -missing_values._superclassnames = [] -missing_values._privpropdict = { -} -missing_values._privelemdict = { -} -number_or_date._superclassnames = [] -number_or_date._privpropdict = { -} -number_or_date._privelemdict = { -} -number_2c__date_or_text._superclassnames = [] -number_2c__date_or_text._privpropdict = { -} -number_2c__date_or_text._privelemdict = { -} -numbers._superclassnames = [] -numbers._privpropdict = { -} -numbers._privelemdict = { -} -November._superclassnames = [] -November._privpropdict = { -} -November._privelemdict = { -} -number_or_string._superclassnames = [] -number_or_string._privpropdict = { -} -number_or_string._privelemdict = { -} -references._superclassnames = [] -references._privpropdict = { -} -references._privelemdict = { -} -October._superclassnames = [] -October._privpropdict = { -} -October._privelemdict = { -} -ounces._superclassnames = [] -ounces._privpropdict = { -} -ounces._privelemdict = { -} -class_._superclassnames = ['type_class'] -class_._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -class_._privelemdict = { -} -prepositions._superclassnames = [] -prepositions._privpropdict = { -} -prepositions._privelemdict = { -} -properties._superclassnames = [] -properties._privpropdict = { -} -properties._privelemdict = { -} -writing_code._superclassnames = [] -writing_code._privpropdict = { -} -writing_code._privelemdict = { -} -Pascal_strings._superclassnames = [] -Pascal_strings._privpropdict = { -} -Pascal_strings._privelemdict = { -} -quarts._superclassnames = [] -quarts._privpropdict = { -} -quarts._privelemdict = { -} -data._superclassnames = [] -data._privpropdict = { -} -data._privelemdict = { -} -records._superclassnames = [] -records._privpropdict = { -} -records._privelemdict = { -} -Saturday._superclassnames = [] -Saturday._privpropdict = { -} -Saturday._privelemdict = { -} -seconds._superclassnames = [] -seconds._privpropdict = { -} -seconds._privelemdict = { -} -script._superclassnames = [] -script._privpropdict = { - 'name' : _Prop_name, - 'parent' : _Prop_parent, -} -script._privelemdict = { -} -September._superclassnames = [] -September._privpropdict = { -} -September._privelemdict = { -} -alias_or_string._superclassnames = [] -alias_or_string._privpropdict = { -} -alias_or_string._privelemdict = { -} -sounds._superclassnames = [] -sounds._privpropdict = { -} -sounds._privelemdict = { -} -square_feet._superclassnames = [] -square_feet._privpropdict = { -} -square_feet._privelemdict = { -} -square_kilometers._superclassnames = [] -square_kilometers._privpropdict = { -} -square_kilometers._privelemdict = { -} -square_miles._superclassnames = [] -square_miles._privpropdict = { -} -square_miles._privelemdict = { -} -square_meters._superclassnames = [] -square_meters._privpropdict = { -} -square_meters._privelemdict = { -} -square_yards._superclassnames = [] -square_yards._privpropdict = { -} -square_yards._privelemdict = { -} -styled_Clipboard_text._superclassnames = [] -styled_Clipboard_text._privpropdict = { -} -styled_Clipboard_text._privelemdict = { -} -styled_Clipboard_text._superclassnames = [] -styled_Clipboard_text._privpropdict = { -} -styled_Clipboard_text._privelemdict = { -} -Sunday._superclassnames = [] -Sunday._privpropdict = { -} -Sunday._privelemdict = { -} -styled_Unicode_text._superclassnames = [] -styled_Unicode_text._privpropdict = { -} -styled_Unicode_text._privelemdict = { -} -styled_Unicode_text._superclassnames = [] -styled_Unicode_text._privpropdict = { -} -styled_Unicode_text._privelemdict = { -} -Thursday._superclassnames = [] -Thursday._privpropdict = { -} -Thursday._privelemdict = { -} -Tuesday._superclassnames = [] -Tuesday._privpropdict = { -} -Tuesday._privelemdict = { -} -type_class._superclassnames = [] -type_class._privpropdict = { -} -type_class._privelemdict = { -} -empty_ae_name_._superclassnames = [] -empty_ae_name_._privpropdict = { -} -empty_ae_name_._privelemdict = { -} -Unicode_text._superclassnames = [] -Unicode_text._privpropdict = { -} -Unicode_text._privelemdict = { -} -Unicode_text._superclassnames = [] -Unicode_text._privpropdict = { -} -Unicode_text._privelemdict = { -} -vector._superclassnames = [] -vector._privpropdict = { - 'length' : _Prop_length, -} -vector._privelemdict = { -} -version._superclassnames = [] -version._privpropdict = { -} -version._privelemdict = { -} -Wednesday._superclassnames = [] -Wednesday._privpropdict = { -} -Wednesday._privelemdict = { -} -weekdays._superclassnames = [] -weekdays._privpropdict = { -} -weekdays._privelemdict = { -} -yards._superclassnames = [] -yards._privpropdict = { -} -yards._privelemdict = { -} -zones._superclassnames = [] -zones._privpropdict = { -} -zones._privelemdict = { -} -_Enum_boov = { - 'true' : 'true', # the true boolean value - 'false' : 'fals', # the false boolean value -} - -_Enum_cons = { - 'case' : 'case', # case - 'diacriticals' : 'diac', # diacriticals - 'white_space' : 'whit', # white space - 'hyphens' : 'hyph', # hyphens - 'expansion' : 'expa', # expansion - 'punctuation' : 'punc', # punctuation - 'application_responses' : 'rmte', # remote event replies -} - -_Enum_eMds = { - 'option_down' : 'Kopt', # - 'command_down' : 'Kcmd', # - 'control_down' : 'Kctl', # - 'shift_down' : 'Ksft', # - 'caps_lock_down' : 'Kclk', # -} - -_Enum_ekst = { - 'escape_key' : 'ks5\x00', # - 'delete_key' : 'ks3\x00', # - 'tab_key' : 'ks0\x00', # - 'return_key' : 'ks$\x00', # - 'clear_key' : 'ksG\x00', # - 'enter_key' : 'ksL\x00', # - 'up_arrow_key' : 'ks~\x00', # - 'down_arrow_key' : 'ks}\x00', # - 'left_arrow_key' : 'ks{\x00', # - 'right_arrow_key' : 'ks|\x00', # - 'help_key' : 'ksr\x00', # - 'home_key' : 'kss\x00', # - 'page_up_key' : 'kst\x00', # - 'page_down_key' : 'ksy\x00', # - 'forward_del_key' : 'ksu\x00', # - 'end_key' : 'ksw\x00', # - 'F1_key' : 'ksz\x00', # - 'F2_key' : 'ksx\x00', # - 'F3_key' : 'ksc\x00', # - 'F4_key' : 'ksv\x00', # - 'F5_key' : 'ks`\x00', # - 'F6_key' : 'ksa\x00', # - 'F7_key' : 'ksb\x00', # - 'F8_key' : 'ksd\x00', # - 'F9_key' : 'kse\x00', # - 'F10_key' : 'ksm\x00', # - 'F11_key' : 'ksg\x00', # - 'F12_key' : 'kso\x00', # - 'F13_key' : 'ksi\x00', # - 'F14_key' : 'ksk\x00', # - 'F15_key' : 'ksq\x00', # -} - -_Enum_misc = { - 'current_application' : 'cura', # the current application -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - '****' : anything, - 'PICT' : pictures, - 'STXT' : styled_text, - 'TEXT' : strings, - 'alis' : alias, - 'apr ' : April, - 'aug ' : August, - 'bool' : booleans, - 'cRGB' : RGB_colors, - 'capp' : application, - 'case' : upper_case, - 'ccmt' : cubic_centimeters, - 'cfet' : cubic_feet, - 'cha ' : characters, - 'citl' : writing_code_info, - 'citm' : text_items, - 'cmet' : cubic_meters, - 'cmtr' : centimeters, - 'cobj' : item, - 'cstr' : C_strings, - 'ctxt' : text, - 'cuin' : cubic_inches, - 'cyrd' : cubic_yards, - 'dec ' : December, - 'degc' : degrees_Celsius, - 'degf' : degrees_Fahrenheit, - 'degk' : degrees_Kelvin, - 'doub' : reals, - 'encs' : encoded_strings, - 'enum' : constants, - 'evnt' : events, - 'feb ' : February, - 'feet' : feet, - 'fri ' : Friday, - 'fss ' : file_specification, - 'galn' : gallons, - 'gram' : grams, - 'hand' : handlers, - 'inch' : inches, - 'itxt' : international_text, - 'jan ' : January, - 'jul ' : July, - 'jun ' : June, - 'kfrm' : reference_forms, - 'kgrm' : kilograms, - 'kmtr' : kilometers, - 'kprs' : keystroke, - 'lbs ' : pounds, - 'ldt ' : date, - 'list' : list, - 'litr' : liters, - 'llst' : linked_list, - 'long' : integers, - 'lr ' : list_or_record, - 'lrs ' : list_2c__record_or_text, - 'ls ' : list_or_string, - 'mach' : machines, - 'mar ' : March, - 'may ' : May, - 'metr' : meters, - 'mile' : miles, - 'mnth' : months, - 'mon ' : Monday, - 'msng' : missing_values, - 'nd ' : number_or_date, - 'nds ' : number_2c__date_or_text, - 'nmbr' : numbers, - 'nov ' : November, - 'ns ' : number_or_string, - 'obj ' : references, - 'oct ' : October, - 'ozs ' : ounces, - 'pcls' : class_, - 'prep' : prepositions, - 'prop' : properties, - 'psct' : writing_code, - 'pstr' : Pascal_strings, - 'qrts' : quarts, - 'rdat' : data, - 'reco' : records, - 'sat ' : Saturday, - 'scnd' : seconds, - 'scpt' : script, - 'sep ' : September, - 'sf ' : alias_or_string, - 'snd ' : sounds, - 'sqft' : square_feet, - 'sqkm' : square_kilometers, - 'sqmi' : square_miles, - 'sqrm' : square_meters, - 'sqyd' : square_yards, - 'styl' : styled_Clipboard_text, - 'sun ' : Sunday, - 'sutx' : styled_Unicode_text, - 'thu ' : Thursday, - 'tue ' : Tuesday, - 'type' : type_class, - 'undf' : empty_ae_name_, - 'utxt' : Unicode_text, - 'vect' : vector, - 'vers' : version, - 'wed ' : Wednesday, - 'wkdy' : weekdays, - 'yard' : yards, - 'zone' : zones, -} - -_propdeclarations = { - 'ID ' : _Prop_id, - 'ascr' : _Prop_AppleScript, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'day ' : _Prop_day, - 'days' : _Prop_days, - 'dstr' : _Prop_date_string, - 'hour' : _Prop_hours, - 'kMod' : _Prop_modifiers, - 'kMsg' : _Prop_key, - 'kknd' : _Prop_key_kind, - 'leng' : _Prop_length, - 'min ' : _Prop_minutes, - 'mnth' : _Prop_month, - 'pare' : _Prop_parent, - 'pi ' : _Prop_pi, - 'plcd' : _Prop_language_code, - 'pnam' : _Prop_name, - 'prdp' : _Prop_print_depth, - 'prln' : _Prop_print_length, - 'pscd' : _Prop_script_code, - 'psxp' : _Prop_POSIX_path, - 'rest' : _Prop_rest, - 'ret ' : _Prop_return_, - 'rslt' : _Prop_result, - 'rvse' : _Prop_reverse, - 'spac' : _Prop_space, - 'tab ' : _Prop_tab, - 'time' : _Prop_time, - 'tstr' : _Prop_time_string, - 'txdl' : _Prop_text_item_delimiters, - 'week' : _Prop_weeks, - 'wkdy' : _Prop_weekday, - 'year' : _Prop_year, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'boov' : _Enum_boov, - 'cons' : _Enum_cons, - 'eMds' : _Enum_eMds, - 'ekst' : _Enum_ekst, - 'misc' : _Enum_misc, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py deleted file mode 100644 index 99fe5e348..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py +++ /dev/null @@ -1,373 +0,0 @@ -"""Suite Macintosh Connectivity Classes: Classes relating to Apple Macintosh personal computer connectivity -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'macc' - -class Macintosh_Connectivity_Clas_Events: - - pass - - -class ADB_address(aetools.ComponentItem): - """ADB address - Addresses a device connected via Apple Desktop Bus """ - want = 'cadb' -class _Prop__3c_inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from this class """ - which = 'c@#^' - want = 'cadr' -class _Prop_ID(aetools.NProperty): - """ID - the Apple Desktop Bus device ID """ - which = 'ID ' - want = 'shor' - -ADB_addresses = ADB_address - -class address_specification(aetools.ComponentItem): - """address specification - Unique designation of a device or service connected to this computer """ - want = 'cadr' -class _Prop_conduit(aetools.NProperty): - """conduit - How the addressee is physically connected """ - which = 'pcon' - want = 'econ' -class _Prop_properties(aetools.NProperty): - """properties - property that allows getting and setting of multiple properties """ - which = 'pALL' - want = 'reco' -class _Prop_protocol(aetools.NProperty): - """protocol - How to talk to this addressee """ - which = 'pprt' - want = 'epro' - -address_specifications = address_specification - -class AppleTalk_address(aetools.ComponentItem): - """AppleTalk address - Addresses a device or service connected via the AppleTalk protocol """ - want = 'cat ' -class _Prop_AppleTalk_machine(aetools.NProperty): - """AppleTalk machine - the machine name part of the address """ - which = 'patm' - want = 'TEXT' -class _Prop_AppleTalk_type(aetools.NProperty): - """AppleTalk type - the type part of the AppleTalk address """ - which = 'patt' - want = 'TEXT' -class _Prop_AppleTalk_zone(aetools.NProperty): - """AppleTalk zone - the zone part of the address """ - which = 'patz' - want = 'TEXT' - -AppleTalk_addresses = AppleTalk_address - -class bus_slot(aetools.ComponentItem): - """bus slot - Addresses a PC, PCI, or NuBus card """ - want = 'cbus' - -bus_slots = bus_slot - -class device_specification(aetools.ComponentItem): - """device specification - A device connected to a computer """ - want = 'cdev' -class _Prop_device_address(aetools.NProperty): - """device address - the address of the device """ - which = 'pdva' - want = 'cadr' -class _Prop_device_type(aetools.NProperty): - """device type - the kind of device """ - which = 'pdvt' - want = 'edvt' - -device_specifications = device_specification - -class Ethernet_address(aetools.ComponentItem): - """Ethernet address - Addresses a device by its Ethernet address """ - want = 'cen ' - -Ethernet_addresses = Ethernet_address - -class FireWire_address(aetools.ComponentItem): - """FireWire address - Addresses a device on the FireWire bus """ - want = 'cfw ' - -FireWire_addresses = FireWire_address - -class IP_address(aetools.ComponentItem): - """IP address - Addresses a device or service via the Internet Protocol (IP) """ - want = 'cip ' -class _Prop_DNS_form(aetools.NProperty): - """DNS form - the address in the form "apple.com" """ - which = 'pdns' - want = 'TEXT' -class _Prop_port(aetools.NProperty): - """port - the port number of the service or client being addressed """ - which = 'ppor' - want = 'TEXT' - -IP_addresses = IP_address - -class LocalTalk_address(aetools.ComponentItem): - """LocalTalk address - Addresses a device by its LocalTalk address """ - want = 'clt ' -class _Prop_network(aetools.NProperty): - """network - the LocalTalk network number """ - which = 'pnet' - want = 'shor' -class _Prop_node(aetools.NProperty): - """node - the LocalTalk node number """ - which = 'pnod' - want = 'shor' -class _Prop_socket(aetools.NProperty): - """socket - the LocalTalk socket number """ - which = 'psoc' - want = 'shor' - -LocalTalk_addresses = LocalTalk_address - -class SCSI_address(aetools.ComponentItem): - """SCSI address - Addresses a SCSI device """ - want = 'cscs' -class _Prop_LUN(aetools.NProperty): - """LUN - the SCSI logical unit number """ - which = 'pslu' - want = 'shor' -class _Prop_SCSI_bus(aetools.NProperty): - """SCSI bus - the SCSI bus number """ - which = 'pscb' - want = 'shor' - -SCSI_addresses = SCSI_address - -class Token_Ring_address(aetools.ComponentItem): - """Token Ring address - Addresses a device or service via the Token Ring protocol """ - want = 'ctok' - -Token_Ring_addresses = Token_Ring_address - -class USB_address(aetools.ComponentItem): - """USB address - Addresses a device on the Universal Serial Bus """ - want = 'cusb' -class _Prop_name(aetools.NProperty): - """name - the USB device name """ - which = 'pnam' - want = 'TEXT' - -USB_Addresses = USB_address -ADB_address._superclassnames = ['address_specification'] -ADB_address._privpropdict = { - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -ADB_address._privelemdict = { -} -address_specification._superclassnames = [] -address_specification._privpropdict = { - 'conduit' : _Prop_conduit, - 'properties' : _Prop_properties, - 'protocol' : _Prop_protocol, -} -address_specification._privelemdict = { -} -AppleTalk_address._superclassnames = ['address_specification'] -AppleTalk_address._privpropdict = { - 'AppleTalk_machine' : _Prop_AppleTalk_machine, - 'AppleTalk_type' : _Prop_AppleTalk_type, - 'AppleTalk_zone' : _Prop_AppleTalk_zone, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -AppleTalk_address._privelemdict = { -} -bus_slot._superclassnames = ['address_specification'] -bus_slot._privpropdict = { - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -bus_slot._privelemdict = { -} -device_specification._superclassnames = [] -device_specification._privpropdict = { - 'device_address' : _Prop_device_address, - 'device_type' : _Prop_device_type, - 'properties' : _Prop_properties, -} -device_specification._privelemdict = { -} -Ethernet_address._superclassnames = ['address_specification'] -Ethernet_address._privpropdict = { - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -Ethernet_address._privelemdict = { -} -FireWire_address._superclassnames = ['address_specification'] -FireWire_address._privpropdict = { - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -FireWire_address._privelemdict = { -} -IP_address._superclassnames = ['address_specification'] -IP_address._privpropdict = { - 'DNS_form' : _Prop_DNS_form, - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, - 'port' : _Prop_port, -} -IP_address._privelemdict = { -} -LocalTalk_address._superclassnames = ['address_specification'] -LocalTalk_address._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, - 'network' : _Prop_network, - 'node' : _Prop_node, - 'socket' : _Prop_socket, -} -LocalTalk_address._privelemdict = { -} -SCSI_address._superclassnames = ['address_specification'] -SCSI_address._privpropdict = { - 'ID' : _Prop_ID, - 'LUN' : _Prop_LUN, - 'SCSI_bus' : _Prop_SCSI_bus, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -SCSI_address._privelemdict = { -} -Token_Ring_address._superclassnames = ['address_specification'] -Token_Ring_address._privpropdict = { - 'ID' : _Prop_ID, - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -Token_Ring_address._privelemdict = { -} -USB_address._superclassnames = ['address_specification'] -USB_address._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, - 'name' : _Prop_name, -} -USB_address._privelemdict = { -} -_Enum_econ = { - 'ADB' : 'eadb', # - 'printer_port' : 'ecpp', # - 'modem_port' : 'ecmp', # - 'modem_printer_port' : 'empp', # - 'LocalTalk' : 'eclt', # - 'Ethernet' : 'ecen', # - 'Token_Ring' : 'etok', # - 'SCSI' : 'ecsc', # - 'USB' : 'ecus', # - 'FireWire' : 'ecfw', # - 'infrared' : 'ecir', # - 'PC_card' : 'ecpc', # - 'PCI_bus' : 'ecpi', # - 'NuBus' : 'enub', # - 'PDS_slot' : 'ecpd', # - 'Comm_slot' : 'eccm', # - 'monitor_out' : 'ecmn', # - 'video_out' : 'ecvo', # - 'video_in' : 'ecvi', # - 'audio_out' : 'ecao', # - 'audio_line_in' : 'ecai', # - 'audio_line_out' : 'ecal', # - 'microphone' : 'ecmi', # -} - -_Enum_edvt = { - 'hard_disk_drive' : 'ehd ', # - 'floppy_disk_drive' : 'efd ', # - 'CD_ROM_drive' : 'ecd ', # - 'DVD_drive' : 'edvd', # - 'storage_device' : 'edst', # - 'keyboard' : 'ekbd', # - 'mouse' : 'emou', # - 'trackball' : 'etrk', # - 'trackpad' : 'edtp', # - 'pointing_device' : 'edpd', # - 'video_monitor' : 'edvm', # - 'LCD_display' : 'edlc', # - 'display' : 'edds', # - 'modem' : 'edmm', # - 'PC_card' : 'ecpc', # - 'PCI_card' : 'edpi', # - 'NuBus_card' : 'ednb', # - 'printer' : 'edpr', # - 'speakers' : 'edsp', # - 'microphone' : 'ecmi', # -} - -_Enum_epro = { - 'serial' : 'epsr', # - 'AppleTalk' : 'epat', # - 'IP' : 'epip', # - 'SCSI' : 'ecsc', # - 'ADB' : 'eadb', # - 'FireWire' : 'ecfw', # - 'IrDA' : 'epir', # - 'IRTalk' : 'epit', # - 'USB' : 'ecus', # - 'PC_card' : 'ecpc', # - 'PCI_bus' : 'ecpi', # - 'NuBus' : 'enub', # - 'bus' : 'ebus', # - 'Macintosh_video' : 'epmv', # - 'SVGA' : 'epsg', # - 'S_video' : 'epsv', # - 'analog_audio' : 'epau', # - 'digital_audio' : 'epda', # - 'PostScript' : 'epps', # -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cadb' : ADB_address, - 'cadr' : address_specification, - 'cat ' : AppleTalk_address, - 'cbus' : bus_slot, - 'cdev' : device_specification, - 'cen ' : Ethernet_address, - 'cfw ' : FireWire_address, - 'cip ' : IP_address, - 'clt ' : LocalTalk_address, - 'cscs' : SCSI_address, - 'ctok' : Token_Ring_address, - 'cusb' : USB_address, -} - -_propdeclarations = { - 'ID ' : _Prop_ID, - 'c@#^' : _Prop__3c_inheritance_3e_, - 'pALL' : _Prop_properties, - 'patm' : _Prop_AppleTalk_machine, - 'patt' : _Prop_AppleTalk_type, - 'patz' : _Prop_AppleTalk_zone, - 'pcon' : _Prop_conduit, - 'pdns' : _Prop_DNS_form, - 'pdva' : _Prop_device_address, - 'pdvt' : _Prop_device_type, - 'pnam' : _Prop_name, - 'pnet' : _Prop_network, - 'pnod' : _Prop_node, - 'ppor' : _Prop_port, - 'pprt' : _Prop_protocol, - 'pscb' : _Prop_SCSI_bus, - 'pslu' : _Prop_LUN, - 'psoc' : _Prop_socket, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'econ' : _Enum_econ, - 'edvt' : _Enum_edvt, - 'epro' : _Enum_epro, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py deleted file mode 100644 index 11747f9c3..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py +++ /dev/null @@ -1,417 +0,0 @@ -"""Suite QuickDraw Graphics Suite: A set of basic classes for graphics -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'qdrw' - -class QuickDraw_Graphics_Suite_Events: - - pass - - -class arc(aetools.ComponentItem): - """arc - An arc """ - want = 'carc' -class _Prop_arc_angle(aetools.NProperty): - """arc angle - the angle of the arc in degrees """ - which = 'parc' - want = 'fixd' -class _Prop_bounds(aetools.NProperty): - """bounds - the smallest rectangle that contains the entire arc """ - which = 'pbnd' - want = 'qdrt' -class _Prop_definition_rect(aetools.NProperty): - """definition rect - the rectangle that contains the circle or oval used to define the arc """ - which = 'pdrt' - want = 'qdrt' -class _Prop_fill_color(aetools.NProperty): - """fill color - the fill color """ - which = 'flcl' - want = 'cRGB' -class _Prop_fill_pattern(aetools.NProperty): - """fill pattern - the fill pattern """ - which = 'flpt' - want = 'cpix' -class _Prop_pen_color(aetools.NProperty): - """pen color - the pen color """ - which = 'ppcl' - want = 'cRGB' -class _Prop_pen_pattern(aetools.NProperty): - """pen pattern - the pen pattern """ - which = 'pppa' - want = 'cpix' -class _Prop_pen_width(aetools.NProperty): - """pen width - the pen width """ - which = 'ppwd' - want = 'shor' -class _Prop_start_angle(aetools.NProperty): - """start angle - the angle that defines the start of the arc, in degrees """ - which = 'pang' - want = 'fixd' -class _Prop_transfer_mode(aetools.NProperty): - """transfer mode - the transfer mode """ - which = 'pptm' - want = 'tran' - -arcs = arc - -class drawing_area(aetools.ComponentItem): - """drawing area - Container for graphics and supporting information """ - want = 'cdrw' -class _Prop_background_color(aetools.NProperty): - """background color - the color used to fill in unoccupied areas """ - which = 'pbcl' - want = 'cRGB' -class _Prop_background_pattern(aetools.NProperty): - """background pattern - the pattern used to fill in unoccupied areas """ - which = 'pbpt' - want = 'cpix' -class _Prop_color_table(aetools.NProperty): - """color table - the color table """ - which = 'cltb' - want = 'clrt' -class _Prop_default_font(aetools.NProperty): - """default font - the name of the default font for text objects """ - which = 'ptxf' - want = 'itxt' -class _Prop_default_location(aetools.NProperty): - """default location - the default location of each new graphic object """ - which = 'pnel' - want = 'QDpt' -class _Prop_default_size(aetools.NProperty): - """default size - the default size for text objects """ - which = 'ptps' - want = 'fixd' -class _Prop_name(aetools.NProperty): - """name - the name """ - which = 'pnam' - want = 'itxt' -class _Prop_ordering(aetools.NProperty): - """ordering - the ordered list of graphic objects in the drawing area """ - which = 'gobs' - want = 'obj ' -class _Prop_pixel_depth(aetools.NProperty): - """pixel depth - the number of bits per pixel """ - which = 'pdpt' - want = 'shor' -class _Prop_style(aetools.NProperty): - """style - the default text style for text objects """ - which = 'txst' - want = 'tsty' -class _Prop_text_color(aetools.NProperty): - """text color - the default color for text objects """ - which = 'ptxc' - want = 'cRGB' -class _Prop_update_on_change(aetools.NProperty): - """update on change - Redraw after each change? """ - which = 'pupd' - want = 'bool' -class _Prop_writing_code(aetools.NProperty): - """writing code - the script system and language of text objects in the drawing area """ - which = 'psct' - want = 'intl' - -drawing_areas = drawing_area - -class graphic_objects(aetools.ComponentItem): - """graphic objects - """ - want = 'cgob' - -graphic_object = graphic_objects - -class graphic_shapes(aetools.ComponentItem): - """graphic shapes - """ - want = 'cgsh' - -graphic_shape = graphic_shapes - -class graphic_text(aetools.ComponentItem): - """graphic text - A series of characters within a drawing area """ - want = 'cgtx' -class _Prop_color(aetools.NProperty): - """color - the color of the first character """ - which = 'colr' - want = 'cRGB' -class _Prop_font(aetools.NProperty): - """font - the name of the font of the first character """ - which = 'font' - want = 'ctxt' -class _Prop_size(aetools.NProperty): - """size - the size in points of the first character """ - which = 'ptsz' - want = 'fixd' -class _Prop_uniform_styles(aetools.NProperty): - """uniform styles - the text styles that are uniform throughout the text """ - which = 'ustl' - want = 'tsty' - -class ovals(aetools.ComponentItem): - """ovals - """ - want = 'covl' - -oval = ovals - -class polygon(aetools.ComponentItem): - """polygon - A polygon """ - want = 'cpgn' -class _Prop_point_list(aetools.NProperty): - """point list - the list of points that define the polygon """ - which = 'ptlt' - want = 'QDpt' - -polygons = polygon - -class graphic_groups(aetools.ComponentItem): - """graphic groups - """ - want = 'cpic' - -graphic_group = graphic_groups - -class pixel_maps(aetools.ComponentItem): - """pixel maps - """ - want = 'cpix' - -pixel_map = pixel_maps - -class pixel(aetools.ComponentItem): - """pixel - A pixel """ - want = 'cpxl' - -pixels = pixel - -class rectangles(aetools.ComponentItem): - """rectangles - """ - want = 'crec' - -rectangle = rectangles - -class rounded_rectangle(aetools.ComponentItem): - """rounded rectangle - A rounded rectangle """ - want = 'crrc' -class _Prop_corner_curve_height(aetools.NProperty): - """corner curve height - the height of the oval used to define the shape of the rounded corners """ - which = 'pchd' - want = 'shor' -class _Prop_corner_curve_width(aetools.NProperty): - """corner curve width - the width of the oval used to define the shape of the rounded corners """ - which = 'pcwd' - want = 'shor' - -rounded_rectangles = rounded_rectangle - -class graphic_line(aetools.ComponentItem): - """graphic line - A graphic line """ - want = 'glin' -class _Prop_arrow_style(aetools.NProperty): - """arrow style - the arrow style """ - which = 'arro' - want = 'arro' -class _Prop_dash_style(aetools.NProperty): - """dash style - the dash style """ - which = 'pdst' - want = 'tdas' -class _Prop_end_point(aetools.NProperty): - """end point - the ending point of the line """ - which = 'pend' - want = 'QDpt' -class _Prop_start_point(aetools.NProperty): - """start point - the starting point of the line """ - which = 'pstp' - want = 'QDpt' - -graphic_lines = graphic_line -arc._superclassnames = [] -arc._privpropdict = { - 'arc_angle' : _Prop_arc_angle, - 'bounds' : _Prop_bounds, - 'definition_rect' : _Prop_definition_rect, - 'fill_color' : _Prop_fill_color, - 'fill_pattern' : _Prop_fill_pattern, - 'pen_color' : _Prop_pen_color, - 'pen_pattern' : _Prop_pen_pattern, - 'pen_width' : _Prop_pen_width, - 'start_angle' : _Prop_start_angle, - 'transfer_mode' : _Prop_transfer_mode, -} -arc._privelemdict = { -} -drawing_area._superclassnames = [] -drawing_area._privpropdict = { - 'background_color' : _Prop_background_color, - 'background_pattern' : _Prop_background_pattern, - 'color_table' : _Prop_color_table, - 'default_font' : _Prop_default_font, - 'default_location' : _Prop_default_location, - 'default_size' : _Prop_default_size, - 'name' : _Prop_name, - 'ordering' : _Prop_ordering, - 'pixel_depth' : _Prop_pixel_depth, - 'style' : _Prop_style, - 'text_color' : _Prop_text_color, - 'update_on_change' : _Prop_update_on_change, - 'writing_code' : _Prop_writing_code, -} -drawing_area._privelemdict = { -} -graphic_objects._superclassnames = [] -graphic_objects._privpropdict = { -} -graphic_objects._privelemdict = { -} -graphic_shapes._superclassnames = [] -graphic_shapes._privpropdict = { -} -graphic_shapes._privelemdict = { -} -graphic_text._superclassnames = [] -graphic_text._privpropdict = { - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, - 'uniform_styles' : _Prop_uniform_styles, -} -graphic_text._privelemdict = { -} -ovals._superclassnames = [] -ovals._privpropdict = { -} -ovals._privelemdict = { -} -polygon._superclassnames = [] -polygon._privpropdict = { - 'point_list' : _Prop_point_list, -} -polygon._privelemdict = { -} -graphic_groups._superclassnames = [] -graphic_groups._privpropdict = { -} -graphic_groups._privelemdict = { -} -pixel_maps._superclassnames = [] -pixel_maps._privpropdict = { -} -pixel_maps._privelemdict = { -} -pixel._superclassnames = [] -pixel._privpropdict = { - 'color' : _Prop_color, -} -pixel._privelemdict = { -} -rectangles._superclassnames = [] -rectangles._privpropdict = { -} -rectangles._privelemdict = { -} -rounded_rectangle._superclassnames = [] -rounded_rectangle._privpropdict = { - 'corner_curve_height' : _Prop_corner_curve_height, - 'corner_curve_width' : _Prop_corner_curve_width, -} -rounded_rectangle._privelemdict = { -} -graphic_line._superclassnames = [] -graphic_line._privpropdict = { - 'arrow_style' : _Prop_arrow_style, - 'dash_style' : _Prop_dash_style, - 'end_point' : _Prop_end_point, - 'start_point' : _Prop_start_point, -} -graphic_line._privelemdict = { -} -_Enum_arro = { - 'no_arrow' : 'arno', # No arrow on line - 'arrow_at_start' : 'arst', # Arrow at start of line - 'arrow_at_end' : 'aren', # Arrow at end of line - 'arrow_at_both_ends' : 'arbo', # Arrow at both the start and the end of the line -} - -_Enum_tran = { - 'copy_pixels' : 'cpy ', # - 'not_copy_pixels' : 'ncpy', # - 'or_pixels' : 'or ', # - 'not_or_pixels' : 'ntor', # - 'bic_pixels' : 'bic ', # - 'not_bic_pixels' : 'nbic', # - 'xor_pixels' : 'xor ', # - 'not_xor_pixels' : 'nxor', # - 'add_over_pixels' : 'addo', # - 'add_pin_pixels' : 'addp', # - 'sub_over_pixels' : 'subo', # - 'sub_pin_pixels' : 'subp', # - 'ad_max_pixels' : 'admx', # - 'ad_min_pixels' : 'admn', # - 'blend_pixels' : 'blnd', # -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'carc' : arc, - 'cdrw' : drawing_area, - 'cgob' : graphic_objects, - 'cgsh' : graphic_shapes, - 'cgtx' : graphic_text, - 'covl' : ovals, - 'cpgn' : polygon, - 'cpic' : graphic_groups, - 'cpix' : pixel_maps, - 'cpxl' : pixel, - 'crec' : rectangles, - 'crrc' : rounded_rectangle, - 'glin' : graphic_line, -} - -_propdeclarations = { - 'arro' : _Prop_arrow_style, - 'cltb' : _Prop_color_table, - 'colr' : _Prop_color, - 'flcl' : _Prop_fill_color, - 'flpt' : _Prop_fill_pattern, - 'font' : _Prop_font, - 'gobs' : _Prop_ordering, - 'pang' : _Prop_start_angle, - 'parc' : _Prop_arc_angle, - 'pbcl' : _Prop_background_color, - 'pbnd' : _Prop_bounds, - 'pbpt' : _Prop_background_pattern, - 'pchd' : _Prop_corner_curve_height, - 'pcwd' : _Prop_corner_curve_width, - 'pdpt' : _Prop_pixel_depth, - 'pdrt' : _Prop_definition_rect, - 'pdst' : _Prop_dash_style, - 'pend' : _Prop_end_point, - 'pnam' : _Prop_name, - 'pnel' : _Prop_default_location, - 'ppcl' : _Prop_pen_color, - 'pppa' : _Prop_pen_pattern, - 'pptm' : _Prop_transfer_mode, - 'ppwd' : _Prop_pen_width, - 'psct' : _Prop_writing_code, - 'pstp' : _Prop_start_point, - 'ptlt' : _Prop_point_list, - 'ptps' : _Prop_default_size, - 'ptsz' : _Prop_size, - 'ptxc' : _Prop_text_color, - 'ptxf' : _Prop_default_font, - 'pupd' : _Prop_update_on_change, - 'txst' : _Prop_style, - 'ustl' : _Prop_uniform_styles, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'arro' : _Enum_arro, - 'tran' : _Enum_tran, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suppleme.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suppleme.py deleted file mode 100644 index d78193796..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suppleme.py +++ /dev/null @@ -1,73 +0,0 @@ -"""Suite QuickDraw Graphics Supplemental Suite: Defines transformations of graphic objects -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'qdsp' - -class QuickDraw_Graphics_Suppleme_Events: - - pass - - -class drawing_area(aetools.ComponentItem): - """drawing area - Container for graphics and supporting information """ - want = 'cdrw' -class _Prop_rotation(aetools.NProperty): - """rotation - the default rotation for objects in the drawing area """ - which = 'prot' - want = 'trot' -class _Prop_scale(aetools.NProperty): - """scale - the default scaling for objects in the drawing area """ - which = 'pscl' - want = 'fixd' -class _Prop_translation(aetools.NProperty): - """translation - the default repositioning for objects in the drawing area """ - which = 'ptrs' - want = 'QDpt' - -drawing_areas = drawing_area - -class graphic_groups(aetools.ComponentItem): - """graphic groups - """ - want = 'cpic' - -graphic_group = graphic_groups -drawing_area._superclassnames = [] -drawing_area._privpropdict = { - 'rotation' : _Prop_rotation, - 'scale' : _Prop_scale, - 'translation' : _Prop_translation, -} -drawing_area._privelemdict = { -} -graphic_groups._superclassnames = [] -graphic_groups._privpropdict = { -} -graphic_groups._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cdrw' : drawing_area, - 'cpic' : graphic_groups, -} - -_propdeclarations = { - 'prot' : _Prop_rotation, - 'pscl' : _Prop_scale, - 'ptrs' : _Prop_translation, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Required_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Required_Suite.py deleted file mode 100644 index 7e77dbbf5..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Required_Suite.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Suite Required Suite: Every application supports open, print, run, and quit -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'reqd' - -from _builtinSuites.builtin_Suite import * -class Required_Suite_Events(builtin_Suite_Events): - - pass - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py deleted file mode 100644 index 86681f57b..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py +++ /dev/null @@ -1,738 +0,0 @@ -"""Suite Standard Suite: Common terms for most applications -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'core' - -from _builtinSuites.builtin_Suite import * -class Standard_Suite_Events(builtin_Suite_Events): - - _argmap_class_info = { - 'in_' : 'wrcd', - } - - def class_info(self, _object=None, _attributes={}, **_arguments): - """class info: (optional) Get information about an object class - Required argument: the object class about which information is requested - Keyword argument in_: the human language and script system in which to return information - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: a record containing the object\xd5s properties and elements - """ - _code = 'core' - _subcode = 'qobj' - - aetools.keysubst(_arguments, self._argmap_class_info) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_close = { - 'saving' : 'savo', - 'saving_in' : 'kfil', - } - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object - Required argument: the object to close - Keyword argument saving: specifies whether changes should be saved before closing - Keyword argument saving_in: the file or alias in which to save the object - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - aetools.keysubst(_arguments, self._argmap_close) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_count = { - 'each' : 'kocl', - } - - def count(self, _object, _attributes={}, **_arguments): - """count: Return the number of elements of an object - Required argument: the object whose elements are to be counted - Keyword argument each: if specified, restricts counting to objects of this class - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the number of elements - """ - _code = 'core' - _subcode = 'cnte' - - aetools.keysubst(_arguments, self._argmap_count) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_data_size = { - 'as' : 'rtyp', - } - - def data_size(self, _object, _attributes={}, **_arguments): - """data size: (optional) Return the size in bytes of an object - Required argument: the object whose data size is to be returned - Keyword argument as: the data type for which the size is calculated - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the size of the object in bytes - """ - _code = 'core' - _subcode = 'dsiz' - - aetools.keysubst(_arguments, self._argmap_data_size) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def delete(self, _object, _attributes={}, **_arguments): - """delete: Delete an object from its container. Note this does not work on script variables, only on elements of application classes. - Required argument: the element to delete - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'delo' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_duplicate = { - 'to' : 'insh', - 'with_properties' : 'prdt', - } - - def duplicate(self, _object, _attributes={}, **_arguments): - """duplicate: Duplicate one or more objects - Required argument: the object(s) to duplicate - Keyword argument to: the new location for the object(s) - Keyword argument with_properties: the initial values for properties of the new object that are to be different from the original - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the duplicated object(s) - """ - _code = 'core' - _subcode = 'clon' - - aetools.keysubst(_arguments, self._argmap_duplicate) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_event_info = { - 'in_' : 'wrcd', - } - - def event_info(self, _object, _attributes={}, **_arguments): - """event info: (optional) Get information about the Apple events in a suite - Required argument: the event class of the Apple events for which to return information - Keyword argument in_: the human language and script system in which to return information - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: a record containing the events and their parameters - """ - _code = 'core' - _subcode = 'gtei' - - aetools.keysubst(_arguments, self._argmap_event_info) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def exists(self, _object, _attributes={}, **_arguments): - """exists: Verify if an object exists - Required argument: the object in question - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: true if it exists, false if not - """ - _code = 'core' - _subcode = 'doex' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def handleBreakpoint(self, _object, _attributes={}, **_arguments): - """handleBreakpoint: return true to stop at a breakpoint - Required argument: the call frame of the breakpoint - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: true to stop, false if not - """ - _code = 'core' - _subcode = 'brak' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'new' : 'kocl', - 'at' : 'insh', - 'with_data' : 'data', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: Make a new element - Keyword argument new: the class of the new element - Keyword argument at: the location at which to insert the element - Keyword argument with_data: the initial data for the element - Keyword argument with_properties: the initial values for the properties of the element - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the new object(s) - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_move = { - 'to' : 'insh', - } - - def move(self, _object, _attributes={}, **_arguments): - """move: Move object(s) to a new location - Required argument: the object(s) to move - Keyword argument to: the new location for the object(s) - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: to the object(s) after they have been moved - """ - _code = 'core' - _subcode = 'move' - - aetools.keysubst(_arguments, self._argmap_move) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: list of objects to print - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_quit = { - 'saving' : 'savo', - } - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit an application - Keyword argument saving: specifies whether to save currently open documents - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - aetools.keysubst(_arguments, self._argmap_quit) - if _no_object != None: raise TypeError, 'No direct arg expected' - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def reopen(self, _no_object=None, _attributes={}, **_arguments): - """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'rapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: Run an application. Most applications will open an empty, untitled window. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'oapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_save = { - 'in_' : 'kfil', - 'as' : 'fltp', - } - - def save(self, _object, _attributes={}, **_arguments): - """save: Save an object - Required argument: the object to save, usually a document or window - Keyword argument in_: the file or alias in which to save the object - Keyword argument as: the file type of the document in which to save the data - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'save' - - aetools.keysubst(_arguments, self._argmap_save) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def select(self, _object, _attributes={}, **_arguments): - """select: Make a selection - Required argument: the object to select - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'slct' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_suite_info = { - 'in_' : 'wrcd', - } - - def suite_info(self, _object, _attributes={}, **_arguments): - """suite info: (optional) Get information about event suite(s) - Required argument: the suite for which to return information - Keyword argument in_: the human language and script system in which to return information - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: a record containing the suites and their versions - """ - _code = 'core' - _subcode = 'gtsi' - - aetools.keysubst(_arguments, self._argmap_suite_info) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class alias(aetools.ComponentItem): - """alias - a file on a disk or server. The file must exist when you check the syntax of your script. """ - want = 'alis' -class _Prop_POSIX_path(aetools.NProperty): - """POSIX path - the POSIX path of the file """ - which = 'psxp' - want = 'TEXT' - -aliases = alias - -class application(aetools.ComponentItem): - """application - An application program """ - want = 'capp' -class _Prop_clipboard(aetools.NProperty): - """clipboard - the contents of the clipboard for this application """ - which = 'pcli' - want = '****' -clipboard = _Prop_clipboard() -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is this the frontmost application? """ - which = 'pisf' - want = 'bool' -frontmost = _Prop_frontmost() -class _Prop_name(aetools.NProperty): - """name - the name of the application """ - which = 'pnam' - want = 'itxt' -name = _Prop_name() -class _Prop_selection(aetools.NProperty): - """selection - the selection visible to the user. Use the \xd4select\xd5 command to set a new selection; use \xd4contents of selection\xd5 to get or change information in the document. """ - which = 'sele' - want = 'csel' -selection = _Prop_selection() -class _Prop_version(aetools.NProperty): - """version - the version of the application """ - which = 'vers' - want = 'vers' -version = _Prop_version() - -applications = application - -class insertion_points(aetools.ComponentItem): - """insertion points - """ - want = 'cins' - -insertion_point = insertion_points - -class selection_2d_object(aetools.ComponentItem): - """selection-object - A way to refer to the state of the current of the selection. Use the \xd4select\xd5 command to make a new selection. """ - want = 'csel' -class _Prop_contents(aetools.NProperty): - """contents - the information currently selected. Use \xd4contents of selection\xd5 to get or change information in a document. """ - which = 'pcnt' - want = '****' - -class window(aetools.ComponentItem): - """window - A window """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window """ - which = 'pbnd' - want = 'qdrt' -class _Prop_closeable(aetools.NProperty): - """closeable - Does the window have a close box? """ - which = 'hclb' - want = 'bool' -class _Prop_floating(aetools.NProperty): - """floating - Does the window float? """ - which = 'isfl' - want = 'bool' -class _Prop_index(aetools.NProperty): - """index - the number of the window """ - which = 'pidx' - want = 'long' -class _Prop_modal(aetools.NProperty): - """modal - Is the window modal? """ - which = 'pmod' - want = 'bool' -class _Prop_resizable(aetools.NProperty): - """resizable - Is the window resizable? """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Does the window have a title bar? """ - which = 'ptit' - want = 'bool' -class _Prop_visible(aetools.NProperty): - """visible - Is the window visible? """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Is the window zoomable? """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Is the window zoomed? """ - which = 'pzum' - want = 'bool' - -windows = window - -class document(aetools.ComponentItem): - """document - A document of a scriptable application """ - want = 'docu' -class _Prop_modified(aetools.NProperty): - """modified - Has the document been modified since the last save? """ - which = 'imod' - want = 'bool' - -documents = document - -class file(aetools.ComponentItem): - """file - a file on a disk or server """ - want = 'file' - -files = file -alias._superclassnames = [] -alias._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, -} -alias._privelemdict = { -} -application._superclassnames = [] -application._privpropdict = { - 'clipboard' : _Prop_clipboard, - 'frontmost' : _Prop_frontmost, - 'name' : _Prop_name, - 'selection' : _Prop_selection, - 'version' : _Prop_version, -} -application._privelemdict = { -} -insertion_points._superclassnames = [] -insertion_points._privpropdict = { -} -insertion_points._privelemdict = { -} -selection_2d_object._superclassnames = [] -selection_2d_object._privpropdict = { - 'contents' : _Prop_contents, -} -selection_2d_object._privelemdict = { -} -window._superclassnames = [] -window._privpropdict = { - 'bounds' : _Prop_bounds, - 'closeable' : _Prop_closeable, - 'floating' : _Prop_floating, - 'index' : _Prop_index, - 'modal' : _Prop_modal, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} -document._superclassnames = [] -document._privpropdict = { - 'modified' : _Prop_modified, -} -document._privelemdict = { -} -file._superclassnames = [] -file._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, -} -file._privelemdict = { -} -class _3c_(aetools.NComparison): - """< - Less than """ -class _3d_(aetools.NComparison): - """= - Equal """ -class _3e_(aetools.NComparison): - """> - Greater than """ -class contains(aetools.NComparison): - """contains - Contains """ -class ends_with(aetools.NComparison): - """ends with - Ends with """ -class starts_with(aetools.NComparison): - """starts with - Starts with """ -class _b2_(aetools.NComparison): - """\xb2 - Less than or equal to """ -class _b3_(aetools.NComparison): - """\xb3 - Greater than or equal to """ -_Enum_kfrm = { - 'index' : 'indx', # keyform designating indexed access - 'named' : 'name', # keyform designating named access - 'id' : 'ID ', # keyform designating access by unique identifier -} - -_Enum_savo = { - 'yes' : 'yes ', # Save objects now - 'no' : 'no ', # Do not save objects - 'ask' : 'ask ', # Ask the user whether to save -} - -_Enum_styl = { - 'plain' : 'plan', # Plain - 'bold' : 'bold', # Bold - 'italic' : 'ital', # Italic - 'outline' : 'outl', # Outline - 'shadow' : 'shad', # Shadow - 'underline' : 'undl', # Underline - 'superscript' : 'spsc', # Superscript - 'subscript' : 'sbsc', # Subscript - 'strikethrough' : 'strk', # Strikethrough - 'small_caps' : 'smcp', # Small caps - 'all_caps' : 'alcp', # All capital letters - 'all_lowercase' : 'lowc', # Lowercase - 'condensed' : 'cond', # Condensed - 'expanded' : 'pexp', # Expanded - 'hidden' : 'hidn', # Hidden -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'alis' : alias, - 'capp' : application, - 'cins' : insertion_points, - 'csel' : selection_2d_object, - 'cwin' : window, - 'docu' : document, - 'file' : file, -} - -_propdeclarations = { - 'hclb' : _Prop_closeable, - 'imod' : _Prop_modified, - 'isfl' : _Prop_floating, - 'iszm' : _Prop_zoomable, - 'pbnd' : _Prop_bounds, - 'pcli' : _Prop_clipboard, - 'pcnt' : _Prop_contents, - 'pidx' : _Prop_index, - 'pisf' : _Prop_frontmost, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'prsz' : _Prop_resizable, - 'psxp' : _Prop_POSIX_path, - 'ptit' : _Prop_titled, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, - 'sele' : _Prop_selection, - 'vers' : _Prop_version, -} - -_compdeclarations = { - '< ' : _3c_, - '<= ' : _b2_, - '= ' : _3d_, - '> ' : _3e_, - '>= ' : _b3_, - 'bgwt' : starts_with, - 'cont' : contains, - 'ends' : ends_with, -} - -_enumdeclarations = { - 'kfrm' : _Enum_kfrm, - 'savo' : _Enum_savo, - 'styl' : _Enum_styl, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py deleted file mode 100644 index afa01a0e0..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py +++ /dev/null @@ -1,104 +0,0 @@ -"""Suite Table Suite: Classes for manipulating tables -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'tbls' - -class Table_Suite_Events: - - pass - - -class cell(aetools.ComponentItem): - """cell - A cell """ - want = 'ccel' -class _Prop_formula(aetools.NProperty): - """formula - the formula of the cell """ - which = 'pfor' - want = 'ctxt' -class _Prop_protection(aetools.NProperty): - """protection - Indicates whether value or formula in the cell can be changed """ - which = 'ppro' - want = 'prtn' - -cells = cell - -class column(aetools.ComponentItem): - """column - A column """ - want = 'ccol' -class _Prop_name(aetools.NProperty): - """name - the name of the column """ - which = 'pnam' - want = 'itxt' - -columns = column - -class rows(aetools.ComponentItem): - """rows - """ - want = 'crow' - -row = rows - -class tables(aetools.ComponentItem): - """tables - """ - want = 'ctbl' - -table = tables -cell._superclassnames = [] -cell._privpropdict = { - 'formula' : _Prop_formula, - 'protection' : _Prop_protection, -} -cell._privelemdict = { -} -column._superclassnames = [] -column._privpropdict = { - 'name' : _Prop_name, -} -column._privelemdict = { -} -rows._superclassnames = [] -rows._privpropdict = { -} -rows._privelemdict = { -} -tables._superclassnames = [] -tables._privpropdict = { -} -tables._privelemdict = { -} -_Enum_prtn = { - 'read_only' : 'nmod', # Can\xd5t change values or formulas - 'formulas_protected' : 'fpro', # Can changes values but not formulas - 'read_2f_write' : 'modf', # Can change values and formulas -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'ccel' : cell, - 'ccol' : column, - 'crow' : rows, - 'ctbl' : tables, -} - -_propdeclarations = { - 'pfor' : _Prop_formula, - 'pnam' : _Prop_name, - 'ppro' : _Prop_protection, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'prtn' : _Enum_prtn, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py deleted file mode 100644 index 1845f4d43..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py +++ /dev/null @@ -1,224 +0,0 @@ -"""Suite Text Suite: A set of basic classes for text processing -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'TEXT' - -class Text_Suite_Events: - - pass - - -class text_flow(aetools.ComponentItem): - """text flow - A contiguous block of text. Page layout applications call this a \xd4story.\xd5 """ - want = 'cflo' -class _Prop__3c_inheritance_3e_(aetools.NProperty): - """ - inherits some of its properties from this class """ - which = 'c@#^' - want = 'ctxt' -class _Prop_name(aetools.NProperty): - """name - the name """ - which = 'pnam' - want = 'itxt' - -text_flows = text_flow - -class character(aetools.ComponentItem): - """character - A character """ - want = 'cha ' - -class line(aetools.ComponentItem): - """line - A line of text """ - want = 'clin' -class _Prop_justification(aetools.NProperty): - """justification - the justification of the text """ - which = 'pjst' - want = 'just' - -lines = line - -class paragraph(aetools.ComponentItem): - """paragraph - A paragraph """ - want = 'cpar' - -paragraphs = paragraph - -class text(aetools.ComponentItem): - """text - Text """ - want = 'ctxt' -class _Prop_color(aetools.NProperty): - """color - the color of the first character """ - which = 'colr' - want = 'cRGB' -class _Prop_font(aetools.NProperty): - """font - the name of the font of the first character """ - which = 'font' - want = 'ctxt' -class _Prop_quoted_form(aetools.NProperty): - """quoted form - the text in quoted form """ - which = 'strq' - want = 'ctxt' -class _Prop_size(aetools.NProperty): - """size - the size in points of the first character """ - which = 'ptsz' - want = 'fixd' -class _Prop_style(aetools.NProperty): - """style - the text style of the first character of the first character """ - which = 'txst' - want = 'tsty' -class _Prop_uniform_styles(aetools.NProperty): - """uniform styles - the text styles that are uniform throughout the text """ - which = 'ustl' - want = 'tsty' -class _Prop_writing_code(aetools.NProperty): - """writing code - the script system and language """ - which = 'psct' - want = 'intl' -# element 'cha ' as ['indx'] -# element 'clin' as ['indx'] -# element 'cpar' as ['indx'] -# element 'ctxt' as ['indx'] -# element 'cwor' as ['indx'] - -class word(aetools.ComponentItem): - """word - A word """ - want = 'cwor' - -words = word - -class text_style_info(aetools.ComponentItem): - """text style info - On and Off styles of text run """ - want = 'tsty' -class _Prop_off_styles(aetools.NProperty): - """off styles - the styles that are off for the text """ - which = 'ofst' - want = 'styl' -class _Prop_on_styles(aetools.NProperty): - """on styles - the styles that are on for the text """ - which = 'onst' - want = 'styl' - -text_style_infos = text_style_info -text_flow._superclassnames = ['text'] -text_flow._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, - 'name' : _Prop_name, -} -text_flow._privelemdict = { -} -character._superclassnames = ['text'] -character._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -character._privelemdict = { -} -line._superclassnames = ['text'] -line._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, - 'justification' : _Prop_justification, -} -line._privelemdict = { -} -paragraph._superclassnames = ['text'] -paragraph._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -paragraph._privelemdict = { -} -text._superclassnames = [] -text._privpropdict = { - 'color' : _Prop_color, - 'font' : _Prop_font, - 'quoted_form' : _Prop_quoted_form, - 'size' : _Prop_size, - 'style' : _Prop_style, - 'uniform_styles' : _Prop_uniform_styles, - 'writing_code' : _Prop_writing_code, -} -text._privelemdict = { - 'character' : character, - 'line' : line, - 'paragraph' : paragraph, - 'text' : text, - 'word' : word, -} -word._superclassnames = ['text'] -word._privpropdict = { - '_3c_inheritance_3e_' : _Prop__3c_inheritance_3e_, -} -word._privelemdict = { -} -text_style_info._superclassnames = [] -text_style_info._privpropdict = { - 'off_styles' : _Prop_off_styles, - 'on_styles' : _Prop_on_styles, -} -text_style_info._privelemdict = { -} -_Enum_just = { - 'left' : 'left', # Align with left margin - 'right' : 'rght', # Align with right margin - 'center' : 'cent', # Align with center - 'full' : 'full', # Align with both left and right margins -} - -_Enum_styl = { - 'plain' : 'plan', # Plain - 'bold' : 'bold', # Bold - 'italic' : 'ital', # Italic - 'outline' : 'outl', # Outline - 'shadow' : 'shad', # Shadow - 'underline' : 'undl', # Underline - 'superscript' : 'spsc', # Superscript - 'subscript' : 'sbsc', # Subscript - 'strikethrough' : 'strk', # Strikethrough - 'small_caps' : 'smcp', # Small caps - 'all_caps' : 'alcp', # All capital letters - 'all_lowercase' : 'lowc', # Lowercase - 'condensed' : 'cond', # Condensed - 'expanded' : 'pexp', # Expanded - 'hidden' : 'hidn', # Hidden -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cflo' : text_flow, - 'cha ' : character, - 'clin' : line, - 'cpar' : paragraph, - 'ctxt' : text, - 'cwor' : word, - 'tsty' : text_style_info, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_inheritance_3e_, - 'colr' : _Prop_color, - 'font' : _Prop_font, - 'ofst' : _Prop_off_styles, - 'onst' : _Prop_on_styles, - 'pjst' : _Prop_justification, - 'pnam' : _Prop_name, - 'psct' : _Prop_writing_code, - 'ptsz' : _Prop_size, - 'strq' : _Prop_quoted_form, - 'txst' : _Prop_style, - 'ustl' : _Prop_uniform_styles, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'just' : _Enum_just, - 'styl' : _Enum_styl, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Type_Names_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Type_Names_Suite.py deleted file mode 100644 index cd9fa1987..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/Type_Names_Suite.py +++ /dev/null @@ -1,435 +0,0 @@ -"""Suite Type Names Suite: Terminology for Registry data types -Level 1, version 1 - -Generated from /Volumes/Sap/System Folder/Extensions/AppleScript -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'tpnm' - -class Type_Names_Suite_Events: - - pass - - -class PostScript_picture(aetools.ComponentItem): - """PostScript picture - """ - want = 'EPS ' - -class point(aetools.ComponentItem): - """point - point coordinates """ - want = 'QDpt' - -class string(aetools.ComponentItem): - """string - a string of characters """ - want = 'TEXT' - -plain_text = string - -plain_text = string - -class TIFF_picture(aetools.ComponentItem): - """TIFF picture - """ - want = 'TIFF' - -class application_dictionary(aetools.ComponentItem): - """application dictionary - """ - want = 'aete' - -class system_dictionary(aetools.ComponentItem): - """system dictionary - """ - want = 'aeut' - -class color_table(aetools.ComponentItem): - """color table - """ - want = 'clrt' - -class menu_item(aetools.ComponentItem): - """menu item - """ - want = 'cmen' - -class menu(aetools.ComponentItem): - """menu - """ - want = 'cmnu' - -class double_integer(aetools.ComponentItem): - """double integer - """ - want = 'comp' - -class type_element_info(aetools.ComponentItem): - """type element info - """ - want = 'elin' - -class type_event_info(aetools.ComponentItem): - """type event info - information about an event """ - want = 'evin' - -class extended_real(aetools.ComponentItem): - """extended real - """ - want = 'exte' - -class fixed(aetools.ComponentItem): - """fixed - a real number """ - want = 'fixd' - -class fixed_point(aetools.ComponentItem): - """fixed point - """ - want = 'fpnt' - -class fixed_rectangle(aetools.ComponentItem): - """fixed rectangle - """ - want = 'frct' - -class type_class_info(aetools.ComponentItem): - """type class info - information about properties and elements of a class """ - want = 'gcli' - -class location_reference(aetools.ComponentItem): - """location reference - """ - want = 'insl' - -class long_fixed_point(aetools.ComponentItem): - """long fixed point - """ - want = 'lfpt' - -class long_fixed_rectangle(aetools.ComponentItem): - """long fixed rectangle - """ - want = 'lfrc' - -class long_fixed(aetools.ComponentItem): - """long fixed - """ - want = 'lfxd' - -class long_point(aetools.ComponentItem): - """long point - """ - want = 'lpnt' - -class long_rectangle(aetools.ComponentItem): - """long rectangle - """ - want = 'lrct' - -class machine_location(aetools.ComponentItem): - """machine location - """ - want = 'mLoc' - -class unsigned_integer(aetools.ComponentItem): - """unsigned integer - """ - want = 'magn' - -class null(aetools.ComponentItem): - """null - """ - want = 'null' - -class type_property_info(aetools.ComponentItem): - """type property info - """ - want = 'pinf' - -class type_parameter_info(aetools.ComponentItem): - """type parameter info - """ - want = 'pmin' - -class bounding_rectangle(aetools.ComponentItem): - """bounding rectangle - bounding rectangle """ - want = 'qdrt' - -class small_integer(aetools.ComponentItem): - """small integer - """ - want = 'shor' - -class small_real(aetools.ComponentItem): - """small real - """ - want = 'sing' - -class scrap_styles(aetools.ComponentItem): - """scrap styles - """ - want = 'styl' - -class type_suite_info(aetools.ComponentItem): - """type suite info - """ - want = 'suin' - -class target_id(aetools.ComponentItem): - """target id - """ - want = 'targ' - -class dash_style(aetools.ComponentItem): - """dash style - """ - want = 'tdas' - -class pixel_map_record(aetools.ComponentItem): - """pixel map record - """ - want = 'tpmm' - -class RGB16_color(aetools.ComponentItem): - """RGB16 color - """ - want = 'tr16' - -class RGB96_color(aetools.ComponentItem): - """RGB96 color - """ - want = 'tr96' - -class rotation(aetools.ComponentItem): - """rotation - """ - want = 'trot' - -class version(aetools.ComponentItem): - """version - """ - want = 'vers' -PostScript_picture._superclassnames = [] -PostScript_picture._privpropdict = { -} -PostScript_picture._privelemdict = { -} -point._superclassnames = [] -point._privpropdict = { -} -point._privelemdict = { -} -string._superclassnames = [] -string._privpropdict = { -} -string._privelemdict = { -} -TIFF_picture._superclassnames = [] -TIFF_picture._privpropdict = { -} -TIFF_picture._privelemdict = { -} -application_dictionary._superclassnames = [] -application_dictionary._privpropdict = { -} -application_dictionary._privelemdict = { -} -system_dictionary._superclassnames = [] -system_dictionary._privpropdict = { -} -system_dictionary._privelemdict = { -} -color_table._superclassnames = [] -color_table._privpropdict = { -} -color_table._privelemdict = { -} -menu_item._superclassnames = [] -menu_item._privpropdict = { -} -menu_item._privelemdict = { -} -menu._superclassnames = [] -menu._privpropdict = { -} -menu._privelemdict = { -} -double_integer._superclassnames = [] -double_integer._privpropdict = { -} -double_integer._privelemdict = { -} -type_element_info._superclassnames = [] -type_element_info._privpropdict = { -} -type_element_info._privelemdict = { -} -type_event_info._superclassnames = [] -type_event_info._privpropdict = { -} -type_event_info._privelemdict = { -} -extended_real._superclassnames = [] -extended_real._privpropdict = { -} -extended_real._privelemdict = { -} -fixed._superclassnames = [] -fixed._privpropdict = { -} -fixed._privelemdict = { -} -fixed_point._superclassnames = [] -fixed_point._privpropdict = { -} -fixed_point._privelemdict = { -} -fixed_rectangle._superclassnames = [] -fixed_rectangle._privpropdict = { -} -fixed_rectangle._privelemdict = { -} -type_class_info._superclassnames = [] -type_class_info._privpropdict = { -} -type_class_info._privelemdict = { -} -location_reference._superclassnames = [] -location_reference._privpropdict = { -} -location_reference._privelemdict = { -} -long_fixed_point._superclassnames = [] -long_fixed_point._privpropdict = { -} -long_fixed_point._privelemdict = { -} -long_fixed_rectangle._superclassnames = [] -long_fixed_rectangle._privpropdict = { -} -long_fixed_rectangle._privelemdict = { -} -long_fixed._superclassnames = [] -long_fixed._privpropdict = { -} -long_fixed._privelemdict = { -} -long_point._superclassnames = [] -long_point._privpropdict = { -} -long_point._privelemdict = { -} -long_rectangle._superclassnames = [] -long_rectangle._privpropdict = { -} -long_rectangle._privelemdict = { -} -machine_location._superclassnames = [] -machine_location._privpropdict = { -} -machine_location._privelemdict = { -} -unsigned_integer._superclassnames = [] -unsigned_integer._privpropdict = { -} -unsigned_integer._privelemdict = { -} -null._superclassnames = [] -null._privpropdict = { -} -null._privelemdict = { -} -type_property_info._superclassnames = [] -type_property_info._privpropdict = { -} -type_property_info._privelemdict = { -} -type_parameter_info._superclassnames = [] -type_parameter_info._privpropdict = { -} -type_parameter_info._privelemdict = { -} -bounding_rectangle._superclassnames = [] -bounding_rectangle._privpropdict = { -} -bounding_rectangle._privelemdict = { -} -small_integer._superclassnames = [] -small_integer._privpropdict = { -} -small_integer._privelemdict = { -} -small_real._superclassnames = [] -small_real._privpropdict = { -} -small_real._privelemdict = { -} -scrap_styles._superclassnames = [] -scrap_styles._privpropdict = { -} -scrap_styles._privelemdict = { -} -type_suite_info._superclassnames = [] -type_suite_info._privpropdict = { -} -type_suite_info._privelemdict = { -} -target_id._superclassnames = [] -target_id._privpropdict = { -} -target_id._privelemdict = { -} -dash_style._superclassnames = [] -dash_style._privpropdict = { -} -dash_style._privelemdict = { -} -pixel_map_record._superclassnames = [] -pixel_map_record._privpropdict = { -} -pixel_map_record._privelemdict = { -} -RGB16_color._superclassnames = [] -RGB16_color._privpropdict = { -} -RGB16_color._privelemdict = { -} -RGB96_color._superclassnames = [] -RGB96_color._privpropdict = { -} -RGB96_color._privelemdict = { -} -rotation._superclassnames = [] -rotation._privpropdict = { -} -rotation._privelemdict = { -} -version._superclassnames = [] -version._privpropdict = { -} -version._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'EPS ' : PostScript_picture, - 'QDpt' : point, - 'TEXT' : string, - 'TIFF' : TIFF_picture, - 'aete' : application_dictionary, - 'aeut' : system_dictionary, - 'clrt' : color_table, - 'cmen' : menu_item, - 'cmnu' : menu, - 'comp' : double_integer, - 'elin' : type_element_info, - 'evin' : type_event_info, - 'exte' : extended_real, - 'fixd' : fixed, - 'fpnt' : fixed_point, - 'frct' : fixed_rectangle, - 'gcli' : type_class_info, - 'insl' : location_reference, - 'lfpt' : long_fixed_point, - 'lfrc' : long_fixed_rectangle, - 'lfxd' : long_fixed, - 'lpnt' : long_point, - 'lrct' : long_rectangle, - 'mLoc' : machine_location, - 'magn' : unsigned_integer, - 'null' : null, - 'pinf' : type_property_info, - 'pmin' : type_parameter_info, - 'qdrt' : bounding_rectangle, - 'shor' : small_integer, - 'sing' : small_real, - 'styl' : scrap_styles, - 'suin' : type_suite_info, - 'targ' : target_id, - 'tdas' : dash_style, - 'tpmm' : pixel_map_record, - 'tr16' : RGB16_color, - 'tr96' : RGB96_color, - 'trot' : rotation, - 'vers' : version, -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/__init__.py deleted file mode 100644 index b80e3bacc..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/StdSuites/__init__.py +++ /dev/null @@ -1,471 +0,0 @@ -""" -Package generated from /Volumes/Sap/System Folder/Extensions/AppleScript -Resource aeut resid 0 Standard Event Suites for English -""" -import aetools -Error = aetools.Error -import Text_Suite -import AppleScript_Suite -import Standard_Suite -import Macintosh_Connectivity_Clas -import QuickDraw_Graphics_Suite -import QuickDraw_Graphics_Suppleme -import Required_Suite -import Table_Suite -import Type_Names_Suite - - -_code_to_module = { - 'TEXT' : Text_Suite, - 'ascr' : AppleScript_Suite, - 'core' : Standard_Suite, - 'macc' : Macintosh_Connectivity_Clas, - 'qdrw' : QuickDraw_Graphics_Suite, - 'qdsp' : QuickDraw_Graphics_Suppleme, - 'reqd' : Required_Suite, - 'tbls' : Table_Suite, - 'tpnm' : Type_Names_Suite, -} - - - -_code_to_fullname = { - 'TEXT' : ('StdSuites.Text_Suite', 'Text_Suite'), - 'ascr' : ('StdSuites.AppleScript_Suite', 'AppleScript_Suite'), - 'core' : ('StdSuites.Standard_Suite', 'Standard_Suite'), - 'macc' : ('StdSuites.Macintosh_Connectivity_Clas', 'Macintosh_Connectivity_Clas'), - 'qdrw' : ('StdSuites.QuickDraw_Graphics_Suite', 'QuickDraw_Graphics_Suite'), - 'qdsp' : ('StdSuites.QuickDraw_Graphics_Suppleme', 'QuickDraw_Graphics_Suppleme'), - 'reqd' : ('StdSuites.Required_Suite', 'Required_Suite'), - 'tbls' : ('StdSuites.Table_Suite', 'Table_Suite'), - 'tpnm' : ('StdSuites.Type_Names_Suite', 'Type_Names_Suite'), -} - -from Text_Suite import * -from AppleScript_Suite import * -from Standard_Suite import * -from Macintosh_Connectivity_Clas import * -from QuickDraw_Graphics_Suite import * -from QuickDraw_Graphics_Suppleme import * -from Required_Suite import * -from Table_Suite import * -from Type_Names_Suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(graphic_group) -getbaseclasses(oval) -getbaseclasses(graphic_text) -getbaseclasses(graphic_shape) -getbaseclasses(drawing_area) -getbaseclasses(graphic_line) -getbaseclasses(polygon) -getbaseclasses(pixel) -getbaseclasses(rounded_rectangle) -getbaseclasses(graphic_object) -getbaseclasses(arc) -getbaseclasses(pixel_map) -getbaseclasses(rectangle) -getbaseclasses(selection_2d_object) -getbaseclasses(application) -getbaseclasses(document) -getbaseclasses(window) -getbaseclasses(file) -getbaseclasses(alias) -getbaseclasses(insertion_point) -getbaseclasses(character) -getbaseclasses(paragraph) -getbaseclasses(word) -getbaseclasses(text_flow) -getbaseclasses(text_style_info) -getbaseclasses(line) -getbaseclasses(text) -getbaseclasses(AppleTalk_address) -getbaseclasses(address_specification) -getbaseclasses(Token_Ring_address) -getbaseclasses(FireWire_address) -getbaseclasses(bus_slot) -getbaseclasses(SCSI_address) -getbaseclasses(ADB_address) -getbaseclasses(USB_address) -getbaseclasses(device_specification) -getbaseclasses(LocalTalk_address) -getbaseclasses(IP_address) -getbaseclasses(Ethernet_address) -getbaseclasses(graphic_group) -getbaseclasses(drawing_area) -getbaseclasses(cell) -getbaseclasses(column) -getbaseclasses(table) -getbaseclasses(row) -getbaseclasses(small_integer) -getbaseclasses(system_dictionary) -getbaseclasses(color_table) -getbaseclasses(fixed_point) -getbaseclasses(plain_text) -getbaseclasses(type_element_info) -getbaseclasses(machine_location) -getbaseclasses(PostScript_picture) -getbaseclasses(type_suite_info) -getbaseclasses(menu_item) -getbaseclasses(pixel_map_record) -getbaseclasses(small_real) -getbaseclasses(null) -getbaseclasses(rotation) -getbaseclasses(fixed) -getbaseclasses(long_point) -getbaseclasses(target_id) -getbaseclasses(type_property_info) -getbaseclasses(type_parameter_info) -getbaseclasses(long_fixed_point) -getbaseclasses(bounding_rectangle) -getbaseclasses(TIFF_picture) -getbaseclasses(long_fixed) -getbaseclasses(location_reference) -getbaseclasses(version) -getbaseclasses(RGB16_color) -getbaseclasses(double_integer) -getbaseclasses(type_event_info) -getbaseclasses(point) -getbaseclasses(application_dictionary) -getbaseclasses(unsigned_integer) -getbaseclasses(menu) -getbaseclasses(fixed_rectangle) -getbaseclasses(long_fixed_rectangle) -getbaseclasses(type_class_info) -getbaseclasses(RGB96_color) -getbaseclasses(dash_style) -getbaseclasses(scrap_styles) -getbaseclasses(extended_real) -getbaseclasses(long_rectangle) -getbaseclasses(May) -getbaseclasses(string) -getbaseclasses(miles) -getbaseclasses(number_or_date) -getbaseclasses(October) -getbaseclasses(event) -getbaseclasses(Pascal_string) -getbaseclasses(zone) -getbaseclasses(picture) -getbaseclasses(list_or_string) -getbaseclasses(number) -getbaseclasses(Tuesday) -getbaseclasses(version) -getbaseclasses(December) -getbaseclasses(square_kilometres) -getbaseclasses(reference) -getbaseclasses(vector) -getbaseclasses(weekday) -getbaseclasses(Sunday) -getbaseclasses(international_text) -getbaseclasses(seconds) -getbaseclasses(RGB_color) -getbaseclasses(kilometres) -getbaseclasses(styled_Unicode_text) -getbaseclasses(missing_value) -getbaseclasses(metres) -getbaseclasses(number_or_string) -getbaseclasses(list) -getbaseclasses(linked_list) -getbaseclasses(real) -getbaseclasses(encoded_string) -getbaseclasses(list_or_record) -getbaseclasses(Monday) -getbaseclasses(September) -getbaseclasses(anything) -getbaseclasses(property) -getbaseclasses(reference_form) -getbaseclasses(item) -getbaseclasses(grams) -getbaseclasses(record) -getbaseclasses(empty_ae_name_) -getbaseclasses(constant) -getbaseclasses(square_miles) -getbaseclasses(data) -getbaseclasses(Unicode_text) -getbaseclasses(yards) -getbaseclasses(cubic_yards) -getbaseclasses(pounds) -getbaseclasses(cubic_centimetres) -getbaseclasses(text) -getbaseclasses(July) -getbaseclasses(cubic_metres) -getbaseclasses(styled_text) -getbaseclasses(number_2c__date_or_text) -getbaseclasses(feet) -getbaseclasses(February) -getbaseclasses(degrees_Celsius) -getbaseclasses(keystroke) -getbaseclasses(integer) -getbaseclasses(degrees_Fahrenheit) -getbaseclasses(list_2c__record_or_text) -getbaseclasses(date) -getbaseclasses(degrees_Kelvin) -getbaseclasses(centimetres) -getbaseclasses(writing_code) -getbaseclasses(alias_or_string) -getbaseclasses(writing_code_info) -getbaseclasses(text_item) -getbaseclasses(machine) -getbaseclasses(type_class) -getbaseclasses(preposition) -getbaseclasses(Wednesday) -getbaseclasses(upper_case) -getbaseclasses(March) -getbaseclasses(square_feet) -getbaseclasses(November) -getbaseclasses(quarts) -getbaseclasses(alias) -getbaseclasses(January) -getbaseclasses(month) -getbaseclasses(June) -getbaseclasses(August) -getbaseclasses(styled_Clipboard_text) -getbaseclasses(gallons) -getbaseclasses(cubic_inches) -getbaseclasses(Friday) -getbaseclasses(sound) -getbaseclasses(class_) -getbaseclasses(kilograms) -getbaseclasses(script) -getbaseclasses(litres) -getbaseclasses(boolean) -getbaseclasses(square_metres) -getbaseclasses(inches) -getbaseclasses(character) -getbaseclasses(April) -getbaseclasses(ounces) -getbaseclasses(app) -getbaseclasses(handler) -getbaseclasses(C_string) -getbaseclasses(Thursday) -getbaseclasses(square_yards) -getbaseclasses(cubic_feet) -getbaseclasses(Saturday) -getbaseclasses(file_specification) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cpic' : graphic_group, - 'covl' : oval, - 'cgtx' : graphic_text, - 'cgsh' : graphic_shape, - 'cdrw' : drawing_area, - 'glin' : graphic_line, - 'cpgn' : polygon, - 'cpxl' : pixel, - 'crrc' : rounded_rectangle, - 'cgob' : graphic_object, - 'carc' : arc, - 'cpix' : pixel_map, - 'crec' : rectangle, - 'csel' : selection_2d_object, - 'capp' : application, - 'docu' : document, - 'cwin' : window, - 'file' : file, - 'alis' : alias, - 'cins' : insertion_point, - 'cha ' : character, - 'cpar' : paragraph, - 'cwor' : word, - 'cflo' : text_flow, - 'tsty' : text_style_info, - 'clin' : line, - 'ctxt' : text, - 'cat ' : AppleTalk_address, - 'cadr' : address_specification, - 'ctok' : Token_Ring_address, - 'cfw ' : FireWire_address, - 'cbus' : bus_slot, - 'cscs' : SCSI_address, - 'cadb' : ADB_address, - 'cusb' : USB_address, - 'cdev' : device_specification, - 'clt ' : LocalTalk_address, - 'cip ' : IP_address, - 'cen ' : Ethernet_address, - 'cpic' : graphic_group, - 'cdrw' : drawing_area, - 'ccel' : cell, - 'ccol' : column, - 'ctbl' : table, - 'crow' : row, - 'shor' : small_integer, - 'aeut' : system_dictionary, - 'clrt' : color_table, - 'fpnt' : fixed_point, - 'TEXT' : plain_text, - 'elin' : type_element_info, - 'mLoc' : machine_location, - 'EPS ' : PostScript_picture, - 'suin' : type_suite_info, - 'cmen' : menu_item, - 'tpmm' : pixel_map_record, - 'sing' : small_real, - 'null' : null, - 'trot' : rotation, - 'fixd' : fixed, - 'lpnt' : long_point, - 'targ' : target_id, - 'pinf' : type_property_info, - 'pmin' : type_parameter_info, - 'lfpt' : long_fixed_point, - 'qdrt' : bounding_rectangle, - 'TIFF' : TIFF_picture, - 'lfxd' : long_fixed, - 'insl' : location_reference, - 'vers' : version, - 'tr16' : RGB16_color, - 'comp' : double_integer, - 'evin' : type_event_info, - 'QDpt' : point, - 'aete' : application_dictionary, - 'magn' : unsigned_integer, - 'cmnu' : menu, - 'frct' : fixed_rectangle, - 'lfrc' : long_fixed_rectangle, - 'gcli' : type_class_info, - 'tr96' : RGB96_color, - 'tdas' : dash_style, - 'styl' : scrap_styles, - 'exte' : extended_real, - 'lrct' : long_rectangle, - 'may ' : May, - 'TEXT' : string, - 'mile' : miles, - 'nd ' : number_or_date, - 'oct ' : October, - 'evnt' : event, - 'pstr' : Pascal_string, - 'zone' : zone, - 'PICT' : picture, - 'ls ' : list_or_string, - 'nmbr' : number, - 'tue ' : Tuesday, - 'vers' : version, - 'dec ' : December, - 'sqkm' : square_kilometres, - 'obj ' : reference, - 'vect' : vector, - 'wkdy' : weekday, - 'sun ' : Sunday, - 'itxt' : international_text, - 'scnd' : seconds, - 'cRGB' : RGB_color, - 'kmtr' : kilometres, - 'sutx' : styled_Unicode_text, - 'msng' : missing_value, - 'metr' : metres, - 'ns ' : number_or_string, - 'list' : list, - 'llst' : linked_list, - 'doub' : real, - 'encs' : encoded_string, - 'lr ' : list_or_record, - 'mon ' : Monday, - 'sep ' : September, - '****' : anything, - 'prop' : property, - 'kfrm' : reference_form, - 'cobj' : item, - 'gram' : grams, - 'reco' : record, - 'undf' : empty_ae_name_, - 'enum' : constant, - 'sqmi' : square_miles, - 'rdat' : data, - 'utxt' : Unicode_text, - 'yard' : yards, - 'cyrd' : cubic_yards, - 'lbs ' : pounds, - 'ccmt' : cubic_centimetres, - 'ctxt' : text, - 'jul ' : July, - 'cmet' : cubic_metres, - 'STXT' : styled_text, - 'nds ' : number_2c__date_or_text, - 'feet' : feet, - 'feb ' : February, - 'degc' : degrees_Celsius, - 'kprs' : keystroke, - 'long' : integer, - 'degf' : degrees_Fahrenheit, - 'lrs ' : list_2c__record_or_text, - 'ldt ' : date, - 'degk' : degrees_Kelvin, - 'cmtr' : centimetres, - 'psct' : writing_code, - 'sf ' : alias_or_string, - 'citl' : writing_code_info, - 'citm' : text_item, - 'mach' : machine, - 'type' : type_class, - 'prep' : preposition, - 'wed ' : Wednesday, - 'case' : upper_case, - 'mar ' : March, - 'sqft' : square_feet, - 'nov ' : November, - 'qrts' : quarts, - 'alis' : alias, - 'jan ' : January, - 'mnth' : month, - 'jun ' : June, - 'aug ' : August, - 'styl' : styled_Clipboard_text, - 'galn' : gallons, - 'cuin' : cubic_inches, - 'fri ' : Friday, - 'snd ' : sound, - 'pcls' : class_, - 'kgrm' : kilograms, - 'scpt' : script, - 'litr' : litres, - 'bool' : boolean, - 'sqrm' : square_metres, - 'inch' : inches, - 'cha ' : character, - 'apr ' : April, - 'ozs ' : ounces, - 'capp' : app, - 'hand' : handler, - 'cstr' : C_string, - 'thu ' : Thursday, - 'sqyd' : square_yards, - 'cfet' : cubic_feet, - 'sat ' : Saturday, - 'fss ' : file_specification, -} - - -class StdSuites(Text_Suite_Events, - AppleScript_Suite_Events, - Standard_Suite_Events, - Macintosh_Connectivity_Clas_Events, - QuickDraw_Graphics_Suite_Events, - QuickDraw_Graphics_Suppleme_Events, - Required_Suite_Events, - Table_Suite_Events, - Type_Names_Suite_Events, - aetools.TalkTo): - _signature = 'ascr' - - _moduleName = 'StdSuites' diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py deleted file mode 100644 index a9ac3dd27..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py +++ /dev/null @@ -1,381 +0,0 @@ -"""Suite Disk-Folder-File Suite: Terms and Events for controlling Disks, Folders, and Files -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'cdis' - -class Disk_Folder_File_Suite_Events: - - _argmap_move = { - 'to' : 'insh', - } - - def move(self, _object, _attributes={}, **_arguments): - """move: Move disk item(s) to a new location. - Required argument: the object for the command - Keyword argument to: The new location for the disk item(s). - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'move' - - aetools.keysubst(_arguments, self._argmap_move) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The Disk-Folder-File Suite host program """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_folder_actions_enabled(aetools.NProperty): - """folder actions enabled - Are Folder Actions currently being processed? """ - which = 'faen' - want = 'bool' -folder_actions_enabled = _Prop_folder_actions_enabled() -class _Prop_properties(aetools.NProperty): - """properties - every property of the Disk-Folder-File Suite host program """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class disk(aetools.ComponentItem): - """disk - A disk in the file system """ - want = 'cdis' -class _Prop_POSIX_path(aetools.NProperty): - """POSIX path - the POSIX file system path of the disk """ - which = 'posx' - want = 'utxt' -class _Prop_capacity(aetools.NProperty): - """capacity - the total number of bytes (free or used) on the disk """ - which = 'capa' - want = 'magn' -class _Prop_ejectable(aetools.NProperty): - """ejectable - Can the media be ejected (floppies, CD's, and so on)? """ - which = 'isej' - want = 'bool' -class _Prop_format(aetools.NProperty): - """format - the file system format of this disk """ - which = 'dfmt' - want = 'edfm' -class _Prop_free_space(aetools.NProperty): - """free space - the number of free bytes left on the disk """ - which = 'frsp' - want = 'magn' -class _Prop_ignore_privileges(aetools.NProperty): - """ignore privileges - Ignore permissions on this disk? """ - which = 'igpr' - want = 'bool' -class _Prop_local_volume(aetools.NProperty): - """local volume - Is the media a local volume (as opposed to a file server? """ - which = 'isrv' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the name of the disk """ - which = 'pnam' - want = 'utxt' -class _Prop_path(aetools.NProperty): - """path - the file system path of the disk """ - which = 'ppth' - want = 'utxt' -class _Prop_startup(aetools.NProperty): - """startup - Is this disk the boot disk? """ - which = 'istd' - want = 'bool' -class _Prop_volume(aetools.NProperty): - """volume - the volume on which the folder resides """ - which = 'volu' - want = 'utxt' -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] - -disks = disk - -class folder(aetools.ComponentItem): - """folder - A folder in the file system """ - want = 'cfol' -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] - -folders = folder - -class item(aetools.ComponentItem): - """item - An item in the file system """ - want = 'cobj' -class _Prop_busy_status(aetools.NProperty): - """busy status - Is the item busy? """ - which = 'busy' - want = 'bool' -class _Prop_creation_date(aetools.NProperty): - """creation date - the date on which the item was created """ - which = 'ascd' - want = '****' -class _Prop_modification_date(aetools.NProperty): - """modification date - the date on which the item was last modified """ - which = 'asmo' - want = '****' -class _Prop_name_extension(aetools.NProperty): - """name extension - the extension portion of the name """ - which = 'extn' - want = 'utxt' -class _Prop_package_folder(aetools.NProperty): - """package folder - Is the item a package? """ - which = 'pkgf' - want = 'bool' -class _Prop_url(aetools.NProperty): - """url - the url of the item """ - which = 'url ' - want = 'utxt' -class _Prop_visible(aetools.NProperty): - """visible - Is the item visible? """ - which = 'visi' - want = 'bool' -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] - -items = item - -class file(aetools.ComponentItem): - """file - A file in the file system """ - want = 'file' -class _Prop_creator_type(aetools.NProperty): - """creator type - the OSType identifying the application that created the item """ - which = 'fcrt' - want = 'utxt' -class _Prop_file_type(aetools.NProperty): - """file type - the OSType identifying the type of data contained in the item """ - which = 'asty' - want = 'utxt' -class _Prop_physical_size(aetools.NProperty): - """physical size - the actual space used by the file on disk """ - which = 'phys' - want = 'magn' -class _Prop_product_version(aetools.NProperty): - """product version - the version of the product (visible at the top of the ?et Info?window) """ - which = 'ver2' - want = 'utxt' -class _Prop_size(aetools.NProperty): - """size - the logical size of the file """ - which = 'ptsz' - want = 'magn' -class _Prop_stationery(aetools.NProperty): - """stationery - Is the file a stationery pad? """ - which = 'pspd' - want = 'bool' -class _Prop_version(aetools.NProperty): - """version - the version of the file (visible at the bottom of the ?et Info?window) """ - which = 'vers' - want = 'utxt' -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] - -files = file -application._superclassnames = [] -import Standard_Suite -import Folder_Actions_Suite -import Login_Items_Suite -import Processes_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'folder_actions_enabled' : _Prop_folder_actions_enabled, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'application_process' : Processes_Suite.application_process, - 'desk_accessory_process' : Processes_Suite.desk_accessory_process, - 'disk' : disk, - 'document' : Standard_Suite.document, - 'file' : file, - 'folder' : folder, - 'folder_action' : Folder_Actions_Suite.folder_action, - 'item' : item, - 'login_item' : Login_Items_Suite.login_item, - 'process' : Processes_Suite.process, - 'window' : Standard_Suite.window, -} -disk._superclassnames = ['item'] -disk._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'capacity' : _Prop_capacity, - 'ejectable' : _Prop_ejectable, - 'format' : _Prop_format, - 'free_space' : _Prop_free_space, - 'ignore_privileges' : _Prop_ignore_privileges, - 'local_volume' : _Prop_local_volume, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'properties' : _Prop_properties, - 'startup' : _Prop_startup, - 'volume' : _Prop_volume, -} -disk._privelemdict = { - 'file' : file, - 'folder' : folder, - 'item' : item, -} -folder._superclassnames = ['item'] -folder._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'properties' : _Prop_properties, - 'volume' : _Prop_volume, -} -folder._privelemdict = { - 'file' : file, - 'file' : file, - 'folder' : folder, - 'folder' : folder, - 'item' : item, - 'item' : item, -} -item._superclassnames = [] -item._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'busy_status' : _Prop_busy_status, - 'creation_date' : _Prop_creation_date, - 'modification_date' : _Prop_modification_date, - 'name' : _Prop_name, - 'name_extension' : _Prop_name_extension, - 'package_folder' : _Prop_package_folder, - 'path' : _Prop_path, - 'properties' : _Prop_properties, - 'url' : _Prop_url, - 'visible' : _Prop_visible, - 'volume' : _Prop_volume, -} -item._privelemdict = { - 'file' : file, - 'folder' : folder, - 'item' : item, -} -file._superclassnames = ['item'] -file._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'creator_type' : _Prop_creator_type, - 'file_type' : _Prop_file_type, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'physical_size' : _Prop_physical_size, - 'product_version' : _Prop_product_version, - 'properties' : _Prop_properties, - 'size' : _Prop_size, - 'stationery' : _Prop_stationery, - 'version' : _Prop_version, - 'volume' : _Prop_volume, -} -file._privelemdict = { - 'file' : file, - 'folder' : folder, - 'item' : item, -} -_Enum_edfm = { - 'MS_2d_DOS_format' : 'dfms', # MS-DOS format - 'Apple_Photo_format' : 'dfph', # Apple Photo format - 'ISO_9660_format' : 'df96', # ISO 9660 format - 'QuickTake_format' : 'dfqt', # QuickTake format - 'AppleShare_format' : 'dfas', # AppleShare format - 'High_Sierra_format' : 'dfhs', # High Sierra format - 'Mac_OS_Extended_format' : 'dfh+', # Mac OS Extended format - 'UDF_format' : 'dfud', # UDF format - 'unknown_format' : 'df??', # unknown format - 'audio_format' : 'dfau', # audio format - 'Mac_OS_format' : 'dfhf', # Mac OS format - 'UFS_format' : 'dfuf', # UFS format - 'NFS_format' : 'dfnf', # NFS format - 'ProDOS_format' : 'dfpr', # ProDOS format - 'WebDAV_format' : 'dfwd', # WebDAV format -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cdis' : disk, - 'cfol' : folder, - 'cobj' : item, - 'file' : file, -} - -_propdeclarations = { - 'ascd' : _Prop_creation_date, - 'asmo' : _Prop_modification_date, - 'asty' : _Prop_file_type, - 'busy' : _Prop_busy_status, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'capa' : _Prop_capacity, - 'dfmt' : _Prop_format, - 'extn' : _Prop_name_extension, - 'faen' : _Prop_folder_actions_enabled, - 'fcrt' : _Prop_creator_type, - 'frsp' : _Prop_free_space, - 'igpr' : _Prop_ignore_privileges, - 'isej' : _Prop_ejectable, - 'isrv' : _Prop_local_volume, - 'istd' : _Prop_startup, - 'pALL' : _Prop_properties, - 'phys' : _Prop_physical_size, - 'pkgf' : _Prop_package_folder, - 'pnam' : _Prop_name, - 'posx' : _Prop_POSIX_path, - 'ppth' : _Prop_path, - 'pspd' : _Prop_stationery, - 'ptsz' : _Prop_size, - 'url ' : _Prop_url, - 'ver2' : _Prop_product_version, - 'vers' : _Prop_version, - 'visi' : _Prop_visible, - 'volu' : _Prop_volume, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'edfm' : _Enum_edfm, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py deleted file mode 100644 index c2c7e5e03..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py +++ /dev/null @@ -1,287 +0,0 @@ -"""Suite Folder Actions Suite: Terms and Events for controlling Folder Actions -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'faco' - -class Folder_Actions_Suite_Events: - - _argmap_attach_action_to = { - 'using' : 'faal', - } - - def attach_action_to(self, _object, _attributes={}, **_arguments): - """attach action to: Attach an action to a folder - Required argument: the object for the command - Keyword argument using: a file containing the script to attach - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'faco' - _subcode = 'atfa' - - aetools.keysubst(_arguments, self._argmap_attach_action_to) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def attached_scripts(self, _object, _attributes={}, **_arguments): - """attached scripts: List the actions attached to a folder - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'faco' - _subcode = 'lact' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_do_folder_action = { - 'with_window_size' : 'fnsz', - 'with_item_list' : 'flst', - 'folder_action_code' : 'actn', - } - - def do_folder_action(self, _object, _attributes={}, **_arguments): - """do folder action: Event the Finder sends to the Folder Actions FBA - Required argument: the object for the command - Keyword argument with_window_size: the new window size for the folder action message to process - Keyword argument with_item_list: a list of items for the folder action message to process - Keyword argument folder_action_code: the folder action message to process - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'faco' - _subcode = 'fola' - - aetools.keysubst(_arguments, self._argmap_do_folder_action) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'actn', _Enum_actn) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_edit_action_of = { - 'using_action_name' : 'snam', - 'using_action_number' : 'indx', - } - - def edit_action_of(self, _object, _attributes={}, **_arguments): - """edit action of: Edit as action of a folder - Required argument: the object for the command - Keyword argument using_action_name: ...or the name of the action to edit - Keyword argument using_action_number: the index number of the action to edit... - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'faco' - _subcode = 'edfa' - - aetools.keysubst(_arguments, self._argmap_edit_action_of) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_remove_action_from = { - 'using_action_name' : 'snam', - 'using_action_number' : 'indx', - } - - def remove_action_from(self, _object, _attributes={}, **_arguments): - """remove action from: Remove a folder action from a folder - Required argument: the object for the command - Keyword argument using_action_name: ...or the name of the action to remove - Keyword argument using_action_number: the index number of the action to remove... - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'faco' - _subcode = 'rmfa' - - aetools.keysubst(_arguments, self._argmap_remove_action_from) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The Folder Actions Suite host program """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_folder_actions_enabled(aetools.NProperty): - """folder actions enabled - Are Folder Actions currently being processed? """ - which = 'faen' - want = 'bool' -folder_actions_enabled = _Prop_folder_actions_enabled() -class _Prop_properties(aetools.NProperty): - """properties - every property of the Folder Actions Suite host program """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class folder_action(aetools.ComponentItem): - """folder action - An action attached to a folder in the file system """ - want = 'foac' -class _Prop_name(aetools.NProperty): - """name - the name of the folder action, which is also the name of the folder """ - which = 'pnam' - want = 'utxt' -class _Prop_path(aetools.NProperty): - """path - the path to the folder to which the folder action applies """ - which = 'ppth' - want = '****' -class _Prop_volume(aetools.NProperty): - """volume - the volume on which the folder action resides """ - which = 'volu' - want = 'utxt' -# element 'scpt' as ['name', 'indx', 'rele', 'rang', 'test'] - -folder_actions = folder_action - -class script(aetools.ComponentItem): - """script - A script invoked by a folder action """ - want = 'scpt' -class _Prop_POSIX_path(aetools.NProperty): - """POSIX path - the POSIX file system path of the disk """ - which = 'posx' - want = 'utxt' - -scripts = script -application._superclassnames = [] -import Disk_Folder_File_Suite -import Standard_Suite -import Login_Items_Suite -import Processes_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'folder_actions_enabled' : _Prop_folder_actions_enabled, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'application_process' : Processes_Suite.application_process, - 'desk_accessory_process' : Processes_Suite.desk_accessory_process, - 'disk' : Disk_Folder_File_Suite.disk, - 'document' : Standard_Suite.document, - 'file' : Disk_Folder_File_Suite.file, - 'folder' : Disk_Folder_File_Suite.folder, - 'folder_action' : folder_action, - 'item' : Disk_Folder_File_Suite.item, - 'login_item' : Login_Items_Suite.login_item, - 'process' : Processes_Suite.process, - 'window' : Standard_Suite.window, -} -folder_action._superclassnames = ['item'] -folder_action._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'properties' : _Prop_properties, - 'volume' : _Prop_volume, -} -folder_action._privelemdict = { - 'script' : script, -} -script._superclassnames = ['item'] -script._privpropdict = { - 'POSIX_path' : _Prop_POSIX_path, - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'name' : _Prop_name, - 'path' : _Prop_path, - 'properties' : _Prop_properties, -} -script._privelemdict = { -} -_Enum_actn = { - 'items_added' : 'fget', # items added - 'items_removed' : 'flos', # items removed - 'window_closed' : 'fclo', # window closed - 'window_moved' : 'fsiz', # window moved - 'window_opened' : 'fopn', # window opened -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'foac' : folder_action, - 'scpt' : script, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'faen' : _Prop_folder_actions_enabled, - 'pALL' : _Prop_properties, - 'pnam' : _Prop_name, - 'posx' : _Prop_POSIX_path, - 'ppth' : _Prop_path, - 'volu' : _Prop_volume, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'actn' : _Enum_actn, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Hidden_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Hidden_Suite.py deleted file mode 100644 index e80ace1e5..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Hidden_Suite.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Suite Hidden Suite: Hidden Terms and Events for controlling the System Events application -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'tpnm' - -from StdSuites.Type_Names_Suite import * -class Hidden_Suite_Events(Type_Names_Suite_Events): - - def do_script(self, _object, _attributes={}, **_arguments): - """do script: Execute an OSA script. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'dosc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Login_Items_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Login_Items_Suite.py deleted file mode 100644 index ed0924515..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Login_Items_Suite.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Suite Login Items Suite: Terms and Events for controlling the Login Items application -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'logi' - -class Login_Items_Suite_Events: - - pass - - -class login_item(aetools.ComponentItem): - """login item - an item to be launched or opened at login """ - want = 'logi' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'cobj' -class _Prop_hidden(aetools.NProperty): - """hidden - Is the Login Item hidden when launched? """ - which = 'hidn' - want = 'bool' -class _Prop_kind(aetools.NProperty): - """kind - the file type of the Login Item """ - which = 'kind' - want = 'utxt' -class _Prop_name(aetools.NProperty): - """name - the name of the Login Item """ - which = 'pnam' - want = 'utxt' -class _Prop_path(aetools.NProperty): - """path - the file system path to the Login Item """ - which = 'ppth' - want = 'utxt' - -login_items = login_item -import Standard_Suite -login_item._superclassnames = ['item'] -login_item._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'hidden' : _Prop_hidden, - 'kind' : _Prop_kind, - 'name' : _Prop_name, - 'path' : _Prop_path, -} -login_item._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'logi' : login_item, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'hidn' : _Prop_hidden, - 'kind' : _Prop_kind, - 'pnam' : _Prop_name, - 'ppth' : _Prop_path, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py deleted file mode 100644 index ef539b1e0..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py +++ /dev/null @@ -1,149 +0,0 @@ -"""Suite Power Suite: Terms and Events for controlling System power -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'powr' - -class Power_Suite_Events: - - def restart(self, _object, _attributes={}, **_arguments): - """restart: Restart the computer - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'rest' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def shut_down(self, _object, _attributes={}, **_arguments): - """shut down: Shut Down the computer - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'shut' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def sleep(self, _object, _attributes={}, **_arguments): - """sleep: Put the computer to sleep - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'fndr' - _subcode = 'slep' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The System Events application """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_folder_actions_enabled(aetools.NProperty): - """folder actions enabled - Are Folder Actions currently being processed? """ - which = 'faen' - want = 'bool' -folder_actions_enabled = _Prop_folder_actions_enabled() -class _Prop_properties(aetools.NProperty): - """properties - every property of the System Events application """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application -application._superclassnames = [] -import Disk_Folder_File_Suite -import Standard_Suite -import Folder_Actions_Suite -import Login_Items_Suite -import Processes_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'folder_actions_enabled' : _Prop_folder_actions_enabled, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'application_process' : Processes_Suite.application_process, - 'desk_accessory_process' : Processes_Suite.desk_accessory_process, - 'disk' : Disk_Folder_File_Suite.disk, - 'document' : Standard_Suite.document, - 'file' : Disk_Folder_File_Suite.file, - 'folder' : Disk_Folder_File_Suite.folder, - 'folder_action' : Folder_Actions_Suite.folder_action, - 'item' : Disk_Folder_File_Suite.item, - 'login_item' : Login_Items_Suite.login_item, - 'process' : Processes_Suite.process, - 'window' : Standard_Suite.window, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'faen' : _Prop_folder_actions_enabled, - 'pALL' : _Prop_properties, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Processes_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Processes_Suite.py deleted file mode 100644 index 9dcb85fb2..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Processes_Suite.py +++ /dev/null @@ -1,214 +0,0 @@ -"""Suite Processes Suite: Terms and Events for controlling Processes -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'prcs' - -class Processes_Suite_Events: - - pass - - -class application(aetools.ComponentItem): - """application - The Processes Suite host program """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_folder_actions_enabled(aetools.NProperty): - """folder actions enabled - Are Folder Actions currently being processed? """ - which = 'faen' - want = 'bool' -folder_actions_enabled = _Prop_folder_actions_enabled() -class _Prop_properties(aetools.NProperty): - """properties - every property of the Processes Suite host program """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class application_process(aetools.ComponentItem): - """application process - A process launched from an application file """ - want = 'pcap' -class _Prop_application_file(aetools.NProperty): - """application file - a reference to the application file from which this process was launched """ - which = 'appf' - want = '****' - -application_processes = application_process - -class desk_accessory_process(aetools.ComponentItem): - """desk accessory process - A process launched from an desk accessory file """ - want = 'pcda' -class _Prop_desk_accessory_file(aetools.NProperty): - """desk accessory file - a reference to the desk accessory file from which this process was launched """ - which = 'dafi' - want = '****' - -desk_accessory_processes = desk_accessory_process - -class process(aetools.ComponentItem): - """process - A process running on this computer """ - want = 'prcs' -class _Prop_accepts_high_level_events(aetools.NProperty): - """accepts high level events - Is the process high-level event aware (accepts open application, open document, print document, and quit)? """ - which = 'isab' - want = 'bool' -class _Prop_accepts_remote_events(aetools.NProperty): - """accepts remote events - Does the process accept remote events? """ - which = 'revt' - want = 'bool' -class _Prop_classic(aetools.NProperty): - """classic - Is the process running in the Classic environment? """ - which = 'clsc' - want = 'bool' -class _Prop_creator_type(aetools.NProperty): - """creator type - the OSType of the creator of the process (the signature) """ - which = 'fcrt' - want = 'utxt' -class _Prop_file(aetools.NProperty): - """file - the file from which the process was launched """ - which = 'file' - want = '****' -class _Prop_file_type(aetools.NProperty): - """file type - the OSType of the file type of the process """ - which = 'asty' - want = 'utxt' -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is the process the frontmost process """ - which = 'pisf' - want = 'bool' -class _Prop_has_scripting_terminology(aetools.NProperty): - """has scripting terminology - Does the process have a scripting terminology, i.e., can it be scripted? """ - which = 'hscr' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the name of the process """ - which = 'pnam' - want = 'utxt' -class _Prop_partition_space_used(aetools.NProperty): - """partition space used - the number of bytes currently used in the process' partition """ - which = 'pusd' - want = 'magn' -class _Prop_total_partition_size(aetools.NProperty): - """total partition size - the size of the partition with which the process was launched """ - which = 'appt' - want = 'magn' -class _Prop_visible(aetools.NProperty): - """visible - Is the process' layer visible? """ - which = 'pvis' - want = 'bool' - -processes = process -application._superclassnames = [] -import Disk_Folder_File_Suite -import Standard_Suite -import Folder_Actions_Suite -import Login_Items_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'folder_actions_enabled' : _Prop_folder_actions_enabled, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'application_process' : application_process, - 'desk_accessory_process' : desk_accessory_process, - 'disk' : Disk_Folder_File_Suite.disk, - 'document' : Standard_Suite.document, - 'file' : Disk_Folder_File_Suite.file, - 'folder' : Disk_Folder_File_Suite.folder, - 'folder_action' : Folder_Actions_Suite.folder_action, - 'item' : Disk_Folder_File_Suite.item, - 'login_item' : Login_Items_Suite.login_item, - 'process' : process, - 'window' : Standard_Suite.window, -} -application_process._superclassnames = ['process'] -application_process._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'application_file' : _Prop_application_file, -} -application_process._privelemdict = { -} -desk_accessory_process._superclassnames = ['process'] -desk_accessory_process._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'desk_accessory_file' : _Prop_desk_accessory_file, -} -desk_accessory_process._privelemdict = { -} -process._superclassnames = ['item'] -process._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'accepts_high_level_events' : _Prop_accepts_high_level_events, - 'accepts_remote_events' : _Prop_accepts_remote_events, - 'classic' : _Prop_classic, - 'creator_type' : _Prop_creator_type, - 'file' : _Prop_file, - 'file_type' : _Prop_file_type, - 'frontmost' : _Prop_frontmost, - 'has_scripting_terminology' : _Prop_has_scripting_terminology, - 'name' : _Prop_name, - 'partition_space_used' : _Prop_partition_space_used, - 'properties' : _Prop_properties, - 'total_partition_size' : _Prop_total_partition_size, - 'visible' : _Prop_visible, -} -process._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'pcap' : application_process, - 'pcda' : desk_accessory_process, - 'prcs' : process, -} - -_propdeclarations = { - 'appf' : _Prop_application_file, - 'appt' : _Prop_total_partition_size, - 'asty' : _Prop_file_type, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'clsc' : _Prop_classic, - 'dafi' : _Prop_desk_accessory_file, - 'faen' : _Prop_folder_actions_enabled, - 'fcrt' : _Prop_creator_type, - 'file' : _Prop_file, - 'hscr' : _Prop_has_scripting_terminology, - 'isab' : _Prop_accepts_high_level_events, - 'pALL' : _Prop_properties, - 'pisf' : _Prop_frontmost, - 'pnam' : _Prop_name, - 'pusd' : _Prop_partition_space_used, - 'pvis' : _Prop_visible, - 'revt' : _Prop_accepts_remote_events, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py deleted file mode 100644 index f20ef8434..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py +++ /dev/null @@ -1,582 +0,0 @@ -"""Suite Standard Suite: Common classes and commands for most applications. -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = '????' - -class Standard_Suite_Events: - - _argmap_close = { - 'saving_in' : 'kfil', - 'saving' : 'savo', - } - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object. - Required argument: the object for the command - Keyword argument saving_in: The file in which to save the object. - Keyword argument saving: Specifies whether changes should be saved before closing. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - aetools.keysubst(_arguments, self._argmap_close) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_count = { - 'each' : 'kocl', - } - - def count(self, _object, _attributes={}, **_arguments): - """count: Return the number of elements of a particular class within an object. - Required argument: the object for the command - Keyword argument each: The class of objects to be counted. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'cnte' - - aetools.keysubst(_arguments, self._argmap_count) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def delete(self, _object, _attributes={}, **_arguments): - """delete: Delete an object. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'delo' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_duplicate = { - 'to' : 'insh', - 'with_properties' : 'prdt', - } - - def duplicate(self, _object, _attributes={}, **_arguments): - """duplicate: Copy object(s) and put the copies at a new location. - Required argument: the object for the command - Keyword argument to: The location for the new object(s). - Keyword argument with_properties: Properties to be set in the new duplicated object(s). - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clon' - - aetools.keysubst(_arguments, self._argmap_duplicate) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def exists(self, _object, _attributes={}, **_arguments): - """exists: Verify if an object exists. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'doex' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def get(self, _object, _attributes={}, **_arguments): - """get: Get the data for an object. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'getd' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'at' : 'insh', - 'new' : 'kocl', - 'with_data' : 'data', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: Make a new object. - Keyword argument at: The location at which to insert the object. - Keyword argument new: The class of the new object. - Keyword argument with_data: The initial data for the object. - Keyword argument with_properties: The initial values for properties of the object. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_move = { - 'to' : 'insh', - } - - def move(self, _object, _attributes={}, **_arguments): - """move: Move object(s) to a new location. - Required argument: the object for the command - Keyword argument to: The new location for the object(s). - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'move' - - aetools.keysubst(_arguments, self._argmap_move) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def open(self, _object=None, _attributes={}, **_arguments): - """open: Open an object. - Required argument: list of objects - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object=None, _attributes={}, **_arguments): - """print: Print an object. - Required argument: list of objects - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_quit = { - 'saving' : 'savo', - } - - def quit(self, _object, _attributes={}, **_arguments): - """quit: Quit an application. - Required argument: the object for the command - Keyword argument saving: Specifies whether changes should be saved before quitting. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - aetools.keysubst(_arguments, self._argmap_quit) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_save = { - 'in_' : 'kfil', - 'as' : 'fltp', - } - - def save(self, _object, _attributes={}, **_arguments): - """save: Save an object. - Required argument: the object for the command - Keyword argument in_: The file in which to save the object. - Keyword argument as: The file type in which to save the data. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'save' - - aetools.keysubst(_arguments, self._argmap_save) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_set = { - 'to' : 'data', - } - - def set(self, _object, _attributes={}, **_arguments): - """set: Set an object's data. - Required argument: the object for the command - Keyword argument to: The new value. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - aetools.keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - An application's top level scripting object. """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'cobj' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is this the frontmost (active) application? """ - which = 'pisf' - want = 'bool' -frontmost = _Prop_frontmost() -class _Prop_name(aetools.NProperty): - """name - The name of the application. """ - which = 'pnam' - want = 'utxt' -name = _Prop_name() -class _Prop_version(aetools.NProperty): - """version - The version of the application. """ - which = 'vers' - want = 'utxt' -version = _Prop_version() -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class item(aetools.ComponentItem): - """item - A scriptable object. """ - want = 'cobj' -class _Prop_class_(aetools.NProperty): - """class - The class of the object. """ - which = 'pcls' - want = 'type' -class _Prop_properties(aetools.NProperty): - """properties - All of the object's properties. """ - which = 'pALL' - want = 'reco' - -items = item - -class color(aetools.ComponentItem): - """color - A color. """ - want = 'colr' - -colors = color - -class window(aetools.ComponentItem): - """window - A window. """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - The bounding rectangle of the window. """ - which = 'pbnd' - want = 'qdrt' -class _Prop_closeable(aetools.NProperty): - """closeable - Whether the window has a close box. """ - which = 'hclb' - want = 'bool' -class _Prop_document(aetools.NProperty): - """document - The document whose contents are being displayed in the window. """ - which = 'docu' - want = 'docu' -class _Prop_floating(aetools.NProperty): - """floating - Whether the window floats. """ - which = 'isfl' - want = 'bool' -class _Prop_id(aetools.NProperty): - """id - The unique identifier of the window. """ - which = 'ID ' - want = 'long' -class _Prop_index(aetools.NProperty): - """index - The index of the window in the back-to-front window ordering. """ - which = 'pidx' - want = 'long' -class _Prop_miniaturizable(aetools.NProperty): - """miniaturizable - Whether the window can be miniaturized. """ - which = 'ismn' - want = 'bool' -class _Prop_miniaturized(aetools.NProperty): - """miniaturized - Whether the window is currently miniaturized. """ - which = 'pmnd' - want = 'bool' -class _Prop_modal(aetools.NProperty): - """modal - Whether the window is the application's current modal window. """ - which = 'pmod' - want = 'bool' -class _Prop_resizable(aetools.NProperty): - """resizable - Whether the window can be resized. """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Whether the window has a title bar. """ - which = 'ptit' - want = 'bool' -class _Prop_visible(aetools.NProperty): - """visible - Whether the window is currently visible. """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Whether the window can be zoomed. """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Whether the window is currently zoomed. """ - which = 'pzum' - want = 'bool' - -windows = window - -class document(aetools.ComponentItem): - """document - A document. """ - want = 'docu' -class _Prop_modified(aetools.NProperty): - """modified - Has the document been modified since the last save? """ - which = 'imod' - want = 'bool' -class _Prop_path(aetools.NProperty): - """path - The document's path. """ - which = 'ppth' - want = 'utxt' - -documents = document -application._superclassnames = ['item'] -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'frontmost' : _Prop_frontmost, - 'name' : _Prop_name, - 'version' : _Prop_version, -} -application._privelemdict = { - 'document' : document, - 'window' : window, -} -item._superclassnames = [] -item._privpropdict = { - 'class_' : _Prop_class_, - 'properties' : _Prop_properties, -} -item._privelemdict = { -} -color._superclassnames = ['item'] -color._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -color._privelemdict = { -} -window._superclassnames = ['item'] -window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'bounds' : _Prop_bounds, - 'closeable' : _Prop_closeable, - 'document' : _Prop_document, - 'floating' : _Prop_floating, - 'id' : _Prop_id, - 'index' : _Prop_index, - 'miniaturizable' : _Prop_miniaturizable, - 'miniaturized' : _Prop_miniaturized, - 'modal' : _Prop_modal, - 'name' : _Prop_name, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} -document._superclassnames = ['item'] -document._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'modified' : _Prop_modified, - 'name' : _Prop_name, - 'path' : _Prop_path, -} -document._privelemdict = { -} -class _3c_(aetools.NComparison): - """< - Less than """ -class _3d_(aetools.NComparison): - """= - Equal """ -class _3e_(aetools.NComparison): - """> - Greater than """ -class contains(aetools.NComparison): - """contains - Contains """ -class ends_with(aetools.NComparison): - """ends with - Ends with """ -class starts_with(aetools.NComparison): - """starts with - Starts with """ -class _b2_(aetools.NComparison): - """\xb2 - Less than or equal to """ -class _b3_(aetools.NComparison): - """\xb3 - Greater than or equal to """ -_Enum_savo = { - 'ask' : 'ask ', # Ask the user whether or not to save the file. - 'yes' : 'yes ', # Save the file. - 'no' : 'no ', # Do not save the file. -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cobj' : item, - 'colr' : color, - 'cwin' : window, - 'docu' : document, -} - -_propdeclarations = { - 'ID ' : _Prop_id, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'docu' : _Prop_document, - 'hclb' : _Prop_closeable, - 'imod' : _Prop_modified, - 'isfl' : _Prop_floating, - 'ismn' : _Prop_miniaturizable, - 'iszm' : _Prop_zoomable, - 'pALL' : _Prop_properties, - 'pbnd' : _Prop_bounds, - 'pcls' : _Prop_class_, - 'pidx' : _Prop_index, - 'pisf' : _Prop_frontmost, - 'pmnd' : _Prop_miniaturized, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'ppth' : _Prop_path, - 'prsz' : _Prop_resizable, - 'ptit' : _Prop_titled, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, - 'vers' : _Prop_version, -} - -_compdeclarations = { - '< ' : _3c_, - '<= ' : _b2_, - '= ' : _3d_, - '> ' : _3e_, - '>= ' : _b3_, - 'bgwt' : starts_with, - 'cont' : contains, - 'ends' : ends_with, -} - -_enumdeclarations = { - 'savo' : _Enum_savo, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/System_Events_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/System_Events_Suite.py deleted file mode 100644 index d5b4bfc6e..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/System_Events_Suite.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Suite System Events Suite: Terms and Events for controlling the System Events application -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'sevs' - -class System_Events_Suite_Events: - - def do_script(self, _object, _attributes={}, **_arguments): - """do script: Execute an OSA script. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'dosc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The System Events application """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_folder_actions_enabled(aetools.NProperty): - """folder actions enabled - Are Folder Actions currently being processed? """ - which = 'faen' - want = 'bool' -folder_actions_enabled = _Prop_folder_actions_enabled() -class _Prop_properties(aetools.NProperty): - """properties - every property of the System Events application """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] -# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application -application._superclassnames = [] -import Disk_Folder_File_Suite -import Standard_Suite -import Folder_Actions_Suite -import Login_Items_Suite -import Processes_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'folder_actions_enabled' : _Prop_folder_actions_enabled, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'application_process' : Processes_Suite.application_process, - 'desk_accessory_process' : Processes_Suite.desk_accessory_process, - 'disk' : Disk_Folder_File_Suite.disk, - 'document' : Standard_Suite.document, - 'file' : Disk_Folder_File_Suite.file, - 'folder' : Disk_Folder_File_Suite.folder, - 'folder_action' : Folder_Actions_Suite.folder_action, - 'item' : Disk_Folder_File_Suite.item, - 'login_item' : Login_Items_Suite.login_item, - 'process' : Processes_Suite.process, - 'window' : Standard_Suite.window, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - -_propdeclarations = { - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'faen' : _Prop_folder_actions_enabled, - 'pALL' : _Prop_properties, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Text_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Text_Suite.py deleted file mode 100644 index 9f109e111..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/Text_Suite.py +++ /dev/null @@ -1,195 +0,0 @@ -"""Suite Text Suite: A set of basic classes for text processing. -Level 1, version 1 - -Generated from /System/Library/CoreServices/System Events.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = '????' - -class Text_Suite_Events: - - pass - - -class attachment(aetools.ComponentItem): - """attachment - Represents an inline text attachment. This class is used mainly for make commands. """ - want = 'atts' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'ctxt' -class _Prop_file_name(aetools.NProperty): - """file name - The path to the file for the attachment """ - which = 'atfn' - want = 'utxt' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -class attribute_run(aetools.ComponentItem): - """attribute run - This subdivides the text into chunks that all have the same attributes. """ - want = 'catr' -class _Prop_color(aetools.NProperty): - """color - The color of the first character. """ - which = 'colr' - want = 'colr' -class _Prop_font(aetools.NProperty): - """font - The name of the font of the first character. """ - which = 'font' - want = 'utxt' -class _Prop_size(aetools.NProperty): - """size - The size in points of the first character. """ - which = 'ptsz' - want = 'long' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -attribute_runs = attribute_run - -class character(aetools.ComponentItem): - """character - This subdivides the text into characters. """ - want = 'cha ' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -characters = character - -class paragraph(aetools.ComponentItem): - """paragraph - This subdivides the text into paragraphs. """ - want = 'cpar' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -paragraphs = paragraph - -class text(aetools.ComponentItem): - """text - Rich (styled) text """ - want = 'ctxt' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -class word(aetools.ComponentItem): - """word - This subdivides the text into words. """ - want = 'cwor' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -words = word -attachment._superclassnames = ['text'] -attachment._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'file_name' : _Prop_file_name, -} -attachment._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -import Standard_Suite -attribute_run._superclassnames = ['item'] -attribute_run._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -attribute_run._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -character._superclassnames = ['item'] -character._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -character._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -paragraph._superclassnames = ['item'] -paragraph._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -paragraph._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -text._superclassnames = ['item'] -text._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -text._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -word._superclassnames = ['item'] -word._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -word._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'atts' : attachment, - 'catr' : attribute_run, - 'cha ' : character, - 'cpar' : paragraph, - 'ctxt' : text, - 'cwor' : word, -} - -_propdeclarations = { - 'atfn' : _Prop_file_name, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'colr' : _Prop_color, - 'font' : _Prop_font, - 'ptsz' : _Prop_size, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/__init__.py deleted file mode 100644 index 95f985ccc..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/SystemEvents/__init__.py +++ /dev/null @@ -1,140 +0,0 @@ -""" -Package generated from /System/Library/CoreServices/System Events.app -""" -import aetools -Error = aetools.Error -import Standard_Suite -import Text_Suite -import Disk_Folder_File_Suite -import Folder_Actions_Suite -import Login_Items_Suite -import Power_Suite -import Processes_Suite -import System_Events_Suite - - -_code_to_module = { - '????' : Standard_Suite, - '????' : Text_Suite, - 'cdis' : Disk_Folder_File_Suite, - 'faco' : Folder_Actions_Suite, - 'logi' : Login_Items_Suite, - 'powr' : Power_Suite, - 'prcs' : Processes_Suite, - 'sevs' : System_Events_Suite, -} - - - -_code_to_fullname = { - '????' : ('SystemEvents.Standard_Suite', 'Standard_Suite'), - '????' : ('SystemEvents.Text_Suite', 'Text_Suite'), - 'cdis' : ('SystemEvents.Disk_Folder_File_Suite', 'Disk_Folder_File_Suite'), - 'faco' : ('SystemEvents.Folder_Actions_Suite', 'Folder_Actions_Suite'), - 'logi' : ('SystemEvents.Login_Items_Suite', 'Login_Items_Suite'), - 'powr' : ('SystemEvents.Power_Suite', 'Power_Suite'), - 'prcs' : ('SystemEvents.Processes_Suite', 'Processes_Suite'), - 'sevs' : ('SystemEvents.System_Events_Suite', 'System_Events_Suite'), -} - -from Standard_Suite import * -from Text_Suite import * -from Disk_Folder_File_Suite import * -from Folder_Actions_Suite import * -from Login_Items_Suite import * -from Power_Suite import * -from Processes_Suite import * -from System_Events_Suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(login_item) -getbaseclasses(color) -getbaseclasses(window) -getbaseclasses(application) -getbaseclasses(item) -getbaseclasses(document) -getbaseclasses(character) -getbaseclasses(attachment) -getbaseclasses(paragraph) -getbaseclasses(word) -getbaseclasses(attribute_run) -getbaseclasses(text) -getbaseclasses(file) -getbaseclasses(application) -getbaseclasses(item) -getbaseclasses(folder) -getbaseclasses(disk) -getbaseclasses(script) -getbaseclasses(application) -getbaseclasses(folder_action) -getbaseclasses(application) -getbaseclasses(application) -getbaseclasses(process) -getbaseclasses(application_process) -getbaseclasses(desk_accessory_process) -getbaseclasses(application) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'logi' : login_item, - 'colr' : color, - 'cwin' : window, - 'capp' : application, - 'cobj' : item, - 'docu' : document, - 'cha ' : character, - 'atts' : attachment, - 'cpar' : paragraph, - 'cwor' : word, - 'catr' : attribute_run, - 'ctxt' : text, - 'file' : file, - 'capp' : application, - 'cobj' : item, - 'cfol' : folder, - 'cdis' : disk, - 'scpt' : script, - 'capp' : application, - 'foac' : folder_action, - 'capp' : application, - 'capp' : application, - 'prcs' : process, - 'pcap' : application_process, - 'pcda' : desk_accessory_process, - 'capp' : application, -} - - -class SystemEvents(Standard_Suite_Events, - Text_Suite_Events, - Disk_Folder_File_Suite_Events, - Folder_Actions_Suite_Events, - Login_Items_Suite_Events, - Power_Suite_Events, - Processes_Suite_Events, - System_Events_Suite_Events, - aetools.TalkTo): - _signature = 'sevs' - - _moduleName = 'SystemEvents' - - _elemdict = application._elemdict - _propdict = application._propdict diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py deleted file mode 100644 index 035290f32..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py +++ /dev/null @@ -1,582 +0,0 @@ -"""Suite Standard Suite: Common classes and commands for most applications. -Level 1, version 1 - -Generated from /Applications/Utilities/Terminal.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = '????' - -class Standard_Suite_Events: - - _argmap_close = { - 'saving_in' : 'kfil', - 'saving' : 'savo', - } - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object. - Required argument: the object for the command - Keyword argument saving_in: The file in which to save the object. - Keyword argument saving: Specifies whether changes should be saved before closing. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - aetools.keysubst(_arguments, self._argmap_close) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_count = { - 'each' : 'kocl', - } - - def count(self, _object, _attributes={}, **_arguments): - """count: Return the number of elements of a particular class within an object. - Required argument: the object for the command - Keyword argument each: The class of objects to be counted. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'cnte' - - aetools.keysubst(_arguments, self._argmap_count) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def delete(self, _object, _attributes={}, **_arguments): - """delete: Delete an object. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'delo' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_duplicate = { - 'to' : 'insh', - 'with_properties' : 'prdt', - } - - def duplicate(self, _object, _attributes={}, **_arguments): - """duplicate: Copy object(s) and put the copies at a new location. - Required argument: the object for the command - Keyword argument to: The location for the new object(s). - Keyword argument with_properties: Properties to be set in the new duplicated object(s). - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clon' - - aetools.keysubst(_arguments, self._argmap_duplicate) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def exists(self, _object, _attributes={}, **_arguments): - """exists: Verify if an object exists. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'doex' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def get(self, _object, _attributes={}, **_arguments): - """get: Get the data for an object. - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'getd' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'at' : 'insh', - 'new' : 'kocl', - 'with_data' : 'data', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: Make a new object. - Keyword argument at: The location at which to insert the object. - Keyword argument new: The class of the new object. - Keyword argument with_data: The initial data for the object. - Keyword argument with_properties: The initial values for properties of the object. - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_move = { - 'to' : 'insh', - } - - def move(self, _object, _attributes={}, **_arguments): - """move: Move object(s) to a new location. - Required argument: the object for the command - Keyword argument to: The new location for the object(s). - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'move' - - aetools.keysubst(_arguments, self._argmap_move) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def open(self, _object=None, _attributes={}, **_arguments): - """open: Open an object. - Required argument: list of objects - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object=None, _attributes={}, **_arguments): - """print: Print an object. - Required argument: list of objects - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_quit = { - 'saving' : 'savo', - } - - def quit(self, _object, _attributes={}, **_arguments): - """quit: Quit an application. - Required argument: the object for the command - Keyword argument saving: Specifies whether changes should be saved before quitting. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - aetools.keysubst(_arguments, self._argmap_quit) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_save = { - 'in_' : 'kfil', - 'as' : 'fltp', - } - - def save(self, _object, _attributes={}, **_arguments): - """save: Save an object. - Required argument: the object for the command - Keyword argument in_: The file in which to save the object. - Keyword argument as: The file type in which to save the data. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'save' - - aetools.keysubst(_arguments, self._argmap_save) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_set = { - 'to' : 'data', - } - - def set(self, _object, _attributes={}, **_arguments): - """set: Set an object's data. - Required argument: the object for the command - Keyword argument to: The new value. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - aetools.keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - An application's top level scripting object. """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'cobj' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is this the frontmost (active) application? """ - which = 'pisf' - want = 'bool' -frontmost = _Prop_frontmost() -class _Prop_name(aetools.NProperty): - """name - The name of the application. """ - which = 'pnam' - want = 'utxt' -name = _Prop_name() -class _Prop_version(aetools.NProperty): - """version - The version of the application. """ - which = 'vers' - want = 'utxt' -version = _Prop_version() -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class item(aetools.ComponentItem): - """item - A scriptable object. """ - want = 'cobj' -class _Prop_class_(aetools.NProperty): - """class - The class of the object. """ - which = 'pcls' - want = 'type' -class _Prop_properties(aetools.NProperty): - """properties - All of the object's properties. """ - which = 'pALL' - want = 'reco' - -items = item - -class color(aetools.ComponentItem): - """color - A color. """ - want = 'colr' - -colors = color - -class window(aetools.ComponentItem): - """window - A window. """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - The bounding rectangle of the window. """ - which = 'pbnd' - want = 'qdrt' -class _Prop_closeable(aetools.NProperty): - """closeable - Whether the window has a close box. """ - which = 'hclb' - want = 'bool' -class _Prop_document(aetools.NProperty): - """document - The document whose contents are being displayed in the window. """ - which = 'docu' - want = 'docu' -class _Prop_floating(aetools.NProperty): - """floating - Whether the window floats. """ - which = 'isfl' - want = 'bool' -class _Prop_id(aetools.NProperty): - """id - The unique identifier of the window. """ - which = 'ID ' - want = 'long' -class _Prop_index(aetools.NProperty): - """index - The index of the window in the back-to-front window ordering. """ - which = 'pidx' - want = 'long' -class _Prop_miniaturizable(aetools.NProperty): - """miniaturizable - Whether the window can be miniaturized. """ - which = 'ismn' - want = 'bool' -class _Prop_miniaturized(aetools.NProperty): - """miniaturized - Whether the window is currently miniaturized. """ - which = 'pmnd' - want = 'bool' -class _Prop_modal(aetools.NProperty): - """modal - Whether the window is the application's current modal window. """ - which = 'pmod' - want = 'bool' -class _Prop_resizable(aetools.NProperty): - """resizable - Whether the window can be resized. """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Whether the window has a title bar. """ - which = 'ptit' - want = 'bool' -class _Prop_visible(aetools.NProperty): - """visible - Whether the window is currently visible. """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Whether the window can be zoomed. """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Whether the window is currently zoomed. """ - which = 'pzum' - want = 'bool' - -windows = window - -class document(aetools.ComponentItem): - """document - A document. """ - want = 'docu' -class _Prop_modified(aetools.NProperty): - """modified - Has the document been modified since the last save? """ - which = 'imod' - want = 'bool' -class _Prop_path(aetools.NProperty): - """path - The document's path. """ - which = 'ppth' - want = 'utxt' - -documents = document -application._superclassnames = ['item'] -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'frontmost' : _Prop_frontmost, - 'name' : _Prop_name, - 'version' : _Prop_version, -} -application._privelemdict = { - 'document' : document, - 'window' : window, -} -item._superclassnames = [] -item._privpropdict = { - 'class_' : _Prop_class_, - 'properties' : _Prop_properties, -} -item._privelemdict = { -} -color._superclassnames = ['item'] -color._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, -} -color._privelemdict = { -} -window._superclassnames = ['item'] -window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'bounds' : _Prop_bounds, - 'closeable' : _Prop_closeable, - 'document' : _Prop_document, - 'floating' : _Prop_floating, - 'id' : _Prop_id, - 'index' : _Prop_index, - 'miniaturizable' : _Prop_miniaturizable, - 'miniaturized' : _Prop_miniaturized, - 'modal' : _Prop_modal, - 'name' : _Prop_name, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} -document._superclassnames = ['item'] -document._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'modified' : _Prop_modified, - 'name' : _Prop_name, - 'path' : _Prop_path, -} -document._privelemdict = { -} -class _3c_(aetools.NComparison): - """< - Less than """ -class _3d_(aetools.NComparison): - """= - Equal """ -class _3e_(aetools.NComparison): - """> - Greater than """ -class contains(aetools.NComparison): - """contains - Contains """ -class ends_with(aetools.NComparison): - """ends with - Ends with """ -class starts_with(aetools.NComparison): - """starts with - Starts with """ -class _b2_(aetools.NComparison): - """\xb2 - Less than or equal to """ -class _b3_(aetools.NComparison): - """\xb3 - Greater than or equal to """ -_Enum_savo = { - 'ask' : 'ask ', # Ask the user whether or not to save the file. - 'yes' : 'yes ', # Save the file. - 'no' : 'no ', # Do not save the file. -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cobj' : item, - 'colr' : color, - 'cwin' : window, - 'docu' : document, -} - -_propdeclarations = { - 'ID ' : _Prop_id, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'docu' : _Prop_document, - 'hclb' : _Prop_closeable, - 'imod' : _Prop_modified, - 'isfl' : _Prop_floating, - 'ismn' : _Prop_miniaturizable, - 'iszm' : _Prop_zoomable, - 'pALL' : _Prop_properties, - 'pbnd' : _Prop_bounds, - 'pcls' : _Prop_class_, - 'pidx' : _Prop_index, - 'pisf' : _Prop_frontmost, - 'pmnd' : _Prop_miniaturized, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'ppth' : _Prop_path, - 'prsz' : _Prop_resizable, - 'ptit' : _Prop_titled, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, - 'vers' : _Prop_version, -} - -_compdeclarations = { - '< ' : _3c_, - '<= ' : _b2_, - '= ' : _3d_, - '> ' : _3e_, - '>= ' : _b3_, - 'bgwt' : starts_with, - 'cont' : contains, - 'ends' : ends_with, -} - -_enumdeclarations = { - 'savo' : _Enum_savo, -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py deleted file mode 100644 index afa02b39f..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py +++ /dev/null @@ -1,254 +0,0 @@ -"""Suite Terminal Suite: Terms and Events for controlling the Terminal application -Level 1, version 1 - -Generated from /Applications/Utilities/Terminal.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'trmx' - -class Terminal_Suite_Events: - - def GetURL(self, _object, _attributes={}, **_arguments): - """GetURL: Opens a telnet: URL - Required argument: the object for the command - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'GURL' - _subcode = 'GURL' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_do_script = { - 'in_' : 'kfil', - 'with_command' : 'cmnd', - } - - def do_script(self, _object, _attributes={}, **_arguments): - """do script: Run a UNIX shell script or command - Required argument: the object for the command - Keyword argument in_: the window in which to execute the command - Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the reply for the command - """ - _code = 'core' - _subcode = 'dosc' - - aetools.keysubst(_arguments, self._argmap_do_script) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - The Terminal program """ - want = 'capp' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'capp' -_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() -class _Prop_properties(aetools.NProperty): - """properties - every property of the Terminal program """ - which = 'pALL' - want = '****' -properties = _Prop_properties() -# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] -# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] - -applications = application - -class window(aetools.ComponentItem): - """window - A Terminal window """ - want = 'cwin' -class _Prop_background_color(aetools.NProperty): - """background color - the background color for the window """ - which = 'pbcl' - want = '****' -class _Prop_bold_text_color(aetools.NProperty): - """bold text color - the bold text color for the window """ - which = 'pbtc' - want = '****' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window, relative to the upper left corner of the screen """ - which = 'pbnd' - want = '****' -class _Prop_busy(aetools.NProperty): - """busy - Is the window busy running a process? """ - which = 'busy' - want = 'bool' -class _Prop_contents(aetools.NProperty): - """contents - the currently visible contents of the window """ - which = 'pcnt' - want = 'utxt' -class _Prop_cursor_color(aetools.NProperty): - """cursor color - the cursor color for the window """ - which = 'pcuc' - want = '****' -class _Prop_custom_title(aetools.NProperty): - """custom title - the custom title for the window """ - which = 'titl' - want = 'utxt' -class _Prop_frame(aetools.NProperty): - """frame - the origin and size of the window """ - which = 'pfra' - want = '****' -class _Prop_frontmost(aetools.NProperty): - """frontmost - Is the window in front of the other Terminal windows? """ - which = 'pisf' - want = 'bool' -class _Prop_history(aetools.NProperty): - """history - the contents of the entire scrolling buffer of the window """ - which = 'hist' - want = 'utxt' -class _Prop_normal_text_color(aetools.NProperty): - """normal text color - the normal text color for the window """ - which = 'ptxc' - want = '****' -class _Prop_number_of_columns(aetools.NProperty): - """number of columns - the number of columns in the window """ - which = 'ccol' - want = 'long' -class _Prop_number_of_rows(aetools.NProperty): - """number of rows - the number of rows in the window """ - which = 'crow' - want = 'long' -class _Prop_origin(aetools.NProperty): - """origin - the lower left coordinates of the window, relative to the lower left corner of the screen """ - which = 'pori' - want = '****' -class _Prop_position(aetools.NProperty): - """position - the upper left coordinates of the window, relative to the upper left corner of the screen """ - which = 'ppos' - want = '****' -class _Prop_processes(aetools.NProperty): - """processes - a list of the currently running processes """ - which = 'prcs' - want = 'utxt' -class _Prop_size(aetools.NProperty): - """size - the width and height of the window """ - which = 'psiz' - want = '****' -class _Prop_title_displays_custom_title(aetools.NProperty): - """title displays custom title - Does the title for the window contain a custom title? """ - which = 'tdct' - want = 'bool' -class _Prop_title_displays_device_name(aetools.NProperty): - """title displays device name - Does the title for the window contain the device name? """ - which = 'tddn' - want = 'bool' -class _Prop_title_displays_file_name(aetools.NProperty): - """title displays file name - Does the title for the window contain the file name? """ - which = 'tdfn' - want = 'bool' -class _Prop_title_displays_shell_path(aetools.NProperty): - """title displays shell path - Does the title for the window contain the shell path? """ - which = 'tdsp' - want = 'bool' -class _Prop_title_displays_window_size(aetools.NProperty): - """title displays window size - Does the title for the window contain the window size? """ - which = 'tdws' - want = 'bool' - -windows = window -application._superclassnames = [] -import Standard_Suite -application._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'properties' : _Prop_properties, -} -application._privelemdict = { - 'document' : Standard_Suite.document, - 'window' : window, -} -window._superclassnames = [] -window._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'background_color' : _Prop_background_color, - 'bold_text_color' : _Prop_bold_text_color, - 'bounds' : _Prop_bounds, - 'busy' : _Prop_busy, - 'contents' : _Prop_contents, - 'cursor_color' : _Prop_cursor_color, - 'custom_title' : _Prop_custom_title, - 'frame' : _Prop_frame, - 'frontmost' : _Prop_frontmost, - 'history' : _Prop_history, - 'normal_text_color' : _Prop_normal_text_color, - 'number_of_columns' : _Prop_number_of_columns, - 'number_of_rows' : _Prop_number_of_rows, - 'origin' : _Prop_origin, - 'position' : _Prop_position, - 'processes' : _Prop_processes, - 'properties' : _Prop_properties, - 'size' : _Prop_size, - 'title_displays_custom_title' : _Prop_title_displays_custom_title, - 'title_displays_device_name' : _Prop_title_displays_device_name, - 'title_displays_file_name' : _Prop_title_displays_file_name, - 'title_displays_shell_path' : _Prop_title_displays_shell_path, - 'title_displays_window_size' : _Prop_title_displays_window_size, -} -window._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cwin' : window, -} - -_propdeclarations = { - 'busy' : _Prop_busy, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'ccol' : _Prop_number_of_columns, - 'crow' : _Prop_number_of_rows, - 'hist' : _Prop_history, - 'pALL' : _Prop_properties, - 'pbcl' : _Prop_background_color, - 'pbnd' : _Prop_bounds, - 'pbtc' : _Prop_bold_text_color, - 'pcnt' : _Prop_contents, - 'pcuc' : _Prop_cursor_color, - 'pfra' : _Prop_frame, - 'pisf' : _Prop_frontmost, - 'pori' : _Prop_origin, - 'ppos' : _Prop_position, - 'prcs' : _Prop_processes, - 'psiz' : _Prop_size, - 'ptxc' : _Prop_normal_text_color, - 'tdct' : _Prop_title_displays_custom_title, - 'tddn' : _Prop_title_displays_device_name, - 'tdfn' : _Prop_title_displays_file_name, - 'tdsp' : _Prop_title_displays_shell_path, - 'tdws' : _Prop_title_displays_window_size, - 'titl' : _Prop_custom_title, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Text_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Text_Suite.py deleted file mode 100644 index 62f4744b2..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/Text_Suite.py +++ /dev/null @@ -1,195 +0,0 @@ -"""Suite Text Suite: A set of basic classes for text processing. -Level 1, version 1 - -Generated from /Applications/Utilities/Terminal.app -AETE/AEUT resource version 1/0, language 0, script 0 -""" - -import aetools -import MacOS - -_code = '????' - -class Text_Suite_Events: - - pass - - -class attachment(aetools.ComponentItem): - """attachment - Represents an inline text attachment. This class is used mainly for make commands. """ - want = 'atts' -class _Prop__3c_Inheritance_3e_(aetools.NProperty): - """ - All of the properties of the superclass. """ - which = 'c@#^' - want = 'ctxt' -class _Prop_file_name(aetools.NProperty): - """file name - The path to the file for the attachment """ - which = 'atfn' - want = 'utxt' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -class attribute_run(aetools.ComponentItem): - """attribute run - This subdivides the text into chunks that all have the same attributes. """ - want = 'catr' -class _Prop_color(aetools.NProperty): - """color - The color of the first character. """ - which = 'colr' - want = 'colr' -class _Prop_font(aetools.NProperty): - """font - The name of the font of the first character. """ - which = 'font' - want = 'utxt' -class _Prop_size(aetools.NProperty): - """size - The size in points of the first character. """ - which = 'ptsz' - want = 'long' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -attribute_runs = attribute_run - -class character(aetools.ComponentItem): - """character - This subdivides the text into characters. """ - want = 'cha ' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -characters = character - -class paragraph(aetools.ComponentItem): - """paragraph - This subdivides the text into paragraphs. """ - want = 'cpar' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -paragraphs = paragraph - -class text(aetools.ComponentItem): - """text - Rich (styled) text """ - want = 'ctxt' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -class word(aetools.ComponentItem): - """word - This subdivides the text into words. """ - want = 'cwor' -# element 'catr' as ['indx', 'rele', 'rang', 'test'] -# element 'cha ' as ['indx', 'rele', 'rang', 'test'] -# element 'cpar' as ['indx', 'rele', 'rang', 'test'] -# element 'cwor' as ['indx', 'rele', 'rang', 'test'] - -words = word -attachment._superclassnames = ['text'] -attachment._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'file_name' : _Prop_file_name, -} -attachment._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -import Standard_Suite -attribute_run._superclassnames = ['item'] -attribute_run._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -attribute_run._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -character._superclassnames = ['item'] -character._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -character._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -paragraph._superclassnames = ['item'] -paragraph._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -paragraph._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -text._superclassnames = ['item'] -text._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -text._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} -word._superclassnames = ['item'] -word._privpropdict = { - '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, - 'color' : _Prop_color, - 'font' : _Prop_font, - 'size' : _Prop_size, -} -word._privelemdict = { - 'attribute_run' : attribute_run, - 'character' : character, - 'paragraph' : paragraph, - 'word' : word, -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'atts' : attachment, - 'catr' : attribute_run, - 'cha ' : character, - 'cpar' : paragraph, - 'ctxt' : text, - 'cwor' : word, -} - -_propdeclarations = { - 'atfn' : _Prop_file_name, - 'c@#^' : _Prop__3c_Inheritance_3e_, - 'colr' : _Prop_color, - 'font' : _Prop_font, - 'ptsz' : _Prop_size, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/__init__.py deleted file mode 100644 index 47b75f2ae..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/Terminal/__init__.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -Package generated from /Applications/Utilities/Terminal.app -""" -import aetools -Error = aetools.Error -import Standard_Suite -import Text_Suite -import Terminal_Suite - - -_code_to_module = { - '????' : Standard_Suite, - '????' : Text_Suite, - 'trmx' : Terminal_Suite, -} - - - -_code_to_fullname = { - '????' : ('Terminal.Standard_Suite', 'Standard_Suite'), - '????' : ('Terminal.Text_Suite', 'Text_Suite'), - 'trmx' : ('Terminal.Terminal_Suite', 'Terminal_Suite'), -} - -from Standard_Suite import * -from Text_Suite import * -from Terminal_Suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(color) -getbaseclasses(window) -getbaseclasses(application) -getbaseclasses(item) -getbaseclasses(document) -getbaseclasses(window) -getbaseclasses(application) -getbaseclasses(character) -getbaseclasses(attachment) -getbaseclasses(paragraph) -getbaseclasses(word) -getbaseclasses(attribute_run) -getbaseclasses(text) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'colr' : color, - 'cwin' : window, - 'capp' : application, - 'cobj' : item, - 'docu' : document, - 'cwin' : window, - 'capp' : application, - 'cha ' : character, - 'atts' : attachment, - 'cpar' : paragraph, - 'cwor' : word, - 'catr' : attribute_run, - 'ctxt' : text, -} - - -class Terminal(Standard_Suite_Events, - Text_Suite_Events, - Terminal_Suite_Events, - aetools.TalkTo): - _signature = 'trmx' - - _moduleName = 'Terminal' - - _elemdict = application._elemdict - _propdict = application._propdict diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py b/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py deleted file mode 100644 index 2c722d9f5..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Manually generated suite used as base class for StdSuites Required and Standard -suites. This is needed because the events and enums in this suite belong -in the Required suite according to the Apple docs, but they often seem to be -in the Standard suite. -""" -import aetools -import builtin_Suite - - -_code_to_module = { - 'reqd' : builtin_Suite, - 'core' : builtin_Suite, -} - - - -_code_to_fullname = { - 'reqd' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), - 'core' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), -} - -from builtin_Suite import * - -class _builtinSuites(builtin_Suite_Events, - aetools.TalkTo): - _signature = 'ascr' diff --git a/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py b/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py deleted file mode 100644 index 318250fa2..000000000 --- a/sys/lib/python/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py +++ /dev/null @@ -1,140 +0,0 @@ -"""Suite builtin_Suite: Every application supports open, reopen, print, run, and quit -Level 1, version 1 -""" - -import aetools -import MacOS - -_code = 'aevt' - -class builtin_Suite_Events: - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: Run an application. Most applications will open an empty, untitled window. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'oapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def reopen(self, _no_object=None, _attributes={}, **_arguments): - """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'rapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _print(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: list of objects to print - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_quit = { - 'saving' : 'savo', - } - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit an application - Keyword argument saving: specifies whether to save currently open documents - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - aetools.keysubst(_arguments, self._argmap_quit) - if _no_object != None: raise TypeError, 'No direct arg expected' - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_close = { - 'saving' : 'savo', - 'saving_in' : 'kfil', - } - -_Enum_savo = { - 'yes' : 'yes ', # Save objects now - 'no' : 'no ', # Do not save objects - 'ask' : 'ask ', # Ask the user whether to save -} - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'savo' : _Enum_savo, -} diff --git a/sys/lib/python/plat-mac/macerrors.py b/sys/lib/python/plat-mac/macerrors.py deleted file mode 100644 index ce2a11828..000000000 --- a/sys/lib/python/plat-mac/macerrors.py +++ /dev/null @@ -1,1852 +0,0 @@ -svTempDisable = -32768 #svTempDisable -svDisabled = -32640 #Reserve range -32640 to -32768 for Apple temp disables. -fontNotOutlineErr = -32615 #bitmap font passed to routine that does outlines only -kURL68kNotSupportedError = -30788 #kURL68kNotSupportedError -kURLAccessNotAvailableError = -30787 #kURLAccessNotAvailableError -kURLInvalidConfigurationError = -30786 #kURLInvalidConfigurationError -kURLExtensionFailureError = -30785 #kURLExtensionFailureError -kURLFileEmptyError = -30783 #kURLFileEmptyError -kURLInvalidCallError = -30781 #kURLInvalidCallError -kURLUnsettablePropertyError = -30780 #kURLUnsettablePropertyError -kURLPropertyBufferTooSmallError = -30779 #kURLPropertyBufferTooSmallError -kURLUnknownPropertyError = -30778 #kURLUnknownPropertyError -kURLPropertyNotYetKnownError = -30777 #kURLPropertyNotYetKnownError -kURLAuthenticationError = -30776 #kURLAuthenticationError -kURLServerBusyError = -30775 #kURLServerBusyError -kURLUnsupportedSchemeError = -30774 #kURLUnsupportedSchemeError -kURLInvalidURLError = -30773 #kURLInvalidURLError -kURLDestinationExistsError = -30772 #kURLDestinationExistsError -kURLProgressAlreadyDisplayedError = -30771 #kURLProgressAlreadyDisplayedError -kURLInvalidURLReferenceError = -30770 #kURLInvalidURLReferenceError -controlHandleInvalidErr = -30599 #controlHandleInvalidErr -controlInvalidDataVersionErr = -30597 #controlInvalidDataVersionErr -errItemNotControl = -30596 #errItemNotControl -errCantEmbedRoot = -30595 #errCantEmbedRoot -errCantEmbedIntoSelf = -30594 #errCantEmbedIntoSelf -errWindowRegionCodeInvalid = -30593 #errWindowRegionCodeInvalid -errControlHiddenOrDisabled = -30592 #errControlHiddenOrDisabled -errDataSizeMismatch = -30591 #errDataSizeMismatch -errControlIsNotEmbedder = -30590 #errControlIsNotEmbedder -errControlsAlreadyExist = -30589 #errControlsAlreadyExist -errInvalidPartCode = -30588 #errInvalidPartCode -errRootAlreadyExists = -30587 #errRootAlreadyExists -errNoRootControl = -30586 #errNoRootControl -errCouldntSetFocus = -30585 #errCouldntSetFocus -errUnknownControl = -30584 #errUnknownControl -errWindowDoesntSupportFocus = -30583 #errWindowDoesntSupportFocus -errControlDoesntSupportFocus = -30582 #errControlDoesntSupportFocus -errDataNotSupported = -30581 #errDataNotSupported -errMessageNotSupported = -30580 #errMessageNotSupported -themeMonitorDepthNotSupportedErr = -30567 #theme not supported at monitor depth -themeScriptFontNotFoundErr = -30566 #theme font requested for uninstalled script system -themeBadCursorIndexErr = -30565 #themeBadCursorIndexErr -themeHasNoAccentsErr = -30564 #themeHasNoAccentsErr -themeBadTextColorErr = -30563 #themeBadTextColorErr -themeProcessNotRegisteredErr = -30562 #themeProcessNotRegisteredErr -themeProcessRegisteredErr = -30561 #themeProcessRegisteredErr -themeInvalidBrushErr = -30560 #pattern index invalid -qtvrUninitialized = -30555 #qtvrUninitialized -qtvrLibraryLoadErr = -30554 #qtvrLibraryLoadErr -streamingNodeNotReadyErr = -30553 #streamingNodeNotReadyErr -noMemoryNodeFailedInitialize = -30552 #noMemoryNodeFailedInitialize -invalidHotSpotIDErr = -30551 #invalidHotSpotIDErr -invalidNodeFormatErr = -30550 #invalidNodeFormatErr -limitReachedErr = -30549 #limitReachedErr -settingNotSupportedByNodeErr = -30548 #settingNotSupportedByNodeErr -propertyNotSupportedByNodeErr = -30547 #propertyNotSupportedByNodeErr -timeNotInViewErr = -30546 #timeNotInViewErr -invalidViewStateErr = -30545 #invalidViewStateErr -invalidNodeIDErr = -30544 #invalidNodeIDErr -selectorNotSupportedByNodeErr = -30543 #selectorNotSupportedByNodeErr -callNotSupportedByNodeErr = -30542 #callNotSupportedByNodeErr -constraintReachedErr = -30541 #constraintReachedErr -notAQTVRMovieErr = -30540 #notAQTVRMovieErr -kFBCnoSuchHit = -30532 #kFBCnoSuchHit -kFBCbadSearchSession = -30531 #kFBCbadSearchSession -kFBCindexDiskIOFailed = -30530 #kFBCindexDiskIOFailed -kFBCsummarizationCanceled = -30529 #kFBCsummarizationCanceled -kFBCbadIndexFileVersion = -30528 #kFBCbadIndexFileVersion -kFBCanalysisNotAvailable = -30527 #kFBCanalysisNotAvailable -kFBCillegalSessionChange = -30526 #tried to add/remove vols to a session -kFBCsomeFilesNotIndexed = -30525 #kFBCsomeFilesNotIndexed -kFBCsearchFailed = -30524 #kFBCsearchFailed -kFBCindexNotAvailable = -30523 #kFBCindexNotAvailable -kFBCindexFileDestroyed = -30522 #kFBCindexFileDestroyed -kFBCaccessCanceled = -30521 #kFBCaccessCanceled -kFBCindexingCanceled = -30520 #kFBCindexingCanceled -kFBCnoSearchSession = -30519 #kFBCnoSearchSession -kFBCindexNotFound = -30518 #kFBCindexNotFound -kFBCflushFailed = -30517 #kFBCflushFailed -kFBCaddDocFailed = -30516 #kFBCaddDocFailed -kFBCaccessorStoreFailed = -30515 #kFBCaccessorStoreFailed -kFBCindexCreationFailed = -30514 #couldn't create index -kFBCmergingFailed = -30513 #couldn't merge index files -kFBCtokenizationFailed = -30512 #couldn't read from document or query -kFBCmoveFailed = -30511 #V-Twin exception caught -kFBCdeletionFailed = -30510 #V-Twin exception caught -kFBCcommitFailed = -30509 #V-Twin exception caught -kFBCindexingFailed = -30508 #V-Twin exception caught -kFBCvalidationFailed = -30507 #V-Twin exception caught -kFBCcompactionFailed = -30506 #V-Twin exception caught -kFBCbadIndexFile = -30505 #bad FSSpec, or bad data in file -kFBCfileNotIndexed = -30504 #kFBCfileNotIndexed -kFBCbadParam = -30503 #kFBCbadParam -kFBCallocFailed = -30502 #probably low memory -kFBCnoIndexesFound = -30501 #kFBCnoIndexesFound -kFBCvTwinExceptionErr = -30500 #no telling what it was -kDSpStereoContextErr = -30450 #kDSpStereoContextErr -kDSpInternalErr = -30449 #kDSpInternalErr -kDSpConfirmSwitchWarning = -30448 #kDSpConfirmSwitchWarning -kDSpFrameRateNotReadyErr = -30447 #kDSpFrameRateNotReadyErr -kDSpContextNotFoundErr = -30446 #kDSpContextNotFoundErr -kDSpContextNotReservedErr = -30445 #kDSpContextNotReservedErr -kDSpContextAlreadyReservedErr = -30444 #kDSpContextAlreadyReservedErr -kDSpInvalidAttributesErr = -30443 #kDSpInvalidAttributesErr -kDSpInvalidContextErr = -30442 #kDSpInvalidContextErr -kDSpSystemSWTooOldErr = -30441 #kDSpSystemSWTooOldErr -kDSpNotInitializedErr = -30440 #kDSpNotInitializedErr -kISpListBusyErr = -30429 #kISpListBusyErr -kISpDeviceActiveErr = -30428 #kISpDeviceActiveErr -kISpSystemActiveErr = -30427 #kISpSystemActiveErr -kISpDeviceInactiveErr = -30426 #kISpDeviceInactiveErr -kISpSystemInactiveErr = -30425 #kISpSystemInactiveErr -kISpElementNotInListErr = -30424 #kISpElementNotInListErr -kISpElementInListErr = -30423 #kISpElementInListErr -kISpBufferToSmallErr = -30422 #kISpBufferToSmallErr -kISpSystemListErr = -30421 #kISpSystemListErr -kISpInternalErr = -30420 #kISpInternalErr -kNSpJoinFailedErr = -30399 #kNSpJoinFailedErr -kNSpCantBlockErr = -30398 #kNSpCantBlockErr -kNSpMessageTooBigErr = -30397 #kNSpMessageTooBigErr -kNSpSendFailedErr = -30396 #kNSpSendFailedErr -kNSpConnectFailedErr = -30395 #kNSpConnectFailedErr -kNSpGameTerminatedErr = -30394 #kNSpGameTerminatedErr -kNSpTimeoutErr = -30393 #kNSpTimeoutErr -kNSpInvalidProtocolListErr = -30392 #kNSpInvalidProtocolListErr -kNSpInvalidProtocolRefErr = -30391 #kNSpInvalidProtocolRefErr -kNSpInvalidDefinitionErr = -30390 #kNSpInvalidDefinitionErr -kNSpAddPlayerFailedErr = -30389 #kNSpAddPlayerFailedErr -kNSpCreateGroupFailedErr = -30388 #kNSpCreateGroupFailedErr -kNSpNoHostVolunteersErr = -30387 #kNSpNoHostVolunteersErr -kNSpNoGroupsErr = -30386 #kNSpNoGroupsErr -kNSpNoPlayersErr = -30385 #kNSpNoPlayersErr -kNSpInvalidGroupIDErr = -30384 #kNSpInvalidGroupIDErr -kNSpInvalidPlayerIDErr = -30383 #kNSpInvalidPlayerIDErr -kNSpNameRequiredErr = -30382 #kNSpNameRequiredErr -kNSpFeatureNotImplementedErr = -30381 #kNSpFeatureNotImplementedErr -kNSpAddressInUseErr = -30380 #kNSpAddressInUseErr -kNSpRemovePlayerFailedErr = -30379 #kNSpRemovePlayerFailedErr -kNSpFreeQExhaustedErr = -30378 #kNSpFreeQExhaustedErr -kNSpInvalidAddressErr = -30377 #kNSpInvalidAddressErr -kNSpNotAdvertisingErr = -30376 #kNSpNotAdvertisingErr -kNSpAlreadyAdvertisingErr = -30374 #kNSpAlreadyAdvertisingErr -kNSpMemAllocationErr = -30373 #kNSpMemAllocationErr -kNSpOTVersionTooOldErr = -30371 #kNSpOTVersionTooOldErr -kNSpOTNotPresentErr = -30370 #kNSpOTNotPresentErr -kNSpInvalidParameterErr = -30369 #kNSpInvalidParameterErr -kNSpInvalidGameRefErr = -30367 #kNSpInvalidGameRefErr -kNSpProtocolNotAvailableErr = -30366 #kNSpProtocolNotAvailableErr -kNSpHostFailedErr = -30365 #kNSpHostFailedErr -kNSpPipeFullErr = -30364 #kNSpPipeFullErr -kNSpTopologyNotSupportedErr = -30362 #kNSpTopologyNotSupportedErr -kNSpAlreadyInitializedErr = -30361 #kNSpAlreadyInitializedErr -kNSpInitializationFailedErr = -30360 #kNSpInitializationFailedErr -kSSpScaleToZeroErr = -30344 #kSSpScaleToZeroErr -kSSpParallelUpVectorErr = -30343 #kSSpParallelUpVectorErr -kSSpCantInstallErr = -30342 #kSSpCantInstallErr -kSSpVersionErr = -30341 #kSSpVersionErr -kSSpInternalErr = -30340 #kSSpInternalErr -kALMInternalErr = -30049 #kALMInternalErr -kALMGroupNotFoundErr = -30048 #kALMGroupNotFoundErr -kALMNoSuchModuleErr = -30047 #kALMNoSuchModuleErr -kALMModuleCommunicationErr = -30046 #kALMModuleCommunicationErr -kALMDuplicateModuleErr = -30045 #kALMDuplicateModuleErr -kALMInstallationErr = -30044 #kALMInstallationErr -kALMDeferSwitchErr = -30043 #kALMDeferSwitchErr -kALMRebootFlagsLevelErr = -30042 #kALMRebootFlagsLevelErr -kLocalesDefaultDisplayStatus = -30029 #Requested display locale unavailable, used default -kLocalesTableFormatErr = -30002 #kLocalesTableFormatErr -kLocalesBufferTooSmallErr = -30001 #kLocalesBufferTooSmallErr -kFNSNameNotFoundErr = -29589 #The name with the requested paramters was not found -kFNSBadFlattenedSizeErr = -29587 #flattened size didn't match input or was too small -kFNSInsufficientDataErr = -29586 #insufficient data for the operation -kFNSMismatchErr = -29585 #reference didn't match or wasn't found in profile -kFNSDuplicateReferenceErr = -29584 #the ref. being added is already in the profile -kFNSBadProfileVersionErr = -29583 #profile version is out of known range -kFNSInvalidProfileErr = -29582 #profile is NULL or otherwise bad -kFNSBadReferenceVersionErr = -29581 #ref. version is out of known range -kFNSInvalidReferenceErr = -29580 #ref. was NULL or otherwise bad -kCollateInvalidCollationRef = -29507 #kCollateInvalidCollationRef -kCollateBufferTooSmall = -29506 #kCollateBufferTooSmall -kCollateInvalidChar = -29505 #kCollateInvalidChar -kCollatePatternNotFoundErr = -29504 #kCollatePatternNotFoundErr -kCollateUnicodeConvertFailedErr = -29503 #kCollateUnicodeConvertFailedErr -kCollateMissingUnicodeTableErr = -29502 #kCollateMissingUnicodeTableErr -kCollateInvalidOptions = -29501 #kCollateInvalidOptions -kCollateAttributesNotFoundErr = -29500 #kCollateAttributesNotFoundErr -kMPInvalidIDErr = -29299 #kMPInvalidIDErr -kMPInsufficientResourcesErr = -29298 #kMPInsufficientResourcesErr -kMPTaskAbortedErr = -29297 #kMPTaskAbortedErr -kMPTimeoutErr = -29296 #kMPTimeoutErr -kMPDeletedErr = -29295 #kMPDeletedErr -kMPBlueBlockingErr = -29293 #kMPBlueBlockingErr -kMPTaskStoppedErr = -29292 #A convention used with MPThrowException. -kMPTaskBlockedErr = -29291 #kMPTaskBlockedErr -kMPTaskCreatedErr = -29290 #kMPTaskCreatedErr -kMPProcessTerminatedErr = -29289 #kMPProcessTerminatedErr -kMPProcessCreatedErr = -29288 #kMPProcessCreatedErr -kMPPrivilegedErr = -29276 #kMPPrivilegedErr -kMPIterationEndErr = -29275 #kMPIterationEndErr -kUCTextBreakLocatorMissingType = -25341 #Unicode text break error -kUCOutputBufferTooSmall = -25340 #Output buffer too small for Unicode string result -errKCCreateChainFailed = -25318 #errKCCreateChainFailed -errKCDataNotModifiable = -25317 #errKCDataNotModifiable -errKCDataNotAvailable = -25316 #errKCDataNotAvailable -errKCInteractionRequired = -25315 #errKCInteractionRequired -errKCNoPolicyModule = -25314 #errKCNoPolicyModule -errKCNoCertificateModule = -25313 #errKCNoCertificateModule -errKCNoStorageModule = -25312 #errKCNoStorageModule -errKCKeySizeNotAllowed = -25311 #errKCKeySizeNotAllowed -errKCWrongKCVersion = -25310 #errKCWrongKCVersion -errKCReadOnlyAttr = -25309 #errKCReadOnlyAttr -errKCInteractionNotAllowed = -25308 #errKCInteractionNotAllowed -errKCNoDefaultKeychain = -25307 #errKCNoDefaultKeychain -errKCNoSuchClass = -25306 #errKCNoSuchClass -errKCInvalidSearchRef = -25305 #errKCInvalidSearchRef -errKCInvalidItemRef = -25304 #errKCInvalidItemRef -errKCNoSuchAttr = -25303 #errKCNoSuchAttr -errKCDataTooLarge = -25302 #errKCDataTooLarge -errKCBufferTooSmall = -25301 #errKCBufferTooSmall -errKCItemNotFound = -25300 #errKCItemNotFound -errKCDuplicateItem = -25299 #errKCDuplicateItem -errKCInvalidCallback = -25298 #errKCInvalidCallback -errKCDuplicateCallback = -25297 #errKCDuplicateCallback -errKCDuplicateKeychain = -25296 #errKCDuplicateKeychain -errKCInvalidKeychain = -25295 #errKCInvalidKeychain -errKCNoSuchKeychain = -25294 #errKCNoSuchKeychain -errKCAuthFailed = -25293 #errKCAuthFailed -errKCReadOnly = -25292 #errKCReadOnly -errKCNotAvailable = -25291 #errKCNotAvailable -printerStatusOpCodeNotSupportedErr = -25280 #printerStatusOpCodeNotSupportedErr -kTXNOutsideOfFrameErr = -22018 #kTXNOutsideOfFrameErr -kTXNOutsideOfLineErr = -22017 #kTXNOutsideOfLineErr -kTXNATSUIIsNotInstalledErr = -22016 #kTXNATSUIIsNotInstalledErr -kTXNDataTypeNotAllowedErr = -22015 #kTXNDataTypeNotAllowedErr -kTXNCopyNotAllowedInEchoModeErr = -22014 #kTXNCopyNotAllowedInEchoModeErr -kTXNCannotTurnTSMOffWhenUsingUnicodeErr = -22013 #kTXNCannotTurnTSMOffWhenUsingUnicodeErr -kTXNAlreadyInitializedErr = -22012 #kTXNAlreadyInitializedErr -kTXNInvalidRunIndex = -22011 #kTXNInvalidRunIndex -kTXNSomeOrAllTagsInvalidForRunErr = -22010 #kTXNSomeOrAllTagsInvalidForRunErr -kTXNAttributeTagInvalidForRunErr = -22009 #dataValue is set to this per invalid tag -kTXNNoMatchErr = -22008 #kTXNNoMatchErr -kTXNRunIndexOutofBoundsErr = -22007 #kTXNRunIndexOutofBoundsErr -kTXNCannotSetAutoIndentErr = -22006 #kTXNCannotSetAutoIndentErr -kTXNBadDefaultFileTypeWarning = -22005 #kTXNBadDefaultFileTypeWarning -kTXNUserCanceledOperationErr = -22004 #kTXNUserCanceledOperationErr -kTXNIllegalToCrossDataBoundariesErr = -22003 #kTXNIllegalToCrossDataBoundariesErr -kTXNInvalidFrameIDErr = -22002 #kTXNInvalidFrameIDErr -kTXNCannotAddFrameErr = -22001 #kTXNCannotAddFrameErr -kTXNEndIterationErr = -22000 #kTXNEndIterationErr -invalidIndexErr = -20002 #The recordIndex parameter is not valid. -recordDataTooBigErr = -20001 #The record data is bigger than buffer size (1024 bytes). -unknownInsertModeErr = -20000 #There is no such an insert mode. -kModemScriptMissing = -14002 #kModemScriptMissing -kModemPreferencesMissing = -14001 #kModemPreferencesMissing -kModemOutOfMemory = -14000 #kModemOutOfMemory -kHIDBaseError = -13950 #kHIDBaseError -kHIDNullStateErr = -13949 #kHIDNullStateErr -kHIDBufferTooSmallErr = -13948 #kHIDBufferTooSmallErr -kHIDValueOutOfRangeErr = -13947 #kHIDValueOutOfRangeErr -kHIDUsageNotFoundErr = -13946 #kHIDUsageNotFoundErr -kHIDNotValueArrayErr = -13945 #kHIDNotValueArrayErr -kHIDInvalidPreparsedDataErr = -13944 #kHIDInvalidPreparsedDataErr -kHIDIncompatibleReportErr = -13943 #kHIDIncompatibleReportErr -kHIDBadLogPhysValuesErr = -13942 #kHIDBadLogPhysValuesErr -kHIDInvalidReportTypeErr = -13941 #kHIDInvalidReportTypeErr -kHIDInvalidReportLengthErr = -13940 #kHIDInvalidReportLengthErr -kHIDNullPointerErr = -13939 #kHIDNullPointerErr -kHIDBadParameterErr = -13938 #kHIDBadParameterErr -kHIDNotEnoughMemoryErr = -13937 #kHIDNotEnoughMemoryErr -kHIDEndOfDescriptorErr = -13936 #kHIDEndOfDescriptorErr -kHIDUsagePageZeroErr = -13935 #kHIDUsagePageZeroErr -kHIDBadLogicalMinimumErr = -13934 #kHIDBadLogicalMinimumErr -kHIDBadLogicalMaximumErr = -13933 #kHIDBadLogicalMaximumErr -kHIDInvertedLogicalRangeErr = -13932 #kHIDInvertedLogicalRangeErr -kHIDInvertedPhysicalRangeErr = -13931 #kHIDInvertedPhysicalRangeErr -kHIDUnmatchedUsageRangeErr = -13930 #kHIDUnmatchedUsageRangeErr -kHIDInvertedUsageRangeErr = -13929 #kHIDInvertedUsageRangeErr -kHIDUnmatchedStringRangeErr = -13928 #kHIDUnmatchedStringRangeErr -kHIDUnmatchedDesignatorRangeErr = -13927 #kHIDUnmatchedDesignatorRangeErr -kHIDReportSizeZeroErr = -13926 #kHIDReportSizeZeroErr -kHIDReportCountZeroErr = -13925 #kHIDReportCountZeroErr -kHIDReportIDZeroErr = -13924 #kHIDReportIDZeroErr -kHIDInvalidRangePageErr = -13923 #kHIDInvalidRangePageErr -kHIDDeviceNotReady = -13910 #The device is still initializing, try again later -kHIDVersionIncompatibleErr = -13909 #kHIDVersionIncompatibleErr -debuggingNoMatchErr = -13887 #debugging component or option not found at this index -debuggingNoCallbackErr = -13886 #debugging component has no callback -debuggingInvalidNameErr = -13885 #componentName or optionName is invalid (NULL) -debuggingInvalidOptionErr = -13884 #optionSelectorNum is not registered -debuggingInvalidSignatureErr = -13883 #componentSignature not registered -debuggingDuplicateOptionErr = -13882 #optionSelectorNum already registered -debuggingDuplicateSignatureErr = -13881 #componentSignature already registered -debuggingExecutionContextErr = -13880 #routine cannot be called at this time -kBridgeSoftwareRunningCantSleep = -13038 #kBridgeSoftwareRunningCantSleep -kNoSuchPowerSource = -13020 #kNoSuchPowerSource -kProcessorTempRoutineRequiresMPLib2 = -13014 #kProcessorTempRoutineRequiresMPLib2 -kCantReportProcessorTemperatureErr = -13013 #kCantReportProcessorTemperatureErr -kPowerMgtRequestDenied = -13010 #kPowerMgtRequestDenied -kPowerMgtMessageNotHandled = -13009 #kPowerMgtMessageNotHandled -kPowerHandlerNotFoundForProcErr = -13008 #kPowerHandlerNotFoundForProcErr -kPowerHandlerNotFoundForDeviceErr = -13007 #kPowerHandlerNotFoundForDeviceErr -kPowerHandlerExistsForDeviceErr = -13006 #kPowerHandlerExistsForDeviceErr -pmRecvEndErr = -13005 #during receive, pmgr did not finish hs configured for this connection -pmRecvStartErr = -13004 #during receive, pmgr did not start hs -pmSendEndErr = -13003 #during send, pmgr did not finish hs -pmSendStartErr = -13002 #during send, pmgr did not start hs -pmReplyTOErr = -13001 #Timed out waiting for reply -pmBusyErr = -13000 #Power Mgr never ready to start handshake -pictureDataErr = -11005 #the picture data was invalid -colorsRequestedErr = -11004 #the number of colors requested was illegal -cantLoadPickMethodErr = -11003 #unable to load the custom pick proc -pictInfoVerbErr = -11002 #the passed verb was invalid -pictInfoIDErr = -11001 #the internal consistancy check for the PictInfoID is wrong -pictInfoVersionErr = -11000 #wrong version of the PictInfo structure -errTaskNotFound = -10780 #no task with that task id exists -telNotEnoughdspBW = -10116 #not enough real-time for allocation -telBadSampleRate = -10115 #incompatible sample rate -telBadSWErr = -10114 #Software not installed properly -telDetAlreadyOn = -10113 #detection is already turned on -telAutoAnsNotOn = -10112 #autoAnswer in not turned on -telValidateFailed = -10111 #telValidate failed -telBadProcID = -10110 #invalid procID -telDeviceNotFound = -10109 #device not found -telBadCodeResource = -10108 #code resource not found -telInitFailed = -10107 #initialization failed -telNoCommFolder = -10106 #Communications/Extensions € not found -telUnknownErr = -10103 #unable to set config -telNoSuchTool = -10102 #unable to find tool with name specified -telBadFunction = -10091 #bad msgCode specified -telPBErr = -10090 #parameter block error, bad format -telCANotDeflectable = -10082 #CA not "deflectable" -telCANotRejectable = -10081 #CA not "rejectable" -telCANotAcceptable = -10080 #CA not "acceptable" -telTermNotOpen = -10072 #terminal not opened via TELOpenTerm -telStillNeeded = -10071 #terminal driver still needed by someone else -telAlreadyOpen = -10070 #terminal already open -telNoCallbackRef = -10064 #no call back reference was specified, but is required -telDisplayModeNotSupp = -10063 #display mode not supported by tool -telBadDisplayMode = -10062 #bad display mode specified -telFwdTypeNotSupp = -10061 #forward type not supported by tool -telDNTypeNotSupp = -10060 #DN type not supported by tool -telBadRate = -10059 #bad rate specified -telBadBearerType = -10058 #bad bearerType specified -telBadSelect = -10057 #unable to select or deselect DN -telBadParkID = -10056 #bad park id specified -telBadPickupGroupID = -10055 #bad pickup group ID specified -telBadFwdType = -10054 #bad fwdType specified -telBadFeatureID = -10053 #bad feature ID specified -telBadIntercomID = -10052 #bad intercom ID specified -telBadPageID = -10051 #bad page ID specified -telBadDNType = -10050 #DN type invalid -telConfLimitExceeded = -10047 #attempt to exceed switch conference limits -telCBErr = -10046 #call back feature not set previously -telTransferRej = -10045 #transfer request rejected -telTransferErr = -10044 #transfer not prepared -telConfRej = -10043 #conference request was rejected -telConfErr = -10042 #conference was not prepared -telConfNoLimit = -10041 #no limit was specified but required -telConfLimitErr = -10040 #limit specified is too high for this configuration -telFeatNotSupp = -10033 #feature program call not supported by this tool -telFeatActive = -10032 #feature already active -telFeatNotAvail = -10031 #feature subscribed but not available -telFeatNotSub = -10030 #feature not subscribed -errAEPropertiesClash = -10025 #illegal combination of properties settings for Set Data, make new, or duplicate -errAECantPutThatThere = -10024 #in make new, duplicate, etc. class can't be an element of container -errAENotAnEnumMember = -10023 #enumerated value in SetData is not allowed for this property -telIntExtNotSupp = -10022 #internal external type not supported by this tool -telBadIntExt = -10021 #bad internal external error -telStateNotSupp = -10020 #device state not supported by tool -telBadStateErr = -10019 #bad device state specified -telIndexNotSupp = -10018 #index not supported by this tool -telBadIndex = -10017 #bad index specified -telAPattNotSupp = -10016 #alerting pattern not supported by tool -telBadAPattErr = -10015 #bad alerting pattern specified -telVTypeNotSupp = -10014 #volume type not supported by this tool -telBadVTypeErr = -10013 #bad volume type error -telBadLevelErr = -10012 #bad volume level setting -telHTypeNotSupp = -10011 #hook type not supported by this tool -telBadHTypeErr = -10010 #bad hook type specified -errAECantSupplyType = -10009 #errAECantSupplyType -telNoOpenErr = -10008 #unable to open terminal -telNoMemErr = -10007 #no memory to allocate handle -errOSACantAssign = -10006 #Signaled when an object cannot be set in a container. -telBadProcErr = -10005 #bad msgProc specified -telBadHandErr = -10004 #bad handle specified -OSAIllegalAssign = -10003 #Signaled when an object can never be set in a container -telBadDNErr = -10002 #TELDNHandle not found or invalid -telBadTermErr = -10001 #invalid TELHandle or handle not found -errAEEventFailed = -10000 #errAEEventFailed -cannotMoveAttachedController = -9999 #cannotMoveAttachedController -controllerHasFixedHeight = -9998 #controllerHasFixedHeight -cannotSetWidthOfAttachedController = -9997 #cannotSetWidthOfAttachedController -controllerBoundsNotExact = -9996 #controllerBoundsNotExact -editingNotAllowed = -9995 #editingNotAllowed -badControllerHeight = -9994 #badControllerHeight -deviceCantMeetRequest = -9408 #deviceCantMeetRequest -seqGrabInfoNotAvailable = -9407 #seqGrabInfoNotAvailable -badSGChannel = -9406 #badSGChannel -couldntGetRequiredComponent = -9405 #couldntGetRequiredComponent -notEnoughDiskSpaceToGrab = -9404 #notEnoughDiskSpaceToGrab -notEnoughMemoryToGrab = -9403 #notEnoughMemoryToGrab -cantDoThatInCurrentMode = -9402 #cantDoThatInCurrentMode -grabTimeComplete = -9401 #grabTimeComplete -noDeviceForChannel = -9400 #noDeviceForChannel -kNoCardBusCISErr = -9109 #No valid CIS exists for this CardBus card -kNotZVCapableErr = -9108 #This socket does not support Zoomed Video -kCardPowerOffErr = -9107 #Power to the card has been turned off -kAttemptDupCardEntryErr = -9106 #The Enabler was asked to create a duplicate card entry -kAlreadySavedStateErr = -9105 #The state has been saved on previous call -kTooManyIOWindowsErr = -9104 #device requested more than one I/O window -kNotReadyErr = -9103 #PC Card failed to go ready -kClientRequestDenied = -9102 #CS Clients should return this code inorder to -kNoCompatibleNameErr = -9101 #There is no compatible driver name for this device -kNoEnablerForCardErr = -9100 #No Enablers were found that can support the card -kNoCardEnablersFoundErr = -9099 #No Enablers were found -kUnsupportedCardErr = -9098 #Card not supported by generic enabler -kNoClientTableErr = -9097 #The client table has not be initialized yet -kNoMoreInterruptSlotsErr = -9096 #All internal Interrupt slots are in use -kNoMoreTimerClientsErr = -9095 #All timer callbacks are in use -kNoIOWindowRequestedErr = -9094 #Request I/O window before calling configuration -kBadCustomIFIDErr = -9093 #Custom interface ID is invalid -kBadTupleDataErr = -9092 #Data in tuple is invalid -kInvalidCSClientErr = -9091 #Card Services ClientID is not registered -kUnsupportedVsErr = -9090 #Unsupported Voltage Sense -kInvalidDeviceNumber = -9089 #kInvalidDeviceNumber -kPostCardEventErr = -9088 #_PCCSLPostCardEvent failed and dropped an event -kCantConfigureCardErr = -9087 #kCantConfigureCardErr -kPassCallToChainErr = -9086 #kPassCallToChainErr -kCardBusCardErr = -9085 #kCardBusCardErr -k16BitCardErr = -9084 #k16BitCardErr -kBadDeviceErr = -9083 #kBadDeviceErr -kBadLinkErr = -9082 #kBadLinkErr -kInvalidRegEntryErr = -9081 #kInvalidRegEntryErr -kNoCardSevicesSocketsErr = -9080 #kNoCardSevicesSocketsErr -kOutOfResourceErr = -9079 #Card Services has exhausted the resource -kNoMoreItemsErr = -9078 #there are no more of the requested item -kInUseErr = -9077 #requested resource is being used by a client -kConfigurationLockedErr = -9076 #a configuration has already been locked -kWriteProtectedErr = -9075 #media is write-protected -kBusyErr = -9074 #unable to process request at this time - try later -kUnsupportedModeErr = -9073 #mode is not supported -kUnsupportedFunctionErr = -9072 #function is not supported by this implementation -kNoCardErr = -9071 #no PC card in the socket -kGeneralFailureErr = -9070 #an undefined error has occurred -kWriteFailureErr = -9069 #unable to complete write request -kReadFailureErr = -9068 #unable to complete read request -kBadSpeedErr = -9067 #specified speed is unavailable -kBadCISErr = -9066 #CIS on card is invalid -kBadHandleErr = -9065 #clientHandle is invalid -kBadArgsErr = -9064 #values in argument packet are invalid -kBadArgLengthErr = -9063 #ArgLength argument is invalid -kBadWindowErr = -9062 #specified window is invalid -kBadVppErr = -9061 #specified Vpp1 or Vpp2 power level index is invalid -kBadVccErr = -9060 #specified Vcc power level index is invalid -kBadTypeErr = -9059 #specified window or interface type is invalid -kBadSocketErr = -9058 #specified logical or physical socket number is invalid -kBadSizeErr = -9057 #specified size is invalid -kBadPageErr = -9056 #specified page is invalid -kBadOffsetErr = -9055 #specified PC card memory array offset is invalid -kBadIRQErr = -9054 #specified IRQ level is invalid -kBadEDCErr = -9053 #specified EDC generator specified is invalid -kBadBaseErr = -9052 #specified base system memory address is invalid -kBadAttributeErr = -9051 #specified attributes field value is invalid -kBadAdapterErr = -9050 #invalid adapter number -codecOffscreenFailedPleaseRetryErr = -8992 #codecOffscreenFailedPleaseRetryErr -lockPortBitsWrongGDeviceErr = -8991 #lockPortBitsWrongGDeviceErr -directXObjectAlreadyExists = -8990 #directXObjectAlreadyExists -codecDroppedFrameErr = -8989 #returned from ImageCodecDrawBand -codecOffscreenFailedErr = -8988 #codecOffscreenFailedErr -codecNeedAccessKeyErr = -8987 #codec needs password in order to decompress -codecParameterDialogConfirm = -8986 #codecParameterDialogConfirm -lockPortBitsSurfaceLostErr = -8985 #lockPortBitsSurfaceLostErr -lockPortBitsBadPortErr = -8984 #lockPortBitsBadPortErr -lockPortBitsWindowClippedErr = -8983 #lockPortBitsWindowClippedErr -lockPortBitsWindowResizedErr = -8982 #lockPortBitsWindowResizedErr -lockPortBitsWindowMovedErr = -8981 #lockPortBitsWindowMovedErr -lockPortBitsBadSurfaceErr = -8980 #lockPortBitsBadSurfaceErr -codecNeedToFlushChainErr = -8979 #codecNeedToFlushChainErr -codecDisabledErr = -8978 #codec disabled itself -- pass codecFlagReenable to reset -codecNoMemoryPleaseWaitErr = -8977 #codecNoMemoryPleaseWaitErr -codecNothingToBlitErr = -8976 #codecNothingToBlitErr -codecCantQueueErr = -8975 #codecCantQueueErr -codecCantWhenErr = -8974 #codecCantWhenErr -codecOpenErr = -8973 #codecOpenErr -codecConditionErr = -8972 #codecConditionErr -codecExtensionNotFoundErr = -8971 #codecExtensionNotFoundErr -codecDataVersErr = -8970 #codecDataVersErr -codecBadDataErr = -8969 #codecBadDataErr -codecWouldOffscreenErr = -8968 #codecWouldOffscreenErr -codecAbortErr = -8967 #codecAbortErr -codecSpoolErr = -8966 #codecSpoolErr -codecImageBufErr = -8965 #codecImageBufErr -codecScreenBufErr = -8964 #codecScreenBufErr -codecSizeErr = -8963 #codecSizeErr -codecUnimpErr = -8962 #codecUnimpErr -noCodecErr = -8961 #noCodecErr -codecErr = -8960 #codecErr -kIllegalClockValueErr = -8852 #kIllegalClockValueErr -kUTCOverflowErr = -8851 #kUTCOverflowErr -kUTCUnderflowErr = -8850 #kUTCUnderflowErr -kATSULastErr = -8809 #The last ATSUI error code. -kATSULineBreakInWord = -8808 #This is not an error code but is returned by ATSUBreakLine to -kATSUCoordinateOverflowErr = -8807 #Used to indicate the coordinates provided to an ATSUI routine caused -kATSUNoFontScalerAvailableErr = -8806 #Used when no font scaler is available for the font passed -kATSUNoFontCmapAvailableErr = -8805 #Used when no CMAP table can be accessed or synthesized for the -kATSULowLevelErr = -8804 #Used when an error was encountered within the low level ATS -kATSUQuickDrawTextErr = -8803 #Used when QuickDraw Text encounters an error rendering or measuring -kATSUNoStyleRunsAssignedErr = -8802 #Used when an attempt was made to measure, highlight or draw -kATSUNotSetErr = -8801 #Used when the client attempts to retrieve an attribute, -kATSUInvalidCacheErr = -8800 #Used when an attempt was made to read in style data -kATSUInvalidAttributeTagErr = -8799 #Used when an attempt was made to use a tag value that -kATSUInvalidAttributeSizeErr = -8798 #Used when an attempt was made to use an attribute with a -kATSUInvalidAttributeValueErr = -8797 #Used when an attempt was made to use an attribute with -kATSUInvalidFontErr = -8796 #Used when an attempt was made to use an invalid font ID. -kATSUNoCorrespondingFontErr = -8795 #This value is retrned by font ID conversion -kATSUFontsNotMatched = -8794 #This value is returned by ATSUMatchFontsToText() -kATSUFontsMatched = -8793 #This is not an error code but is returned by -kATSUInvalidTextRangeErr = -8792 #An attempt was made to extract information -kATSUInvalidStyleErr = -8791 #An attempt was made to use a ATSUStyle which -kATSUInvalidTextLayoutErr = -8790 #An attempt was made to use a ATSUTextLayout -kTECOutputBufferFullStatus = -8785 #output buffer has no room for conversion of next input text element (partial conversion) -kTECNeedFlushStatus = -8784 #kTECNeedFlushStatus -kTECUsedFallbacksStatus = -8783 #kTECUsedFallbacksStatus -kTECItemUnavailableErr = -8771 #item (e.g. name) not available for specified region (& encoding if relevant) -kTECGlobalsUnavailableErr = -8770 #globals have already been deallocated (premature TERM) -unicodeChecksumErr = -8769 #unicodeChecksumErr -unicodeNoTableErr = -8768 #unicodeNoTableErr -unicodeVariantErr = -8767 #unicodeVariantErr -unicodeFallbacksErr = -8766 #unicodeFallbacksErr -unicodePartConvertErr = -8765 #unicodePartConvertErr -unicodeBufErr = -8764 #unicodeBufErr -unicodeCharErr = -8763 #unicodeCharErr -unicodeElementErr = -8762 #unicodeElementErr -unicodeNotFoundErr = -8761 #unicodeNotFoundErr -unicodeTableFormatErr = -8760 #unicodeTableFormatErr -unicodeDirectionErr = -8759 #unicodeDirectionErr -unicodeContextualErr = -8758 #unicodeContextualErr -unicodeTextEncodingDataErr = -8757 #unicodeTextEncodingDataErr -kTECDirectionErr = -8756 #direction stack overflow, etc. -kTECIncompleteElementErr = -8755 #text element may be incomplete or is too long for internal buffers -kTECUnmappableElementErr = -8754 #kTECUnmappableElementErr -kTECPartialCharErr = -8753 #input buffer ends in the middle of a multibyte character, conversion stopped -kTECBadTextRunErr = -8752 #kTECBadTextRunErr -kTECArrayFullErr = -8751 #supplied name buffer or TextRun, TextEncoding, or UnicodeMapping array is too small -kTECBufferBelowMinimumSizeErr = -8750 #output buffer too small to allow processing of first input text element -kTECNoConversionPathErr = -8749 #kTECNoConversionPathErr -kTECCorruptConverterErr = -8748 #invalid converter object reference -kTECTableFormatErr = -8747 #kTECTableFormatErr -kTECTableChecksumErr = -8746 #kTECTableChecksumErr -kTECMissingTableErr = -8745 #kTECMissingTableErr -kTextUndefinedElementErr = -8740 #text conversion errors -kTextMalformedInputErr = -8739 #in DBCS, for example, high byte followed by invalid low byte -kTextUnsupportedEncodingErr = -8738 #specified encoding not supported for this operation -kRANotEnabled = -7139 #kRANotEnabled -kRACallBackFailed = -7138 #kRACallBackFailed -kRADuplicateIPAddr = -7137 #kRADuplicateIPAddr -kRANCPRejectedbyPeer = -7136 #kRANCPRejectedbyPeer -kRAExtAuthenticationFailed = -7135 #kRAExtAuthenticationFailed -kRAATalkInactive = -7134 #kRAATalkInactive -kRAPeerNotResponding = -7133 #kRAPeerNotResponding -kRAPPPPeerDisconnected = -7132 #kRAPPPPeerDisconnected -kRAPPPUserDisconnected = -7131 #kRAPPPUserDisconnected -kRAPPPNegotiationFailed = -7130 #kRAPPPNegotiationFailed -kRAPPPAuthenticationFailed = -7129 #kRAPPPAuthenticationFailed -kRAPPPProtocolRejected = -7128 #kRAPPPProtocolRejected -dcmBufferOverflowErr = -7127 #data is larger than buffer size -kRANotPrimaryInterface = -7126 #when IPCP is not primary TCP/IP intf. -kRATCPIPNotConfigured = -7125 #TCP/IP not configured, could be loaded -kRATCPIPInactive = -7124 #TCP/IP inactive, cannot be loaded -kRARemoteAccessNotReady = -7123 #kRARemoteAccessNotReady -kRAInitOpenTransportFailed = -7122 #kRAInitOpenTransportFailed -dcmProtectedErr = -7121 #need keyword to use dictionary -kRAUserPwdEntryRequired = -7120 #kRAUserPwdEntryRequired -kRAUserPwdChangeRequired = -7119 #kRAUserPwdChangeRequired -dcmBadFindMethodErr = -7118 #no such find method supported -kRAInvalidSerialProtocol = -7117 #kRAInvalidSerialProtocol -kRAInvalidPortState = -7116 #kRAInvalidPortState -dcmBadKeyErr = -7115 #bad key information -kRAPortBusy = -7114 #kRAPortBusy -kRAInstallationDamaged = -7113 #kRAInstallationDamaged -dcmBadFieldTypeErr = -7112 #no such field type supported -dcmBadFieldInfoErr = -7111 #incomplete information -dcmNecessaryFieldErr = -7110 #lack required/identify field -dcmDupRecordErr = -7109 #same record already exist -kRANotConnected = -7108 #kRANotConnected -dcmBlockFullErr = -7107 #dictionary block full -kRAMissingResources = -7106 #kRAMissingResources -dcmDictionaryBusyErr = -7105 #dictionary is busy -dcmDictionaryNotOpenErr = -7104 #dictionary not opened -dcmPermissionErr = -7103 #invalid permission -dcmBadDictionaryErr = -7102 #invalid dictionary -dcmNotDictionaryErr = -7101 #not dictionary -kRAInvalidParameter = -7100 #kRAInvalidParameter -laEngineNotFoundErr = -7000 #can't find the engine -laPropertyErr = -6999 #Error in properties -kUSBUnknownDeviceErr = -6998 #device ref not recognised -laPropertyIsReadOnlyErr = -6997 #the property is read only -laPropertyUnknownErr = -6996 #the property is unknown to this environment -laPropertyValueErr = -6995 #Invalid property value -laDictionaryTooManyErr = -6994 #too many dictionaries -laDictionaryUnknownErr = -6993 #can't use this dictionary with this environment -laDictionaryNotOpenedErr = -6992 #the dictionary is not opened -laTextOverFlowErr = -6991 #text is too long -laFailAnalysisErr = -6990 #analysis failed -laNoMoreMorphemeErr = -6989 #nothing to read -laInvalidPathErr = -6988 #path is not correct -kUSBNotHandled = -6987 #Notification was not handled (same as NotFound) -laEnvironmentNotFoundErr = -6986 #can't fint the specified environment -laEnvironmentBusyErr = -6985 #specified environment is used -laTooSmallBufferErr = -6984 #output buffer is too small to store any result -kUSBFlagsError = -6983 #Unused flags not zeroed -kUSBAbortedError = -6982 #Pipe aborted -kUSBNoBandwidthError = -6981 #Not enough bandwidth available -kUSBPipeIdleError = -6980 #Pipe is Idle, it will not accept transactions -kUSBPipeStalledError = -6979 #Pipe has stalled, error needs to be cleared -kUSBUnknownInterfaceErr = -6978 #Interface ref not recognised -kUSBDeviceBusy = -6977 #Device is already being configured -kUSBDevicePowerProblem = -6976 #Device has a power problem -kUSBInvalidBuffer = -6975 #bad buffer, usually nil -kUSBDeviceSuspended = -6974 #Device is suspended -kUSBDeviceNotSuspended = -6973 #device is not suspended for resume -kUSBDeviceDisconnected = -6972 #Disconnected during suspend or reset -kUSBTimedOut = -6971 #Transaction timed out. -kUSBQueueAborted = -6970 #Pipe zero stall cleared. -kUSBPortDisabled = -6969 #The port you are attached to is disabled, use USBDeviceReset. -kUSBBadDispatchTable = -6950 #Improper driver dispatch table -kUSBUnknownNotification = -6949 #Notification type not defined -kUSBQueueFull = -6948 #Internal queue maxxed -kUSBLinkErr = -6916 #kUSBLinkErr -kUSBCRCErr = -6915 #Pipe stall, bad CRC -kUSBBitstufErr = -6914 #Pipe stall, bitstuffing -kUSBDataToggleErr = -6913 #Pipe stall, Bad data toggle -kUSBEndpointStallErr = -6912 #Device didn't understand -kUSBNotRespondingErr = -6911 #Pipe stall, No device, device hung -kUSBPIDCheckErr = -6910 #Pipe stall, PID CRC error -kUSBWrongPIDErr = -6909 #Pipe stall, Bad or wrong PID -kUSBOverRunErr = -6908 #Packet too large or more data than buffer -kUSBUnderRunErr = -6907 #Less data than buffer -kUSBRes1Err = -6906 #kUSBRes1Err -kUSBRes2Err = -6905 #kUSBRes2Err -kUSBBufOvrRunErr = -6904 #Host hardware failure on data in, PCI busy? -kUSBBufUnderRunErr = -6903 #Host hardware failure on data out, PCI busy? -kUSBNotSent1Err = -6902 #Transaction not sent -kUSBNotSent2Err = -6901 #Transaction not sent -kDMFoundErr = -6232 #Did not proceed because we found an item -kDMMainDisplayCannotMoveErr = -6231 #Trying to move main display (or a display mirrored to it) -kDMDisplayAlreadyInstalledErr = -6230 #Attempt to add an already installed display. -kDMDisplayNotFoundErr = -6229 #Could not find item (will someday remove). -kDMDriverNotDisplayMgrAwareErr = -6228 #Video Driver does not support display manager. -kDMSWNotInitializedErr = -6227 #Required software not initialized (eg windowmanager or display mgr). -kSysSWTooOld = -6226 #Missing critical pieces of System Software. -kDMMirroringNotOn = -6225 #Returned by all calls that need mirroring to be on to do their thing. -kDMCantBlock = -6224 #Mirroring is already on, canÕt Block now (call DMUnMirror() first). -kDMMirroringBlocked = -6223 #DMBlockMirroring() has been called. -kDMWrongNumberOfDisplays = -6222 #Can only handle 2 displays for now. -kDMMirroringOnAlready = -6221 #Returned by all calls that need mirroring to be off to do their thing. -kDMGenErr = -6220 #Unexpected Error -kQTSSUnknownErr = -6150 #kQTSSUnknownErr -collectionVersionErr = -5753 #collectionVersionErr -collectionIndexRangeErr = -5752 #collectionIndexRangeErr -collectionItemNotFoundErr = -5751 #collectionItemNotFoundErr -collectionItemLockedErr = -5750 #collectionItemLockedErr -kNavMissingKindStringErr = -5699 #kNavMissingKindStringErr -kNavInvalidCustomControlMessageErr = -5698 #kNavInvalidCustomControlMessageErr -kNavCustomControlMessageFailedErr = -5697 #kNavCustomControlMessageFailedErr -kNavInvalidSystemConfigErr = -5696 #kNavInvalidSystemConfigErr -kNavWrongDialogClassErr = -5695 #kNavWrongDialogClassErr -kNavWrongDialogStateErr = -5694 #kNavWrongDialogStateErr -dialogNoTimeoutErr = -5640 #dialogNoTimeoutErr -menuInvalidErr = -5623 #menu is invalid -menuItemNotFoundErr = -5622 #specified menu item wasn't found -menuUsesSystemDefErr = -5621 #GetMenuDefinition failed because the menu uses the system MDEF -menuNotFoundErr = -5620 #specified menu or menu ID wasn't found -windowWrongStateErr = -5615 #window is not in a state that is valid for the current action -windowManagerInternalErr = -5614 #something really weird happened inside the window manager -windowAttributesConflictErr = -5613 #passed some attributes that are mutually exclusive -windowAttributeImmutableErr = -5612 #tried to change attributes which can't be changed -errWindowDoesNotFitOnscreen = -5611 #ConstrainWindowToScreen could not make the window fit onscreen -errWindowNotFound = -5610 #returned from FindWindowOfClass -errFloatingWindowsNotInitialized = -5609 #called HideFloatingWindows or ShowFloatingWindows without calling InitFloatingWindows -errWindowsAlreadyInitialized = -5608 #tried to call InitFloatingWindows twice, or called InitWindows and then floating windows -errUserWantsToDragWindow = -5607 #if returned from TrackWindowProxyDrag, you should call DragWindow on the window -errCorruptWindowDescription = -5606 #tried to load a corrupt window description (size or version fields incorrect) -errUnrecognizedWindowClass = -5605 #tried to create a window with a bad WindowClass -errWindowPropertyNotFound = -5604 #tried to get a nonexistent property -errInvalidWindowProperty = -5603 #tried to access a property tag with private creator -errWindowDoesNotHaveProxy = -5602 #tried to do something requiring a proxy to a window which doesnÕt have a proxy -errUnsupportedWindowAttributesForClass = -5601 #tried to create a window with WindowAttributes not supported by the WindowClass -errInvalidWindowPtr = -5600 #tried to pass a bad WindowRef argument -gestaltLocationErr = -5553 #gestalt function ptr wasn't in sysheap -gestaltDupSelectorErr = -5552 #tried to add an entry that already existed -gestaltUndefSelectorErr = -5551 #undefined selector was passed to Gestalt -gestaltUnknownErr = -5550 #value returned if Gestalt doesn't know the answer -envVersTooBig = -5502 #Version bigger than call can handle -envBadVers = -5501 #Version non-positive -envNotPresent = -5500 #returned by glue. -qtsAddressBusyErr = -5421 #qtsAddressBusyErr -qtsConnectionFailedErr = -5420 #qtsConnectionFailedErr -qtsTimeoutErr = -5408 #qtsTimeoutErr -qtsUnknownValueErr = -5407 #qtsUnknownValueErr -qtsTooMuchDataErr = -5406 #qtsTooMuchDataErr -qtsUnsupportedFeatureErr = -5405 #qtsUnsupportedFeatureErr -qtsUnsupportedRateErr = -5404 #qtsUnsupportedRateErr -qtsUnsupportedDataTypeErr = -5403 #qtsUnsupportedDataTypeErr -qtsBadDataErr = -5402 #something is wrong with the data -qtsBadStateErr = -5401 #qtsBadStateErr -qtsBadSelectorErr = -5400 #qtsBadSelectorErr -errIAEndOfTextRun = -5388 #errIAEndOfTextRun -errIATextExtractionErr = -5387 #errIATextExtractionErr -errIAInvalidDocument = -5386 #errIAInvalidDocument -errIACanceled = -5385 #errIACanceled -errIABufferTooSmall = -5384 #errIABufferTooSmall -errIANoMoreItems = -5383 #errIANoMoreItems -errIAParamErr = -5382 #errIAParamErr -errIAAllocationErr = -5381 #errIAAllocationErr -errIAUnknownErr = -5380 #errIAUnknownErr -hrURLNotHandledErr = -5363 #hrURLNotHandledErr -hrUnableToResizeHandleErr = -5362 #hrUnableToResizeHandleErr -hrMiscellaneousExceptionErr = -5361 #hrMiscellaneousExceptionErr -hrHTMLRenderingLibNotInstalledErr = -5360 #hrHTMLRenderingLibNotInstalledErr -errCannotUndo = -5253 #errCannotUndo -errNonContiuousAttribute = -5252 #errNonContiuousAttribute -errUnknownElement = -5251 #errUnknownElement -errReadOnlyText = -5250 #errReadOnlyText -errEmptyScrap = -5249 #errEmptyScrap -errNoHiliteText = -5248 #errNoHiliteText -errOffsetNotOnElementBounday = -5247 #errOffsetNotOnElementBounday -errInvalidRange = -5246 #errInvalidRange -errIteratorReachedEnd = -5245 #errIteratorReachedEnd -errEngineNotFound = -5244 #errEngineNotFound -errAlreadyInImagingMode = -5243 #errAlreadyInImagingMode -errNotInImagingMode = -5242 #errNotInImagingMode -errMarginWilllNotFit = -5241 #errMarginWilllNotFit -errUnknownAttributeTag = -5240 #errUnknownAttributeTag -afpSameNodeErr = -5063 #An Attempt was made to connect to a file server running on the same machine -afpAlreadyMounted = -5062 #The volume is already mounted -afpCantMountMoreSrvre = -5061 #The Maximum number of server connections has been reached -afpBadDirIDType = -5060 #afpBadDirIDType -afpCallNotAllowed = -5048 #The server knows what you wanted to do, but won't let you do it just now -afpAlreadyLoggedInErr = -5047 #User has been authenticated but is already logged in from another machine (and that's not allowed on this server) -afpPwdPolicyErr = -5046 #Password does not conform to servers password policy -afpPwdNeedsChangeErr = -5045 #The password needs to be changed -afpInsideTrashErr = -5044 #The folder being shared is inside the trash folder OR the shared folder is being moved into the trash folder -afpInsideSharedErr = -5043 #The folder being shared is inside a shared folder OR the folder contains a shared folder and is being moved into a shared folder -afpPwdExpiredErr = -5042 #The password being used is too old: this requires the user to change the password before log-in can continue -afpPwdTooShortErr = -5041 #The password being set is too short: there is a minimum length that must be met or exceeded -afpPwdSameErr = -5040 #Someone tried to change their password to the same password on a mantadory password change -afpBadIDErr = -5039 #afpBadIDErr -afpSameObjectErr = -5038 #afpSameObjectErr -afpCatalogChanged = -5037 #afpCatalogChanged -afpDiffVolErr = -5036 #afpDiffVolErr -afpIDExists = -5035 #afpIDExists -afpIDNotFound = -5034 #afpIDNotFound -afpContainsSharedErr = -5033 #the folder being shared contains a shared folder -afpObjectLocked = -5032 #Object is M/R/D/W inhibited -afpVolLocked = -5031 #Volume is Read-Only -afpIconTypeError = -5030 #Icon size specified different from existing icon size -afpDirNotFound = -5029 #Unknown directory specified -afpCantRename = -5028 #AFPRename cannot rename volume -afpServerGoingDown = -5027 #Server is shutting down -afpTooManyFilesOpen = -5026 #Maximum open file count reached -afpObjectTypeErr = -5025 #File/Directory specified where Directory/File expected -afpCallNotSupported = -5024 #Unsupported AFP call was made -afpUserNotAuth = -5023 #No AFPLogin call has successfully been made for this session -afpSessClosed = -5022 #Session closed -afpRangeOverlap = -5021 #Some or all of range already locked by same user -afpRangeNotLocked = -5020 #Tried to unlock range that was not locked by user -afpParmErr = -5019 #A specified parameter was out of allowable range -afpObjectNotFound = -5018 #Specified file or directory does not exist -afpObjectExists = -5017 #Specified destination file or directory already exists -afpNoServer = -5016 #Server not responding -afpNoMoreLocks = -5015 #Maximum lock limit reached -afpMiscErr = -5014 #Unexpected error encountered during execution -afpLockErr = -5013 #Some or all of requested range is locked by another user -afpItemNotFound = -5012 #Unknown UserName/UserID or missing comment/APPL entry -afpFlatVol = -5011 #Cannot create directory on specified volume -afpFileBusy = -5010 #Cannot delete an open file -afpEofError = -5009 #Read beyond logical end-of-file -afpDiskFull = -5008 #Insufficient free space on volume for operation -afpDirNotEmpty = -5007 #Cannot delete non-empty directory -afpDenyConflict = -5006 #Specified open/deny modes conflict with current open modes -afpCantMove = -5005 #Move destination is offspring of source, or root was specified -afpBitmapErr = -5004 #Bitmap contained bits undefined for call -afpBadVersNum = -5003 #Unknown AFP protocol version number specified -afpBadUAM = -5002 #Unknown user authentication method specified -afpAuthContinue = -5001 #Further information required to complete AFPLogin call -afpAccessDenied = -5000 #Insufficient access privileges for operation -illegalScrapFlavorSizeErr = -4999 #illegalScrapFlavorSizeErr -illegalScrapFlavorTypeErr = -4998 #illegalScrapFlavorTypeErr -illegalScrapFlavorFlagsErr = -4997 #illegalScrapFlavorFlagsErr -scrapFlavorSizeMismatchErr = -4996 #scrapFlavorSizeMismatchErr -scrapFlavorFlagsMismatchErr = -4995 #scrapFlavorFlagsMismatchErr -nilScrapFlavorDataErr = -4994 #nilScrapFlavorDataErr -noScrapPromiseKeeperErr = -4993 #noScrapPromiseKeeperErr -scrapPromiseNotKeptErr = -4992 #scrapPromiseNotKeptErr -processStateIncorrectErr = -4991 #processStateIncorrectErr -badScrapRefErr = -4990 #badScrapRefErr -duplicateScrapFlavorErr = -4989 #duplicateScrapFlavorErr -internalScrapErr = -4988 #internalScrapErr -coreFoundationUnknownErr = -4960 #coreFoundationUnknownErr -badRoutingSizeErr = -4276 #badRoutingSizeErr -routingNotFoundErr = -4275 #routingNotFoundErr -duplicateRoutingErr = -4274 #duplicateRoutingErr -invalidFolderTypeErr = -4273 #invalidFolderTypeErr -noMoreFolderDescErr = -4272 #noMoreFolderDescErr -duplicateFolderDescErr = -4271 #duplicateFolderDescErr -badFolderDescErr = -4270 #badFolderDescErr -cmCantGamutCheckError = -4217 #Gammut checking not supported by this ColorWorld -cmNamedColorNotFound = -4216 #NamedColor not found -cmCantCopyModifiedV1Profile = -4215 #Illegal to copy version 1 profiles that have been modified -cmRangeOverFlow = -4214 #Color conversion warning that some output color values over/underflowed and were clipped -cmInvalidProfileComment = -4213 #Bad Profile comment during drawpicture -cmNoGDevicesError = -4212 #Begin/End Matching -- no gdevices available -cmInvalidDstMap = -4211 #Destination pix/bit map was invalid -cmInvalidSrcMap = -4210 #Source pix/bit map was invalid -cmInvalidColorSpace = -4209 #Profile colorspace does not match bitmap type -cmErrIncompatibleProfile = -4208 #Other ColorSync Errors -cmSearchError = -4207 #cmSearchError -cmInvalidSearch = -4206 #Bad Search Handle -cmInvalidProfileLocation = -4205 #Operation not supported for this profile location -cmInvalidProfile = -4204 #A Profile must contain a 'cs1 ' tag to be valid -cmFatalProfileErr = -4203 #cmFatalProfileErr -cmCantDeleteElement = -4202 #cmCantDeleteElement -cmIndexRangeErr = -4201 #Tag index out of range -kNSLInitializationFailed = -4200 #UNABLE TO INITIALIZE THE MANAGER!!!!! DO NOT CONTINUE!!!! -kNSLNotInitialized = -4199 #kNSLNotInitialized -kNSLInsufficientSysVer = -4198 #kNSLInsufficientSysVer -kNSLInsufficientOTVer = -4197 #kNSLInsufficientOTVer -kNSLNoElementsInList = -4196 #kNSLNoElementsInList -kNSLBadReferenceErr = -4195 #kNSLBadReferenceErr -kNSLBadServiceTypeErr = -4194 #kNSLBadServiceTypeErr -kNSLBadDataTypeErr = -4193 #kNSLBadDataTypeErr -kNSLBadNetConnection = -4192 #kNSLBadNetConnection -kNSLNoSupportForService = -4191 #kNSLNoSupportForService -kNSLInvalidPluginSpec = -4190 #kNSLInvalidPluginSpec -kNSLRequestBufferAlreadyInList = -4189 #kNSLRequestBufferAlreadyInList -kNSLNoContextAvailable = -4188 #(ContinueLookup function ptr invalid) -kNSLBufferTooSmallForData = -4187 #(Client buffer too small for data from plugin) -kNSLCannotContinueLookup = -4186 #(Can't continue lookup; error or bad state) -kNSLBadClientInfoPtr = -4185 #(nil ClientAsyncInfoPtr; no reference available) -kNSLNullListPtr = -4184 #(client is trying to add items to a nil list) -kNSLBadProtocolTypeErr = -4183 #(client is trying to add a null protocol type) -kNSLPluginLoadFailed = -4182 #(manager unable to load one of the plugins) -kNSLNoPluginsFound = -4181 #(manager didn't find any valid plugins to load) -kNSLSearchAlreadyInProgress = -4180 #(you can only have one ongoing search per clientRef) -kNSLNoPluginsForSearch = -4179 #(no plugins will respond to search request; bad protocol(s)?) -kNSLNullNeighborhoodPtr = -4178 #(client passed a null neighborhood ptr) -kNSLSomePluginsFailedToLoad = -4177 #(one or more plugins failed to load, but at least one did load; this error isn't fatal) -kNSLErrNullPtrError = -4176 #kNSLErrNullPtrError -kNSLNotImplementedYet = -4175 #kNSLNotImplementedYet -kNSLUILibraryNotAvailable = -4174 #The NSL UI Library needs to be in the Extensions Folder -kNSLNoCarbonLib = -4173 #kNSLNoCarbonLib -kNSLBadURLSyntax = -4172 #URL contains illegal characters -kNSLSchedulerError = -4171 #A custom thread routine encountered an error -kNSL68kContextNotSupported = -4170 #no 68k allowed -noHelpForItem = -4009 #noHelpForItem -badProfileError = -4008 #badProfileError -colorSyncNotInstalled = -4007 #colorSyncNotInstalled -pickerCantLive = -4006 #pickerCantLive -cantLoadPackage = -4005 #cantLoadPackage -cantCreatePickerWindow = -4004 #cantCreatePickerWindow -cantLoadPicker = -4003 #cantLoadPicker -pickerResourceError = -4002 #pickerResourceError -requiredFlagsDontMatch = -4001 #requiredFlagsDontMatch -firstPickerError = -4000 #firstPickerError -kOTPortLostConnection = -3285 # -kOTUserRequestedErr = -3284 # -kOTConfigurationChangedErr = -3283 # -kOTBadConfigurationErr = -3282 # -kOTPortWasEjectedErr = -3281 # -kOTPortHasDiedErr = -3280 # -kOTClientNotInittedErr = -3279 # -kENOMSGErr = -3278 # -kESRCHErr = -3277 # -kEINPROGRESSErr = -3276 # -kENODATAErr = -3275 # -kENOSTRErr = -3274 # -kECANCELErr = -3273 # -kEBADMSGErr = -3272 # -kENOSRErr = -3271 # -kETIMEErr = -3270 # -kEPROTOErr = -3269 #‚‚‚ fill out missing codes ‚‚‚ -kEHOSTUNREACHErr = -3264 #No route to host -kEHOSTDOWNErr = -3263 #Host is down -kECONNREFUSEDErr = -3260 #Connection refused -kETIMEDOUTErr = -3259 #Connection timed out -kETOOMANYREFSErr = -3258 #Too many references: can't splice -kESHUTDOWNErr = -3257 #Can't send after socket shutdown -kENOTCONNErr = -3256 #Socket is not connected -kEISCONNErr = -3255 #Socket is already connected -kENOBUFSErr = -3254 #No buffer space available -kECONNRESETErr = -3253 #Connection reset by peer -kECONNABORTEDErr = -3252 #Software caused connection abort -kENETRESETErr = -3251 #Network dropped connection on reset -kENETUNREACHErr = -3250 #Network is unreachable -kENETDOWNErr = -3249 #Network is down -kEADDRNOTAVAILErr = -3248 #Can't assign requested address -kEADDRINUSEErr = -3247 #Address already in use -kEOPNOTSUPPErr = -3244 #Operation not supported on socket -kESOCKTNOSUPPORTErr = -3243 #Socket type not supported -kEPROTONOSUPPORTErr = -3242 #Protocol not supported -kENOPROTOOPTErr = -3241 #Protocol not available -kEPROTOTYPEErr = -3240 #Protocol wrong type for socket -kEMSGSIZEErr = -3239 #Message too long -kEDESTADDRREQErr = -3238 #Destination address required -kENOTSOCKErr = -3237 #Socket operation on non-socket -kEALREADYErr = -3236 # -kEWOULDBLOCKErr = -3234 #Call would block, so was aborted -kERANGEErr = -3233 #Message size too large for STREAM -kEPIPEErr = -3231 #Broken pipe -kENOTTYErr = -3224 #Not a character device -kEINVALErr = -3221 #Invalid argument -kENODEVErr = -3218 #No such device -kOTDuplicateFoundErr = -3216 #OT generic duplicate found error -kEBUSYErr = -3215 #Device or resource busy -kEFAULTErr = -3213 #Bad address -kEACCESErr = -3212 #Permission denied -kOTOutOfMemoryErr = -3211 #OT ran out of memory, may be a temporary -kEAGAINErr = -3210 #Try operation again later -kEBADFErr = -3208 #Bad file number -kENXIOErr = -3205 #No such device or address -kEIOErr = -3204 #I/O error -kEINTRErr = -3203 #Interrupted system service -kENORSRCErr = -3202 #No such resource -kOTNotFoundErr = -3201 #OT generic not found error -kEPERMErr = -3200 #Permission denied -kOTCanceledErr = -3180 #XTI2OSStatus(TCANCELED) The command was cancelled -kOTBadSyncErr = -3179 #XTI2OSStatus(TBADSYNC) A synchronous call at interrupt time -kOTProtocolErr = -3178 #XTI2OSStatus(TPROTO) An unspecified provider error occurred -kOTQFullErr = -3177 #XTI2OSStatus(TQFULL) -kOTResAddressErr = -3176 #XTI2OSStatus(TRESADDR) -kOTResQLenErr = -3175 #XTI2OSStatus(TRESQLEN) -kOTProviderMismatchErr = -3174 #XTI2OSStatus(TPROVMISMATCH) Tried to accept on incompatible endpoint -kOTIndOutErr = -3173 #XTI2OSStatus(TINDOUT) Accept failed because of pending listen -kOTAddressBusyErr = -3172 #XTI2OSStatus(TADDRBUSY) Address requested is already in use -kOTBadQLenErr = -3171 #XTI2OSStatus(TBADQLEN) A Bind to an in-use addr with qlen > 0 -kOTBadNameErr = -3170 #XTI2OSStatus(TBADNAME) A bad endpoint name was supplied -kOTNoStructureTypeErr = -3169 #XTI2OSStatus(TNOSTRUCTYPE) Bad structure type requested for OTAlloc -kOTStateChangeErr = -3168 #XTI2OSStatus(TSTATECHNG) State is changing - try again later -kOTNotSupportedErr = -3167 #XTI2OSStatus(TNOTSUPPORT) Command is not supported -kOTNoReleaseErr = -3166 #XTI2OSStatus(TNOREL) No orderly release indication available -kOTBadFlagErr = -3165 #XTI2OSStatus(TBADFLAG) A Bad flag value was supplied -kOTNoUDErrErr = -3164 #XTI2OSStatus(TNOUDERR) No Unit Data Error indication available -kOTNoDisconnectErr = -3163 #XTI2OSStatus(TNODIS) No disconnect indication available -kOTNoDataErr = -3162 #XTI2OSStatus(TNODATA) No data available for reading -kOTFlowErr = -3161 #XTI2OSStatus(TFLOW) Provider is flow-controlled -kOTBufferOverflowErr = -3160 #XTI2OSStatus(TBUFOVFLW) Passed buffer not big enough -kOTBadDataErr = -3159 #XTI2OSStatus(TBADDATA) An illegal amount of data was specified -kOTLookErr = -3158 #XTI2OSStatus(TLOOK) An event occurred - call Look() -kOTSysErrorErr = -3157 #XTI2OSStatus(TSYSERR) A system error occurred -kOTBadSequenceErr = -3156 #XTI2OSStatus(TBADSEQ) Sequence specified does not exist -kOTOutStateErr = -3155 #XTI2OSStatus(TOUTSTATE) Call issued in wrong state -kOTNoAddressErr = -3154 #XTI2OSStatus(TNOADDR) No address was specified -kOTBadReferenceErr = -3153 #XTI2OSStatus(TBADF) Bad provider reference -kOTAccessErr = -3152 #XTI2OSStatus(TACCES) Missing access permission -kOTBadOptionErr = -3151 #XTI2OSStatus(TBADOPT) A Bad option was specified -kOTBadAddressErr = -3150 #XTI2OSStatus(TBADADDR) A Bad address was specified -sktClosedErr = -3109 #sktClosedErr -recNotFnd = -3108 #recNotFnd -atpBadRsp = -3107 #atpBadRsp -atpLenErr = -3106 #atpLenErr -readQErr = -3105 #readQErr -extractErr = -3104 #extractErr -ckSumErr = -3103 #ckSumErr -noMPPErr = -3102 #noMPPErr -buf2SmallErr = -3101 #buf2SmallErr -noPrefAppErr = -3032 #noPrefAppErr -badTranslationSpecErr = -3031 #badTranslationSpecErr -noTranslationPathErr = -3030 #noTranslationPathErr -couldNotParseSourceFileErr = -3026 #Source document does not contain source type -invalidTranslationPathErr = -3025 #Source type to destination type not a valid path -retryComponentRegistrationErr = -3005 #retryComponentRegistrationErr -unresolvedComponentDLLErr = -3004 #unresolvedComponentDLLErr -componentDontRegister = -3003 #componentDontRegister -componentNotCaptured = -3002 #componentNotCaptured -validInstancesExist = -3001 #validInstancesExist -invalidComponentID = -3000 #invalidComponentID -cfragLastErrCode = -2899 #The last value in the range of CFM errors. -cfragOutputLengthErr = -2831 #An output parameter is too small to hold the value. -cfragAbortClosureErr = -2830 #Used by notification handlers to abort a closure. -cfragClosureIDErr = -2829 #The closure ID was not valid. -cfragContainerIDErr = -2828 #The fragment container ID was not valid. -cfragNoRegistrationErr = -2827 #The registration name was not found. -cfragNotClosureErr = -2826 #The closure ID was actually a connection ID. -cfragFileSizeErr = -2825 #A file was too large to be mapped. -cfragFragmentUsageErr = -2824 #A semantic error in usage of the fragment. -cfragArchitectureErr = -2823 #A fragment has an unacceptable architecture. -cfragNoApplicationErr = -2822 #No application member found in the cfrg resource. -cfragInitFunctionErr = -2821 #A fragment's initialization routine returned an error. -cfragFragmentCorruptErr = -2820 #A fragment's container was corrupt (known format). -cfragCFMInternalErr = -2819 #An internal inconstistancy has been detected. -cfragCFMStartupErr = -2818 #Internal error during CFM initialization. -cfragLibConnErr = -2817 # -cfragInitAtBootErr = -2816 #A boot library has an initialization function. (System 7 only) -cfragInitLoopErr = -2815 #Circularity in required initialization order. -cfragImportTooNewErr = -2814 #An import library was too new for a client. -cfragImportTooOldErr = -2813 #An import library was too old for a client. -cfragInitOrderErr = -2812 # -cfragNoIDsErr = -2811 #No more CFM IDs for contexts, connections, etc. -cfragNoClientMemErr = -2810 #Out of memory for fragment mapping or section instances. -cfragNoPrivateMemErr = -2809 #Out of memory for internal bookkeeping. -cfragNoPositionErr = -2808 #The registration insertion point was not found. -cfragUnresolvedErr = -2807 #A fragment had "hard" unresolved imports. -cfragFragmentFormatErr = -2806 #A fragment's container format is unknown. -cfragDupRegistrationErr = -2805 #The registration name was already in use. -cfragNoLibraryErr = -2804 #The named library was not found. -cfragNoSectionErr = -2803 #The specified section was not found. -cfragNoSymbolErr = -2802 #The specified symbol was not found. -cfragConnectionIDErr = -2801 #The connection ID was not valid. -cfragFirstErrCode = -2800 #The first value in the range of CFM errors. -errASInconsistentNames = -2780 #English errors: -errASNoResultReturned = -2763 #The range -2780 thru -2799 is reserved for dialect specific error codes. (Error codes from different dialects may overlap.) -errASParameterNotForEvent = -2762 #errASParameterNotForEvent -errASIllegalFormalParameter = -2761 #errASIllegalFormalParameter -errASTerminologyNestingTooDeep = -2760 #errASTerminologyNestingTooDeep -OSAControlFlowError = -2755 #Signaled when illegal control flow occurs in an application (no catcher for throw, non-lexical loop exit, etc.) -OSAInconsistentDeclarations = -2754 #Signaled when a variable is declared inconsistently in the same scope, such as both local and global -OSAUndefinedVariable = -2753 #Signaled when a variable is accessed that has no value -OSADuplicateHandler = -2752 #Signaled when more than one handler is defined with the same name in a scope where the language doesn't allow it -OSADuplicateProperty = -2751 #Signaled when a formal parameter, local variable, or instance variable is specified more than once. -OSADuplicateParameter = -2750 #Signaled when a formal parameter, local variable, or instance variable is specified more than once -OSATokenTooLong = -2742 #Signaled when a name or number is too long to be parsed -OSASyntaxTypeError = -2741 #Signaled when another form of syntax was expected. (e.g. "expected a but found ") -OSASyntaxError = -2740 #Signaled when a syntax error occurs. (e.g. "Syntax error" or " can't go after ") -errASCantCompareMoreThan32k = -2721 #Parser/Compiler errors: -errASCantConsiderAndIgnore = -2720 #errASCantConsiderAndIgnore -errOSACantCreate = -2710 #errOSACantCreate -errOSACantGetTerminology = -2709 #errOSACantGetTerminology -errOSADataBlockTooLarge = -2708 #Signaled when an intrinsic limitation is exceeded for the size of a value or data structure. -errOSAInternalTableOverflow = -2707 #Signaled when a runtime internal data structure overflows -errOSAStackOverflow = -2706 #Signaled when the runtime stack overflows -errOSACorruptTerminology = -2705 #Signaled when an application's terminology resource is not readable -errOSAAppNotHighLevelEventAware = -2704 #Signaled when an application can't respond to AppleEvents -errOSACantLaunch = -2703 #Signaled when application can't be launched or when it is remote and program linking is not enabled -errOSANumericOverflow = -2702 #Signaled when integer or real value is too large to be represented -errOSADivideByZero = -2701 #Signaled when there is an attempt to divide by zero -errOSAGeneralError = -2700 #Signaled by user scripts or applications when no actual error code is to be returned. -noIconDataAvailableErr = -2582 #The necessary icon data is not available -noSuchIconErr = -2581 #The requested icon could not be found -invalidIconRefErr = -2580 #The icon ref is not valid -nrCallNotSupported = -2557 #This call is not available or supported on this machine -nrTransactionAborted = -2556 #transaction was aborted -nrExitedIteratorScope = -2555 #outer scope of iterator was exited -nrIterationDone = -2554 #iteration operation is done -nrPropertyAlreadyExists = -2553 #property already exists -nrInvalidEntryIterationOp = -2552 #invalid entry iteration operation -nrPathBufferTooSmall = -2551 #buffer for path is too small -nrPathNotFound = -2550 #a path component lookup failed -nrResultCodeBase = -2549 #nrResultCodeBase -nrOverrunErr = -2548 #nrOverrunErr -nrNotModifiedErr = -2547 #nrNotModifiedErr -nrTypeMismatchErr = -2546 #nrTypeMismatchErr -nrPowerSwitchAbortErr = -2545 #nrPowerSwitchAbortErr -nrPowerErr = -2544 #nrPowerErr -nrDataTruncatedErr = -2543 #nrDataTruncatedErr -nrNotSlotDeviceErr = -2542 #nrNotSlotDeviceErr -nrNameErr = -2541 #nrNameErr -nrNotCreatedErr = -2540 #nrNotCreatedErr -nrNotFoundErr = -2539 #nrNotFoundErr -nrInvalidNodeErr = -2538 #nrInvalidNodeErr -nrNotEnoughMemoryErr = -2537 #nrNotEnoughMemoryErr -nrLockedErr = -2536 #nrLockedErr -mmInternalError = -2526 #mmInternalError -tsmDefaultIsNotInputMethodErr = -2524 #Current Input source is KCHR or uchr, not Input Method (GetDefaultInputMethod) -tsmNoStem = -2523 #No stem exists for the token -tsmNoMoreTokens = -2522 #No more tokens are available for the source text -tsmNoHandler = -2521 #No Callback Handler exists for callback -tsmInvalidContext = -2520 #Invalid TSMContext specified in call -tsmUnknownErr = -2519 #any other errors -tsmUnsupportedTypeErr = -2518 #unSupported interface type error -tsmScriptHasNoIMErr = -2517 #script has no imput method or is using old IM -tsmInputMethodIsOldErr = -2516 #returned by GetDefaultInputMethod -tsmComponentAlreadyOpenErr = -2515 #text service already opened for the document -tsmTSNotOpenErr = -2514 #text service is not open -tsmTSHasNoMenuErr = -2513 #the text service has no menu -tsmUseInputWindowErr = -2512 #not TSM aware because we are using input window -tsmDocumentOpenErr = -2511 #there are open documents -tsmTextServiceNotFoundErr = -2510 #no text service found -tsmCantOpenComponentErr = -2509 #canÕt open the component -tsmNoOpenTSErr = -2508 #no open text service -tsmDocNotActiveErr = -2507 #document is NOT active -tsmTSMDocBusyErr = -2506 #document is still active -tsmInvalidDocIDErr = -2505 #invalid TSM documentation id -tsmNeverRegisteredErr = -2504 #app never registered error (not TSM aware) -tsmAlreadyRegisteredErr = -2503 #want to register again error -tsmNotAnAppErr = -2502 #not an application error -tsmInputMethodNotFoundErr = -2501 #tsmInputMethodNotFoundErr -tsmUnsupScriptLanguageErr = -2500 #tsmUnsupScriptLanguageErr -kernelUnrecoverableErr = -2499 #kernelUnrecoverableErr -kernelReturnValueErr = -2422 #kernelReturnValueErr -kernelAlreadyFreeErr = -2421 #kernelAlreadyFreeErr -kernelIDErr = -2419 #kernelIDErr -kernelExceptionErr = -2418 #kernelExceptionErr -kernelTerminatedErr = -2417 #kernelTerminatedErr -kernelInUseErr = -2416 #kernelInUseErr -kernelTimeoutErr = -2415 #kernelTimeoutErr -kernelAsyncReceiveLimitErr = -2414 #kernelAsyncReceiveLimitErr -kernelAsyncSendLimitErr = -2413 #kernelAsyncSendLimitErr -kernelAttributeErr = -2412 #kernelAttributeErr -kernelExecutionLevelErr = -2411 #kernelExecutionLevelErr -kernelDeletePermissionErr = -2410 #kernelDeletePermissionErr -kernelExecutePermissionErr = -2409 #kernelExecutePermissionErr -kernelReadPermissionErr = -2408 #kernelReadPermissionErr -kernelWritePermissionErr = -2407 #kernelWritePermissionErr -kernelObjectExistsErr = -2406 #kernelObjectExistsErr -kernelUnsupportedErr = -2405 #kernelUnsupportedErr -kernelPrivilegeErr = -2404 #kernelPrivilegeErr -kernelOptionsErr = -2403 #kernelOptionsErr -kernelCanceledErr = -2402 #kernelCanceledErr -kernelIncompleteErr = -2401 #kernelIncompleteErr -badCallOrderErr = -2209 #Usually due to a status call being called prior to being setup first -noDMAErr = -2208 #CanÕt do DMA digitizing (i.e. can't go to requested dest -badDepthErr = -2207 #CanÕt digitize into this depth -notExactSizeErr = -2206 #CanÕt do exact size requested -noMoreKeyColorsErr = -2205 #all key indexes in use -notExactMatrixErr = -2204 #warning of bad matrix, digitizer did its best -matrixErr = -2203 #bad matrix, digitizer did nothing -qtParamErr = -2202 #bad input parameter (out of range, etc) -digiUnimpErr = -2201 #feature unimplemented -qtXMLApplicationErr = -2159 #qtXMLApplicationErr -qtXMLParseErr = -2158 #qtXMLParseErr -qtActionNotHandledErr = -2157 #qtActionNotHandledErr -notEnoughDataErr = -2149 #notEnoughDataErr -urlDataHFTPURLErr = -2148 #urlDataHFTPURLErr -urlDataHFTPServerDisconnectedErr = -2147 #urlDataHFTPServerDisconnectedErr -urlDataHFTPNoPasswordErr = -2146 #urlDataHFTPNoPasswordErr -urlDataHFTPNeedPasswordErr = -2145 #urlDataHFTPNeedPasswordErr -urlDataHFTPBadNameListErr = -2144 #urlDataHFTPBadNameListErr -urlDataHFTPNoNetDriverErr = -2143 #urlDataHFTPNoNetDriverErr -urlDataHFTPFilenameErr = -2142 #urlDataHFTPFilenameErr -urlDataHFTPPermissionsErr = -2141 #urlDataHFTPPermissionsErr -urlDataHFTPQuotaErr = -2140 #urlDataHFTPQuotaErr -urlDataHFTPNoDirectoryErr = -2139 #urlDataHFTPNoDirectoryErr -urlDataHFTPDataConnectionErr = -2138 #urlDataHFTPDataConnectionErr -urlDataHFTPServerErr = -2137 #urlDataHFTPServerErr -urlDataHFTPBadPasswordErr = -2136 #urlDataHFTPBadPasswordErr -urlDataHFTPBadUserErr = -2135 #urlDataHFTPBadUserErr -urlDataHFTPShutdownErr = -2134 #urlDataHFTPShutdownErr -urlDataHFTPProtocolErr = -2133 #urlDataHFTPProtocolErr -urlDataHHTTPRedirectErr = -2132 #urlDataHHTTPRedirectErr -urlDataHHTTPURLErr = -2131 #urlDataHHTTPURLErr -urlDataHHTTPNoNetDriverErr = -2130 #urlDataHHTTPNoNetDriverErr -urlDataHHTTPProtocolErr = -2129 #urlDataHHTTPProtocolErr -qtNetworkAlreadyAllocatedErr = -2127 #qtNetworkAlreadyAllocatedErr -notAllowedToSaveMovieErr = -2126 #notAllowedToSaveMovieErr -fileOffsetTooBigErr = -2125 #fileOffsetTooBigErr -ASDEntryNotFoundErr = -2124 #ASDEntryNotFoundErr -ASDBadForkErr = -2123 #ASDBadForkErr -ASDBadHeaderErr = -2122 #ASDBadHeaderErr -AAPNotFoundErr = -2121 #AAPNotFoundErr -AAPNotCreatedErr = -2120 #AAPNotCreatedErr -qfcbNotCreatedErr = -2119 #qfcbNotCreatedErr -qfcbNotFoundErr = -2118 #qfcbNotFoundErr -wackBadMetaDataErr = -2117 #wackBadMetaDataErr -wackForkNotFoundErr = -2116 #wackForkNotFoundErr -wackBadFileErr = -2115 #wackBadFileErr -unknownFormatErr = -2114 #unknownFormatErr -pathNotVerifiedErr = -2113 #pathNotVerifiedErr -noPathMappingErr = -2112 #noPathMappingErr -emptyPathErr = -2111 #emptyPathErr -pathTooLongErr = -2110 #pathTooLongErr -cannotBeLeafAtomErr = -2109 #cannotBeLeafAtomErr -invalidAtomTypeErr = -2108 #invalidAtomTypeErr -invalidAtomContainerErr = -2107 #invalidAtomContainerErr -invalidAtomErr = -2106 #invalidAtomErr -duplicateAtomTypeAndIDErr = -2105 #duplicateAtomTypeAndIDErr -atomIndexInvalidErr = -2104 #atomIndexInvalidErr -atomsNotOfSameTypeErr = -2103 #atomsNotOfSameTypeErr -notLeafAtomErr = -2102 #notLeafAtomErr -cannotFindAtomErr = -2101 #cannotFindAtomErr -unsupportedProcessorErr = -2097 #unsupportedProcessorErr -unsupportedOSErr = -2096 #unsupportedOSErr -qtmlUninitialized = -2095 #qtmlUninitialized -qtmlDllEntryNotFoundErr = -2094 #Windows specific errors (when qtml is loading) -qtmlDllLoadErr = -2093 #Windows specific errors (when qtml is loading) -componentDllEntryNotFoundErr = -2092 #Windows specific errors (when component is loading) -componentDllLoadErr = -2091 #Windows specific errors (when component is loading) -videoOutputInUseErr = -2090 #videoOutputInUseErr -noExportProcAvailableErr = -2089 #noExportProcAvailableErr -tuneParseOSErr = -2087 #tuneParseOSErr -tunePlayerFullOSErr = -2086 #tunePlayerFullOSErr -noteChannelNotAllocatedOSErr = -2085 #noteChannelNotAllocatedOSErr -illegalNoteChannelOSErr = -2084 #illegalNoteChannelOSErr -synthesizerOSErr = -2083 #synthesizerOSErr -synthesizerNotRespondingOSErr = -2082 #synthesizerNotRespondingOSErr -midiManagerAbsentOSErr = -2081 #midiManagerAbsentOSErr -illegalControllerOSErr = -2080 #illegalControllerOSErr -illegalInstrumentOSErr = -2079 #illegalInstrumentOSErr -illegalKnobValueOSErr = -2078 #illegalKnobValueOSErr -illegalKnobOSErr = -2077 #illegalKnobOSErr -illegalChannelOSErr = -2076 #illegalChannelOSErr -illegalPartOSErr = -2075 #illegalPartOSErr -illegalVoiceAllocationOSErr = -2074 #illegalVoiceAllocationOSErr -cantReceiveFromSynthesizerOSErr = -2073 #cantReceiveFromSynthesizerOSErr -cantSendToSynthesizerOSErr = -2072 #cantSendToSynthesizerOSErr -notImplementedMusicOSErr = -2071 #notImplementedMusicOSErr -internalComponentErr = -2070 #internalComponentErr -invalidSpriteIDErr = -2069 #invalidSpriteIDErr -invalidImageIndexErr = -2068 #invalidImageIndexErr -invalidSpriteIndexErr = -2067 #invalidSpriteIndexErr -gWorldsNotSameDepthAndSizeErr = -2066 #gWorldsNotSameDepthAndSizeErr -invalidSpritePropertyErr = -2065 #invalidSpritePropertyErr -invalidSpriteWorldPropertyErr = -2064 #invalidSpriteWorldPropertyErr -missingRequiredParameterErr = -2063 #missingRequiredParameterErr -movieTextNotFoundErr = -2062 #movieTextNotFoundErr -sourceNotFoundErr = -2061 #sourceNotFoundErr -noSourceTreeFoundErr = -2060 #noSourceTreeFoundErr -samplesAlreadyInMediaErr = -2059 #samplesAlreadyInMediaErr -auxiliaryExportDataUnavailable = -2058 #auxiliaryExportDataUnavailable -unsupportedAuxiliaryImportData = -2057 #unsupportedAuxiliaryImportData -soundSupportNotAvailableErr = -2056 #QT for Windows error -noSoundTrackInMovieErr = -2055 #QT for Windows error -noVideoTrackInMovieErr = -2054 #QT for Windows error -featureUnsupported = -2053 #featureUnsupported -couldNotUseAnExistingSample = -2052 #couldNotUseAnExistingSample -noDefaultDataRef = -2051 #noDefaultDataRef -badDataRefIndex = -2050 #badDataRefIndex -invalidDataRefContainer = -2049 #invalidDataRefContainer -noMovieFound = -2048 #noMovieFound -dataNoDataRef = -2047 #dataNoDataRef -endOfDataReached = -2046 #endOfDataReached -dataAlreadyClosed = -2045 #dataAlreadyClosed -dataAlreadyOpenForWrite = -2044 #dataAlreadyOpenForWrite -dataNotOpenForWrite = -2043 #dataNotOpenForWrite -dataNotOpenForRead = -2042 #dataNotOpenForRead -invalidSampleDescription = -2041 #invalidSampleDescription -invalidChunkCache = -2040 #invalidChunkCache -invalidSampleDescIndex = -2039 #invalidSampleDescIndex -invalidChunkNum = -2038 #invalidChunkNum -invalidSampleNum = -2037 #invalidSampleNum -invalidRect = -2036 #invalidRect -cantEnableTrack = -2035 #cantEnableTrack -internalQuickTimeError = -2034 #internalQuickTimeError -badEditIndex = -2033 #badEditIndex -timeNotInMedia = -2032 #timeNotInMedia -timeNotInTrack = -2031 #timeNotInTrack -trackNotInMovie = -2030 #trackNotInMovie -trackIDNotFound = -2029 #trackIDNotFound -badTrackIndex = -2028 #badTrackIndex -maxSizeToGrowTooSmall = -2027 #maxSizeToGrowTooSmall -userDataItemNotFound = -2026 #userDataItemNotFound -staleEditState = -2025 #staleEditState -nonMatchingEditState = -2024 #nonMatchingEditState -invalidEditState = -2023 #invalidEditState -cantCreateSingleForkFile = -2022 #happens when file already exists -wfFileNotFound = -2021 #wfFileNotFound -movieToolboxUninitialized = -2020 #movieToolboxUninitialized -progressProcAborted = -2019 #progressProcAborted -mediaTypesDontMatch = -2018 #mediaTypesDontMatch -badEditList = -2017 #badEditList -cantPutPublicMovieAtom = -2016 #cantPutPublicMovieAtom -invalidTime = -2015 #invalidTime -invalidDuration = -2014 #invalidDuration -invalidHandler = -2013 #invalidHandler -invalidDataRef = -2012 #invalidDataRef -invalidSampleTable = -2011 #invalidSampleTable -invalidMovie = -2010 #invalidMovie -invalidTrack = -2009 #invalidTrack -invalidMedia = -2008 #invalidMedia -noDataHandler = -2007 #noDataHandler -noMediaHandler = -2006 #noMediaHandler -badComponentType = -2005 #badComponentType -cantOpenHandler = -2004 #cantOpenHandler -cantFindHandler = -2003 #cantFindHandler -badPublicMovieAtom = -2002 #badPublicMovieAtom -badImageDescription = -2001 #badImageDescription -couldNotResolveDataRef = -2000 #couldNotResolveDataRef -nonDragOriginatorErr = -1862 #illegal attempt at originator only data -badImageErr = -1861 #bad translucent image PixMap -badImageRgnErr = -1860 #bad translucent image region -noSuitableDisplaysErr = -1859 #no displays support translucency -unsupportedForPlatformErr = -1858 #call is for PowerPC only -dragNotAcceptedErr = -1857 #drag was not accepted by receiver -handlerNotFoundErr = -1856 #handler not found -duplicateHandlerErr = -1855 #handler already exists -cantGetFlavorErr = -1854 #error while trying to get flavor data -duplicateFlavorErr = -1853 #flavor type already exists -badDragFlavorErr = -1852 #unknown flavor type -badDragItemErr = -1851 #unknown drag item reference -badDragRefErr = -1850 #unknown drag reference -errEndOfBody = -1813 #errEndOfBody -errEndOfDocument = -1812 #errEndOfDocument -errTopOfBody = -1811 #errTopOfBody -errTopOfDocument = -1810 #errTopOfDocument -errOffsetIsOutsideOfView = -1801 #errOffsetIsOutsideOfView -errOffsetInvalid = -1800 #errOffsetInvalid -errOSACantOpenComponent = -1762 #Can't connect to scripting system with that ID -errOSAComponentMismatch = -1761 #Parameters are from 2 different components -errOSADataFormatTooNew = -1759 #errOSADataFormatTooNew -errOSADataFormatObsolete = -1758 #errOSADataFormatObsolete -errOSANoSuchDialect = -1757 #errOSANoSuchDialect -errOSASourceNotAvailable = -1756 #errOSASourceNotAvailable -errOSABadSelector = -1754 #errOSABadSelector -errOSAScriptError = -1753 #errOSAScriptError -errOSABadStorageType = -1752 #errOSABadStorageType -errOSAInvalidID = -1751 #errOSAInvalidID -errOSASystemError = -1750 #errOSASystemError -errAEBufferTooSmall = -1741 #buffer for AEFlattenDesc too small -errAEBuildSyntaxError = -1740 #AEBuildDesc and friends detected a syntax error -errAEDescIsNull = -1739 #attempting to perform an invalid operation on a null descriptor -errAEStreamAlreadyConverted = -1738 #attempt to convert a stream that has already been converted -errAEStreamBadNesting = -1737 #nesting violation while streaming -errAEDuplicateHandler = -1736 #attempt to install handler in table for identical class and id (1.1 or greater) -errAEEventFiltered = -1735 #event has been filtered, and should not be propogated (1.1 or greater) -errAEReceiveEscapeCurrent = -1734 #break out of only lowest level of AEReceive (1.1 or greater) -errAEReceiveTerminate = -1733 #break out of all levels of AEReceive to the topmost (1.1 or greater) -errAERecordingIsAlreadyOn = -1732 #available only in version 1.0.1 or greater -errAEUnknownObjectType = -1731 #available only in version 1.0.1 or greater -errAEEmptyListContainer = -1730 #Attempt to pass empty list as container to accessor -errAENegativeCount = -1729 #CountProc returned negative value -errAENoSuchObject = -1728 #e.g.,: specifier asked for the 3rd, but there are only 2. Basically, this indicates a run-time resolution error. -errAENotAnObjSpec = -1727 #Param to AEResolve not of type 'obj ' -errAEBadTestKey = -1726 #Test is neither typeLogicalDescriptor nor typeCompDescriptor -errAENoSuchLogical = -1725 #Something other than AND, OR, or NOT -errAEAccessorNotFound = -1723 #Accessor proc matching wantClass and containerType or wildcards not found -errAEWrongNumberArgs = -1721 #Logical op kAENOT used with other than 1 term -errAEImpossibleRange = -1720 #A range like 3rd to 2nd, or 1st to all. -errAEIllegalIndex = -1719 #index is out of range in a put operation -errAEReplyNotArrived = -1718 #the contents of the reply you are accessing have not arrived yet -errAEHandlerNotFound = -1717 #no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler -errAEUnknownAddressType = -1716 #the target address type is not known -errAEParamMissed = -1715 #a required parameter was not accessed -errAENotASpecialFunction = -1714 #there is no special function for/with this keyword -errAENoUserInteraction = -1713 #no user interaction is allowed -errAETimeout = -1712 #the AppleEvent timed out -errAEWaitCanceled = -1711 #in AESend, the user cancelled out of wait loop for reply or receipt -errAEUnknownSendMode = -1710 #mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown -errAEReplyNotValid = -1709 #AEResetTimer was passed an invalid reply parameter -errAEEventNotHandled = -1708 #the AppleEvent was not handled by any handler -errAENotAppleEvent = -1707 #the event is not in AppleEvent format -errAENewerVersion = -1706 #need newer version of the AppleEvent manager -errAEBadListItem = -1705 #the specified list item does not exist -errAENotAEDesc = -1704 #errAENotAEDesc -errAEWrongDataType = -1703 #errAEWrongDataType -errAECorruptData = -1702 #errAECorruptData -errAEDescNotFound = -1701 #errAEDescNotFound -errAECoercionFail = -1700 #bad parameter data or unable to coerce the data supplied -errFSIteratorNotSupported = -1424 #The iterator's flags or container are not supported by this call -errFSIteratorNotFound = -1423 #Passed FSIterator is not an open iterator -errFSBadIteratorFlags = -1422 #Flags passed to FSOpenIterator are bad -errFSForkExists = -1421 #Named fork already exists. -errFSRefsDifferent = -1420 #FSCompareFSRefs; refs are for different objects -errFSBadSearchParams = -1419 #Something wrong with CatalogSearch searchParams -errFSBadItemCount = -1418 #maximumItems was zero -errFSNoMoreItems = -1417 #Iteration ran out of items to return -errFSBadAllocFlags = -1413 #Invalid bits set in allocationFlags -errFSBadPosMode = -1412 #Newline bits set in positionMode -errFSMissingName = -1411 #A Unicode name parameter was NULL or nameLength parameter was zero -errFSNameTooLong = -1410 #File/fork name is too long to create/rename -errFSForkNotFound = -1409 #Named fork does not exist -errFSNotAFolder = -1407 #Expected a folder, got a file -errFSMissingCatInfo = -1406 #A CatalogInfo parameter was NULL -errFSBadInfoBitmap = -1405 #A CatalogInfoBitmap or VolumeInfoBitmap has reserved or invalid bits set -errFSBadForkRef = -1404 #A ForkRefNum parameter was bad -errFSBadBuffer = -1403 #A buffer parameter was bad -errFSBadForkName = -1402 #Fork name parameter is bad -errFSBadFSRef = -1401 #FSRef parameter is bad -errFSUnknownCall = -1400 #selector is not recognized by this filesystem -badFCBErr = -1327 #FCBRecPtr is not valid -volVMBusyErr = -1311 #can't eject because volume is in use by VM -fsDataTooBigErr = -1310 #file or volume is too big for system -fileBoundsErr = -1309 #file's EOF, offset, mark or size is too big -notARemountErr = -1308 #when _Mount allows only remounts and doesn't get one -badFidErr = -1307 #file id is dangling or doesn't match with the file number -sameFileErr = -1306 #can't exchange a file with itself -desktopDamagedErr = -1305 #desktop database files are corrupted -catChangedErr = -1304 #the catalog has been modified -diffVolErr = -1303 #files on different volumes -notAFileErr = -1302 #directory specified -fidExists = -1301 #file id already exists -fidNotFound = -1300 #no file thread exists. -errRefNum = -1280 #bad connection refNum -errAborted = -1279 #control call was aborted -errState = -1278 #bad connection state for this operation -errOpening = -1277 #open connection request failed -errAttention = -1276 #attention message too long -errFwdReset = -1275 #read terminated by forward reset -errDSPQueueSize = -1274 #DSP Read/Write Queue Too small -errOpenDenied = -1273 #open connection request was denied -reqAborted = -1105 #reqAborted -noDataArea = -1104 #noDataArea -noSendResp = -1103 #noSendResp -cbNotFound = -1102 #cbNotFound -noRelErr = -1101 #noRelErr -badBuffNum = -1100 #badBuffNum -badATPSkt = -1099 #badATPSkt -tooManySkts = -1098 #tooManySkts -tooManyReqs = -1097 #tooManyReqs -reqFailed = -1096 #reqFailed -aspNoAck = -1075 #No ack on attention request (server err) -aspTooMany = -1074 #Too many clients (server error) -aspSizeErr = -1073 #Command block too big -aspSessClosed = -1072 #Session closed -aspServerBusy = -1071 #Server cannot open another session -aspParamErr = -1070 #Parameter error -aspNoServers = -1069 #No servers at that address -aspNoMoreSess = -1068 #No more sessions on server -aspBufTooSmall = -1067 #Buffer too small -aspBadVersNum = -1066 #Server cannot support this ASP version -nbpNISErr = -1029 #Error trying to open the NIS -nbpNotFound = -1028 #Name not found on remove -nbpDuplicate = -1027 #Duplicate name exists already -nbpConfDiff = -1026 #Name confirmed at different socket -nbpNoConfirm = -1025 #nbpNoConfirm -nbpBuffOvr = -1024 #Buffer overflow in LookupName -noMaskFoundErr = -1000 #Icon Utilties Error -kFMFontContainerAccessErr = -985 #kFMFontContainerAccessErr -kFMFontTableAccessErr = -984 #kFMFontTableAccessErr -kFMIterationScopeModifiedErr = -983 #kFMIterationScopeModifiedErr -kFMInvalidFontErr = -982 #kFMInvalidFontErr -kFMInvalidFontFamilyErr = -981 #kFMInvalidFontFamilyErr -kFMIterationCompleted = -980 #kFMIterationCompleted -guestNotAllowedErr = -932 #destination port requires authentication -badLocNameErr = -931 #location name malformed -badServiceMethodErr = -930 #illegal service type, or not supported -noUserRecErr = -928 #Invalid user reference number -authFailErr = -927 #unable to authenticate user at destination -noInformErr = -926 #PPCStart failed because destination did not have inform pending -networkErr = -925 #An error has occurred in the network, not too likely -noUserRefErr = -924 #unable to create a new userRefNum -notLoggedInErr = -923 #The default userRefNum does not yet exist -noDefaultUserErr = -922 #user hasn't typed in owners name in Network Setup Control Pannel -badPortNameErr = -919 #PPCPortRec malformed -sessClosedErr = -917 #session was closed -portClosedErr = -916 #port was closed -noResponseErr = -915 #unable to contact destination -noToolboxNameErr = -914 #A system resource is missing, not too likely -noMachineNameErr = -913 #user hasn't named his Macintosh in the Network Setup Control Panel -userRejectErr = -912 #Destination rejected the session request -noUserNameErr = -911 #user name unknown on destination machine -portNameExistsErr = -910 #port is already open (perhaps in another app) -badReqErr = -909 #bad parameter or invalid state for operation -noSessionErr = -908 #Invalid session reference number -sessTableErr = -907 #Out of session tables, try again later -destPortErr = -906 #Port does not exist at destination -localOnlyErr = -905 #Network activity is currently disabled -noGlobalsErr = -904 #The system is hosed, better re-boot -noPortErr = -903 #Unable to open port or bad portRefNum. If you're calling -nameTypeErr = -902 #Invalid or inappropriate locationKindSelector in locationName -notInitErr = -900 #PPCToolBox not initialized -notAppropriateForClassic = -877 #This application won't or shouldn't run on Classic (Problem 2481058). -appVersionTooOld = -876 #The application's creator and version are incompatible with the current version of Mac OS. -wrongApplicationPlatform = -875 #The application could not launch because the required platform is not available -hmCloseViewActive = -863 #Returned from HMRemoveBalloon if CloseView was active -hmNoBalloonUp = -862 #Returned from HMRemoveBalloon if no balloon was visible when call was made -hmOperationUnsupported = -861 #Returned from HMShowBalloon call if bad method passed to routine -hmUnknownHelpType = -859 #Returned if help msg record contained a bad type -hmWrongVersion = -858 #Returned if help mgr resource was the wrong version -hmSkippedBalloon = -857 #Returned from calls if helpmsg specified a skip balloon -hmHelpManagerNotInited = -855 #Returned from HMGetHelpMenuHandle if help menu not setup -hmSameAsLastBalloon = -854 #Returned from HMShowMenuBalloon if menu & item is same as last time -hmBalloonAborted = -853 #Returned if mouse was moving or mouse wasn't in window port rect -hmHelpDisabled = -850 #Show Balloons mode was off, call to routine ignored -rcDBPackNotInited = -813 #attempt to call other routine before InitDBPack -rcDBWrongVersion = -812 #incompatible versions -rcDBNoHandler = -811 #no app handler for specified data type -rcDBBadAsyncPB = -810 #tried to kill a bad pb -rcDBAsyncNotSupp = -809 #ddev does not support async calls -rcDBBadDDEV = -808 #bad ddev specified on DBInit -rcDBBadSessNum = -807 #bad session number for DBGetConnInfo -rcDBBadSessID = -806 #rcDBBadSessID -rcDBExec = -805 #rcDBExec -rcDBBreak = -804 #rcDBBreak -rcDBBadType = -803 #rcDBBadType -rcDBError = -802 #rcDBError -rcDBValue = -801 #rcDBValue -rcDBNull = -800 #rcDBNull -icTooManyProfilesErr = -677 #too many profiles in database -icProfileNotFoundErr = -676 #profile not found -icConfigInappropriateErr = -675 #incorrect manufacturer code -icConfigNotFoundErr = -674 #no internet configuration was found -icNoURLErr = -673 #no URL found -icNothingToOverrideErr = -672 #no component for the override component to capture -icNoMoreWritersErr = -671 #you cannot begin a write session because someone else is already doing it -icTruncatedErr = -670 #more data was present than was returned -icInternalErr = -669 #Internet Config internal error -icPrefDataErr = -668 #problem with preference data -icPermErr = -667 #cannot set preference -icPrefNotFoundErr = -666 #Internet preference not found -vmInvalidOwningProcessErr = -648 #current process does not own the BackingFileID or FileViewID -vmAddressNotInFileViewErr = -647 #address is not in a FileView -vmNoMoreFileViewsErr = -646 #no more FileViews were found -vmFileViewAccessErr = -645 #requested FileViewAccess cannot be obtained -vmInvalidFileViewIDErr = -644 #invalid FileViewID -vmNoMoreBackingFilesErr = -643 #no more BackingFiles were found -vmBusyBackingFileErr = -642 #open views found on BackingFile -vmMappingPrivilegesErr = -641 #requested MappingPrivileges cannot be obtained -vmInvalidBackingFileIDErr = -640 #invalid BackingFileID -noMMUErr = -626 #no MMU present -cannotDeferErr = -625 #unable to defer additional functions -interruptsMaskedErr = -624 #donÕt call with interrupts masked -notLockedErr = -623 #specified range of memory is not locked -cannotMakeContiguousErr = -622 #cannot make specified range contiguous -notHeldErr = -621 #specified range of memory is not held -notEnoughMemoryErr = -620 #insufficient physical memory -threadProtocolErr = -619 #threadProtocolErr -threadNotFoundErr = -618 #threadNotFoundErr -threadTooManyReqsErr = -617 #threadTooManyReqsErr -noUserInteractionAllowed = -610 #no user interaction allowed -connectionInvalid = -609 #connectionInvalid -noOutstandingHLE = -608 #noOutstandingHLE -bufferIsSmall = -607 #error returns from Post and Accept -appIsDaemon = -606 #app is BG-only, and launch flags disallow this -appMemFullErr = -605 #application SIZE not big enough for launch -hardwareConfigErr = -604 #hardware configuration not correct for call -protocolErr = -603 #app made module calls in improper order -appModeErr = -602 #memory mode is 32-bit, but app not 32-bit clean -memFragErr = -601 #not enough room to launch app w/special requirements -procNotFound = -600 #no eligible process with specified descriptor -driverHardwareGoneErr = -503 #disk driver's hardware was disconnected -hwParamErr = -502 #bad selector for _HWPriv -teScrapSizeErr = -501 #scrap item too big for text edit record -rgnTooBigErr = -500 #rgnTooBigErr -exUserBreak = -492 #user debugger break; execute debugger commands on stack -strUserBreak = -491 #user debugger break; display string on stack -userBreak = -490 #user debugger break -notThePublisherWrn = -463 #not the first registered publisher for that container -containerAlreadyOpenWrn = -462 #container already opened by this section -containerNotFoundWrn = -461 #could not find editionContainer at this time -multiplePublisherWrn = -460 #A Publisher is already registered for that container -badSubPartErr = -454 #can not use sub parts in this release -badEditionFileErr = -453 #edition file is corrupt -notRegisteredSectionErr = -452 #not a registered SectionRecord -badSectionErr = -451 #not a valid SectionRecord -editionMgrInitErr = -450 #edition manager not inited by this app -fsmUnknownFSMMessageErr = -438 #unknown message passed to FSM -fsmNoAlternateStackErr = -437 #no alternate stack for HFS CI -fsmBadFSDVersionErr = -436 #FSM version incompatible with FSD -fsmDuplicateFSIDErr = -435 #FSID already exists on InstallFS -fsmBadFSDLenErr = -434 #FSD size incompatible with current FSM vers -fsmBadFFSNameErr = -433 #Name length not 1 <= length <= 31 -fsmBusyFFSErr = -432 #File system is busy, cannot be removed -fsmFFSNotFoundErr = -431 #Foreign File system does not exist - new Pack2 could return this error too -btKeyAttrErr = -417 #There is no such a key attribute. -btKeyLenErr = -416 #Maximum key length is too long or equal to zero. -btRecNotFnd = -415 #Record cannot be found. -btDupRecErr = -414 #Record already exists. -btNoSpace = -413 #Can't allocate disk space. -notBTree = -410 #The file is not a dictionary. -gcrOnMFMErr = -400 #gcr format on high density media error -slotNumErr = -360 #invalid slot # error -smRecNotFnd = -351 #Record not found in the SRT. -smSRTOvrFlErr = -350 #SRT over flow. -smNoGoodOpens = -349 #No opens were successfull in the loop. -smOffsetErr = -348 #Offset was too big (temporary error -smByteLanesErr = -347 #NumByteLanes was determined to be zero. -smBadsPtrErr = -346 #Bad pointer was passed to sCalcsPointer -smsGetDrvrErr = -345 #Error occurred during _sGetDriver. -smNoMoresRsrcs = -344 #No more sResources -smDisDrvrNamErr = -343 #Error occurred during _sDisDrvrName. -smGetDrvrNamErr = -342 #Error occurred during _sGetDrvrName. -smCkStatusErr = -341 #Status of slot = fail. -smBlkMoveErr = -340 #_BlockMove error -smNewPErr = -339 #_NewPtr error -smSelOOBErr = -338 #Selector out of bounds error -smSlotOOBErr = -337 #Slot out of bounds error -smNilsBlockErr = -336 #Nil sBlock error (Dont allocate and try to use a nil sBlock) -smsPointerNil = -335 #LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information. -smCPUErr = -334 #Code revision is wrong -smCodeRevErr = -333 #Code revision is wrong -smReservedErr = -332 #Reserved field not zero -smBadsList = -331 #Bad sList: Id1 < Id2 < Id3 ...format is not followed. -smBadRefId = -330 #Reference Id not found in List -smBusErrTO = -320 #BusError time out. -smBadBoardId = -319 #BoardId was wrong; re-init the PRAM record. -smReservedSlot = -318 #slot is reserved, VM should not use this address space. -smInitTblVErr = -317 #An error occurred while trying to initialize the Slot Resource Table. -smInitStatVErr = -316 #The InitStatusV field was negative after primary or secondary init. -smNoBoardId = -315 #No Board Id. -smGetPRErr = -314 #Error occurred during _sGetPRAMRec (See SIMStatus). -smNoBoardSRsrc = -313 #No Board sResource. -smDisposePErr = -312 #_DisposePointer error -smFHBlkDispErr = -311 #Error occurred during _sDisposePtr (Dispose of FHeader block). -smFHBlockRdErr = -310 #Error occurred during _sGetFHeader. -smBLFieldBad = -309 #ByteLanes field was bad. -smUnExBusErr = -308 #Unexpected BusError -smResrvErr = -307 #Fatal reserved error. Resreved field <> 0. -smNosInfoArray = -306 #No sInfoArray. Memory Mgr error. -smDisabledSlot = -305 #This slot is disabled (-305 use to be smLWTstBad) -smNoDir = -304 #Directory offset is Nil -smRevisionErr = -303 #Wrong revison level -smFormatErr = -302 #FHeader Format is not Apple's -smCRCFail = -301 #CRC check failed for declaration data -smEmptySlot = -300 #No card in slot -nmTypErr = -299 #Notification Manager:wrong queue type -smPriInitErr = -293 #Error; Cards could not be initialized. -smPRAMInitErr = -292 #Error; Slot Resource Table could not be initialized. -smSRTInitErr = -291 #Error; Slot Resource Table could not be initialized. -smSDMInitErr = -290 #Error; SDM could not be initialized. -midiInvalidCmdErr = -261 #command not supported for port type -midiDupIDErr = -260 #duplicate client ID -midiNameLenErr = -259 #name supplied is longer than 31 characters -midiWriteErr = -258 #MIDIWritePacket couldn't write to all connected ports -midiNoConErr = -257 #no connection exists between specified ports -midiVConnectRmvd = -256 #pending virtual connection removed -midiVConnectMade = -255 #pending virtual connection resolved -midiVConnectErr = -254 #pending virtual connection created -midiTooManyConsErr = -253 #too many connections made -midiTooManyPortsErr = -252 #too many ports already installed in the system -midiNoPortErr = -251 #no port with that ID found -midiNoClientErr = -250 #no client with that ID found -badInputText = -247 #badInputText -badDictFormat = -246 #badDictFormat -incompatibleVoice = -245 #incompatibleVoice -voiceNotFound = -244 #voiceNotFound -bufTooSmall = -243 #bufTooSmall -synthNotReady = -242 #synthNotReady -synthOpenFailed = -241 #synthOpenFailed -noSynthFound = -240 #noSynthFound -siUnknownQuality = -232 #invalid quality selector (returned by driver) -siUnknownInfoType = -231 #invalid info type selector (returned by driver) -siInputDeviceErr = -230 #input device hardware failure -siBadRefNum = -229 #invalid input device reference number -siBadDeviceName = -228 #input device could not be opened -siDeviceBusyErr = -227 #input device already in use -siInvalidSampleSize = -226 #invalid sample size -siInvalidSampleRate = -225 #invalid sample rate -siHardDriveTooSlow = -224 #hard drive too slow to record to disk -siInvalidCompression = -223 #invalid compression type -siNoBufferSpecified = -222 #returned by synchronous SPBRecord if nil buffer passed -siBadSoundInDevice = -221 #invalid index passed to SoundInGetIndexedDevice -siNoSoundInHardware = -220 #no Sound Input hardware -siVBRCompressionNotSupported = -213 #vbr audio compression not supported for this operation -noMoreRealTime = -212 #not enough CPU cycles left to add another task -channelNotBusy = -211 #channelNotBusy -buffersTooSmall = -210 #can not operate in the memory allowed -channelBusy = -209 #the Channel is being used for a PFD already -badFileFormat = -208 #was not type AIFF or was of bad format,corrupt -notEnoughBufferSpace = -207 #could not allocate enough memory -badFormat = -206 #Sound Manager Error Returns -badChannel = -205 #Sound Manager Error Returns -resProblem = -204 #Sound Manager Error Returns -queueFull = -203 #Sound Manager Error Returns -notEnoughHardwareErr = -201 #Sound Manager Error Returns -noHardwareErr = -200 #Sound Manager Error Returns -mapReadErr = -199 #map inconsistent with operation -resAttrErr = -198 #attribute inconsistent with operation -rmvRefFailed = -197 #RmveReference failed -rmvResFailed = -196 #RmveResource failed -addRefFailed = -195 #AddReference failed -addResFailed = -194 #AddResource failed -resFNotFound = -193 #Resource file not found -resNotFound = -192 #Resource not found -inputOutOfBounds = -190 #Offset of Count out of bounds -writingPastEnd = -189 #Writing past end of file -resourceInMemory = -188 #Resource already in memory -CantDecompress = -186 #resource bent ("the bends") - can't decompress a compressed resource -badExtResource = -185 #extended resource has a bad format. -cmNoCurrentProfile = -182 #Responder error -cmUnsupportedDataType = -181 #Responder error -cmCantDeleteProfile = -180 #Responder error -cmCantXYZ = -179 #CMM cant handle XYZ space -cmCantConcatenateError = -178 #Profile can't be concatenated -cmProfilesIdentical = -177 #Profiles the same -cmProfileNotFound = -176 #Responder error -cmMethodNotFound = -175 #CMM not present -cmMethodError = -171 #cmMethodError -cmProfileError = -170 #cmProfileError -cDepthErr = -157 #invalid pixel depth -cResErr = -156 #invalid resolution for MakeITable -cDevErr = -155 #invalid type of graphics device -cProtectErr = -154 #colorTable entry protection violation -cRangeErr = -153 #range error on colorTable request -cNoMemErr = -152 #failed to allocate memory for structure -cTempMemErr = -151 #failed to allocate memory for temporary structures -cMatchErr = -150 #Color2Index failed to find an index -insufficientStackErr = -149 #insufficientStackErr -pixMapTooDeepErr = -148 #pixMapTooDeepErr -rgnOverflowErr = -147 #rgnOverflowErr -noMemForPictPlaybackErr = -145 #noMemForPictPlaybackErr -userCanceledErr = -128 #userCanceledErr -hMenuFindErr = -127 #could not find HMenu's parent in MenuKey (wrong error code - obsolete) -mBarNFnd = -126 #system error code for MBDF not found -updPixMemErr = -125 #insufficient memory to update a pixmap -volGoneErr = -124 #Server volume has been disconnected. -wrgVolTypErr = -123 #Wrong volume type error [operation not supported for MFS] -badMovErr = -122 #Move into offspring error -tmwdoErr = -121 #No free WDCB available -dirNFErr = -120 #Directory not found -memLockedErr = -117 #trying to move a locked block (MoveHHi) -memSCErr = -116 #Size Check failed -memBCErr = -115 #Block Check failed -memPCErr = -114 #Pointer Check failed -memAZErr = -113 #Address in zone check failed -memPurErr = -112 #trying to purge a locked or non-purgeable block -memWZErr = -111 #WhichZone failed (applied to free block) -memAdrErr = -110 #address was odd; or out of range -nilHandleErr = -109 #Master Pointer was NIL in HandleZone or other -memFullErr = -108 #Not enough room in heap zone -noTypeErr = -102 #No object of that type in scrap -noScrapErr = -100 #No scrap exists error -memROZWarn = -99 #soft error in ROZ -portNotCf = -98 #driver Open error code (parameter RAM not configured for this connection) -portInUse = -97 #driver Open error code (port is in use) -portNotPwr = -96 #serial port not currently powered -excessCollsns = -95 #excessive collisions on write -lapProtErr = -94 #error in attaching/detaching protocol -noBridgeErr = -93 #no network bridge for non-local send -eLenErr = -92 #Length error ddpLenErr -eMultiErr = -91 #Multicast address error ddpSktErr -breakRecd = -90 #Break received (SCC) -rcvrErr = -89 #SCC receiver error (framing; parity; OR) -prInitErr = -88 #InitUtil found the parameter ram uninitialized -prWrErr = -87 #parameter ram written didn't read-verify -clkWrErr = -86 #time written did not verify -clkRdErr = -85 #unable to read same clock value twice -verErr = -84 #track failed to verify -fmt2Err = -83 #can't get enough sync -fmt1Err = -82 #can't find sector 0 after track format -sectNFErr = -81 #sector number never found on a track -seekErr = -80 #track number wrong on address mark -spdAdjErr = -79 #unable to correctly adjust disk speed -twoSideErr = -78 #tried to read 2nd side on a 1-sided drive -initIWMErr = -77 #unable to initialize IWM -tk0BadErr = -76 #track 0 detect doesn't change -cantStepErr = -75 #step handshake failed -wrUnderrun = -74 #write underrun occurred -badDBtSlp = -73 #bad data mark bit slip nibbles -badDCksum = -72 #bad data mark checksum -noDtaMkErr = -71 #couldn't find a data mark header -badBtSlpErr = -70 #bad addr mark bit slip nibbles -badCksmErr = -69 #addr mark checksum didn't check -dataVerErr = -68 #read verify compare failed -noAdrMkErr = -67 #couldn't find valid addr mark -noNybErr = -66 #couldn't find 5 nybbles in 200 tries -offLinErr = -65 #r/w requested for an off-line drive -fontDecError = -64 #error during font declaration -wrPermErr = -61 #write permissions error -badMDBErr = -60 #bad master directory block -fsRnErr = -59 #file system internal error:during rename the old entry was deleted but could not be restored. -extFSErr = -58 #volume in question belongs to an external fs -noMacDskErr = -57 #not a mac diskette (sig bytes are wrong) -nsDrvErr = -56 #no such drive (tried to mount a bad drive num) -volOnLinErr = -55 #drive volume already on-line at MountVol -permErr = -54 #permissions error (on file open) -volOffLinErr = -53 #volume not on line error (was Ejected) -gfpErr = -52 #get file position error -rfNumErr = -51 #refnum error -paramErr = -50 #error in user parameter list -opWrErr = -49 #file already open with with write permission -dupFNErr = -48 #duplicate filename (rename) -fBsyErr = -47 #File is busy (delete) -vLckdErr = -46 #volume is locked -fLckdErr = -45 #file is locked -wPrErr = -44 #diskette is write protected. -fnfErr = -43 #File not found -tmfoErr = -42 #too many files open -mFulErr = -41 #memory full (open) or file won't fit (load) -posErr = -40 #tried to position to before start of file (r/w) -eofErr = -39 #End of file -fnOpnErr = -38 #File not open -bdNamErr = -37 #there may be no bad names in the final system! -ioErr = -36 #I/O error (bummers) -nsvErr = -35 #no such volume -dskFulErr = -34 #disk full -dirFulErr = -33 #Directory full -dceExtErr = -30 #dce extension error -unitTblFullErr = -29 #unit table has no more entries -notOpenErr = -28 #Couldn't rd/wr/ctl/sts cause driver not opened -iIOAbortErr = -27 #IO abort error (Printing Manager) -dInstErr = -26 #DrvrInstall couldn't find driver in resources -dRemovErr = -25 #tried to remove an open driver -closErr = -24 #I/O System Errors -openErr = -23 #I/O System Errors -unitEmptyErr = -22 #I/O System Errors -badUnitErr = -21 #I/O System Errors -writErr = -20 #I/O System Errors -readErr = -19 #I/O System Errors -statusErr = -18 #I/O System Errors -controlErr = -17 #I/O System Errors -dsExtensionsDisabled = -13 #say –Extensions Disabled” -dsHD20Installed = -12 #say –HD20 Startup” -dsDisassemblerInstalled = -11 #say –Disassembler Installed” -dsMacsBugInstalled = -10 #say –MacsBug Installed” -seNoDB = -8 #no debugger installed to handle debugger command -SlpTypeErr = -5 #invalid queue element -unimpErr = -4 #unimplemented core routine -corErr = -3 #core routine number out of range -dsNoExtsDisassembler = -2 #not a SysErr, just a placeholder -qErr = -1 #queue element not found during deletion -tsmComponentNoErr = 0 #component result = no error -EPERM = 1 #Operation not permitted -ENOENT = 2 #No such file or directory -ESRCH = 3 #No such process -EINTR = 4 #Interrupted system call -EIO = 5 #Input/output error -ENXIO = 6 #Device not configured -E2BIG = 7 #Argument list too long -ENOEXEC = 8 #Exec format error -EBADF = 9 #Bad file descriptor -ECHILD = 10 #No child processes -EDEADLK = 11 #Resource deadlock avoided -ENOMEM = 12 #Cannot allocate memory -EACCES = 13 #Permission denied -EFAULT = 14 #Bad address -ECANCELED = 15 #Operation cancelled -EBUSY = 16 #Device busy -EEXIST = 17 #File exists -EXDEV = 18 #Cross-device link -ENODEV = 19 #Operation not supported by device -ENOTDIR = 20 #Not a directory -EISDIR = 21 #Is a directory -EINVAL = 22 #Invalid argument -ENFILE = 23 #Too many open files in system -EMFILE = 24 #Too many open files -ENOTTY = 25 #Inappropriate ioctl for device -ESIGPARM = 26 #Signal error -EFBIG = 27 #File too large -ENOSPC = 28 #No space left on device -ESPIPE = 29 #Illegal seek -EROFS = 30 #Read-only file system -EMLINK = 31 #Too many links -EPIPE = 32 #Broken pipe -EDOM = 33 #Numerical argument out of domain -ERANGE = 34 #Result too large -EAGAIN = 35 #Resource temporarily unavailable -EINPROGRESS = 36 #Operation now in progress -EALREADY = 37 #Operation already in progress -ENOTSOCK = 38 #Socket operation on non-socket -EDESTADDRREQ = 39 #Destination address required -EMSGSIZE = 40 #Message too long -EPROTOTYPE = 41 #Protocol wrong type for socket -ENOPROTOOPT = 42 #Protocol not available -EPROTONOSUPPORT = 43 #Protocol not supported -ESOCKTNOSUPPORT = 44 #Socket type not supported -EOPNOTSUPP = 45 #Operation not supported -EPFNOSUPPORT = 46 #Protocol family not supported -EAFNOSUPPORT = 47 #Address family not supported by protocol family -EADDRINUSE = 48 #Address already in use -EADDRNOTAVAIL = 49 #Can't assign requested address -ENETDOWN = 50 #Network is down -ENETUNREACH = 51 #Network is unreachable -ENETRESET = 52 #Network dropped connection on reset -ECONNABORTED = 53 #Software caused connection abort -ECONNRESET = 54 #Connection reset by peer -ENOBUFS = 55 #No buffer space available -EISCONN = 56 #Socket is already connected -ENOTCONN = 57 #Socket is not connected -ESHUTDOWN = 58 #Can't send after socket shutdown -ETOOMANYREFS = 59 #Too many references: can't splice -ETIMEDOUT = 60 #Operation timed out -ECONNREFUSED = 61 #Connection refused -ELOOP = 62 #Too many levels of symbolic links -ENAMETOOLONG = 63 #File name too long -EHOSTDOWN = 64 #Host is down -EHOSTUNREACH = 65 #No route to host -ENOTEMPTY = 66 #Directory not empty -ELOOK = 67 #Internal mapping for kOTLookErr, don't return to client -ENOLCK = 77 #No locks available -ENOSYS = 78 #Function not implemented -EILSEQ = 88 #Wide character encoding error -EUNKNOWN = 99 #Unknown error diff --git a/sys/lib/python/plat-mac/macfs.py b/sys/lib/python/plat-mac/macfs.py deleted file mode 100644 index 73815aeb3..000000000 --- a/sys/lib/python/plat-mac/macfs.py +++ /dev/null @@ -1,198 +0,0 @@ -"""macfs - Pure Python module designed to be backward compatible with -macfs and MACFS. -""" -import sys -import struct -import Carbon.Res -import Carbon.File -import warnings - -warnings.warn("macfs is deprecated, use Carbon.File, Carbon.Folder or EasyDialogs", - DeprecationWarning, stacklevel=2) - -# First step: ensure we also emulate the MACFS module, which contained -# all the constants - -sys.modules['MACFS'] = sys.modules[__name__] - -# Import all those constants -from Carbon.Files import * -from Carbon.Folders import * - -# For some obscure historical reason these are here too: -READ = 1 -WRITE = 2 -smAllScripts = -3 - -# -# Find the epoch conversion for file dates in a way that works on OS9 and OSX -import time -if time.gmtime(0)[0] == 1970: - _EPOCHCONVERT = -((1970-1904)*365 + 17) * (24*60*60) + 0x100000000L - def _utc2time(utc): - t = utc[1] + _EPOCHCONVERT - return int(t) - def _time2utc(t): - t = int(t) - _EPOCHCONVERT - if t < -0x7fffffff: - t = t + 0x10000000L - return (0, int(t), 0) -else: - def _utc2time(utc): - t = utc[1] - if t < 0: - t = t + 0x100000000L - return t - def _time2utc(t): - if t > 0x7fffffff: - t = t - 0x100000000L - return (0, int(t), 0) - -# The old name of the error object: -error = Carbon.File.Error - -# -# The various objects macfs used to export. We override them here, because some -# of the method names are subtly different. -# -class FSSpec(Carbon.File.FSSpec): - def as_fsref(self): - return FSRef(self) - - def NewAlias(self, src=None): - return Alias(Carbon.File.NewAlias(src, self)) - - def GetCreatorType(self): - finfo = self.FSpGetFInfo() - return finfo.Creator, finfo.Type - - def SetCreatorType(self, ctor, tp): - finfo = self.FSpGetFInfo() - finfo.Creator = ctor - finfo.Type = tp - self.FSpSetFInfo(finfo) - - def GetFInfo(self): - return self.FSpGetFInfo() - - def SetFInfo(self, info): - return self.FSpSetFInfo(info) - - def GetDates(self): - catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate - catinfo, d1, d2, d3 = FSRef(self).FSGetCatalogInfo(catInfoFlags) - cdate = catinfo.createDate - mdate = catinfo.contentModDate - bdate = catinfo.backupDate - return _utc2time(cdate), _utc2time(mdate), _utc2time(bdate) - - def SetDates(self, cdate, mdate, bdate): - catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate - catinfo = Carbon.File.FSCatalogInfo( - createDate = _time2utc(cdate), - contentModDate = _time2utc(mdate), - backupDate = _time2utc(bdate)) - FSRef(self).FSSetCatalogInfo(catInfoFlags, catinfo) - -class FSRef(Carbon.File.FSRef): - def as_fsspec(self): - return FSSpec(self) - -class Alias(Carbon.File.Alias): - - def GetInfo(self, index): - return self.GetAliasInfo(index) - - def Update(self, *args): - pass # print "Alias.Update not yet implemented" - - def Resolve(self, src=None): - fss, changed = self.ResolveAlias(src) - return FSSpec(fss), changed - -from Carbon.File import FInfo - -# Backward-compatible type names: -FSSpecType = FSSpec -FSRefType = FSRef -AliasType = Alias -FInfoType = FInfo - -# Global functions: -def ResolveAliasFile(fss, chain=1): - fss, isdir, isalias = Carbon.File.ResolveAliasFile(fss, chain) - return FSSpec(fss), isdir, isalias - -def RawFSSpec(data): - return FSSpec(rawdata=data) - -def RawAlias(data): - return Alias(rawdata=data) - -def FindApplication(*args): - raise NotImplementedError, "FindApplication no longer implemented" - -def NewAliasMinimalFromFullPath(path): - return Alias(Carbon.File.NewAliasMinimalFromFullPath(path, '', '')) - -# Another global function: -from Carbon.Folder import FindFolder - -# -# Finally the old Standard File routine emulators. -# - -_curfolder = None - -def StandardGetFile(*typelist): - """Ask for an input file, optionally specifying 4-char file types that are - allowable""" - return PromptGetFile('', *typelist) - -def PromptGetFile(prompt, *typelist): - """Ask for an input file giving the user a prompt message. Optionally you can - specifying 4-char file types that are allowable""" - import EasyDialogs - warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", - DeprecationWarning, stacklevel=2) - if not typelist: - typelist = None - fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec, - typeList=typelist, defaultLocation=_handleSetFolder()) - return fss, not fss is None - -def StandardPutFile(prompt, default=None): - """Ask the user for an output file, with a prompt. Optionally you cn supply a - default output filename""" - import EasyDialogs - warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", - DeprecationWarning, stacklevel=2) - fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt, - savedFileName=default, defaultLocation=_handleSetFolder()) - return fss, not fss is None - -def SetFolder(folder): - global _curfolder - warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", - DeprecationWarning, stacklevel=2) - if _curfolder: - rv = FSSpec(_curfolder) - else: - rv = None - _curfolder = folder - return rv - -def _handleSetFolder(): - global _curfolder - rv = _curfolder - _curfolder = None - return rv - -def GetDirectory(prompt=None): - """Ask the user to select a folder. Optionally you can give a prompt.""" - import EasyDialogs - warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", - DeprecationWarning, stacklevel=2) - fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec, - defaultLocation=_handleSetFolder()) - return fss, not fss is None diff --git a/sys/lib/python/plat-mac/macostools.py b/sys/lib/python/plat-mac/macostools.py deleted file mode 100644 index f7ce46826..000000000 --- a/sys/lib/python/plat-mac/macostools.py +++ /dev/null @@ -1,142 +0,0 @@ -"""macostools - Various utility functions for MacOS. - -mkalias(src, dst) - Create a finder alias 'dst' pointing to 'src' -copy(src, dst) - Full copy of 'src' to 'dst' -""" - -from Carbon import Res -from Carbon import File, Files -import os -import sys -import MacOS -import time -try: - openrf = MacOS.openrf -except AttributeError: - # Backward compatibility - openrf = open - -Error = 'macostools.Error' - -BUFSIZ=0x80000 # Copy in 0.5Mb chunks - -COPY_FLAGS = (Files.kIsStationary|Files.kNameLocked|Files.kHasBundle| - Files.kIsInvisible|Files.kIsAlias) - -# -# Not guaranteed to be correct or stay correct (Apple doesn't tell you -# how to do this), but it seems to work. -# -def mkalias(src, dst, relative=None): - """Create a finder alias""" - srcfsr = File.FSRef(src) - # The next line will fail under unix-Python if the destination - # doesn't exist yet. We should change this code to be fsref-based. - dstdir, dstname = os.path.split(dst) - if not dstdir: dstdir = os.curdir - dstdirfsr = File.FSRef(dstdir) - if relative: - relativefsr = File.FSRef(relative) - # ik mag er geen None in stoppen :-( - alias = File.FSNewAlias(relativefsr, srcfsr) - else: - alias = srcfsr.FSNewAliasMinimal() - - dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), - File.FSGetResourceForkName()) - h = Res.FSOpenResourceFile(dstfsr, File.FSGetResourceForkName(), 3) - resource = Res.Resource(alias.data) - resource.AddResource('alis', 0, '') - Res.CloseResFile(h) - - dstfinfo = dstfss.FSpGetFInfo() - dstfinfo.Flags = dstfinfo.Flags|0x8000 # Alias flag - dstfss.FSpSetFInfo(dstfinfo) - -def mkdirs(dst): - """Make directories leading to 'dst' if they don't exist yet""" - if dst == '' or os.path.exists(dst): - return - head, tail = os.path.split(dst) - if os.sep == ':' and not ':' in head: - head = head + ':' - mkdirs(head) - os.mkdir(dst, 0777) - -def touched(dst): - """Tell the finder a file has changed. No-op on MacOSX.""" - if sys.platform != 'mac': return - import warnings - warnings.filterwarnings("ignore", "macfs.*", DeprecationWarning, __name__) - import macfs - file_fss = macfs.FSSpec(dst) - vRefNum, dirID, name = file_fss.as_tuple() - dir_fss = macfs.FSSpec((vRefNum, dirID, '')) - crdate, moddate, bkdate = dir_fss.GetDates() - now = time.time() - if now == moddate: - now = now + 1 - try: - dir_fss.SetDates(crdate, now, bkdate) - except macfs.error: - pass - -def touched_ae(dst): - """Tell the finder a file has changed""" - pardir = os.path.split(dst)[0] - if not pardir: - pardir = os.curdir - import Finder - f = Finder.Finder() - f.update(File.FSRef(pardir)) - -def copy(src, dst, createpath=0, copydates=1, forcetype=None): - """Copy a file, including finder info, resource fork, etc""" - src = File.pathname(src) - dst = File.pathname(dst) - if createpath: - mkdirs(os.path.split(dst)[0]) - - ifp = open(src, 'rb') - ofp = open(dst, 'wb') - d = ifp.read(BUFSIZ) - while d: - ofp.write(d) - d = ifp.read(BUFSIZ) - ifp.close() - ofp.close() - - ifp = openrf(src, '*rb') - ofp = openrf(dst, '*wb') - d = ifp.read(BUFSIZ) - while d: - ofp.write(d) - d = ifp.read(BUFSIZ) - ifp.close() - ofp.close() - - srcfss = File.FSSpec(src) - dstfss = File.FSSpec(dst) - sf = srcfss.FSpGetFInfo() - df = dstfss.FSpGetFInfo() - df.Creator, df.Type = sf.Creator, sf.Type - if forcetype != None: - df.Type = forcetype - df.Flags = (sf.Flags & COPY_FLAGS) - dstfss.FSpSetFInfo(df) - if copydates: - srcfsr = File.FSRef(src) - dstfsr = File.FSRef(dst) - catinfo, _, _, _ = srcfsr.FSGetCatalogInfo(Files.kFSCatInfoAllDates) - dstfsr.FSSetCatalogInfo(Files.kFSCatInfoAllDates, catinfo) - touched(dstfss) - -def copytree(src, dst, copydates=1): - """Copy a complete file tree to a new destination""" - if os.path.isdir(src): - mkdirs(dst) - files = os.listdir(src) - for f in files: - copytree(os.path.join(src, f), os.path.join(dst, f), copydates) - else: - copy(src, dst, 1, copydates) diff --git a/sys/lib/python/plat-mac/macresource.py b/sys/lib/python/plat-mac/macresource.py deleted file mode 100644 index f68ecdc8a..000000000 --- a/sys/lib/python/plat-mac/macresource.py +++ /dev/null @@ -1,146 +0,0 @@ -"""macresource - Locate and open the resources needed for a script.""" - -from Carbon import Res -import os -import sys -import MacOS -import macostools - -class ArgumentError(TypeError): pass -class ResourceFileNotFoundError(ImportError): pass - -def need(restype, resid, filename=None, modname=None): - """Open a resource file, if needed. restype and resid - are required parameters, and identify the resource for which to test. If it - is available we are done. If it is not available we look for a file filename - (default: modname with .rsrc appended) either in the same folder as - where modname was loaded from, or otherwise across sys.path. - - Returns the refno of the resource file opened (or None)""" - - if modname is None and filename is None: - raise ArgumentError, "Either filename or modname argument (or both) must be given" - - if type(resid) is type(1): - try: - h = Res.GetResource(restype, resid) - except Res.Error: - pass - else: - return None - else: - try: - h = Res.GetNamedResource(restype, resid) - except Res.Error: - pass - else: - return None - - # Construct a filename if we don't have one - if not filename: - if '.' in modname: - filename = modname.split('.')[-1] + '.rsrc' - else: - filename = modname + '.rsrc' - - # Now create a list of folders to search - searchdirs = [] - if modname == '__main__': - # If we're main we look in the current directory - searchdirs = [os.curdir] - if sys.modules.has_key(modname): - mod = sys.modules[modname] - if hasattr(mod, '__file__'): - searchdirs = [os.path.dirname(mod.__file__)] - searchdirs.extend(sys.path) - - # And look for the file - for dir in searchdirs: - pathname = os.path.join(dir, filename) - if os.path.exists(pathname): - break - else: - raise ResourceFileNotFoundError, filename - - refno = open_pathname(pathname) - - # And check that the resource exists now - if type(resid) is type(1): - h = Res.GetResource(restype, resid) - else: - h = Res.GetNamedResource(restype, resid) - return refno - -def open_pathname(pathname, verbose=0): - """Open a resource file given by pathname, possibly decoding an - AppleSingle file""" - try: - refno = Res.FSpOpenResFile(pathname, 1) - except Res.Error, arg: - if arg[0] in (-37, -39): - # No resource fork. We may be on OSX, and this may be either - # a data-fork based resource file or a AppleSingle file - # from the CVS repository. - try: - refno = Res.FSOpenResourceFile(pathname, u'', 1) - except Res.Error, arg: - if arg[0] != -199: - # -199 is "bad resource map" - raise - else: - return refno - # Finally try decoding an AppleSingle file - pathname = _decode(pathname, verbose=verbose) - refno = Res.FSOpenResourceFile(pathname, u'', 1) - else: - raise - return refno - -def resource_pathname(pathname, verbose=0): - """Return the pathname for a resource file (either DF or RF based). - If the pathname given already refers to such a file simply return it, - otherwise first decode it.""" - try: - refno = Res.FSpOpenResFile(pathname, 1) - Res.CloseResFile(refno) - except Res.Error, arg: - if arg[0] in (-37, -39): - # No resource fork. We may be on OSX, and this may be either - # a data-fork based resource file or a AppleSingle file - # from the CVS repository. - try: - refno = Res.FSOpenResourceFile(pathname, u'', 1) - except Res.Error, arg: - if arg[0] != -199: - # -199 is "bad resource map" - raise - else: - return refno - # Finally try decoding an AppleSingle file - pathname = _decode(pathname, verbose=verbose) - else: - raise - return pathname - -def open_error_resource(): - """Open the resource file containing the error code to error message - mapping.""" - need('Estr', 1, filename="errors.rsrc", modname=__name__) - -def _decode(pathname, verbose=0): - # Decode an AppleSingle resource file, return the new pathname. - newpathname = pathname + '.df.rsrc' - if os.path.exists(newpathname) and \ - os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime: - return newpathname - if hasattr(os, 'access') and not \ - os.access(os.path.dirname(pathname), os.W_OK|os.X_OK): - # The destination directory isn't writeable. Create the file in - # a temporary directory - import tempfile - fd, newpathname = tempfile.mkstemp(".rsrc") - if verbose: - print 'Decoding', pathname, 'to', newpathname - import applesingle - applesingle.decode(pathname, newpathname, resonly=1) - return newpathname diff --git a/sys/lib/python/plat-mac/pimp.py b/sys/lib/python/plat-mac/pimp.py deleted file mode 100644 index 456427c1c..000000000 --- a/sys/lib/python/plat-mac/pimp.py +++ /dev/null @@ -1,1177 +0,0 @@ -"""Package Install Manager for Python. - -This is currently a MacOSX-only strawman implementation. -Despite other rumours the name stands for "Packman IMPlementation". - -Tools to allow easy installation of packages. The idea is that there is -an online XML database per (platform, python-version) containing packages -known to work with that combination. This module contains tools for getting -and parsing the database, testing whether packages are installed, computing -dependencies and installing packages. - -There is a minimal main program that works as a command line tool, but the -intention is that the end user will use this through a GUI. -""" -import sys -import os -import popen2 -import urllib -import urllib2 -import urlparse -import plistlib -import distutils.util -import distutils.sysconfig -import hashlib -import tarfile -import tempfile -import shutil -import time - -__all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main", - "getDefaultDatabase", "PIMP_VERSION", "main"] - -_scriptExc_NotInstalled = "pimp._scriptExc_NotInstalled" -_scriptExc_OldInstalled = "pimp._scriptExc_OldInstalled" -_scriptExc_BadInstalled = "pimp._scriptExc_BadInstalled" - -NO_EXECUTE=0 - -PIMP_VERSION="0.5" - -# Flavors: -# source: setup-based package -# binary: tar (or other) archive created with setup.py bdist. -# installer: something that can be opened -DEFAULT_FLAVORORDER=['source', 'binary', 'installer'] -DEFAULT_DOWNLOADDIR='/tmp' -DEFAULT_BUILDDIR='/tmp' -DEFAULT_INSTALLDIR=distutils.sysconfig.get_python_lib() -DEFAULT_PIMPDATABASE_FMT="http://www.python.org/packman/version-%s/%s-%s-%s-%s-%s.plist" - -def getDefaultDatabase(experimental=False): - if experimental: - status = "exp" - else: - status = "prod" - - major, minor, micro, state, extra = sys.version_info - pyvers = '%d.%d' % (major, minor) - if micro == 0 and state != 'final': - pyvers = pyvers + '%s%d' % (state, extra) - - longplatform = distutils.util.get_platform() - osname, release, machine = longplatform.split('-') - # For some platforms we may want to differentiate between - # installation types - if osname == 'darwin': - if sys.prefix.startswith('/System/Library/Frameworks/Python.framework'): - osname = 'darwin_apple' - elif sys.prefix.startswith('/Library/Frameworks/Python.framework'): - osname = 'darwin_macpython' - # Otherwise we don't know... - # Now we try various URLs by playing with the release string. - # We remove numbers off the end until we find a match. - rel = release - while True: - url = DEFAULT_PIMPDATABASE_FMT % (PIMP_VERSION, status, pyvers, osname, rel, machine) - try: - urllib2.urlopen(url) - except urllib2.HTTPError, arg: - pass - else: - break - if not rel: - # We're out of version numbers to try. Use the - # full release number, this will give a reasonable - # error message later - url = DEFAULT_PIMPDATABASE_FMT % (PIMP_VERSION, status, pyvers, osname, release, machine) - break - idx = rel.rfind('.') - if idx < 0: - rel = '' - else: - rel = rel[:idx] - return url - -def _cmd(output, dir, *cmditems): - """Internal routine to run a shell command in a given directory.""" - - cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) - if output: - output.write("+ %s\n" % cmd) - if NO_EXECUTE: - return 0 - child = popen2.Popen4(cmd) - child.tochild.close() - while 1: - line = child.fromchild.readline() - if not line: - break - if output: - output.write(line) - return child.wait() - -class PimpDownloader: - """Abstract base class - Downloader for archives""" - - def __init__(self, argument, - dir="", - watcher=None): - self.argument = argument - self._dir = dir - self._watcher = watcher - - def download(self, url, filename, output=None): - return None - - def update(self, str): - if self._watcher: - return self._watcher.update(str) - return True - -class PimpCurlDownloader(PimpDownloader): - - def download(self, url, filename, output=None): - self.update("Downloading %s..." % url) - exitstatus = _cmd(output, self._dir, - "curl", - "--output", filename, - url) - self.update("Downloading %s: finished" % url) - return (not exitstatus) - -class PimpUrllibDownloader(PimpDownloader): - - def download(self, url, filename, output=None): - output = open(filename, 'wb') - self.update("Downloading %s: opening connection" % url) - keepgoing = True - download = urllib2.urlopen(url) - if download.headers.has_key("content-length"): - length = long(download.headers['content-length']) - else: - length = -1 - - data = download.read(4096) #read 4K at a time - dlsize = 0 - lasttime = 0 - while keepgoing: - dlsize = dlsize + len(data) - if len(data) == 0: - #this is our exit condition - break - output.write(data) - if int(time.time()) != lasttime: - # Update at most once per second - lasttime = int(time.time()) - if length == -1: - keepgoing = self.update("Downloading %s: %d bytes..." % (url, dlsize)) - else: - keepgoing = self.update("Downloading %s: %d%% (%d bytes)..." % (url, int(100.0*dlsize/length), dlsize)) - data = download.read(4096) - if keepgoing: - self.update("Downloading %s: finished" % url) - return keepgoing - -class PimpUnpacker: - """Abstract base class - Unpacker for archives""" - - _can_rename = False - - def __init__(self, argument, - dir="", - renames=[], - watcher=None): - self.argument = argument - if renames and not self._can_rename: - raise RuntimeError, "This unpacker cannot rename files" - self._dir = dir - self._renames = renames - self._watcher = watcher - - def unpack(self, archive, output=None, package=None): - return None - - def update(self, str): - if self._watcher: - return self._watcher.update(str) - return True - -class PimpCommandUnpacker(PimpUnpacker): - """Unpack archives by calling a Unix utility""" - - _can_rename = False - - def unpack(self, archive, output=None, package=None): - cmd = self.argument % archive - if _cmd(output, self._dir, cmd): - return "unpack command failed" - -class PimpTarUnpacker(PimpUnpacker): - """Unpack tarfiles using the builtin tarfile module""" - - _can_rename = True - - def unpack(self, archive, output=None, package=None): - tf = tarfile.open(archive, "r") - members = tf.getmembers() - skip = [] - if self._renames: - for member in members: - for oldprefix, newprefix in self._renames: - if oldprefix[:len(self._dir)] == self._dir: - oldprefix2 = oldprefix[len(self._dir):] - else: - oldprefix2 = None - if member.name[:len(oldprefix)] == oldprefix: - if newprefix is None: - skip.append(member) - #print 'SKIP', member.name - else: - member.name = newprefix + member.name[len(oldprefix):] - print ' ', member.name - break - elif oldprefix2 and member.name[:len(oldprefix2)] == oldprefix2: - if newprefix is None: - skip.append(member) - #print 'SKIP', member.name - else: - member.name = newprefix + member.name[len(oldprefix2):] - #print ' ', member.name - break - else: - skip.append(member) - #print '????', member.name - for member in members: - if member in skip: - self.update("Skipping %s" % member.name) - continue - self.update("Extracting %s" % member.name) - tf.extract(member, self._dir) - if skip: - names = [member.name for member in skip if member.name[-1] != '/'] - if package: - names = package.filterExpectedSkips(names) - if names: - return "Not all files were unpacked: %s" % " ".join(names) - -ARCHIVE_FORMATS = [ - (".tar.Z", PimpTarUnpacker, None), - (".taz", PimpTarUnpacker, None), - (".tar.gz", PimpTarUnpacker, None), - (".tgz", PimpTarUnpacker, None), - (".tar.bz", PimpTarUnpacker, None), - (".zip", PimpCommandUnpacker, "unzip \"%s\""), -] - -class PimpPreferences: - """Container for per-user preferences, such as the database to use - and where to install packages.""" - - def __init__(self, - flavorOrder=None, - downloadDir=None, - buildDir=None, - installDir=None, - pimpDatabase=None): - if not flavorOrder: - flavorOrder = DEFAULT_FLAVORORDER - if not downloadDir: - downloadDir = DEFAULT_DOWNLOADDIR - if not buildDir: - buildDir = DEFAULT_BUILDDIR - if not pimpDatabase: - pimpDatabase = getDefaultDatabase() - self.setInstallDir(installDir) - self.flavorOrder = flavorOrder - self.downloadDir = downloadDir - self.buildDir = buildDir - self.pimpDatabase = pimpDatabase - self.watcher = None - - def setWatcher(self, watcher): - self.watcher = watcher - - def setInstallDir(self, installDir=None): - if installDir: - # Installing to non-standard location. - self.installLocations = [ - ('--install-lib', installDir), - ('--install-headers', None), - ('--install-scripts', None), - ('--install-data', None)] - else: - installDir = DEFAULT_INSTALLDIR - self.installLocations = [] - self.installDir = installDir - - def isUserInstall(self): - return self.installDir != DEFAULT_INSTALLDIR - - def check(self): - """Check that the preferences make sense: directories exist and are - writable, the install directory is on sys.path, etc.""" - - rv = "" - RWX_OK = os.R_OK|os.W_OK|os.X_OK - if not os.path.exists(self.downloadDir): - rv += "Warning: Download directory \"%s\" does not exist\n" % self.downloadDir - elif not os.access(self.downloadDir, RWX_OK): - rv += "Warning: Download directory \"%s\" is not writable or not readable\n" % self.downloadDir - if not os.path.exists(self.buildDir): - rv += "Warning: Build directory \"%s\" does not exist\n" % self.buildDir - elif not os.access(self.buildDir, RWX_OK): - rv += "Warning: Build directory \"%s\" is not writable or not readable\n" % self.buildDir - if not os.path.exists(self.installDir): - rv += "Warning: Install directory \"%s\" does not exist\n" % self.installDir - elif not os.access(self.installDir, RWX_OK): - rv += "Warning: Install directory \"%s\" is not writable or not readable\n" % self.installDir - else: - installDir = os.path.realpath(self.installDir) - for p in sys.path: - try: - realpath = os.path.realpath(p) - except: - pass - if installDir == realpath: - break - else: - rv += "Warning: Install directory \"%s\" is not on sys.path\n" % self.installDir - return rv - - def compareFlavors(self, left, right): - """Compare two flavor strings. This is part of your preferences - because whether the user prefers installing from source or binary is.""" - if left in self.flavorOrder: - if right in self.flavorOrder: - return cmp(self.flavorOrder.index(left), self.flavorOrder.index(right)) - return -1 - if right in self.flavorOrder: - return 1 - return cmp(left, right) - -class PimpDatabase: - """Class representing a pimp database. It can actually contain - information from multiple databases through inclusion, but the - toplevel database is considered the master, as its maintainer is - "responsible" for the contents.""" - - def __init__(self, prefs): - self._packages = [] - self.preferences = prefs - self._url = "" - self._urllist = [] - self._version = "" - self._maintainer = "" - self._description = "" - - # Accessor functions - def url(self): return self._url - def version(self): return self._version - def maintainer(self): return self._maintainer - def description(self): return self._description - - def close(self): - """Clean up""" - self._packages = [] - self.preferences = None - - def appendURL(self, url, included=0): - """Append packages from the database with the given URL. - Only the first database should specify included=0, so the - global information (maintainer, description) get stored.""" - - if url in self._urllist: - return - self._urllist.append(url) - fp = urllib2.urlopen(url).fp - plistdata = plistlib.Plist.fromFile(fp) - # Test here for Pimp version, etc - if included: - version = plistdata.get('Version') - if version and version > self._version: - sys.stderr.write("Warning: included database %s is for pimp version %s\n" % - (url, version)) - else: - self._version = plistdata.get('Version') - if not self._version: - sys.stderr.write("Warning: database has no Version information\n") - elif self._version > PIMP_VERSION: - sys.stderr.write("Warning: database version %s newer than pimp version %s\n" - % (self._version, PIMP_VERSION)) - self._maintainer = plistdata.get('Maintainer', '') - self._description = plistdata.get('Description', '').strip() - self._url = url - self._appendPackages(plistdata['Packages'], url) - others = plistdata.get('Include', []) - for o in others: - o = urllib.basejoin(url, o) - self.appendURL(o, included=1) - - def _appendPackages(self, packages, url): - """Given a list of dictionaries containing package - descriptions create the PimpPackage objects and append them - to our internal storage.""" - - for p in packages: - p = dict(p) - if p.has_key('Download-URL'): - p['Download-URL'] = urllib.basejoin(url, p['Download-URL']) - flavor = p.get('Flavor') - if flavor == 'source': - pkg = PimpPackage_source(self, p) - elif flavor == 'binary': - pkg = PimpPackage_binary(self, p) - elif flavor == 'installer': - pkg = PimpPackage_installer(self, p) - elif flavor == 'hidden': - pkg = PimpPackage_installer(self, p) - else: - pkg = PimpPackage(self, dict(p)) - self._packages.append(pkg) - - def list(self): - """Return a list of all PimpPackage objects in the database.""" - - return self._packages - - def listnames(self): - """Return a list of names of all packages in the database.""" - - rv = [] - for pkg in self._packages: - rv.append(pkg.fullname()) - rv.sort() - return rv - - def dump(self, pathOrFile): - """Dump the contents of the database to an XML .plist file. - - The file can be passed as either a file object or a pathname. - All data, including included databases, is dumped.""" - - packages = [] - for pkg in self._packages: - packages.append(pkg.dump()) - plistdata = { - 'Version': self._version, - 'Maintainer': self._maintainer, - 'Description': self._description, - 'Packages': packages - } - plist = plistlib.Plist(**plistdata) - plist.write(pathOrFile) - - def find(self, ident): - """Find a package. The package can be specified by name - or as a dictionary with name, version and flavor entries. - - Only name is obligatory. If there are multiple matches the - best one (higher version number, flavors ordered according to - users' preference) is returned.""" - - if type(ident) == str: - # Remove ( and ) for pseudo-packages - if ident[0] == '(' and ident[-1] == ')': - ident = ident[1:-1] - # Split into name-version-flavor - fields = ident.split('-') - if len(fields) < 1 or len(fields) > 3: - return None - name = fields[0] - if len(fields) > 1: - version = fields[1] - else: - version = None - if len(fields) > 2: - flavor = fields[2] - else: - flavor = None - else: - name = ident['Name'] - version = ident.get('Version') - flavor = ident.get('Flavor') - found = None - for p in self._packages: - if name == p.name() and \ - (not version or version == p.version()) and \ - (not flavor or flavor == p.flavor()): - if not found or found < p: - found = p - return found - -ALLOWED_KEYS = [ - "Name", - "Version", - "Flavor", - "Description", - "Home-page", - "Download-URL", - "Install-test", - "Install-command", - "Pre-install-command", - "Post-install-command", - "Prerequisites", - "MD5Sum", - "User-install-skips", - "Systemwide-only", -] - -class PimpPackage: - """Class representing a single package.""" - - def __init__(self, db, plistdata): - self._db = db - name = plistdata["Name"] - for k in plistdata.keys(): - if not k in ALLOWED_KEYS: - sys.stderr.write("Warning: %s: unknown key %s\n" % (name, k)) - self._dict = plistdata - - def __getitem__(self, key): - return self._dict[key] - - def name(self): return self._dict['Name'] - def version(self): return self._dict.get('Version') - def flavor(self): return self._dict.get('Flavor') - def description(self): return self._dict['Description'].strip() - def shortdescription(self): return self.description().splitlines()[0] - def homepage(self): return self._dict.get('Home-page') - def downloadURL(self): return self._dict.get('Download-URL') - def systemwideOnly(self): return self._dict.get('Systemwide-only') - - def fullname(self): - """Return the full name "name-version-flavor" of a package. - - If the package is a pseudo-package, something that cannot be - installed through pimp, return the name in (parentheses).""" - - rv = self._dict['Name'] - if self._dict.has_key('Version'): - rv = rv + '-%s' % self._dict['Version'] - if self._dict.has_key('Flavor'): - rv = rv + '-%s' % self._dict['Flavor'] - if self._dict.get('Flavor') == 'hidden': - # Pseudo-package, show in parentheses - rv = '(%s)' % rv - return rv - - def dump(self): - """Return a dict object containing the information on the package.""" - return self._dict - - def __cmp__(self, other): - """Compare two packages, where the "better" package sorts lower.""" - - if not isinstance(other, PimpPackage): - return cmp(id(self), id(other)) - if self.name() != other.name(): - return cmp(self.name(), other.name()) - if self.version() != other.version(): - return -cmp(self.version(), other.version()) - return self._db.preferences.compareFlavors(self.flavor(), other.flavor()) - - def installed(self): - """Test wheter the package is installed. - - Returns two values: a status indicator which is one of - "yes", "no", "old" (an older version is installed) or "bad" - (something went wrong during the install test) and a human - readable string which may contain more details.""" - - namespace = { - "NotInstalled": _scriptExc_NotInstalled, - "OldInstalled": _scriptExc_OldInstalled, - "BadInstalled": _scriptExc_BadInstalled, - "os": os, - "sys": sys, - } - installTest = self._dict['Install-test'].strip() + '\n' - try: - exec installTest in namespace - except ImportError, arg: - return "no", str(arg) - except _scriptExc_NotInstalled, arg: - return "no", str(arg) - except _scriptExc_OldInstalled, arg: - return "old", str(arg) - except _scriptExc_BadInstalled, arg: - return "bad", str(arg) - except: - sys.stderr.write("-------------------------------------\n") - sys.stderr.write("---- %s: install test got exception\n" % self.fullname()) - sys.stderr.write("---- source:\n") - sys.stderr.write(installTest) - sys.stderr.write("---- exception:\n") - import traceback - traceback.print_exc(file=sys.stderr) - if self._db._maintainer: - sys.stderr.write("---- Please copy this and mail to %s\n" % self._db._maintainer) - sys.stderr.write("-------------------------------------\n") - return "bad", "Package install test got exception" - return "yes", "" - - def prerequisites(self): - """Return a list of prerequisites for this package. - - The list contains 2-tuples, of which the first item is either - a PimpPackage object or None, and the second is a descriptive - string. The first item can be None if this package depends on - something that isn't pimp-installable, in which case the descriptive - string should tell the user what to do.""" - - rv = [] - if not self._dict.get('Download-URL'): - # For pseudo-packages that are already installed we don't - # return an error message - status, _ = self.installed() - if status == "yes": - return [] - return [(None, - "Package %s cannot be installed automatically, see the description" % - self.fullname())] - if self.systemwideOnly() and self._db.preferences.isUserInstall(): - return [(None, - "Package %s can only be installed system-wide" % - self.fullname())] - if not self._dict.get('Prerequisites'): - return [] - for item in self._dict['Prerequisites']: - if type(item) == str: - pkg = None - descr = str(item) - else: - name = item['Name'] - if item.has_key('Version'): - name = name + '-' + item['Version'] - if item.has_key('Flavor'): - name = name + '-' + item['Flavor'] - pkg = self._db.find(name) - if not pkg: - descr = "Requires unknown %s"%name - else: - descr = pkg.shortdescription() - rv.append((pkg, descr)) - return rv - - - def downloadPackageOnly(self, output=None): - """Download a single package, if needed. - - An MD5 signature is used to determine whether download is needed, - and to test that we actually downloaded what we expected. - If output is given it is a file-like object that will receive a log - of what happens. - - If anything unforeseen happened the method returns an error message - string. - """ - - scheme, loc, path, query, frag = urlparse.urlsplit(self._dict['Download-URL']) - path = urllib.url2pathname(path) - filename = os.path.split(path)[1] - self.archiveFilename = os.path.join(self._db.preferences.downloadDir, filename) - if not self._archiveOK(): - if scheme == 'manual': - return "Please download package manually and save as %s" % self.archiveFilename - downloader = PimpUrllibDownloader(None, self._db.preferences.downloadDir, - watcher=self._db.preferences.watcher) - if not downloader.download(self._dict['Download-URL'], - self.archiveFilename, output): - return "download command failed" - if not os.path.exists(self.archiveFilename) and not NO_EXECUTE: - return "archive not found after download" - if not self._archiveOK(): - return "archive does not have correct MD5 checksum" - - def _archiveOK(self): - """Test an archive. It should exist and the MD5 checksum should be correct.""" - - if not os.path.exists(self.archiveFilename): - return 0 - if not self._dict.get('MD5Sum'): - sys.stderr.write("Warning: no MD5Sum for %s\n" % self.fullname()) - return 1 - data = open(self.archiveFilename, 'rb').read() - checksum = hashlib.md5(data).hexdigest() - return checksum == self._dict['MD5Sum'] - - def unpackPackageOnly(self, output=None): - """Unpack a downloaded package archive.""" - - filename = os.path.split(self.archiveFilename)[1] - for ext, unpackerClass, arg in ARCHIVE_FORMATS: - if filename[-len(ext):] == ext: - break - else: - return "unknown extension for archive file: %s" % filename - self.basename = filename[:-len(ext)] - unpacker = unpackerClass(arg, dir=self._db.preferences.buildDir, - watcher=self._db.preferences.watcher) - rv = unpacker.unpack(self.archiveFilename, output=output) - if rv: - return rv - - def installPackageOnly(self, output=None): - """Default install method, to be overridden by subclasses""" - return "%s: This package needs to be installed manually (no support for flavor=\"%s\")" \ - % (self.fullname(), self._dict.get(flavor, "")) - - def installSinglePackage(self, output=None): - """Download, unpack and install a single package. - - If output is given it should be a file-like object and it - will receive a log of what happened.""" - - if not self._dict.get('Download-URL'): - return "%s: This package needs to be installed manually (no Download-URL field)" % self.fullname() - msg = self.downloadPackageOnly(output) - if msg: - return "%s: download: %s" % (self.fullname(), msg) - - msg = self.unpackPackageOnly(output) - if msg: - return "%s: unpack: %s" % (self.fullname(), msg) - - return self.installPackageOnly(output) - - def beforeInstall(self): - """Bookkeeping before installation: remember what we have in site-packages""" - self._old_contents = os.listdir(self._db.preferences.installDir) - - def afterInstall(self): - """Bookkeeping after installation: interpret any new .pth files that have - appeared""" - - new_contents = os.listdir(self._db.preferences.installDir) - for fn in new_contents: - if fn in self._old_contents: - continue - if fn[-4:] != '.pth': - continue - fullname = os.path.join(self._db.preferences.installDir, fn) - f = open(fullname) - for line in f.readlines(): - if not line: - continue - if line[0] == '#': - continue - if line[:6] == 'import': - exec line - continue - if line[-1] == '\n': - line = line[:-1] - if not os.path.isabs(line): - line = os.path.join(self._db.preferences.installDir, line) - line = os.path.realpath(line) - if not line in sys.path: - sys.path.append(line) - - def filterExpectedSkips(self, names): - """Return a list that contains only unpexpected skips""" - if not self._db.preferences.isUserInstall(): - return names - expected_skips = self._dict.get('User-install-skips') - if not expected_skips: - return names - newnames = [] - for name in names: - for skip in expected_skips: - if name[:len(skip)] == skip: - break - else: - newnames.append(name) - return newnames - -class PimpPackage_binary(PimpPackage): - - def unpackPackageOnly(self, output=None): - """We don't unpack binary packages until installing""" - pass - - def installPackageOnly(self, output=None): - """Install a single source package. - - If output is given it should be a file-like object and it - will receive a log of what happened.""" - - if self._dict.has_key('Install-command'): - return "%s: Binary package cannot have Install-command" % self.fullname() - - if self._dict.has_key('Pre-install-command'): - if _cmd(output, '/tmp', self._dict['Pre-install-command']): - return "pre-install %s: running \"%s\" failed" % \ - (self.fullname(), self._dict['Pre-install-command']) - - self.beforeInstall() - - # Install by unpacking - filename = os.path.split(self.archiveFilename)[1] - for ext, unpackerClass, arg in ARCHIVE_FORMATS: - if filename[-len(ext):] == ext: - break - else: - return "%s: unknown extension for archive file: %s" % (self.fullname(), filename) - self.basename = filename[:-len(ext)] - - install_renames = [] - for k, newloc in self._db.preferences.installLocations: - if not newloc: - continue - if k == "--install-lib": - oldloc = DEFAULT_INSTALLDIR - else: - return "%s: Don't know installLocation %s" % (self.fullname(), k) - install_renames.append((oldloc, newloc)) - - unpacker = unpackerClass(arg, dir="/", renames=install_renames) - rv = unpacker.unpack(self.archiveFilename, output=output, package=self) - if rv: - return rv - - self.afterInstall() - - if self._dict.has_key('Post-install-command'): - if _cmd(output, '/tmp', self._dict['Post-install-command']): - return "%s: post-install: running \"%s\" failed" % \ - (self.fullname(), self._dict['Post-install-command']) - - return None - - -class PimpPackage_source(PimpPackage): - - def unpackPackageOnly(self, output=None): - """Unpack a source package and check that setup.py exists""" - PimpPackage.unpackPackageOnly(self, output) - # Test that a setup script has been create - self._buildDirname = os.path.join(self._db.preferences.buildDir, self.basename) - setupname = os.path.join(self._buildDirname, "setup.py") - if not os.path.exists(setupname) and not NO_EXECUTE: - return "no setup.py found after unpack of archive" - - def installPackageOnly(self, output=None): - """Install a single source package. - - If output is given it should be a file-like object and it - will receive a log of what happened.""" - - if self._dict.has_key('Pre-install-command'): - if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): - return "pre-install %s: running \"%s\" failed" % \ - (self.fullname(), self._dict['Pre-install-command']) - - self.beforeInstall() - installcmd = self._dict.get('Install-command') - if installcmd and self._install_renames: - return "Package has install-command and can only be installed to standard location" - # This is the "bit-bucket" for installations: everything we don't - # want. After installation we check that it is actually empty - unwanted_install_dir = None - if not installcmd: - extra_args = "" - for k, v in self._db.preferences.installLocations: - if not v: - # We don't want these files installed. Send them - # to the bit-bucket. - if not unwanted_install_dir: - unwanted_install_dir = tempfile.mkdtemp() - v = unwanted_install_dir - extra_args = extra_args + " %s \"%s\"" % (k, v) - installcmd = '"%s" setup.py install %s' % (sys.executable, extra_args) - if _cmd(output, self._buildDirname, installcmd): - return "install %s: running \"%s\" failed" % \ - (self.fullname(), installcmd) - if unwanted_install_dir and os.path.exists(unwanted_install_dir): - unwanted_files = os.listdir(unwanted_install_dir) - if unwanted_files: - rv = "Warning: some files were not installed: %s" % " ".join(unwanted_files) - else: - rv = None - shutil.rmtree(unwanted_install_dir) - return rv - - self.afterInstall() - - if self._dict.has_key('Post-install-command'): - if _cmd(output, self._buildDirname, self._dict['Post-install-command']): - return "post-install %s: running \"%s\" failed" % \ - (self.fullname(), self._dict['Post-install-command']) - return None - -class PimpPackage_installer(PimpPackage): - - def unpackPackageOnly(self, output=None): - """We don't unpack dmg packages until installing""" - pass - - def installPackageOnly(self, output=None): - """Install a single source package. - - If output is given it should be a file-like object and it - will receive a log of what happened.""" - - if self._dict.has_key('Post-install-command'): - return "%s: Installer package cannot have Post-install-command" % self.fullname() - - if self._dict.has_key('Pre-install-command'): - if _cmd(output, '/tmp', self._dict['Pre-install-command']): - return "pre-install %s: running \"%s\" failed" % \ - (self.fullname(), self._dict['Pre-install-command']) - - self.beforeInstall() - - installcmd = self._dict.get('Install-command') - if installcmd: - if '%' in installcmd: - installcmd = installcmd % self.archiveFilename - else: - installcmd = 'open \"%s\"' % self.archiveFilename - if _cmd(output, "/tmp", installcmd): - return '%s: install command failed (use verbose for details)' % self.fullname() - return '%s: downloaded and opened. Install manually and restart Package Manager' % self.archiveFilename - -class PimpInstaller: - """Installer engine: computes dependencies and installs - packages in the right order.""" - - def __init__(self, db): - self._todo = [] - self._db = db - self._curtodo = [] - self._curmessages = [] - - def __contains__(self, package): - return package in self._todo - - def _addPackages(self, packages): - for package in packages: - if not package in self._todo: - self._todo.append(package) - - def _prepareInstall(self, package, force=0, recursive=1): - """Internal routine, recursive engine for prepareInstall. - - Test whether the package is installed and (if not installed - or if force==1) prepend it to the temporary todo list and - call ourselves recursively on all prerequisites.""" - - if not force: - status, message = package.installed() - if status == "yes": - return - if package in self._todo or package in self._curtodo: - return - self._curtodo.insert(0, package) - if not recursive: - return - prereqs = package.prerequisites() - for pkg, descr in prereqs: - if pkg: - self._prepareInstall(pkg, False, recursive) - else: - self._curmessages.append("Problem with dependency: %s" % descr) - - def prepareInstall(self, package, force=0, recursive=1): - """Prepare installation of a package. - - If the package is already installed and force is false nothing - is done. If recursive is true prerequisites are installed first. - - Returns a list of packages (to be passed to install) and a list - of messages of any problems encountered. - """ - - self._curtodo = [] - self._curmessages = [] - self._prepareInstall(package, force, recursive) - rv = self._curtodo, self._curmessages - self._curtodo = [] - self._curmessages = [] - return rv - - def install(self, packages, output): - """Install a list of packages.""" - - self._addPackages(packages) - status = [] - for pkg in self._todo: - msg = pkg.installSinglePackage(output) - if msg: - status.append(msg) - return status - - - -def _run(mode, verbose, force, args, prefargs, watcher): - """Engine for the main program""" - - prefs = PimpPreferences(**prefargs) - if watcher: - prefs.setWatcher(watcher) - rv = prefs.check() - if rv: - sys.stdout.write(rv) - db = PimpDatabase(prefs) - db.appendURL(prefs.pimpDatabase) - - if mode == 'dump': - db.dump(sys.stdout) - elif mode =='list': - if not args: - args = db.listnames() - print "%-20.20s\t%s" % ("Package", "Description") - print - for pkgname in args: - pkg = db.find(pkgname) - if pkg: - description = pkg.shortdescription() - pkgname = pkg.fullname() - else: - description = 'Error: no such package' - print "%-20.20s\t%s" % (pkgname, description) - if verbose: - print "\tHome page:\t", pkg.homepage() - try: - print "\tDownload URL:\t", pkg.downloadURL() - except KeyError: - pass - description = pkg.description() - description = '\n\t\t\t\t\t'.join(description.splitlines()) - print "\tDescription:\t%s" % description - elif mode =='status': - if not args: - args = db.listnames() - print "%-20.20s\t%s\t%s" % ("Package", "Installed", "Message") - print - for pkgname in args: - pkg = db.find(pkgname) - if pkg: - status, msg = pkg.installed() - pkgname = pkg.fullname() - else: - status = 'error' - msg = 'No such package' - print "%-20.20s\t%-9.9s\t%s" % (pkgname, status, msg) - if verbose and status == "no": - prereq = pkg.prerequisites() - for pkg, msg in prereq: - if not pkg: - pkg = '' - else: - pkg = pkg.fullname() - print "%-20.20s\tRequirement: %s %s" % ("", pkg, msg) - elif mode == 'install': - if not args: - print 'Please specify packages to install' - sys.exit(1) - inst = PimpInstaller(db) - for pkgname in args: - pkg = db.find(pkgname) - if not pkg: - print '%s: No such package' % pkgname - continue - list, messages = inst.prepareInstall(pkg, force) - if messages and not force: - print "%s: Not installed:" % pkgname - for m in messages: - print "\t", m - else: - if verbose: - output = sys.stdout - else: - output = None - messages = inst.install(list, output) - if messages: - print "%s: Not installed:" % pkgname - for m in messages: - print "\t", m - -def main(): - """Minimal commandline tool to drive pimp.""" - - import getopt - def _help(): - print "Usage: pimp [options] -s [package ...] List installed status" - print " pimp [options] -l [package ...] Show package information" - print " pimp [options] -i package ... Install packages" - print " pimp -d Dump database to stdout" - print " pimp -V Print version number" - print "Options:" - print " -v Verbose" - print " -f Force installation" - print " -D dir Set destination directory" - print " (default: %s)" % DEFAULT_INSTALLDIR - print " -u url URL for database" - sys.exit(1) - - class _Watcher: - def update(self, msg): - sys.stderr.write(msg + '\r') - return 1 - - try: - opts, args = getopt.getopt(sys.argv[1:], "slifvdD:Vu:") - except getopt.GetoptError: - _help() - if not opts and not args: - _help() - mode = None - force = 0 - verbose = 0 - prefargs = {} - watcher = None - for o, a in opts: - if o == '-s': - if mode: - _help() - mode = 'status' - if o == '-l': - if mode: - _help() - mode = 'list' - if o == '-d': - if mode: - _help() - mode = 'dump' - if o == '-V': - if mode: - _help() - mode = 'version' - if o == '-i': - mode = 'install' - if o == '-f': - force = 1 - if o == '-v': - verbose = 1 - watcher = _Watcher() - if o == '-D': - prefargs['installDir'] = a - if o == '-u': - prefargs['pimpDatabase'] = a - if not mode: - _help() - if mode == 'version': - print 'Pimp version %s; module name is %s' % (PIMP_VERSION, __name__) - else: - _run(mode, verbose, force, args, prefargs, watcher) - -# Finally, try to update ourselves to a newer version. -# If the end-user updates pimp through pimp the new version -# will be called pimp_update and live in site-packages -# or somewhere similar -if __name__ != 'pimp_update': - try: - import pimp_update - except ImportError: - pass - else: - if pimp_update.PIMP_VERSION <= PIMP_VERSION: - import warnings - warnings.warn("pimp_update is version %s, not newer than pimp version %s" % - (pimp_update.PIMP_VERSION, PIMP_VERSION)) - else: - from pimp_update import * - -if __name__ == '__main__': - main() diff --git a/sys/lib/python/plat-mac/plistlib.py b/sys/lib/python/plat-mac/plistlib.py deleted file mode 100644 index 49bd5563c..000000000 --- a/sys/lib/python/plat-mac/plistlib.py +++ /dev/null @@ -1,470 +0,0 @@ -"""plistlib.py -- a tool to generate and parse MacOSX .plist files. - -The PropertList (.plist) file format is a simple XML pickle supporting -basic object types, like dictionaries, lists, numbers and strings. -Usually the top level object is a dictionary. - -To write out a plist file, use the writePlist(rootObject, pathOrFile) -function. 'rootObject' is the top level object, 'pathOrFile' is a -filename or a (writable) file object. - -To parse a plist from a file, use the readPlist(pathOrFile) function, -with a file name or a (readable) file object as the only argument. It -returns the top level object (again, usually a dictionary). - -To work with plist data in strings, you can use readPlistFromString() -and writePlistToString(). - -Values can be strings, integers, floats, booleans, tuples, lists, -dictionaries, Data or datetime.datetime objects. String values (including -dictionary keys) may be unicode strings -- they will be written out as -UTF-8. - -The plist type is supported through the Data class. This is a -thin wrapper around a Python string. - -Generate Plist example: - - pl = dict( - aString="Doodah", - aList=["A", "B", 12, 32.1, [1, 2, 3]], - aFloat = 0.1, - anInt = 728, - aDict=dict( - anotherString="", - aUnicodeValue=u'M\xe4ssig, Ma\xdf', - aTrueValue=True, - aFalseValue=False, - ), - someData = Data(""), - someMoreData = Data("" * 10), - aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())), - ) - # unicode keys are possible, but a little awkward to use: - pl[u'\xc5benraa'] = "That was a unicode key." - writePlist(pl, fileName) - -Parse Plist example: - - pl = readPlist(pathOrFile) - print pl["aKey"] -""" - - -__all__ = [ - "readPlist", "writePlist", "readPlistFromString", "writePlistToString", - "readPlistFromResource", "writePlistToResource", - "Plist", "Data", "Dict" -] -# Note: the Plist and Dict classes have been deprecated. - -import binascii -import datetime -from cStringIO import StringIO -import re - - -def readPlist(pathOrFile): - """Read a .plist file. 'pathOrFile' may either be a file name or a - (readable) file object. Return the unpacked root object (which - usually is a dictionary). - """ - didOpen = 0 - if isinstance(pathOrFile, (str, unicode)): - pathOrFile = open(pathOrFile) - didOpen = 1 - p = PlistParser() - rootObject = p.parse(pathOrFile) - if didOpen: - pathOrFile.close() - return rootObject - - -def writePlist(rootObject, pathOrFile): - """Write 'rootObject' to a .plist file. 'pathOrFile' may either be a - file name or a (writable) file object. - """ - didOpen = 0 - if isinstance(pathOrFile, (str, unicode)): - pathOrFile = open(pathOrFile, "w") - didOpen = 1 - writer = PlistWriter(pathOrFile) - writer.writeln("") - writer.writeValue(rootObject) - writer.writeln("") - if didOpen: - pathOrFile.close() - - -def readPlistFromString(data): - """Read a plist data from a string. Return the root object. - """ - return readPlist(StringIO(data)) - - -def writePlistToString(rootObject): - """Return 'rootObject' as a plist-formatted string. - """ - f = StringIO() - writePlist(rootObject, f) - return f.getvalue() - - -def readPlistFromResource(path, restype='plst', resid=0): - """Read plst resource from the resource fork of path. - """ - from Carbon.File import FSRef, FSGetResourceForkName - from Carbon.Files import fsRdPerm - from Carbon import Res - fsRef = FSRef(path) - resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdPerm) - Res.UseResFile(resNum) - plistData = Res.Get1Resource(restype, resid).data - Res.CloseResFile(resNum) - return readPlistFromString(plistData) - - -def writePlistToResource(rootObject, path, restype='plst', resid=0): - """Write 'rootObject' as a plst resource to the resource fork of path. - """ - from Carbon.File import FSRef, FSGetResourceForkName - from Carbon.Files import fsRdWrPerm - from Carbon import Res - plistData = writePlistToString(rootObject) - fsRef = FSRef(path) - resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdWrPerm) - Res.UseResFile(resNum) - try: - Res.Get1Resource(restype, resid).RemoveResource() - except Res.Error: - pass - res = Res.Resource(plistData) - res.AddResource(restype, resid, '') - res.WriteResource() - Res.CloseResFile(resNum) - - -class DumbXMLWriter: - - def __init__(self, file, indentLevel=0, indent="\t"): - self.file = file - self.stack = [] - self.indentLevel = indentLevel - self.indent = indent - - def beginElement(self, element): - self.stack.append(element) - self.writeln("<%s>" % element) - self.indentLevel += 1 - - def endElement(self, element): - assert self.indentLevel > 0 - assert self.stack.pop() == element - self.indentLevel -= 1 - self.writeln("" % element) - - def simpleElement(self, element, value=None): - if value is not None: - value = _escapeAndEncode(value) - self.writeln("<%s>%s" % (element, value, element)) - else: - self.writeln("<%s/>" % element) - - def writeln(self, line): - if line: - self.file.write(self.indentLevel * self.indent + line + "\n") - else: - self.file.write("\n") - - -# Contents should conform to a subset of ISO 8601 -# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'. Smaller units may be omitted with -# a loss of precision) -_dateParser = re.compile(r"(?P\d\d\d\d)(?:-(?P\d\d)(?:-(?P\d\d)(?:T(?P\d\d)(?::(?P\d\d)(?::(?P\d\d))?)?)?)?)?Z") - -def _dateFromString(s): - order = ('year', 'month', 'day', 'hour', 'minute', 'second') - gd = _dateParser.match(s).groupdict() - lst = [] - for key in order: - val = gd[key] - if val is None: - break - lst.append(int(val)) - return datetime.datetime(*lst) - -def _dateToString(d): - return '%04d-%02d-%02dT%02d:%02d:%02dZ' % ( - d.year, d.month, d.day, - d.hour, d.minute, d.second - ) - - -# Regex to find any control chars, except for \t \n and \r -_controlCharPat = re.compile( - r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f" - r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]") - -def _escapeAndEncode(text): - m = _controlCharPat.search(text) - if m is not None: - raise ValueError("strings can't contains control characters; " - "use plistlib.Data instead") - text = text.replace("\r\n", "\n") # convert DOS line endings - text = text.replace("\r", "\n") # convert Mac line endings - text = text.replace("&", "&") # escape '&' - text = text.replace("<", "<") # escape '<' - text = text.replace(">", ">") # escape '>' - return text.encode("utf-8") # encode as UTF-8 - - -PLISTHEADER = """\ - - -""" - -class PlistWriter(DumbXMLWriter): - - def __init__(self, file, indentLevel=0, indent="\t", writeHeader=1): - if writeHeader: - file.write(PLISTHEADER) - DumbXMLWriter.__init__(self, file, indentLevel, indent) - - def writeValue(self, value): - if isinstance(value, (str, unicode)): - self.simpleElement("string", value) - elif isinstance(value, bool): - # must switch for bool before int, as bool is a - # subclass of int... - if value: - self.simpleElement("true") - else: - self.simpleElement("false") - elif isinstance(value, int): - self.simpleElement("integer", str(value)) - elif isinstance(value, float): - self.simpleElement("real", repr(value)) - elif isinstance(value, dict): - self.writeDict(value) - elif isinstance(value, Data): - self.writeData(value) - elif isinstance(value, datetime.datetime): - self.simpleElement("date", _dateToString(value)) - elif isinstance(value, (tuple, list)): - self.writeArray(value) - else: - raise TypeError("unsuported type: %s" % type(value)) - - def writeData(self, data): - self.beginElement("data") - self.indentLevel -= 1 - maxlinelength = 76 - len(self.indent.replace("\t", " " * 8) * - self.indentLevel) - for line in data.asBase64(maxlinelength).split("\n"): - if line: - self.writeln(line) - self.indentLevel += 1 - self.endElement("data") - - def writeDict(self, d): - self.beginElement("dict") - items = d.items() - items.sort() - for key, value in items: - if not isinstance(key, (str, unicode)): - raise TypeError("keys must be strings") - self.simpleElement("key", key) - self.writeValue(value) - self.endElement("dict") - - def writeArray(self, array): - self.beginElement("array") - for value in array: - self.writeValue(value) - self.endElement("array") - - -class _InternalDict(dict): - - # This class is needed while Dict is scheduled for deprecation: - # we only need to warn when a *user* instantiates Dict or when - # the "attribute notation for dict keys" is used. - - def __getattr__(self, attr): - try: - value = self[attr] - except KeyError: - raise AttributeError, attr - from warnings import warn - warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) - return value - - def __setattr__(self, attr, value): - from warnings import warn - warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) - self[attr] = value - - def __delattr__(self, attr): - try: - del self[attr] - except KeyError: - raise AttributeError, attr - from warnings import warn - warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) - -class Dict(_InternalDict): - - def __init__(self, **kwargs): - from warnings import warn - warn("The plistlib.Dict class is deprecated, use builtin dict instead", - PendingDeprecationWarning) - super(Dict, self).__init__(**kwargs) - - -class Plist(_InternalDict): - - """This class has been deprecated. Use readPlist() and writePlist() - functions instead, together with regular dict objects. - """ - - def __init__(self, **kwargs): - from warnings import warn - warn("The Plist class is deprecated, use the readPlist() and " - "writePlist() functions instead", PendingDeprecationWarning) - super(Plist, self).__init__(**kwargs) - - def fromFile(cls, pathOrFile): - """Deprecated. Use the readPlist() function instead.""" - rootObject = readPlist(pathOrFile) - plist = cls() - plist.update(rootObject) - return plist - fromFile = classmethod(fromFile) - - def write(self, pathOrFile): - """Deprecated. Use the writePlist() function instead.""" - writePlist(self, pathOrFile) - - -def _encodeBase64(s, maxlinelength=76): - # copied from base64.encodestring(), with added maxlinelength argument - maxbinsize = (maxlinelength//4)*3 - pieces = [] - for i in range(0, len(s), maxbinsize): - chunk = s[i : i + maxbinsize] - pieces.append(binascii.b2a_base64(chunk)) - return "".join(pieces) - -class Data: - - """Wrapper for binary data.""" - - def __init__(self, data): - self.data = data - - def fromBase64(cls, data): - # base64.decodestring just calls binascii.a2b_base64; - # it seems overkill to use both base64 and binascii. - return cls(binascii.a2b_base64(data)) - fromBase64 = classmethod(fromBase64) - - def asBase64(self, maxlinelength=76): - return _encodeBase64(self.data, maxlinelength) - - def __cmp__(self, other): - if isinstance(other, self.__class__): - return cmp(self.data, other.data) - elif isinstance(other, str): - return cmp(self.data, other) - else: - return cmp(id(self), id(other)) - - def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, repr(self.data)) - - -class PlistParser: - - def __init__(self): - self.stack = [] - self.currentKey = None - self.root = None - - def parse(self, fileobj): - from xml.parsers.expat import ParserCreate - parser = ParserCreate() - parser.StartElementHandler = self.handleBeginElement - parser.EndElementHandler = self.handleEndElement - parser.CharacterDataHandler = self.handleData - parser.ParseFile(fileobj) - return self.root - - def handleBeginElement(self, element, attrs): - self.data = [] - handler = getattr(self, "begin_" + element, None) - if handler is not None: - handler(attrs) - - def handleEndElement(self, element): - handler = getattr(self, "end_" + element, None) - if handler is not None: - handler() - - def handleData(self, data): - self.data.append(data) - - def addObject(self, value): - if self.currentKey is not None: - self.stack[-1][self.currentKey] = value - self.currentKey = None - elif not self.stack: - # this is the root object - self.root = value - else: - self.stack[-1].append(value) - - def getData(self): - data = "".join(self.data) - try: - data = data.encode("ascii") - except UnicodeError: - pass - self.data = [] - return data - - # element handlers - - def begin_dict(self, attrs): - d = _InternalDict() - self.addObject(d) - self.stack.append(d) - def end_dict(self): - self.stack.pop() - - def end_key(self): - self.currentKey = self.getData() - - def begin_array(self, attrs): - a = [] - self.addObject(a) - self.stack.append(a) - def end_array(self): - self.stack.pop() - - def end_true(self): - self.addObject(True) - def end_false(self): - self.addObject(False) - def end_integer(self): - self.addObject(int(self.getData())) - def end_real(self): - self.addObject(float(self.getData())) - def end_string(self): - self.addObject(self.getData()) - def end_data(self): - self.addObject(Data.fromBase64(self.getData())) - def end_date(self): - self.addObject(_dateFromString(self.getData())) diff --git a/sys/lib/python/plat-mac/terminalcommand.py b/sys/lib/python/plat-mac/terminalcommand.py deleted file mode 100644 index 292f09c7d..000000000 --- a/sys/lib/python/plat-mac/terminalcommand.py +++ /dev/null @@ -1,47 +0,0 @@ -"""terminalcommand.py -- A minimal interface to Terminal.app. - -To run a shell command in a new Terminal.app window: - - import terminalcommand - terminalcommand.run("ls -l") - -No result is returned; it is purely meant as a quick way to run a script -with a decent input/output window. -""" - -# -# This module is a fairly straightforward translation of Jack Jansen's -# Mac/OSX/PythonLauncher/doscript.m. -# - -import time -import os -from Carbon import AE -from Carbon.AppleEvents import * - - -TERMINAL_SIG = "trmx" -START_TERMINAL = "/usr/bin/open /Applications/Utilities/Terminal.app" -SEND_MODE = kAENoReply # kAEWaitReply hangs when run from Terminal.app itself - - -def run(command): - """Run a shell command in a new Terminal.app window.""" - termAddress = AE.AECreateDesc(typeApplSignature, TERMINAL_SIG) - theEvent = AE.AECreateAppleEvent(kAECoreSuite, kAEDoScript, termAddress, - kAutoGenerateReturnID, kAnyTransactionID) - commandDesc = AE.AECreateDesc(typeChar, command) - theEvent.AEPutParamDesc(kAECommandClass, commandDesc) - - try: - theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout) - except AE.Error, why: - if why[0] != -600: # Terminal.app not yet running - raise - os.system(START_TERMINAL) - time.sleep(1) - theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout) - - -if __name__ == "__main__": - run("ls -l") diff --git a/sys/lib/python/plat-mac/videoreader.py b/sys/lib/python/plat-mac/videoreader.py deleted file mode 100644 index f16228b82..000000000 --- a/sys/lib/python/plat-mac/videoreader.py +++ /dev/null @@ -1,291 +0,0 @@ -# Video file reader, using QuickTime -# -# This module was quickly ripped out of another software package, so there is a good -# chance that it does not work as-is and it needs some hacking. -# -# Jack Jansen, August 2000 -# -import sys -from Carbon import Qt -from Carbon import QuickTime -from Carbon import Qd -from Carbon import Qdoffs -from Carbon import QDOffscreen -from Carbon import Res -try: - import MediaDescr -except ImportError: - def _audiodescr(data): - return None -else: - def _audiodescr(data): - return MediaDescr.SoundDescription.decode(data) -try: - from imgformat import macrgb -except ImportError: - macrgb = "Macintosh RGB format" -import os -# import audio.format - -class VideoFormat: - def __init__(self, name, descr, width, height, format): - self.__name = name - self.__descr = descr - self.__width = width - self.__height = height - self.__format = format - - def getname(self): - return self.__name - - def getdescr(self): - return self.__descr - - def getsize(self): - return self.__width, self.__height - - def getformat(self): - return self.__format - -class _Reader: - def __init__(self, path): - fd = Qt.OpenMovieFile(path, 0) - self.movie, d1, d2 = Qt.NewMovieFromFile(fd, 0, 0) - self.movietimescale = self.movie.GetMovieTimeScale() - try: - self.audiotrack = self.movie.GetMovieIndTrackType(1, - QuickTime.AudioMediaCharacteristic, QuickTime.movieTrackCharacteristic) - self.audiomedia = self.audiotrack.GetTrackMedia() - except Qt.Error: - self.audiotrack = self.audiomedia = None - self.audiodescr = {} - else: - handle = Res.Handle('') - n = self.audiomedia.GetMediaSampleDescriptionCount() - self.audiomedia.GetMediaSampleDescription(1, handle) - self.audiodescr = _audiodescr(handle.data) - self.audiotimescale = self.audiomedia.GetMediaTimeScale() - del handle - - try: - self.videotrack = self.movie.GetMovieIndTrackType(1, - QuickTime.VisualMediaCharacteristic, QuickTime.movieTrackCharacteristic) - self.videomedia = self.videotrack.GetTrackMedia() - except Qt.Error: - self.videotrack = self.videomedia = self.videotimescale = None - if self.videotrack: - self.videotimescale = self.videomedia.GetMediaTimeScale() - x0, y0, x1, y1 = self.movie.GetMovieBox() - self.videodescr = {'width':(x1-x0), 'height':(y1-y0)} - self._initgworld() - self.videocurtime = None - self.audiocurtime = None - - - def __del__(self): - self.audiomedia = None - self.audiotrack = None - self.videomedia = None - self.videotrack = None - self.movie = None - - def _initgworld(self): - old_port, old_dev = Qdoffs.GetGWorld() - try: - movie_w = self.videodescr['width'] - movie_h = self.videodescr['height'] - movie_rect = (0, 0, movie_w, movie_h) - self.gworld = Qdoffs.NewGWorld(32, movie_rect, None, None, QDOffscreen.keepLocal) - self.pixmap = self.gworld.GetGWorldPixMap() - Qdoffs.LockPixels(self.pixmap) - Qdoffs.SetGWorld(self.gworld.as_GrafPtr(), None) - Qd.EraseRect(movie_rect) - self.movie.SetMovieGWorld(self.gworld.as_GrafPtr(), None) - self.movie.SetMovieBox(movie_rect) - self.movie.SetMovieActive(1) - self.movie.MoviesTask(0) - self.movie.SetMoviePlayHints(QuickTime.hintsHighQuality, QuickTime.hintsHighQuality) - # XXXX framerate - finally: - Qdoffs.SetGWorld(old_port, old_dev) - - def _gettrackduration_ms(self, track): - tracktime = track.GetTrackDuration() - return self._movietime_to_ms(tracktime) - - def _movietime_to_ms(self, time): - value, d1, d2 = Qt.ConvertTimeScale((time, self.movietimescale, None), 1000) - return value - - def _videotime_to_ms(self, time): - value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), 1000) - return value - - def _audiotime_to_ms(self, time): - value, d1, d2 = Qt.ConvertTimeScale((time, self.audiotimescale, None), 1000) - return value - - def _videotime_to_movietime(self, time): - value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), - self.movietimescale) - return value - - def HasAudio(self): - return not self.audiotrack is None - - def HasVideo(self): - return not self.videotrack is None - - def GetAudioDuration(self): - if not self.audiotrack: - return 0 - return self._gettrackduration_ms(self.audiotrack) - - def GetVideoDuration(self): - if not self.videotrack: - return 0 - return self._gettrackduration_ms(self.videotrack) - - def GetAudioFormat(self): - if not self.audiodescr: - return None, None, None, None, None - bps = self.audiodescr['sampleSize'] - nch = self.audiodescr['numChannels'] - if nch == 1: - channels = ['mono'] - elif nch == 2: - channels = ['left', 'right'] - else: - channels = map(lambda x: str(x+1), range(nch)) - if bps % 8: - # Funny bits-per sample. We pretend not to understand - blocksize = 0 - fpb = 0 - else: - # QuickTime is easy (for as far as we support it): samples are always a whole - # number of bytes, so frames are nchannels*samplesize, and there's one frame per block. - blocksize = (bps/8)*nch - fpb = 1 - if self.audiodescr['dataFormat'] == 'raw ': - encoding = 'linear-excess' - elif self.audiodescr['dataFormat'] == 'twos': - encoding = 'linear-signed' - else: - encoding = 'quicktime-coding-%s'%self.audiodescr['dataFormat'] -## return audio.format.AudioFormatLinear('quicktime_audio', 'QuickTime Audio Format', -## channels, encoding, blocksize=blocksize, fpb=fpb, bps=bps) - return channels, encoding, blocksize, fpb, bps - - def GetAudioFrameRate(self): - if not self.audiodescr: - return None - return int(self.audiodescr['sampleRate']) - - def GetVideoFormat(self): - width = self.videodescr['width'] - height = self.videodescr['height'] - return VideoFormat('dummy_format', 'Dummy Video Format', width, height, macrgb) - - def GetVideoFrameRate(self): - tv = self.videocurtime - if tv == None: - tv = 0 - flags = QuickTime.nextTimeStep|QuickTime.nextTimeEdgeOK - tv, dur = self.videomedia.GetMediaNextInterestingTime(flags, tv, 1.0) - dur = self._videotime_to_ms(dur) - return int((1000.0/dur)+0.5) - - def ReadAudio(self, nframes, time=None): - if not time is None: - self.audiocurtime = time - flags = QuickTime.nextTimeStep|QuickTime.nextTimeEdgeOK - if self.audiocurtime == None: - self.audiocurtime = 0 - tv = self.audiomedia.GetMediaNextInterestingTimeOnly(flags, self.audiocurtime, 1.0) - if tv < 0 or (self.audiocurtime and tv < self.audiocurtime): - return self._audiotime_to_ms(self.audiocurtime), None - h = Res.Handle('') - desc_h = Res.Handle('') - size, actualtime, sampleduration, desc_index, actualcount, flags = \ - self.audiomedia.GetMediaSample(h, 0, tv, desc_h, nframes) - self.audiocurtime = actualtime + actualcount*sampleduration - return self._audiotime_to_ms(actualtime), h.data - - def ReadVideo(self, time=None): - if not time is None: - self.videocurtime = time - flags = QuickTime.nextTimeStep - if self.videocurtime == None: - flags = flags | QuickTime.nextTimeEdgeOK - self.videocurtime = 0 - tv = self.videomedia.GetMediaNextInterestingTimeOnly(flags, self.videocurtime, 1.0) - if tv < 0 or (self.videocurtime and tv <= self.videocurtime): - return self._videotime_to_ms(self.videocurtime), None - self.videocurtime = tv - moviecurtime = self._videotime_to_movietime(self.videocurtime) - self.movie.SetMovieTimeValue(moviecurtime) - self.movie.MoviesTask(0) - return self._videotime_to_ms(self.videocurtime), self._getpixmapcontent() - - def _getpixmapcontent(self): - """Shuffle the offscreen PixMap data, because it may have funny stride values""" - rowbytes = Qdoffs.GetPixRowBytes(self.pixmap) - width = self.videodescr['width'] - height = self.videodescr['height'] - start = 0 - rv = '' - for i in range(height): - nextline = Qdoffs.GetPixMapBytes(self.pixmap, start, width*4) - start = start + rowbytes - rv = rv + nextline - return rv - -def reader(url): - try: - rdr = _Reader(url) - except IOError: - return None - return rdr - -def _test(): - import EasyDialogs - try: - import img - except ImportError: - img = None - import MacOS - Qt.EnterMovies() - path = EasyDialogs.AskFileForOpen(message='Video to convert') - if not path: sys.exit(0) - rdr = reader(path) - if not rdr: - sys.exit(1) - dstdir = EasyDialogs.AskFileForSave(message='Name for output folder') - if not dstdir: sys.exit(0) - num = 0 - os.mkdir(dstdir) - videofmt = rdr.GetVideoFormat() - imgfmt = videofmt.getformat() - imgw, imgh = videofmt.getsize() - timestamp, data = rdr.ReadVideo() - while data: - fname = 'frame%04.4d.jpg'%num - num = num+1 - pname = os.path.join(dstdir, fname) - if not img: print 'Not', - print 'Writing %s, size %dx%d, %d bytes'%(fname, imgw, imgh, len(data)) - if img: - wrt = img.writer(imgfmt, pname) - wrt.width = imgw - wrt.height = imgh - wrt.write(data) - timestamp, data = rdr.ReadVideo() - MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG') - if num > 20: - print 'stopping at 20 frames so your disk does not fill up:-)' - break - print 'Total frames:', num - -if __name__ == '__main__': - _test() - sys.exit(1) diff --git a/sys/lib/python/sqlite3/test/__init__.py b/sys/lib/python/sqlite3/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sys/lib/python/sqlite3/test/dbapi.py b/sys/lib/python/sqlite3/test/dbapi.py deleted file mode 100644 index b08da9c5f..000000000 --- a/sys/lib/python/sqlite3/test/dbapi.py +++ /dev/null @@ -1,732 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/dbapi.py: tests for DB-API compliance -# -# Copyright (C) 2004-2005 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import unittest -import threading -import sqlite3 as sqlite - -class ModuleTests(unittest.TestCase): - def CheckAPILevel(self): - self.assertEqual(sqlite.apilevel, "2.0", - "apilevel is %s, should be 2.0" % sqlite.apilevel) - - def CheckThreadSafety(self): - self.assertEqual(sqlite.threadsafety, 1, - "threadsafety is %d, should be 1" % sqlite.threadsafety) - - def CheckParamStyle(self): - self.assertEqual(sqlite.paramstyle, "qmark", - "paramstyle is '%s', should be 'qmark'" % - sqlite.paramstyle) - - def CheckWarning(self): - self.assert_(issubclass(sqlite.Warning, StandardError), - "Warning is not a subclass of StandardError") - - def CheckError(self): - self.failUnless(issubclass(sqlite.Error, StandardError), - "Error is not a subclass of StandardError") - - def CheckInterfaceError(self): - self.failUnless(issubclass(sqlite.InterfaceError, sqlite.Error), - "InterfaceError is not a subclass of Error") - - def CheckDatabaseError(self): - self.failUnless(issubclass(sqlite.DatabaseError, sqlite.Error), - "DatabaseError is not a subclass of Error") - - def CheckDataError(self): - self.failUnless(issubclass(sqlite.DataError, sqlite.DatabaseError), - "DataError is not a subclass of DatabaseError") - - def CheckOperationalError(self): - self.failUnless(issubclass(sqlite.OperationalError, sqlite.DatabaseError), - "OperationalError is not a subclass of DatabaseError") - - def CheckIntegrityError(self): - self.failUnless(issubclass(sqlite.IntegrityError, sqlite.DatabaseError), - "IntegrityError is not a subclass of DatabaseError") - - def CheckInternalError(self): - self.failUnless(issubclass(sqlite.InternalError, sqlite.DatabaseError), - "InternalError is not a subclass of DatabaseError") - - def CheckProgrammingError(self): - self.failUnless(issubclass(sqlite.ProgrammingError, sqlite.DatabaseError), - "ProgrammingError is not a subclass of DatabaseError") - - def CheckNotSupportedError(self): - self.failUnless(issubclass(sqlite.NotSupportedError, - sqlite.DatabaseError), - "NotSupportedError is not a subclass of DatabaseError") - -class ConnectionTests(unittest.TestCase): - def setUp(self): - self.cx = sqlite.connect(":memory:") - cu = self.cx.cursor() - cu.execute("create table test(id integer primary key, name text)") - cu.execute("insert into test(name) values (?)", ("foo",)) - - def tearDown(self): - self.cx.close() - - def CheckCommit(self): - self.cx.commit() - - def CheckCommitAfterNoChanges(self): - """ - A commit should also work when no changes were made to the database. - """ - self.cx.commit() - self.cx.commit() - - def CheckRollback(self): - self.cx.rollback() - - def CheckRollbackAfterNoChanges(self): - """ - A rollback should also work when no changes were made to the database. - """ - self.cx.rollback() - self.cx.rollback() - - def CheckCursor(self): - cu = self.cx.cursor() - - def CheckFailedOpen(self): - YOU_CANNOT_OPEN_THIS = "/foo/bar/bla/23534/mydb.db" - try: - con = sqlite.connect(YOU_CANNOT_OPEN_THIS) - except sqlite.OperationalError: - return - self.fail("should have raised an OperationalError") - - def CheckClose(self): - self.cx.close() - - def CheckExceptions(self): - # Optional DB-API extension. - self.failUnlessEqual(self.cx.Warning, sqlite.Warning) - self.failUnlessEqual(self.cx.Error, sqlite.Error) - self.failUnlessEqual(self.cx.InterfaceError, sqlite.InterfaceError) - self.failUnlessEqual(self.cx.DatabaseError, sqlite.DatabaseError) - self.failUnlessEqual(self.cx.DataError, sqlite.DataError) - self.failUnlessEqual(self.cx.OperationalError, sqlite.OperationalError) - self.failUnlessEqual(self.cx.IntegrityError, sqlite.IntegrityError) - self.failUnlessEqual(self.cx.InternalError, sqlite.InternalError) - self.failUnlessEqual(self.cx.ProgrammingError, sqlite.ProgrammingError) - self.failUnlessEqual(self.cx.NotSupportedError, sqlite.NotSupportedError) - -class CursorTests(unittest.TestCase): - def setUp(self): - self.cx = sqlite.connect(":memory:") - self.cu = self.cx.cursor() - self.cu.execute("create table test(id integer primary key, name text, income number)") - self.cu.execute("insert into test(name) values (?)", ("foo",)) - - def tearDown(self): - self.cu.close() - self.cx.close() - - def CheckExecuteNoArgs(self): - self.cu.execute("delete from test") - - def CheckExecuteIllegalSql(self): - try: - self.cu.execute("select asdf") - self.fail("should have raised an OperationalError") - except sqlite.OperationalError: - return - except: - self.fail("raised wrong exception") - - def CheckExecuteTooMuchSql(self): - try: - self.cu.execute("select 5+4; select 4+5") - self.fail("should have raised a Warning") - except sqlite.Warning: - return - except: - self.fail("raised wrong exception") - - def CheckExecuteTooMuchSql2(self): - self.cu.execute("select 5+4; -- foo bar") - - def CheckExecuteTooMuchSql3(self): - self.cu.execute(""" - select 5+4; - - /* - foo - */ - """) - - def CheckExecuteWrongSqlArg(self): - try: - self.cu.execute(42) - self.fail("should have raised a ValueError") - except ValueError: - return - except: - self.fail("raised wrong exception.") - - def CheckExecuteArgInt(self): - self.cu.execute("insert into test(id) values (?)", (42,)) - - def CheckExecuteArgFloat(self): - self.cu.execute("insert into test(income) values (?)", (2500.32,)) - - def CheckExecuteArgString(self): - self.cu.execute("insert into test(name) values (?)", ("Hugo",)) - - def CheckExecuteWrongNoOfArgs1(self): - # too many parameters - try: - self.cu.execute("insert into test(id) values (?)", (17, "Egon")) - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckExecuteWrongNoOfArgs2(self): - # too little parameters - try: - self.cu.execute("insert into test(id) values (?)") - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckExecuteWrongNoOfArgs3(self): - # no parameters, parameters are needed - try: - self.cu.execute("insert into test(id) values (?)") - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckExecuteDictMapping(self): - self.cu.execute("insert into test(name) values ('foo')") - self.cu.execute("select name from test where name=:name", {"name": "foo"}) - row = self.cu.fetchone() - self.failUnlessEqual(row[0], "foo") - - def CheckExecuteDictMappingTooLittleArgs(self): - self.cu.execute("insert into test(name) values ('foo')") - try: - self.cu.execute("select name from test where name=:name and id=:id", {"name": "foo"}) - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckExecuteDictMappingNoArgs(self): - self.cu.execute("insert into test(name) values ('foo')") - try: - self.cu.execute("select name from test where name=:name") - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckExecuteDictMappingUnnamed(self): - self.cu.execute("insert into test(name) values ('foo')") - try: - self.cu.execute("select name from test where name=?", {"name": "foo"}) - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - - def CheckClose(self): - self.cu.close() - - def CheckRowcountExecute(self): - self.cu.execute("delete from test") - self.cu.execute("insert into test(name) values ('foo')") - self.cu.execute("insert into test(name) values ('foo')") - self.cu.execute("update test set name='bar'") - self.failUnlessEqual(self.cu.rowcount, 2) - - def CheckRowcountExecutemany(self): - self.cu.execute("delete from test") - self.cu.executemany("insert into test(name) values (?)", [(1,), (2,), (3,)]) - self.failUnlessEqual(self.cu.rowcount, 3) - - def CheckTotalChanges(self): - self.cu.execute("insert into test(name) values ('foo')") - self.cu.execute("insert into test(name) values ('foo')") - if self.cx.total_changes < 2: - self.fail("total changes reported wrong value") - - # Checks for executemany: - # Sequences are required by the DB-API, iterators - # enhancements in pysqlite. - - def CheckExecuteManySequence(self): - self.cu.executemany("insert into test(income) values (?)", [(x,) for x in range(100, 110)]) - - def CheckExecuteManyIterator(self): - class MyIter: - def __init__(self): - self.value = 5 - - def next(self): - if self.value == 10: - raise StopIteration - else: - self.value += 1 - return (self.value,) - - self.cu.executemany("insert into test(income) values (?)", MyIter()) - - def CheckExecuteManyGenerator(self): - def mygen(): - for i in range(5): - yield (i,) - - self.cu.executemany("insert into test(income) values (?)", mygen()) - - def CheckExecuteManyWrongSqlArg(self): - try: - self.cu.executemany(42, [(3,)]) - self.fail("should have raised a ValueError") - except ValueError: - return - except: - self.fail("raised wrong exception.") - - def CheckExecuteManySelect(self): - try: - self.cu.executemany("select ?", [(3,)]) - self.fail("should have raised a ProgrammingError") - except sqlite.ProgrammingError: - return - except: - self.fail("raised wrong exception.") - - def CheckExecuteManyNotIterable(self): - try: - self.cu.executemany("insert into test(income) values (?)", 42) - self.fail("should have raised a TypeError") - except TypeError: - return - except Exception, e: - print "raised", e.__class__ - self.fail("raised wrong exception.") - - def CheckFetchIter(self): - # Optional DB-API extension. - self.cu.execute("delete from test") - self.cu.execute("insert into test(id) values (?)", (5,)) - self.cu.execute("insert into test(id) values (?)", (6,)) - self.cu.execute("select id from test order by id") - lst = [] - for row in self.cu: - lst.append(row[0]) - self.failUnlessEqual(lst[0], 5) - self.failUnlessEqual(lst[1], 6) - - def CheckFetchone(self): - self.cu.execute("select name from test") - row = self.cu.fetchone() - self.failUnlessEqual(row[0], "foo") - row = self.cu.fetchone() - self.failUnlessEqual(row, None) - - def CheckFetchoneNoStatement(self): - cur = self.cx.cursor() - row = cur.fetchone() - self.failUnlessEqual(row, None) - - def CheckArraySize(self): - # must default ot 1 - self.failUnlessEqual(self.cu.arraysize, 1) - - # now set to 2 - self.cu.arraysize = 2 - - # now make the query return 3 rows - self.cu.execute("delete from test") - self.cu.execute("insert into test(name) values ('A')") - self.cu.execute("insert into test(name) values ('B')") - self.cu.execute("insert into test(name) values ('C')") - self.cu.execute("select name from test") - res = self.cu.fetchmany() - - self.failUnlessEqual(len(res), 2) - - def CheckFetchmany(self): - self.cu.execute("select name from test") - res = self.cu.fetchmany(100) - self.failUnlessEqual(len(res), 1) - res = self.cu.fetchmany(100) - self.failUnlessEqual(res, []) - - def CheckFetchall(self): - self.cu.execute("select name from test") - res = self.cu.fetchall() - self.failUnlessEqual(len(res), 1) - res = self.cu.fetchall() - self.failUnlessEqual(res, []) - - def CheckSetinputsizes(self): - self.cu.setinputsizes([3, 4, 5]) - - def CheckSetoutputsize(self): - self.cu.setoutputsize(5, 0) - - def CheckSetoutputsizeNoColumn(self): - self.cu.setoutputsize(42) - - def CheckCursorConnection(self): - # Optional DB-API extension. - self.failUnlessEqual(self.cu.connection, self.cx) - - def CheckWrongCursorCallable(self): - try: - def f(): pass - cur = self.cx.cursor(f) - self.fail("should have raised a TypeError") - except TypeError: - return - self.fail("should have raised a ValueError") - - def CheckCursorWrongClass(self): - class Foo: pass - foo = Foo() - try: - cur = sqlite.Cursor(foo) - self.fail("should have raised a ValueError") - except TypeError: - pass - -class ThreadTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - self.cur = self.con.cursor() - self.cur.execute("create table test(id integer primary key, name text, bin binary, ratio number, ts timestamp)") - - def tearDown(self): - self.cur.close() - self.con.close() - - def CheckConCursor(self): - def run(con, errors): - try: - cur = con.cursor() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckConCommit(self): - def run(con, errors): - try: - con.commit() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckConRollback(self): - def run(con, errors): - try: - con.rollback() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckConClose(self): - def run(con, errors): - try: - con.close() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckCurImplicitBegin(self): - def run(cur, errors): - try: - cur.execute("insert into test(name) values ('a')") - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckCurClose(self): - def run(cur, errors): - try: - cur.close() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckCurExecute(self): - def run(cur, errors): - try: - cur.execute("select name from test") - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - self.cur.execute("insert into test(name) values ('a')") - t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - - def CheckCurIterNext(self): - def run(cur, errors): - try: - row = cur.fetchone() - errors.append("did not raise ProgrammingError") - return - except sqlite.ProgrammingError: - return - except: - errors.append("raised wrong exception") - - errors = [] - self.cur.execute("insert into test(name) values ('a')") - self.cur.execute("select name from test") - t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors}) - t.start() - t.join() - if len(errors) > 0: - self.fail("\n".join(errors)) - -class ConstructorTests(unittest.TestCase): - def CheckDate(self): - d = sqlite.Date(2004, 10, 28) - - def CheckTime(self): - t = sqlite.Time(12, 39, 35) - - def CheckTimestamp(self): - ts = sqlite.Timestamp(2004, 10, 28, 12, 39, 35) - - def CheckDateFromTicks(self): - d = sqlite.DateFromTicks(42) - - def CheckTimeFromTicks(self): - t = sqlite.TimeFromTicks(42) - - def CheckTimestampFromTicks(self): - ts = sqlite.TimestampFromTicks(42) - - def CheckBinary(self): - b = sqlite.Binary(chr(0) + "'") - -class ExtensionTests(unittest.TestCase): - def CheckScriptStringSql(self): - con = sqlite.connect(":memory:") - cur = con.cursor() - cur.executescript(""" - -- bla bla - /* a stupid comment */ - create table a(i); - insert into a(i) values (5); - """) - cur.execute("select i from a") - res = cur.fetchone()[0] - self.failUnlessEqual(res, 5) - - def CheckScriptStringUnicode(self): - con = sqlite.connect(":memory:") - cur = con.cursor() - cur.executescript(u""" - create table a(i); - insert into a(i) values (5); - select i from a; - delete from a; - insert into a(i) values (6); - """) - cur.execute("select i from a") - res = cur.fetchone()[0] - self.failUnlessEqual(res, 6) - - def CheckScriptErrorIncomplete(self): - con = sqlite.connect(":memory:") - cur = con.cursor() - raised = False - try: - cur.executescript("create table test(sadfsadfdsa") - except sqlite.ProgrammingError: - raised = True - self.failUnlessEqual(raised, True, "should have raised an exception") - - def CheckScriptErrorNormal(self): - con = sqlite.connect(":memory:") - cur = con.cursor() - raised = False - try: - cur.executescript("create table test(sadfsadfdsa); select foo from hurz;") - except sqlite.OperationalError: - raised = True - self.failUnlessEqual(raised, True, "should have raised an exception") - - def CheckConnectionExecute(self): - con = sqlite.connect(":memory:") - result = con.execute("select 5").fetchone()[0] - self.failUnlessEqual(result, 5, "Basic test of Connection.execute") - - def CheckConnectionExecutemany(self): - con = sqlite.connect(":memory:") - con.execute("create table test(foo)") - con.executemany("insert into test(foo) values (?)", [(3,), (4,)]) - result = con.execute("select foo from test order by foo").fetchall() - self.failUnlessEqual(result[0][0], 3, "Basic test of Connection.executemany") - self.failUnlessEqual(result[1][0], 4, "Basic test of Connection.executemany") - - def CheckConnectionExecutescript(self): - con = sqlite.connect(":memory:") - con.executescript("create table test(foo); insert into test(foo) values (5);") - result = con.execute("select foo from test").fetchone()[0] - self.failUnlessEqual(result, 5, "Basic test of Connection.executescript") - -class ClosedTests(unittest.TestCase): - def setUp(self): - pass - - def tearDown(self): - pass - - def CheckClosedConCursor(self): - con = sqlite.connect(":memory:") - con.close() - try: - cur = con.cursor() - self.fail("Should have raised a ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("Should have raised a ProgrammingError") - - def CheckClosedConCommit(self): - con = sqlite.connect(":memory:") - con.close() - try: - con.commit() - self.fail("Should have raised a ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("Should have raised a ProgrammingError") - - def CheckClosedConRollback(self): - con = sqlite.connect(":memory:") - con.close() - try: - con.rollback() - self.fail("Should have raised a ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("Should have raised a ProgrammingError") - - def CheckClosedCurExecute(self): - con = sqlite.connect(":memory:") - cur = con.cursor() - con.close() - try: - cur.execute("select 4") - self.fail("Should have raised a ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("Should have raised a ProgrammingError") - -def suite(): - module_suite = unittest.makeSuite(ModuleTests, "Check") - connection_suite = unittest.makeSuite(ConnectionTests, "Check") - cursor_suite = unittest.makeSuite(CursorTests, "Check") - thread_suite = unittest.makeSuite(ThreadTests, "Check") - constructor_suite = unittest.makeSuite(ConstructorTests, "Check") - ext_suite = unittest.makeSuite(ExtensionTests, "Check") - closed_suite = unittest.makeSuite(ClosedTests, "Check") - return unittest.TestSuite((module_suite, connection_suite, cursor_suite, thread_suite, constructor_suite, ext_suite, closed_suite)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/factory.py b/sys/lib/python/sqlite3/test/factory.py deleted file mode 100644 index 8778056af..000000000 --- a/sys/lib/python/sqlite3/test/factory.py +++ /dev/null @@ -1,164 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/factory.py: tests for the various factories in pysqlite -# -# Copyright (C) 2005 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import unittest -import sqlite3 as sqlite - -class MyConnection(sqlite.Connection): - def __init__(self, *args, **kwargs): - sqlite.Connection.__init__(self, *args, **kwargs) - -def dict_factory(cursor, row): - d = {} - for idx, col in enumerate(cursor.description): - d[col[0]] = row[idx] - return d - -class MyCursor(sqlite.Cursor): - def __init__(self, *args, **kwargs): - sqlite.Cursor.__init__(self, *args, **kwargs) - self.row_factory = dict_factory - -class ConnectionFactoryTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:", factory=MyConnection) - - def tearDown(self): - self.con.close() - - def CheckIsInstance(self): - self.failUnless(isinstance(self.con, - MyConnection), - "connection is not instance of MyConnection") - -class CursorFactoryTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - def tearDown(self): - self.con.close() - - def CheckIsInstance(self): - cur = self.con.cursor(factory=MyCursor) - self.failUnless(isinstance(cur, - MyCursor), - "cursor is not instance of MyCursor") - -class RowFactoryTestsBackwardsCompat(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - def CheckIsProducedByFactory(self): - cur = self.con.cursor(factory=MyCursor) - cur.execute("select 4+5 as foo") - row = cur.fetchone() - self.failUnless(isinstance(row, - dict), - "row is not instance of dict") - cur.close() - - def tearDown(self): - self.con.close() - -class RowFactoryTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - def CheckCustomFactory(self): - self.con.row_factory = lambda cur, row: list(row) - row = self.con.execute("select 1, 2").fetchone() - self.failUnless(isinstance(row, - list), - "row is not instance of list") - - def CheckSqliteRow(self): - self.con.row_factory = sqlite.Row - row = self.con.execute("select 1 as a, 2 as b").fetchone() - self.failUnless(isinstance(row, - sqlite.Row), - "row is not instance of sqlite.Row") - - col1, col2 = row["a"], row["b"] - self.failUnless(col1 == 1, "by name: wrong result for column 'a'") - self.failUnless(col2 == 2, "by name: wrong result for column 'a'") - - col1, col2 = row["A"], row["B"] - self.failUnless(col1 == 1, "by name: wrong result for column 'A'") - self.failUnless(col2 == 2, "by name: wrong result for column 'B'") - - col1, col2 = row[0], row[1] - self.failUnless(col1 == 1, "by index: wrong result for column 0") - self.failUnless(col2 == 2, "by index: wrong result for column 1") - - def tearDown(self): - self.con.close() - -class TextFactoryTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - def CheckUnicode(self): - austria = unicode("Österreich", "latin1") - row = self.con.execute("select ?", (austria,)).fetchone() - self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode") - - def CheckString(self): - self.con.text_factory = str - austria = unicode("Österreich", "latin1") - row = self.con.execute("select ?", (austria,)).fetchone() - self.failUnless(type(row[0]) == str, "type of row[0] must be str") - self.failUnless(row[0] == austria.encode("utf-8"), "column must equal original data in UTF-8") - - def CheckCustom(self): - self.con.text_factory = lambda x: unicode(x, "utf-8", "ignore") - austria = unicode("Österreich", "latin1") - row = self.con.execute("select ?", (austria.encode("latin1"),)).fetchone() - self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode") - self.failUnless(row[0].endswith(u"reich"), "column must contain original data") - - def CheckOptimizedUnicode(self): - self.con.text_factory = sqlite.OptimizedUnicode - austria = unicode("Österreich", "latin1") - germany = unicode("Deutchland") - a_row = self.con.execute("select ?", (austria,)).fetchone() - d_row = self.con.execute("select ?", (germany,)).fetchone() - self.failUnless(type(a_row[0]) == unicode, "type of non-ASCII row must be unicode") - self.failUnless(type(d_row[0]) == str, "type of ASCII-only row must be str") - - def tearDown(self): - self.con.close() - -def suite(): - connection_suite = unittest.makeSuite(ConnectionFactoryTests, "Check") - cursor_suite = unittest.makeSuite(CursorFactoryTests, "Check") - row_suite_compat = unittest.makeSuite(RowFactoryTestsBackwardsCompat, "Check") - row_suite = unittest.makeSuite(RowFactoryTests, "Check") - text_suite = unittest.makeSuite(TextFactoryTests, "Check") - return unittest.TestSuite((connection_suite, cursor_suite, row_suite_compat, row_suite, text_suite)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/hooks.py b/sys/lib/python/sqlite3/test/hooks.py deleted file mode 100644 index 761bdaa6b..000000000 --- a/sys/lib/python/sqlite3/test/hooks.py +++ /dev/null @@ -1,117 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks -# -# Copyright (C) 2006 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import os, unittest -import sqlite3 as sqlite - -class CollationTests(unittest.TestCase): - def setUp(self): - pass - - def tearDown(self): - pass - - def CheckCreateCollationNotCallable(self): - con = sqlite.connect(":memory:") - try: - con.create_collation("X", 42) - self.fail("should have raised a TypeError") - except TypeError, e: - self.failUnlessEqual(e.args[0], "parameter must be callable") - - def CheckCreateCollationNotAscii(self): - con = sqlite.connect(":memory:") - try: - con.create_collation("collä", cmp) - self.fail("should have raised a ProgrammingError") - except sqlite.ProgrammingError, e: - pass - - def CheckCollationIsUsed(self): - if sqlite.version_info < (3, 2, 1): # old SQLite versions crash on this test - return - def mycoll(x, y): - # reverse order - return -cmp(x, y) - - con = sqlite.connect(":memory:") - con.create_collation("mycoll", mycoll) - sql = """ - select x from ( - select 'a' as x - union - select 'b' as x - union - select 'c' as x - ) order by x collate mycoll - """ - result = con.execute(sql).fetchall() - if result[0][0] != "c" or result[1][0] != "b" or result[2][0] != "a": - self.fail("the expected order was not returned") - - con.create_collation("mycoll", None) - try: - result = con.execute(sql).fetchall() - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0].lower(), "no such collation sequence: mycoll") - - def CheckCollationRegisterTwice(self): - """ - Register two different collation functions under the same name. - Verify that the last one is actually used. - """ - con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", lambda x, y: -cmp(x, y)) - result = con.execute(""" - select x from (select 'a' as x union select 'b' as x) order by x collate mycoll - """).fetchall() - if result[0][0] != 'b' or result[1][0] != 'a': - self.fail("wrong collation function is used") - - def CheckDeregisterCollation(self): - """ - Register a collation, then deregister it. Make sure an error is raised if we try - to use it. - """ - con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", None) - try: - con.execute("select 'a' as x union select 'b' as x order by x collate mycoll") - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - if not e.args[0].startswith("no such collation sequence"): - self.fail("wrong OperationalError raised") - -def suite(): - collation_suite = unittest.makeSuite(CollationTests, "Check") - return unittest.TestSuite((collation_suite,)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/regression.py b/sys/lib/python/sqlite3/test/regression.py deleted file mode 100644 index c8733b963..000000000 --- a/sys/lib/python/sqlite3/test/regression.py +++ /dev/null @@ -1,81 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/regression.py: pysqlite regression tests -# -# Copyright (C) 2006 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import unittest -import sqlite3 as sqlite - -class RegressionTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - def tearDown(self): - self.con.close() - - def CheckPragmaUserVersion(self): - # This used to crash pysqlite because this pragma command returns NULL for the column name - cur = self.con.cursor() - cur.execute("pragma user_version") - - def CheckPragmaSchemaVersion(self): - # This still crashed pysqlite <= 2.2.1 - con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES) - try: - cur = self.con.cursor() - cur.execute("pragma schema_version") - finally: - cur.close() - con.close() - - def CheckStatementReset(self): - # pysqlite 2.1.0 to 2.2.0 have the problem that not all statements are - # reset before a rollback, but only those that are still in the - # statement cache. The others are not accessible from the connection object. - con = sqlite.connect(":memory:", cached_statements=5) - cursors = [con.cursor() for x in xrange(5)] - cursors[0].execute("create table test(x)") - for i in range(10): - cursors[0].executemany("insert into test(x) values (?)", [(x,) for x in xrange(10)]) - - for i in range(5): - cursors[i].execute(" " * i + "select x from test") - - con.rollback() - - def CheckColumnNameWithSpaces(self): - cur = self.con.cursor() - cur.execute('select 1 as "foo bar [datetime]"') - self.failUnlessEqual(cur.description[0][0], "foo bar") - - cur.execute('select 1 as "foo baz"') - self.failUnlessEqual(cur.description[0][0], "foo baz") - -def suite(): - regression_suite = unittest.makeSuite(RegressionTests, "Check") - return unittest.TestSuite((regression_suite,)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/transactions.py b/sys/lib/python/sqlite3/test/transactions.py deleted file mode 100644 index 1f0b19aa9..000000000 --- a/sys/lib/python/sqlite3/test/transactions.py +++ /dev/null @@ -1,156 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/transactions.py: tests transactions -# -# Copyright (C) 2005 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import os, unittest -import sqlite3 as sqlite - -def get_db_path(): - return "sqlite_testdb" - -class TransactionTests(unittest.TestCase): - def setUp(self): - try: - os.remove(get_db_path()) - except: - pass - - self.con1 = sqlite.connect(get_db_path(), timeout=0.1) - self.cur1 = self.con1.cursor() - - self.con2 = sqlite.connect(get_db_path(), timeout=0.1) - self.cur2 = self.con2.cursor() - - def tearDown(self): - self.cur1.close() - self.con1.close() - - self.cur2.close() - self.con2.close() - - os.unlink(get_db_path()) - - def CheckDMLdoesAutoCommitBefore(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.cur1.execute("create table test2(j)") - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 1) - - def CheckInsertStartsTransaction(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 0) - - def CheckUpdateStartsTransaction(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.con1.commit() - self.cur1.execute("update test set i=6") - self.cur2.execute("select i from test") - res = self.cur2.fetchone()[0] - self.failUnlessEqual(res, 5) - - def CheckDeleteStartsTransaction(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.con1.commit() - self.cur1.execute("delete from test") - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 1) - - def CheckReplaceStartsTransaction(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.con1.commit() - self.cur1.execute("replace into test(i) values (6)") - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 1) - self.failUnlessEqual(res[0][0], 5) - - def CheckToggleAutoCommit(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - self.con1.isolation_level = None - self.failUnlessEqual(self.con1.isolation_level, None) - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 1) - - self.con1.isolation_level = "DEFERRED" - self.failUnlessEqual(self.con1.isolation_level , "DEFERRED") - self.cur1.execute("insert into test(i) values (5)") - self.cur2.execute("select i from test") - res = self.cur2.fetchall() - self.failUnlessEqual(len(res), 1) - - def CheckRaiseTimeout(self): - self.cur1.execute("create table test(i)") - self.cur1.execute("insert into test(i) values (5)") - try: - self.cur2.execute("insert into test(i) values (5)") - self.fail("should have raised an OperationalError") - except sqlite.OperationalError: - pass - except: - self.fail("should have raised an OperationalError") - -class SpecialCommandTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - self.cur = self.con.cursor() - - def CheckVacuum(self): - self.cur.execute("create table test(i)") - self.cur.execute("insert into test(i) values (5)") - self.cur.execute("vacuum") - - def CheckDropTable(self): - self.cur.execute("create table test(i)") - self.cur.execute("insert into test(i) values (5)") - self.cur.execute("drop table test") - - def CheckPragma(self): - self.cur.execute("create table test(i)") - self.cur.execute("insert into test(i) values (5)") - self.cur.execute("pragma count_changes=1") - - def tearDown(self): - self.cur.close() - self.con.close() - -def suite(): - default_suite = unittest.makeSuite(TransactionTests, "Check") - special_command_suite = unittest.makeSuite(SpecialCommandTests, "Check") - return unittest.TestSuite((default_suite, special_command_suite)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/types.py b/sys/lib/python/sqlite3/test/types.py deleted file mode 100644 index 8da5722d5..000000000 --- a/sys/lib/python/sqlite3/test/types.py +++ /dev/null @@ -1,351 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/types.py: tests for type conversion and detection -# -# Copyright (C) 2005 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import bz2, datetime -import unittest -import sqlite3 as sqlite - -class SqliteTypeTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - self.cur = self.con.cursor() - self.cur.execute("create table test(i integer, s varchar, f number, b blob)") - - def tearDown(self): - self.cur.close() - self.con.close() - - def CheckString(self): - self.cur.execute("insert into test(s) values (?)", (u"Österreich",)) - self.cur.execute("select s from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], u"Österreich") - - def CheckSmallInt(self): - self.cur.execute("insert into test(i) values (?)", (42,)) - self.cur.execute("select i from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], 42) - - def CheckLargeInt(self): - num = 2**40 - self.cur.execute("insert into test(i) values (?)", (num,)) - self.cur.execute("select i from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], num) - - def CheckFloat(self): - val = 3.14 - self.cur.execute("insert into test(f) values (?)", (val,)) - self.cur.execute("select f from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], val) - - def CheckBlob(self): - val = buffer("Guglhupf") - self.cur.execute("insert into test(b) values (?)", (val,)) - self.cur.execute("select b from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], val) - - def CheckUnicodeExecute(self): - self.cur.execute(u"select 'Österreich'") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], u"Österreich") - -class DeclTypesTests(unittest.TestCase): - class Foo: - def __init__(self, _val): - self.val = _val - - def __cmp__(self, other): - if not isinstance(other, DeclTypesTests.Foo): - raise ValueError - if self.val == other.val: - return 0 - else: - return 1 - - def __conform__(self, protocol): - if protocol is sqlite.PrepareProtocol: - return self.val - else: - return None - - def __str__(self): - return "<%s>" % self.val - - def setUp(self): - self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_DECLTYPES) - self.cur = self.con.cursor() - self.cur.execute("create table test(i int, s str, f float, b bool, u unicode, foo foo, bin blob)") - - # override float, make them always return the same number - sqlite.converters["FLOAT"] = lambda x: 47.2 - - # and implement two custom ones - sqlite.converters["BOOL"] = lambda x: bool(int(x)) - sqlite.converters["FOO"] = DeclTypesTests.Foo - - def tearDown(self): - del sqlite.converters["FLOAT"] - del sqlite.converters["BOOL"] - del sqlite.converters["FOO"] - self.cur.close() - self.con.close() - - def CheckString(self): - # default - self.cur.execute("insert into test(s) values (?)", ("foo",)) - self.cur.execute("select s from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], "foo") - - def CheckSmallInt(self): - # default - self.cur.execute("insert into test(i) values (?)", (42,)) - self.cur.execute("select i from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], 42) - - def CheckLargeInt(self): - # default - num = 2**40 - self.cur.execute("insert into test(i) values (?)", (num,)) - self.cur.execute("select i from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], num) - - def CheckFloat(self): - # custom - val = 3.14 - self.cur.execute("insert into test(f) values (?)", (val,)) - self.cur.execute("select f from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], 47.2) - - def CheckBool(self): - # custom - self.cur.execute("insert into test(b) values (?)", (False,)) - self.cur.execute("select b from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], False) - - self.cur.execute("delete from test") - self.cur.execute("insert into test(b) values (?)", (True,)) - self.cur.execute("select b from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], True) - - def CheckUnicode(self): - # default - val = u"\xd6sterreich" - self.cur.execute("insert into test(u) values (?)", (val,)) - self.cur.execute("select u from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], val) - - def CheckFoo(self): - val = DeclTypesTests.Foo("bla") - self.cur.execute("insert into test(foo) values (?)", (val,)) - self.cur.execute("select foo from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], val) - - def CheckUnsupportedSeq(self): - class Bar: pass - val = Bar() - try: - self.cur.execute("insert into test(f) values (?)", (val,)) - self.fail("should have raised an InterfaceError") - except sqlite.InterfaceError: - pass - except: - self.fail("should have raised an InterfaceError") - - def CheckUnsupportedDict(self): - class Bar: pass - val = Bar() - try: - self.cur.execute("insert into test(f) values (:val)", {"val": val}) - self.fail("should have raised an InterfaceError") - except sqlite.InterfaceError: - pass - except: - self.fail("should have raised an InterfaceError") - - def CheckBlob(self): - # default - val = buffer("Guglhupf") - self.cur.execute("insert into test(bin) values (?)", (val,)) - self.cur.execute("select bin from test") - row = self.cur.fetchone() - self.failUnlessEqual(row[0], val) - -class ColNamesTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES|sqlite.PARSE_DECLTYPES) - self.cur = self.con.cursor() - self.cur.execute("create table test(x foo)") - - sqlite.converters["FOO"] = lambda x: "[%s]" % x - sqlite.converters["BAR"] = lambda x: "<%s>" % x - sqlite.converters["EXC"] = lambda x: 5/0 - - def tearDown(self): - del sqlite.converters["FOO"] - del sqlite.converters["BAR"] - del sqlite.converters["EXC"] - self.cur.close() - self.con.close() - - def CheckDeclType(self): - self.cur.execute("insert into test(x) values (?)", ("xxx",)) - self.cur.execute("select x from test") - val = self.cur.fetchone()[0] - self.failUnlessEqual(val, "[xxx]") - - def CheckNone(self): - self.cur.execute("insert into test(x) values (?)", (None,)) - self.cur.execute("select x from test") - val = self.cur.fetchone()[0] - self.failUnlessEqual(val, None) - - def CheckColName(self): - self.cur.execute("insert into test(x) values (?)", ("xxx",)) - self.cur.execute('select x as "x [bar]" from test') - val = self.cur.fetchone()[0] - self.failUnlessEqual(val, "") - - # Check if the stripping of colnames works. Everything after the first - # whitespace should be stripped. - self.failUnlessEqual(self.cur.description[0][0], "x") - - def CheckCursorDescriptionNoRow(self): - """ - cursor.description should at least provide the column name(s), even if - no row returned. - """ - self.cur.execute("select * from test where 0 = 1") - self.assert_(self.cur.description[0][0] == "x") - -class ObjectAdaptationTests(unittest.TestCase): - def cast(obj): - return float(obj) - cast = staticmethod(cast) - - def setUp(self): - self.con = sqlite.connect(":memory:") - try: - del sqlite.adapters[int] - except: - pass - sqlite.register_adapter(int, ObjectAdaptationTests.cast) - self.cur = self.con.cursor() - - def tearDown(self): - del sqlite.adapters[(int, sqlite.PrepareProtocol)] - self.cur.close() - self.con.close() - - def CheckCasterIsUsed(self): - self.cur.execute("select ?", (4,)) - val = self.cur.fetchone()[0] - self.failUnlessEqual(type(val), float) - -class BinaryConverterTests(unittest.TestCase): - def convert(s): - return bz2.decompress(s) - convert = staticmethod(convert) - - def setUp(self): - self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES) - sqlite.register_converter("bin", BinaryConverterTests.convert) - - def tearDown(self): - self.con.close() - - def CheckBinaryInputForConverter(self): - testdata = "abcdefg" * 10 - result = self.con.execute('select ? as "x [bin]"', (buffer(bz2.compress(testdata)),)).fetchone()[0] - self.failUnlessEqual(testdata, result) - -class DateTimeTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_DECLTYPES) - self.cur = self.con.cursor() - self.cur.execute("create table test(d date, ts timestamp)") - - def tearDown(self): - self.cur.close() - self.con.close() - - def CheckSqliteDate(self): - d = sqlite.Date(2004, 2, 14) - self.cur.execute("insert into test(d) values (?)", (d,)) - self.cur.execute("select d from test") - d2 = self.cur.fetchone()[0] - self.failUnlessEqual(d, d2) - - def CheckSqliteTimestamp(self): - ts = sqlite.Timestamp(2004, 2, 14, 7, 15, 0) - self.cur.execute("insert into test(ts) values (?)", (ts,)) - self.cur.execute("select ts from test") - ts2 = self.cur.fetchone()[0] - self.failUnlessEqual(ts, ts2) - - def CheckSqlTimestamp(self): - # The date functions are only available in SQLite version 3.1 or later - if sqlite.sqlite_version_info < (3, 1): - return - - # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time. - now = datetime.datetime.now() - self.cur.execute("insert into test(ts) values (current_timestamp)") - self.cur.execute("select ts from test") - ts = self.cur.fetchone()[0] - self.failUnlessEqual(type(ts), datetime.datetime) - self.failUnlessEqual(ts.year, now.year) - - def CheckDateTimeSubSeconds(self): - ts = sqlite.Timestamp(2004, 2, 14, 7, 15, 0, 500000) - self.cur.execute("insert into test(ts) values (?)", (ts,)) - self.cur.execute("select ts from test") - ts2 = self.cur.fetchone()[0] - self.failUnlessEqual(ts, ts2) - -def suite(): - sqlite_type_suite = unittest.makeSuite(SqliteTypeTests, "Check") - decltypes_type_suite = unittest.makeSuite(DeclTypesTests, "Check") - colnames_type_suite = unittest.makeSuite(ColNamesTests, "Check") - adaptation_suite = unittest.makeSuite(ObjectAdaptationTests, "Check") - bin_suite = unittest.makeSuite(BinaryConverterTests, "Check") - date_suite = unittest.makeSuite(DateTimeTests, "Check") - return unittest.TestSuite((sqlite_type_suite, decltypes_type_suite, colnames_type_suite, adaptation_suite, bin_suite, date_suite)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/lib/python/sqlite3/test/userfunctions.py b/sys/lib/python/sqlite3/test/userfunctions.py deleted file mode 100644 index 31bf28919..000000000 --- a/sys/lib/python/sqlite3/test/userfunctions.py +++ /dev/null @@ -1,413 +0,0 @@ -#-*- coding: ISO-8859-1 -*- -# pysqlite2/test/userfunctions.py: tests for user-defined functions and -# aggregates. -# -# Copyright (C) 2005 Gerhard Häring -# -# This file is part of pysqlite. -# -# This software is provided 'as-is', without any express or implied -# warranty. In no event will the authors be held liable for any damages -# arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software -# in a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# 3. This notice may not be removed or altered from any source distribution. - -import unittest -import sqlite3 as sqlite - -def func_returntext(): - return "foo" -def func_returnunicode(): - return u"bar" -def func_returnint(): - return 42 -def func_returnfloat(): - return 3.14 -def func_returnnull(): - return None -def func_returnblob(): - return buffer("blob") -def func_raiseexception(): - 5/0 - -def func_isstring(v): - return type(v) is unicode -def func_isint(v): - return type(v) is int -def func_isfloat(v): - return type(v) is float -def func_isnone(v): - return type(v) is type(None) -def func_isblob(v): - return type(v) is buffer - -class AggrNoStep: - def __init__(self): - pass - - def finalize(self): - return 1 - -class AggrNoFinalize: - def __init__(self): - pass - - def step(self, x): - pass - -class AggrExceptionInInit: - def __init__(self): - 5/0 - - def step(self, x): - pass - - def finalize(self): - pass - -class AggrExceptionInStep: - def __init__(self): - pass - - def step(self, x): - 5/0 - - def finalize(self): - return 42 - -class AggrExceptionInFinalize: - def __init__(self): - pass - - def step(self, x): - pass - - def finalize(self): - 5/0 - -class AggrCheckType: - def __init__(self): - self.val = None - - def step(self, whichType, val): - theType = {"str": unicode, "int": int, "float": float, "None": type(None), "blob": buffer} - self.val = int(theType[whichType] is type(val)) - - def finalize(self): - return self.val - -class AggrSum: - def __init__(self): - self.val = 0.0 - - def step(self, val): - self.val += val - - def finalize(self): - return self.val - -class FunctionTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - - self.con.create_function("returntext", 0, func_returntext) - self.con.create_function("returnunicode", 0, func_returnunicode) - self.con.create_function("returnint", 0, func_returnint) - self.con.create_function("returnfloat", 0, func_returnfloat) - self.con.create_function("returnnull", 0, func_returnnull) - self.con.create_function("returnblob", 0, func_returnblob) - self.con.create_function("raiseexception", 0, func_raiseexception) - - self.con.create_function("isstring", 1, func_isstring) - self.con.create_function("isint", 1, func_isint) - self.con.create_function("isfloat", 1, func_isfloat) - self.con.create_function("isnone", 1, func_isnone) - self.con.create_function("isblob", 1, func_isblob) - - def tearDown(self): - self.con.close() - - def CheckFuncErrorOnCreate(self): - try: - self.con.create_function("bla", -100, lambda x: 2*x) - self.fail("should have raised an OperationalError") - except sqlite.OperationalError: - pass - - def CheckFuncRefCount(self): - def getfunc(): - def f(): - return 1 - return f - f = getfunc() - globals()["foo"] = f - # self.con.create_function("reftest", 0, getfunc()) - self.con.create_function("reftest", 0, f) - cur = self.con.cursor() - cur.execute("select reftest()") - - def CheckFuncReturnText(self): - cur = self.con.cursor() - cur.execute("select returntext()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), unicode) - self.failUnlessEqual(val, "foo") - - def CheckFuncReturnUnicode(self): - cur = self.con.cursor() - cur.execute("select returnunicode()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), unicode) - self.failUnlessEqual(val, u"bar") - - def CheckFuncReturnInt(self): - cur = self.con.cursor() - cur.execute("select returnint()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), int) - self.failUnlessEqual(val, 42) - - def CheckFuncReturnFloat(self): - cur = self.con.cursor() - cur.execute("select returnfloat()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), float) - if val < 3.139 or val > 3.141: - self.fail("wrong value") - - def CheckFuncReturnNull(self): - cur = self.con.cursor() - cur.execute("select returnnull()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), type(None)) - self.failUnlessEqual(val, None) - - def CheckFuncReturnBlob(self): - cur = self.con.cursor() - cur.execute("select returnblob()") - val = cur.fetchone()[0] - self.failUnlessEqual(type(val), buffer) - self.failUnlessEqual(val, buffer("blob")) - - def CheckFuncException(self): - cur = self.con.cursor() - try: - cur.execute("select raiseexception()") - cur.fetchone() - self.fail("should have raised OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0], 'user-defined function raised exception') - - def CheckParamString(self): - cur = self.con.cursor() - cur.execute("select isstring(?)", ("foo",)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckParamInt(self): - cur = self.con.cursor() - cur.execute("select isint(?)", (42,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckParamFloat(self): - cur = self.con.cursor() - cur.execute("select isfloat(?)", (3.14,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckParamNone(self): - cur = self.con.cursor() - cur.execute("select isnone(?)", (None,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckParamBlob(self): - cur = self.con.cursor() - cur.execute("select isblob(?)", (buffer("blob"),)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - -class AggregateTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - cur = self.con.cursor() - cur.execute(""" - create table test( - t text, - i integer, - f float, - n, - b blob - ) - """) - cur.execute("insert into test(t, i, f, n, b) values (?, ?, ?, ?, ?)", - ("foo", 5, 3.14, None, buffer("blob"),)) - - self.con.create_aggregate("nostep", 1, AggrNoStep) - self.con.create_aggregate("nofinalize", 1, AggrNoFinalize) - self.con.create_aggregate("excInit", 1, AggrExceptionInInit) - self.con.create_aggregate("excStep", 1, AggrExceptionInStep) - self.con.create_aggregate("excFinalize", 1, AggrExceptionInFinalize) - self.con.create_aggregate("checkType", 2, AggrCheckType) - self.con.create_aggregate("mysum", 1, AggrSum) - - def tearDown(self): - #self.cur.close() - #self.con.close() - pass - - def CheckAggrErrorOnCreate(self): - try: - self.con.create_function("bla", -100, AggrSum) - self.fail("should have raised an OperationalError") - except sqlite.OperationalError: - pass - - def CheckAggrNoStep(self): - cur = self.con.cursor() - try: - cur.execute("select nostep(t) from test") - self.fail("should have raised an AttributeError") - except AttributeError, e: - self.failUnlessEqual(e.args[0], "AggrNoStep instance has no attribute 'step'") - - def CheckAggrNoFinalize(self): - cur = self.con.cursor() - try: - cur.execute("select nofinalize(t) from test") - val = cur.fetchone()[0] - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0], "user-defined aggregate's 'finalize' method raised error") - - def CheckAggrExceptionInInit(self): - cur = self.con.cursor() - try: - cur.execute("select excInit(t) from test") - val = cur.fetchone()[0] - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0], "user-defined aggregate's '__init__' method raised error") - - def CheckAggrExceptionInStep(self): - cur = self.con.cursor() - try: - cur.execute("select excStep(t) from test") - val = cur.fetchone()[0] - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0], "user-defined aggregate's 'step' method raised error") - - def CheckAggrExceptionInFinalize(self): - cur = self.con.cursor() - try: - cur.execute("select excFinalize(t) from test") - val = cur.fetchone()[0] - self.fail("should have raised an OperationalError") - except sqlite.OperationalError, e: - self.failUnlessEqual(e.args[0], "user-defined aggregate's 'finalize' method raised error") - - def CheckAggrCheckParamStr(self): - cur = self.con.cursor() - cur.execute("select checkType('str', ?)", ("foo",)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckAggrCheckParamInt(self): - cur = self.con.cursor() - cur.execute("select checkType('int', ?)", (42,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckAggrCheckParamFloat(self): - cur = self.con.cursor() - cur.execute("select checkType('float', ?)", (3.14,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckAggrCheckParamNone(self): - cur = self.con.cursor() - cur.execute("select checkType('None', ?)", (None,)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckAggrCheckParamBlob(self): - cur = self.con.cursor() - cur.execute("select checkType('blob', ?)", (buffer("blob"),)) - val = cur.fetchone()[0] - self.failUnlessEqual(val, 1) - - def CheckAggrCheckAggrSum(self): - cur = self.con.cursor() - cur.execute("delete from test") - cur.executemany("insert into test(i) values (?)", [(10,), (20,), (30,)]) - cur.execute("select mysum(i) from test") - val = cur.fetchone()[0] - self.failUnlessEqual(val, 60) - -def authorizer_cb(action, arg1, arg2, dbname, source): - if action != sqlite.SQLITE_SELECT: - return sqlite.SQLITE_DENY - if arg2 == 'c2' or arg1 == 't2': - return sqlite.SQLITE_DENY - return sqlite.SQLITE_OK - -class AuthorizerTests(unittest.TestCase): - def setUp(self): - self.con = sqlite.connect(":memory:") - self.con.executescript(""" - create table t1 (c1, c2); - create table t2 (c1, c2); - insert into t1 (c1, c2) values (1, 2); - insert into t2 (c1, c2) values (4, 5); - """) - - # For our security test: - self.con.execute("select c2 from t2") - - self.con.set_authorizer(authorizer_cb) - - def tearDown(self): - pass - - def CheckTableAccess(self): - try: - self.con.execute("select * from t2") - except sqlite.DatabaseError, e: - if not e.args[0].endswith("prohibited"): - self.fail("wrong exception text: %s" % e.args[0]) - return - self.fail("should have raised an exception due to missing privileges") - - def CheckColumnAccess(self): - try: - self.con.execute("select c2 from t1") - except sqlite.DatabaseError, e: - if not e.args[0].endswith("prohibited"): - self.fail("wrong exception text: %s" % e.args[0]) - return - self.fail("should have raised an exception due to missing privileges") - -def suite(): - function_suite = unittest.makeSuite(FunctionTests, "Check") - aggregate_suite = unittest.makeSuite(AggregateTests, "Check") - authorizer_suite = unittest.makeSuite(AuthorizerTests, "Check") - return unittest.TestSuite((function_suite, aggregate_suite, authorizer_suite)) - -def test(): - runner = unittest.TextTestRunner() - runner.run(suite()) - -if __name__ == "__main__": - test() diff --git a/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head b/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head deleted file mode 100644 index 1203a2215..000000000 --- a/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head +++ /dev/null @@ -1,163 +0,0 @@ -This file, together with ChangeLog.0_9_7-stable_not-in-head_FIPS, -provides a collection of those CVS change log entries for the -0.9.7 branch (OpenSSL_0_9_7-stable) that do not appear similarly in -0.9.8-dev (CVS head). - -ChangeLog.0_9_7-stable_not-in-head_FIPS - "FIPS" related changes -ChangeLog.0_9_7-stable_not-in-head - everything else - -Some obvious false positives have been eliminated: e.g., we do not -care about a simple "make update"; and we don't care about changes -identified to the 0.9.7 branch that were explicitly identified as -backports from head. - -Eliminating all other entries (and finally this file and its -compantion), either as false positives or as things that should go -into 0.9.8, remains to be done. Any additional changes to 0.9.7 that -are not immediately put into 0.9.8, but belong there as well, should -be added to the end of this file. - - -2002-11-04 17:33 levitte - - Changed: - Configure (1.314.2.38), "Exp", lines: +4 -2 - - Return my normal debug targets to something not so extreme, and - make the extreme ones special (or 'extreme', if you will :-)). - -2002-12-16 19:17 appro - - Changed: - crypto/bn/bn_lcl.h (1.23.2.3), "Exp", lines: +3 -0 - crypto/bn/bn_mul.c (1.28.2.4), "Exp", lines: +84 -445 - - This is rollback to 0.9.6h bn_mul.c to address problem reported in - RT#272. - -2003-07-27 15:46 ben - - Changed: - crypto/aes/aes.h (1.1.2.5), "Exp", lines: +3 -0 - crypto/aes/aes_cfb.c (1.1.2.4), "Exp", lines: +57 -0 - - Add untested CFB-r mode. Will be tested soon. - -2003-07-28 17:07 ben - - Changed: - Makefile.org (1.154.2.69), "Exp", lines: +5 -1 - crypto/aes/aes.h (1.1.2.6), "Exp", lines: +3 -0 - crypto/aes/aes_cfb.c (1.1.2.5), "Exp", lines: +19 -0 - crypto/dsa/Makefile.ssl (1.49.2.6), "Exp", lines: +3 -2 - crypto/err/Makefile.ssl (1.48.2.4), "Exp", lines: +17 -16 - crypto/evp/e_aes.c (1.6.2.5), "Exp", lines: +8 -0 - crypto/evp/e_des.c (1.5.2.2), "Exp", lines: +1 -1 - crypto/evp/e_des3.c (1.8.2.3), "Exp", lines: +2 -2 - crypto/evp/evp.h (1.86.2.11), "Exp", lines: +28 -11 - crypto/evp/evp_locl.h (1.7.2.3), "Exp", lines: +2 -2 - crypto/objects/obj_dat.h (1.49.2.13), "Exp", lines: +10 -5 - crypto/objects/obj_mac.h (1.19.2.13), "Exp", lines: +5 -0 - crypto/objects/obj_mac.num (1.15.2.9), "Exp", lines: +1 -0 - crypto/objects/objects.txt (1.20.2.14), "Exp", lines: +4 -0 - fips/Makefile.ssl (1.1.2.3), "Exp", lines: +7 -0 - fips/aes/Makefile.ssl (1.1.2.2), "Exp", lines: +23 -1 - fips/aes/fips_aesavs.c (1.1.2.3), "Exp", lines: +9 -1 - test/Makefile.ssl (1.84.2.30), "Exp", lines: +101 -43 - - Add support for partial CFB modes, make tests work, update - dependencies. - -2003-07-29 12:56 ben - - Changed: - crypto/aes/aes_cfb.c (1.1.2.6), "Exp", lines: +9 -6 - crypto/evp/c_allc.c (1.8.2.3), "Exp", lines: +1 -0 - crypto/evp/evp_test.c (1.14.2.11), "Exp", lines: +17 -8 - crypto/evp/evptests.txt (1.9.2.2), "Exp", lines: +48 -1 - - Working CFB1 and test vectors. - -2003-07-29 15:24 ben - - Changed: - crypto/evp/e_aes.c (1.6.2.6), "Exp", lines: +14 -0 - crypto/objects/obj_dat.h (1.49.2.14), "Exp", lines: +15 -5 - crypto/objects/obj_mac.h (1.19.2.14), "Exp", lines: +10 -0 - crypto/objects/obj_mac.num (1.15.2.10), "Exp", lines: +2 -0 - crypto/objects/objects.txt (1.20.2.15), "Exp", lines: +2 -0 - fips/aes/Makefile.ssl (1.1.2.3), "Exp", lines: +1 -1 - fips/aes/fips_aesavs.c (1.1.2.4), "Exp", lines: +34 -19 - - The rest of the keysizes for CFB1, working AES AVS test for CFB1. - -2003-07-29 19:05 ben - - Changed: - crypto/aes/aes.h (1.1.2.7), "Exp", lines: +3 -0 - crypto/aes/aes_cfb.c (1.1.2.7), "Exp", lines: +14 -0 - crypto/evp/c_allc.c (1.8.2.4), "Exp", lines: +1 -0 - crypto/evp/e_aes.c (1.6.2.7), "Exp", lines: +4 -9 - crypto/evp/evptests.txt (1.9.2.3), "Exp", lines: +48 -0 - crypto/objects/obj_dat.h (1.49.2.15), "Exp", lines: +20 -5 - crypto/objects/obj_mac.h (1.19.2.15), "Exp", lines: +15 -0 - crypto/objects/obj_mac.num (1.15.2.11), "Exp", lines: +3 -0 - crypto/objects/objects.txt (1.20.2.16), "Exp", lines: +3 -0 - fips/aes/fips_aesavs.c (1.1.2.7), "Exp", lines: +11 -0 - - AES CFB8. - -2003-07-30 20:30 ben - - Changed: - Makefile.org (1.154.2.70), "Exp", lines: +16 -5 - crypto/des/cfb_enc.c (1.7.2.1), "Exp", lines: +2 -1 - crypto/des/des_enc.c (1.11.2.2), "Exp", lines: +4 -0 - crypto/evp/e_aes.c (1.6.2.8), "Exp", lines: +7 -14 - crypto/evp/e_des.c (1.5.2.3), "Exp", lines: +37 -1 - crypto/evp/evp.h (1.86.2.12), "Exp", lines: +6 -0 - crypto/evp/evp_locl.h (1.7.2.4), "Exp", lines: +9 -0 - crypto/objects/obj_dat.h (1.49.2.16), "Exp", lines: +48 -23 - crypto/objects/obj_mac.h (1.19.2.16), "Exp", lines: +31 -6 - crypto/objects/obj_mac.num (1.15.2.12), "Exp", lines: +5 -0 - crypto/objects/objects.txt (1.20.2.17), "Exp", lines: +12 -6 - fips/Makefile.ssl (1.1.2.4), "Exp", lines: +8 -1 - fips/fips_make_sha1 (1.1.2.3), "Exp", lines: +3 -0 - fips/aes/Makefile.ssl (1.1.2.4), "Exp", lines: +1 -1 - fips/des/.cvsignore (1.1.2.1), "Exp", lines: +3 -0 - fips/des/Makefile.ssl (1.1.2.1), "Exp", lines: +96 -0 - fips/des/fingerprint.sha1 (1.1.2.1), "Exp", lines: +2 -0 - fips/des/fips_des_enc.c (1.1.2.1), "Exp", lines: +288 -0 - fips/des/fips_des_locl.h (1.1.2.1), "Exp", lines: +428 -0 - fips/des/fips_desmovs.c (1.1.2.1), "Exp", lines: +659 -0 - - Whoops, forgot FIPS DES, also add EVPs for DES CFB1 and 8. - -2003-08-01 12:25 ben - - Changed: - crypto/des/cfb_enc.c (1.7.2.2), "Exp", lines: +45 -36 - crypto/evp/c_allc.c (1.8.2.5), "Exp", lines: +2 -0 - crypto/evp/e_des.c (1.5.2.4), "Exp", lines: +8 -3 - crypto/evp/evptests.txt (1.9.2.4), "Exp", lines: +6 -0 - - Fix DES CFB-r. - -2003-08-01 12:31 ben - - Changed: - crypto/evp/evptests.txt (1.9.2.5), "Exp", lines: +4 -0 - - DES CFB8 test. - -2005-04-19 16:21 appro - - Changed: - Configure (1.314.2.117), "Exp", lines: +24 -21 - Makefile.org (1.154.2.100), "Exp", lines: +1 -11 - TABLE (1.99.2.52), "Exp", lines: +20 -20 - apps/Makefile (1.1.4.15), "Exp", lines: +1 -1 - test/Makefile (1.1.4.12), "Exp", lines: +1 -1 - - Enable shared link on HP-UX. - diff --git a/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head_FIPS b/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head_FIPS deleted file mode 100644 index 1e6c88f77..000000000 --- a/sys/src/ape/lib/openssl/ChangeLog.0_9_7-stable_not-in-head_FIPS +++ /dev/null @@ -1,1494 +0,0 @@ -See file ChangeLog.0_9_7-stable_not-in-head for explanations. -This is the "FIPS"-related part. - - - -2003-07-27 19:00 ben - - Changed: - Configure (1.314.2.85), "Exp", lines: +2 -0 - Makefile.org (1.154.2.67), "Exp", lines: +12 -3 - crypto/cryptlib.c (1.32.2.9), "Exp", lines: +5 -0 - crypto/md32_common.h (1.22.2.4), "Exp", lines: +11 -0 - crypto/aes/Makefile.ssl (1.4.2.6), "Exp", lines: +2 -1 - crypto/aes/aes_core.c (1.1.2.4), "Exp", lines: +4 -0 - crypto/des/des.h (1.40.2.4), "Exp", lines: +1 -1 - crypto/des/des_old.c (1.11.2.4), "Exp", lines: +1 -1 - crypto/des/destest.c (1.30.2.6), "Exp", lines: +2 -2 - crypto/des/ecb3_enc.c (1.8.2.1), "Exp", lines: +1 -3 - crypto/dsa/Makefile.ssl (1.49.2.5), "Exp", lines: +7 -4 - crypto/dsa/dsa_ossl.c (1.12.2.4), "Exp", lines: +2 -0 - crypto/dsa/dsa_sign.c (1.10.2.3), "Exp", lines: +12 -0 - crypto/dsa/dsa_vrf.c (1.10.2.3), "Exp", lines: +8 -0 - crypto/engine/engine.h (1.36.2.6), "Exp", lines: +4 -0 - crypto/err/err.h (1.35.2.3), "Exp", lines: +2 -0 - crypto/err/err_all.c (1.17.2.2), "Exp", lines: +4 -0 - crypto/err/openssl.ec (1.11.2.1), "Exp", lines: +1 -0 - crypto/evp/Makefile.ssl (1.64.2.8), "Exp", lines: +8 -7 - crypto/evp/c_all.c (1.7.8.7), "Exp", lines: +1 -0 - crypto/evp/e_aes.c (1.6.2.4), "Exp", lines: +12 -4 - crypto/evp/e_des3.c (1.8.2.2), "Exp", lines: +1 -1 - crypto/evp/evp.h (1.86.2.10), "Exp", lines: +2 -0 - crypto/evp/evp_err.c (1.23.2.1), "Exp", lines: +3 -1 - crypto/md4/Makefile.ssl (1.6.2.4), "Exp", lines: +7 -4 - crypto/md5/Makefile.ssl (1.33.2.7), "Exp", lines: +7 -4 - crypto/rand/Makefile.ssl (1.56.2.4), "Exp", lines: +17 -15 - crypto/rand/md_rand.c (1.69.2.2), "Exp", lines: +9 -0 - crypto/rand/rand.h (1.26.2.5), "Exp", lines: +2 -0 - crypto/rand/rand_err.c (1.6.2.1), "Exp", lines: +3 -1 - crypto/rand/rand_lib.c (1.15.2.2), "Exp", lines: +11 -0 - crypto/ripemd/Makefile.ssl (1.25.2.5), "Exp", lines: +7 -2 - crypto/sha/Makefile.ssl (1.26.2.5), "Exp", lines: +16 -6 - fips/.cvsignore (1.1.2.1), "Exp", lines: +1 -0 - fips/Makefile.ssl (1.1.2.1), "Exp", lines: +155 -0 - fips/fingerprint.sha1 (1.1.2.1), "Exp", lines: +3 -0 - fips/fips.c (1.1.2.1), "Exp", lines: +74 -0 - fips/fips.h (1.1.2.1), "Exp", lines: +85 -0 - fips/fips_check_sha1 (1.1.2.1), "Exp", lines: +7 -0 - fips/fips_err.c (1.1.2.1), "Exp", lines: +96 -0 - fips/fips_make_sha1 (1.1.2.1), "Exp", lines: +21 -0 - fips/lib (1.1.2.1), "Exp", lines: +0 -0 - fips/aes/.cvsignore (1.1.2.1), "Exp", lines: +4 -0 - fips/aes/Makefile.ssl (1.1.2.1), "Exp", lines: +95 -0 - fips/aes/fingerprint.sha1 (1.1.2.1), "Exp", lines: +2 -0 - fips/aes/fips_aes_core.c (1.1.2.1), "Exp", lines: +1260 -0 - fips/aes/fips_aes_locl.h (1.1.2.1), "Exp", lines: +85 -0 - fips/aes/fips_aesavs.c (1.1.2.1), "Exp", lines: +896 -0 - fips/dsa/.cvsignore (1.1.2.1), "Exp", lines: +2 -0 - fips/dsa/Makefile.ssl (1.1.2.1), "Exp", lines: +95 -0 - fips/dsa/fingerprint.sha1 (1.1.2.1), "Exp", lines: +1 -0 - fips/dsa/fips_dsa_ossl.c (1.1.2.1), "Exp", lines: +366 -0 - fips/dsa/fips_dsatest.c (1.1.2.1), "Exp", lines: +252 -0 - fips/rand/.cvsignore (1.1.2.1), "Exp", lines: +2 -0 - fips/rand/Makefile.ssl (1.1.2.1), "Exp", lines: +94 -0 - fips/rand/fingerprint.sha1 (1.1.2.1), "Exp", lines: +2 -0 - fips/rand/fips_rand.c (1.1.2.1), "Exp", lines: +236 -0 - fips/rand/fips_rand.h (1.1.2.1), "Exp", lines: +55 -0 - fips/rand/fips_randtest.c (1.1.2.1), "Exp", lines: +348 -0 - fips/sha1/.cvsignore (1.1.2.1), "Exp", lines: +3 -0 - fips/sha1/Makefile.ssl (1.1.2.1), "Exp", lines: +94 -0 - fips/sha1/fingerprint.sha1 (1.1.2.1), "Exp", lines: +3 -0 - fips/sha1/fips_md32_common.h (1.1.2.1), "Exp", lines: +637 -0 - fips/sha1/fips_sha1dgst.c (1.1.2.1), "Exp", lines: +76 -0 - fips/sha1/fips_sha1test.c (1.1.2.1), "Exp", lines: +128 -0 - fips/sha1/fips_sha_locl.h (1.1.2.1), "Exp", lines: +472 -0 - fips/sha1/fips_standalone_sha1.c (1.1.2.1), "Exp", lines: +101 -0 - fips/sha1/standalone.sha1 (1.1.2.1), "Exp", lines: +4 -0 - test/Makefile.ssl (1.84.2.29), "Exp", lines: +81 -13 - util/mkerr.pl (1.18.2.4), "Exp", lines: +2 -1 - - Unfinished FIPS stuff for review/improvement. - -2003-07-27 19:19 ben - - Changed: - fips/fips_check_sha1 (1.1.2.2), "Exp", lines: +1 -1 - - Use unified diff. - -2003-07-27 19:23 ben - - Changed: - fips/Makefile.ssl (1.1.2.2), "Exp", lines: +3 -3 - fips/fingerprint.sha1 (1.1.2.2), "Exp", lines: +2 -1 - fips/fips_make_sha1 (1.1.2.2), "Exp", lines: +1 -1 - - Build in non-FIPS mode. - -2003-07-27 23:13 ben - - Changed: - Makefile.org (1.154.2.68), "Exp", lines: +1 -1 - fips/fips_check_sha1 (1.1.2.3), "Exp", lines: +2 -1 - fips/aes/fips_aesavs.c (1.1.2.2), "Exp", lines: +2 -0 - fips/dsa/fips_dsa_ossl.c (1.1.2.2), "Exp", lines: +8 -0 - fips/dsa/fips_dsatest.c (1.1.2.2), "Exp", lines: +2 -1 - fips/sha1/fingerprint.sha1 (1.1.2.2), "Exp", lines: +1 -1 - fips/sha1/fips_sha1dgst.c (1.1.2.2), "Exp", lines: +5 -1 - fips/sha1/fips_standalone_sha1.c (1.1.2.2), "Exp", lines: +2 -0 - fips/sha1/standalone.sha1 (1.1.2.2), "Exp", lines: +1 -1 - - Build when not FIPS. - -2003-07-28 11:56 ben - - Changed: - fips/dsa/fingerprint.sha1 (1.1.2.2), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.3), "Exp", lines: +1 -1 - - New fingerprints. - -2003-07-29 16:06 ben - - Changed: - fips/aes/fips_aesavs.c (1.1.2.5), "Exp", lines: +295 -303 - - Reformat. - -2003-07-29 16:34 ben - - Changed: - fips/aes/fips_aesavs.c (1.1.2.6), "Exp", lines: +43 -17 - - MMT for CFB1 - -2003-07-29 17:17 ben - - Changed: - fips/fips_err_wrapper.c (1.1.2.1), "Exp", lines: +5 -0 - fips/sha1/sha1hashes.txt (1.1.2.1), "Exp", lines: +342 -0 - fips/sha1/sha1vectors.txt (1.1.2.1), "Exp", lines: +2293 -0 - - Missing files. - -2003-07-31 23:30 levitte - - Changed: - Makefile.org (1.154.2.71), "Exp", lines: +2 -0 - - If FDIRS is to be treated like SDIRS, let's not forget to - initialize it in Makefile.org. - -2003-07-31 23:41 levitte - - Changed: - fips/sha1/fips_sha1test.c (1.1.2.2), "Exp", lines: +3 -3 - - No C++ comments in C programs! - -2003-08-01 15:07 steve - - Changed: - fips/aes/fips_aesavs.c (1.1.2.8), "Exp", lines: +3 -3 - - Replace C++ style comments. - -2003-08-03 14:22 ben - - Changed: - fips/des/fips_desmovs.c (1.1.2.2), "Exp", lines: +55 -37 - - Make tests work (CFB1 still doesn't produce the right answers, - strangely). - -2003-08-08 12:08 levitte - - Changed: - fips/des/fips_des_enc.c (1.1.2.2), "Exp", lines: +9 -0 - - Avoid clashing with the regular DES functions when not compiling - with -DFIPS. This is basically only visible when building with - shared library supoort... - -2003-08-11 11:36 levitte - - Deleted: - fips/sha1/.cvsignore (1.1.2.2) - fips/sha1/Makefile.ssl (1.1.2.3) - fips/sha1/fingerprint.sha1 (1.1.2.3) - fips/sha1/fips_md32_common.h (1.1.2.2) - fips/sha1/fips_sha1dgst.c (1.1.2.3) - fips/sha1/fips_sha1test.c (1.1.2.3) - fips/sha1/fips_sha_locl.h (1.1.2.2) - fips/sha1/fips_standalone_sha1.c (1.1.2.3) - fips/sha1/sha1hashes.txt (1.1.2.2) - fips/sha1/sha1vectors.txt (1.1.2.2) - fips/sha1/standalone.sha1 (1.1.2.4) - fips/dsa/.cvsignore (1.1.2.2) - fips/dsa/Makefile.ssl (1.1.2.2) - fips/dsa/fingerprint.sha1 (1.1.2.3) - fips/dsa/fips_dsa_ossl.c (1.1.2.3) - fips/dsa/fips_dsatest.c (1.1.2.3) - fips/rand/.cvsignore (1.1.2.2) - fips/rand/Makefile.ssl (1.1.2.2) - fips/rand/fingerprint.sha1 (1.1.2.2) - fips/rand/fips_rand.c (1.1.2.2) - fips/rand/fips_rand.h (1.1.2.2) - fips/rand/fips_randtest.c (1.1.2.2) - fips/des/.cvsignore (1.1.2.2) - fips/des/Makefile.ssl (1.1.2.3) - fips/des/fingerprint.sha1 (1.1.2.2) - fips/des/fips_des_enc.c (1.1.2.3) - fips/des/fips_des_locl.h (1.1.2.2) - fips/des/fips_desmovs.c (1.1.2.3) - fips/aes/.cvsignore (1.1.2.2) - fips/aes/Makefile.ssl (1.1.2.5) - fips/aes/fingerprint.sha1 (1.1.2.2) - fips/aes/fips_aes_core.c (1.1.2.2) - fips/aes/fips_aes_locl.h (1.1.2.2) - fips/aes/fips_aesavs.c (1.1.2.9) - fips/.cvsignore (1.1.2.2) - fips/Makefile.ssl (1.1.2.6) - fips/fingerprint.sha1 (1.1.2.3) - fips/fips.c (1.1.2.2) - fips/fips.h (1.1.2.2) - fips/fips_check_sha1 (1.1.2.4) - fips/fips_err.c (1.1.2.2) - fips/fips_err_wrapper.c (1.1.2.2) - fips/fips_make_sha1 (1.1.2.4) - fips/lib (1.1.2.2) - Changed: - util/libeay.num (1.173.2.16), "Exp", lines: +11 -38 - util/mkerr.pl (1.18.2.5), "Exp", lines: +1 -2 - test/Makefile.ssl (1.84.2.31), "Exp", lines: +54 -180 - crypto/ripemd/Makefile.ssl (1.25.2.6), "Exp", lines: +2 -7 - crypto/sha/Makefile.ssl (1.26.2.6), "Exp", lines: +6 -16 - crypto/rand/Makefile.ssl (1.56.2.5), "Exp", lines: +15 -17 - crypto/rand/md_rand.c (1.69.2.3), "Exp", lines: +0 -9 - crypto/rand/rand.h (1.26.2.6), "Exp", lines: +0 -2 - crypto/rand/rand_err.c (1.6.2.2), "Exp", lines: +1 -3 - crypto/rand/rand_lib.c (1.15.2.3), "Exp", lines: +0 -11 - crypto/objects/obj_dat.h (1.49.2.18), "Exp", lines: +3 -27 - crypto/objects/obj_mac.h (1.19.2.18), "Exp", lines: +0 -32 - crypto/objects/obj_mac.num (1.15.2.14), "Exp", lines: +0 -8 - crypto/objects/objects.txt (1.20.2.19), "Exp", lines: +0 -11 - crypto/md4/Makefile.ssl (1.6.2.5), "Exp", lines: +4 -7 - crypto/md5/Makefile.ssl (1.33.2.8), "Exp", lines: +4 -7 - crypto/evp/Makefile.ssl (1.64.2.9), "Exp", lines: +7 -8 - crypto/evp/c_allc.c (1.8.2.6), "Exp", lines: +0 -4 - crypto/evp/e_aes.c (1.6.2.9), "Exp", lines: +4 -22 - crypto/evp/e_des.c (1.5.2.5), "Exp", lines: +2 -43 - crypto/evp/e_des3.c (1.8.2.4), "Exp", lines: +3 -3 - crypto/evp/evp.h (1.86.2.13), "Exp", lines: +11 -36 - crypto/evp/evp_err.c (1.23.2.2), "Exp", lines: +1 -3 - crypto/evp/evp_lib.c (1.6.8.3), "Exp", lines: +0 -24 - crypto/evp/evp_locl.h (1.7.2.5), "Exp", lines: +2 -11 - crypto/evp/evp_test.c (1.14.2.12), "Exp", lines: +8 -17 - crypto/evp/evptests.txt (1.9.2.6), "Exp", lines: +1 -106 - crypto/dsa/Makefile.ssl (1.49.2.7), "Exp", lines: +6 -10 - crypto/dsa/dsa_ossl.c (1.12.2.5), "Exp", lines: +0 -2 - crypto/dsa/dsa_sign.c (1.10.2.4), "Exp", lines: +0 -12 - crypto/dsa/dsa_vrf.c (1.10.2.4), "Exp", lines: +0 -8 - crypto/err/Makefile.ssl (1.48.2.5), "Exp", lines: +16 -17 - crypto/err/err.h (1.35.2.4), "Exp", lines: +0 -2 - crypto/err/err_all.c (1.17.2.3), "Exp", lines: +0 -4 - crypto/err/openssl.ec (1.11.2.2), "Exp", lines: +0 -1 - crypto/des/des.h (1.40.2.5), "Exp", lines: +1 -1 - crypto/des/des_enc.c (1.11.2.3), "Exp", lines: +0 -4 - crypto/des/des_old.c (1.11.2.5), "Exp", lines: +1 -1 - crypto/des/destest.c (1.30.2.7), "Exp", lines: +2 -2 - crypto/des/ecb3_enc.c (1.8.2.2), "Exp", lines: +3 -1 - crypto/aes/Makefile.ssl (1.4.2.7), "Exp", lines: +1 -2 - crypto/aes/aes.h (1.1.2.8), "Exp", lines: +0 -9 - crypto/aes/aes_cfb.c (1.1.2.8), "Exp", lines: +0 -93 - crypto/aes/aes_core.c (1.1.2.5), "Exp", lines: +0 -4 - crypto/cryptlib.c (1.32.2.10), "Exp", lines: +0 -5 - crypto/md32_common.h (1.22.2.5), "Exp", lines: +0 -11 - Configure (1.314.2.86), "Exp", lines: +0 -2 - Makefile.org (1.154.2.72), "Exp", lines: +8 -34 - TABLE (1.99.2.30), "Exp", lines: +0 -50 - - A new branch for FIPS-related changes has been created with the - name OpenSSL-fips-0_9_7-stable. - - Since the 0.9.7-stable branch is supposed to be in freeze - and should only contain bug corrections, this change removes the - FIPS changes from that branch. - -2004-05-11 14:44 ben - - Deleted: - apps/Makefile.ssl (1.100.2.27) - crypto/Makefile.ssl (1.84.2.12) - crypto/aes/Makefile.ssl (1.4.2.9) - crypto/asn1/Makefile.ssl (1.77.2.7) - crypto/bf/Makefile.ssl (1.25.2.6) - crypto/bio/Makefile.ssl (1.52.2.4) - crypto/bn/Makefile.ssl (1.65.2.9) - crypto/buffer/Makefile.ssl (1.32.2.4) - crypto/cast/Makefile.ssl (1.31.2.6) - crypto/comp/Makefile.ssl (1.32.2.4) - crypto/conf/Makefile.ssl (1.38.2.8) - crypto/des/Makefile.ssl (1.61.2.13) - crypto/dh/Makefile.ssl (1.43.2.5) - crypto/dsa/Makefile.ssl (1.49.2.9) - crypto/dso/Makefile.ssl (1.11.2.4) - crypto/ec/Makefile.ssl (1.7.2.4) - crypto/engine/Makefile.ssl (1.30.2.13) - crypto/err/Makefile.ssl (1.48.2.7) - crypto/evp/Makefile.ssl (1.64.2.12) - crypto/hmac/Makefile.ssl (1.33.2.6) - crypto/idea/Makefile.ssl (1.20.2.4) - crypto/krb5/Makefile.ssl (1.5.2.6) - crypto/lhash/Makefile.ssl (1.28.2.4) - crypto/md2/Makefile.ssl (1.29.2.5) - crypto/md4/Makefile.ssl (1.6.2.7) - crypto/md5/Makefile.ssl (1.33.2.10) - crypto/mdc2/Makefile.ssl (1.30.2.4) - crypto/objects/Makefile.ssl (1.46.2.6) - crypto/ocsp/Makefile.ssl (1.19.2.7) - crypto/pem/Makefile.ssl (1.51.2.5) - crypto/pkcs12/Makefile.ssl (1.37.2.5) - crypto/pkcs7/Makefile.ssl (1.47.2.5) - crypto/rand/Makefile.ssl (1.56.2.8) - crypto/rc2/Makefile.ssl (1.20.2.4) - crypto/rc4/Makefile.ssl (1.25.2.6) - crypto/rc5/Makefile.ssl (1.22.2.6) - crypto/ripemd/Makefile.ssl (1.25.2.9) - crypto/rsa/Makefile.ssl (1.53.2.6) - crypto/sha/Makefile.ssl (1.26.2.9) - crypto/stack/Makefile.ssl (1.28.2.4) - crypto/txt_db/Makefile.ssl (1.26.2.4) - crypto/ui/Makefile.ssl (1.10.2.6) - crypto/x509/Makefile.ssl (1.56.2.5) - crypto/x509v3/Makefile.ssl (1.62.2.5) - ssl/Makefile.ssl (1.53.2.11) - test/Makefile.ssl (1.84.2.36) - tools/Makefile.ssl (1.9.2.4) - Changed: - .cvsignore (1.7.6.2), "Exp", lines: +2 -1 - Configure (1.314.2.92), "Exp", lines: +38 -8 - FAQ (1.61.2.31), "Exp", lines: +1 -1 - INSTALL (1.45.2.9), "Exp", lines: +2 -2 - INSTALL.W32 (1.30.2.14), "Exp", lines: +9 -4 - Makefile.org (1.154.2.78), "Exp", lines: +51 -19 - PROBLEMS (1.4.2.10), "Exp", lines: +2 -2 - e_os.h (1.56.2.17), "Exp", lines: +20 -1 - apps/.cvsignore (1.5.8.1), "Exp", lines: +1 -0 - apps/Makefile (1.1.4.1), "Exp", lines: +1147 -0 - apps/apps.c (1.49.2.27), "Exp", lines: +0 -10 - apps/ca.c (1.102.2.31), "Exp", lines: +0 -10 - apps/dgst.c (1.23.2.10), "Exp", lines: +39 -11 - apps/openssl.c (1.48.2.9), "Exp", lines: +19 -0 - crypto/Makefile (1.1.4.1), "Exp", lines: +217 -0 - crypto/cryptlib.c (1.32.2.11), "Exp", lines: +5 -0 - crypto/crypto-lib.com (1.53.2.12), "Exp", lines: +1 -1 - crypto/md32_common.h (1.22.2.6), "Exp", lines: +12 -0 - crypto/aes/Makefile (1.1.4.1), "Exp", lines: +102 -0 - crypto/aes/aes.h (1.1.2.9), "Exp", lines: +9 -0 - crypto/aes/aes_cfb.c (1.1.2.9), "Exp", lines: +93 -0 - crypto/aes/aes_core.c (1.1.2.6), "Exp", lines: +4 -0 - crypto/asn1/Makefile (1.1.4.1), "Exp", lines: +1150 -0 - crypto/bf/Makefile (1.1.4.1), "Exp", lines: +113 -0 - crypto/bio/Makefile (1.1.4.1), "Exp", lines: +214 -0 - crypto/bio/bio.h (1.56.2.6), "Exp", lines: +1 -0 - crypto/bn/Makefile (1.1.4.1), "Exp", lines: +324 -0 - crypto/bn/bntest.c (1.55.2.4), "Exp", lines: +1 -1 - crypto/buffer/Makefile (1.1.4.1), "Exp", lines: +92 -0 - crypto/cast/Makefile (1.1.4.1), "Exp", lines: +118 -0 - crypto/cast/asm/.cvsignore (1.2.8.1), "Exp", lines: +1 -0 - crypto/comp/Makefile (1.1.4.1), "Exp", lines: +112 -0 - crypto/conf/Makefile (1.1.4.1), "Exp", lines: +181 -0 - crypto/des/Makefile (1.1.4.1), "Exp", lines: +314 -0 - crypto/des/cfb64ede.c (1.6.2.4), "Exp", lines: +111 -0 - crypto/des/des.h (1.40.2.6), "Exp", lines: +5 -1 - crypto/des/des_enc.c (1.11.2.4), "Exp", lines: +8 -0 - crypto/des/des_old.c (1.11.2.6), "Exp", lines: +1 -1 - crypto/des/destest.c (1.30.2.8), "Exp", lines: +2 -2 - crypto/des/ecb3_enc.c (1.8.2.3), "Exp", lines: +1 -3 - crypto/des/set_key.c (1.18.2.2), "Exp", lines: +4 -0 - crypto/dh/Makefile (1.1.4.1), "Exp", lines: +131 -0 - crypto/dsa/Makefile (1.1.4.1), "Exp", lines: +173 -0 - crypto/dsa/dsa_gen.c (1.19.2.1), "Exp", lines: +4 -1 - crypto/dsa/dsa_key.c (1.9.2.1), "Exp", lines: +2 -0 - crypto/dsa/dsa_ossl.c (1.12.2.6), "Exp", lines: +2 -0 - crypto/dsa/dsa_sign.c (1.10.2.5), "Exp", lines: +12 -0 - crypto/dsa/dsa_vrf.c (1.10.2.5), "Exp", lines: +8 -0 - crypto/dso/Makefile (1.1.4.1), "Exp", lines: +140 -0 - crypto/ec/Makefile (1.1.4.1), "Exp", lines: +126 -0 - crypto/engine/Makefile (1.1.4.1), "Exp", lines: +536 -0 - crypto/engine/hw_cryptodev.c (1.1.2.6), "Exp", lines: +6 -2 - crypto/err/Makefile (1.1.4.1), "Exp", lines: +118 -0 - crypto/err/err.h (1.35.2.6), "Exp", lines: +2 -0 - crypto/err/err_all.c (1.17.2.4), "Exp", lines: +4 -0 - crypto/err/openssl.ec (1.11.2.3), "Exp", lines: +1 -0 - crypto/evp/Makefile (1.1.4.1), "Exp", lines: +1057 -0 - crypto/evp/bio_md.c (1.11.2.1), "Exp", lines: +6 -0 - crypto/evp/c_allc.c (1.8.2.7), "Exp", lines: +8 -0 - crypto/evp/e_aes.c (1.6.2.10), "Exp", lines: +22 -4 - crypto/evp/e_des.c (1.5.2.8), "Exp", lines: +36 -3 - crypto/evp/e_des3.c (1.8.2.7), "Exp", lines: +43 -4 - crypto/evp/evp.h (1.86.2.15), "Exp", lines: +39 -11 - crypto/evp/evp_err.c (1.23.2.3), "Exp", lines: +3 -1 - crypto/evp/evp_lib.c (1.6.8.4), "Exp", lines: +24 -0 - crypto/evp/evp_locl.h (1.7.2.6), "Exp", lines: +11 -2 - crypto/evp/evp_test.c (1.14.2.13), "Exp", lines: +17 -8 - crypto/evp/evptests.txt (1.9.2.7), "Exp", lines: +106 -1 - crypto/hmac/Makefile (1.1.4.1), "Exp", lines: +99 -0 - crypto/idea/Makefile (1.1.4.1), "Exp", lines: +89 -0 - crypto/krb5/Makefile (1.1.4.1), "Exp", lines: +88 -0 - crypto/lhash/Makefile (1.1.4.1), "Exp", lines: +91 -0 - crypto/md2/Makefile (1.1.4.1), "Exp", lines: +91 -0 - crypto/md4/Makefile (1.1.4.1), "Exp", lines: +93 -0 - crypto/md5/Makefile (1.1.4.1), "Exp", lines: +129 -0 - crypto/mdc2/Makefile (1.1.4.1), "Exp", lines: +96 -0 - crypto/objects/Makefile (1.1.4.1), "Exp", lines: +121 -0 - crypto/objects/obj_dat.h (1.49.2.19), "Exp", lines: +33 -3 - crypto/objects/obj_mac.h (1.19.2.19), "Exp", lines: +40 -0 - crypto/objects/obj_mac.num (1.15.2.15), "Exp", lines: +10 -0 - crypto/objects/objects.txt (1.20.2.20), "Exp", lines: +13 -0 - crypto/ocsp/Makefile (1.1.4.1), "Exp", lines: +291 -0 - crypto/pem/Makefile (1.1.4.1), "Exp", lines: +334 -0 - crypto/pkcs12/Makefile (1.1.4.1), "Exp", lines: +415 -0 - crypto/pkcs7/Makefile (1.1.4.1), "Exp", lines: +241 -0 - crypto/rand/Makefile (1.1.4.1), "Exp", lines: +196 -0 - crypto/rand/md_rand.c (1.69.2.4), "Exp", lines: +9 -0 - crypto/rand/rand.h (1.26.2.7), "Exp", lines: +3 -0 - crypto/rand/rand_err.c (1.6.2.3), "Exp", lines: +4 -1 - crypto/rand/rand_lib.c (1.15.2.4), "Exp", lines: +11 -0 - crypto/rc2/Makefile (1.1.4.1), "Exp", lines: +89 -0 - crypto/rc4/Makefile (1.1.4.1), "Exp", lines: +108 -0 - crypto/rc5/Makefile (1.1.4.1), "Exp", lines: +106 -0 - crypto/ripemd/Makefile (1.1.4.1), "Exp", lines: +111 -0 - crypto/rsa/Makefile (1.1.4.1), "Exp", lines: +239 -0 - crypto/rsa/rsa_eay.c (1.28.2.9), "Exp", lines: +1 -1 - crypto/rsa/rsa_gen.c (1.8.6.1), "Exp", lines: +3 -0 - crypto/sha/Makefile (1.1.4.1), "Exp", lines: +118 -0 - crypto/sha/sha1dgst.c (1.21.2.1), "Exp", lines: +8 -0 - crypto/stack/Makefile (1.1.4.1), "Exp", lines: +86 -0 - crypto/txt_db/Makefile (1.1.4.1), "Exp", lines: +86 -0 - crypto/ui/Makefile (1.1.4.1), "Exp", lines: +115 -0 - crypto/x509/Makefile (1.1.4.1), "Exp", lines: +592 -0 - crypto/x509v3/Makefile (1.1.4.1), "Exp", lines: +601 -0 - fips/Makefile (1.1.4.1), "Exp", lines: +202 -0 - fips/fingerprint.sha1 (1.1.2.4), "Exp", lines: +4 -4 - fips/fips.c (1.1.2.3), "Exp", lines: +120 -5 - fips/fips.h (1.1.2.3), "Exp", lines: +42 -2 - fips/fips_check_sha1 (1.1.2.5), "Exp", lines: +2 -2 - fips/fips_err.h (1.1.4.1), "Exp", lines: +117 -0 - fips/fips_err_wrapper.c (1.1.2.3), "Exp", lines: +4 -2 - fips/fips_locl.h (1.1.4.1), "Exp", lines: +62 -0 - fips/fips_make_sha1 (1.1.2.5), "Exp", lines: +9 -6 - fips/fips_test_suite.c (1.1.4.1), "Exp", lines: +302 -0 - fips/openssl_fips_fingerprint (1.1.4.1), "Exp", lines: +25 -0 - fips/aes/Makefile (1.1.4.1), "Exp", lines: +131 -0 - fips/aes/fingerprint.sha1 (1.1.2.3), "Exp", lines: +3 -2 - fips/aes/fips_aes_core.c (1.1.2.3), "Exp", lines: +5 -2 - fips/aes/fips_aes_locl.h (1.1.2.3), "Exp", lines: +0 -0 - fips/aes/fips_aes_selftest.c (1.1.4.1), "Exp", lines: +112 -0 - fips/aes/fips_aesavs.c (1.1.2.10), "Exp", lines: +12 -6 - fips/des/Makefile (1.1.4.1), "Exp", lines: +155 -0 - fips/des/fingerprint.sha1 (1.1.2.3), "Exp", lines: +5 -2 - fips/des/fips_des_enc.c (1.1.2.4), "Exp", lines: +16 -3 - fips/des/fips_des_locl.h (1.1.2.3), "Exp", lines: +1 -1 - fips/des/fips_des_selftest.c (1.1.4.1), "Exp", lines: +200 -0 - fips/des/fips_desmovs.c (1.1.2.4), "Exp", lines: +186 -79 - fips/des/fips_set_key.c (1.1.4.1), "Exp", lines: +415 -0 - fips/des/asm/fips-dx86-elf.s (1.1.4.1), "Exp", lines: +2697 -0 - fips/dsa/Makefile (1.1.4.1), "Exp", lines: +159 -0 - fips/dsa/fingerprint.sha1 (1.1.2.4), "Exp", lines: +3 -1 - fips/dsa/fips_dsa_gen.c (1.1.4.1), "Exp", lines: +373 -0 - fips/dsa/fips_dsa_ossl.c (1.1.2.4), "Exp", lines: +16 -3 - fips/dsa/fips_dsa_selftest.c (1.1.4.1), "Exp", lines: +168 -0 - fips/dsa/fips_dsatest.c (1.1.2.4), "Exp", lines: +10 -6 - fips/dsa/fips_dssvs.c (1.1.4.1), "Exp", lines: +306 -0 - fips/rand/Makefile (1.1.4.1), "Exp", lines: +104 -0 - fips/rand/fingerprint.sha1 (1.1.2.3), "Exp", lines: +2 -2 - fips/rand/fips_rand.c (1.1.2.3), "Exp", lines: +60 -10 - fips/rand/fips_rand.h (1.1.2.3), "Exp", lines: +19 -1 - fips/rand/fips_randtest.c (1.1.2.3), "Exp", lines: +31 -10 - fips/rsa/Makefile (1.1.4.1), "Exp", lines: +112 -0 - fips/rsa/fingerprint.sha1 (1.1.4.1), "Exp", lines: +3 -0 - fips/rsa/fips_rsa_eay.c (1.1.4.1), "Exp", lines: +735 -0 - fips/rsa/fips_rsa_gen.c (1.1.4.1), "Exp", lines: +249 -0 - fips/rsa/fips_rsa_selftest.c (1.1.4.1), "Exp", lines: +207 -0 - fips/sha1/.cvsignore (1.1.2.3), "Exp", lines: +1 -2 - fips/sha1/Makefile (1.1.4.1), "Exp", lines: +158 -0 - fips/sha1/fingerprint.sha1 (1.1.2.4), "Exp", lines: +5 -3 - fips/sha1/fips_md32_common.h (1.1.2.3), "Exp", lines: +0 -0 - fips/sha1/fips_sha1_selftest.c (1.1.4.1), "Exp", lines: +97 -0 - fips/sha1/fips_sha1dgst.c (1.1.2.4), "Exp", lines: +4 -4 - fips/sha1/fips_sha1test.c (1.1.2.4), "Exp", lines: +17 -0 - fips/sha1/fips_sha_locl.h (1.1.2.3), "Exp", lines: +7 -0 - fips/sha1/fips_standalone_sha1.c (1.1.2.4), "Exp", lines: +60 -7 - fips/sha1/sha1hashes.txt (1.1.2.3), "Exp", lines: +0 -0 - fips/sha1/sha1vectors.txt (1.1.2.3), "Exp", lines: +0 -0 - fips/sha1/standalone.sha1 (1.1.2.5), "Exp", lines: +6 -4 - fips/sha1/asm/sx86-elf.s (1.1.4.1), "Exp", lines: +1568 -0 - ms/do_masm.bat (1.1.8.2), "Exp", lines: +12 -10 - ms/do_ms.bat (1.4.8.2), "Exp", lines: +11 -11 - ms/do_nasm.bat (1.1.8.2), "Exp", lines: +12 -11 - ms/do_nt.bat (1.2.8.1), "Exp", lines: +4 -4 - shlib/hpux10-cc.sh (1.3.2.2), "Exp", lines: +3 -3 - ssl/Makefile (1.1.4.1), "Exp", lines: +1019 -0 - ssl/s3_clnt.c (1.53.2.16), "Exp", lines: +10 -0 - ssl/s3_srvr.c (1.85.2.21), "Exp", lines: +9 -0 - ssl/ssl_cert.c (1.48.2.7), "Exp", lines: +9 -0 - ssl/ssl_lib.c (1.110.2.12), "Exp", lines: +13 -1 - ssl/ssltest.c (1.53.2.23), "Exp", lines: +33 -1 - ssl/t1_enc.c (1.27.2.8), "Exp", lines: +19 -1 - test/.cvsignore (1.4.8.1), "Exp", lines: +4 -0 - test/Makefile (1.1.4.1), "Exp", lines: +941 -0 - test/bctest (1.14.2.1), "Exp", lines: +1 -1 - test/testenc (1.3.8.1), "Exp", lines: +1 -1 - test/testfipsssl (1.1.4.1), "Exp", lines: +113 -0 - tools/Makefile (1.1.4.1), "Exp", lines: +61 -0 - util/cygwin.sh (1.1.2.5), "Exp", lines: +3 -3 - util/domd (1.6.2.3), "Exp", lines: +5 -5 - util/fixNT.sh (1.1.1.2.8.1), "Exp", lines: +3 -3 - util/libeay.num (1.173.2.19), "Exp", lines: +55 -11 - util/mk1mf.pl (1.41.2.10), "Exp", lines: +6 -4 - util/mkdef.pl (1.67.2.7), "Exp", lines: +11 -4 - util/mkerr.pl (1.18.2.6), "Exp", lines: +2 -1 - util/mkfiles.pl (1.12.2.1), "Exp", lines: +8 -1 - util/pod2mantest (1.1.2.7), "Exp", lines: +1 -1 - util/selftest.pl (1.18.2.1), "Exp", lines: +2 -2 - util/pl/BC-16.pl (1.2.2.1), "Exp", lines: +1 -1 - util/pl/BC-32.pl (1.11.2.4), "Exp", lines: +1 -1 - util/pl/Mingw32.pl (1.12.6.5), "Exp", lines: +1 -1 - util/pl/OS2-EMX.pl (1.1.2.3), "Exp", lines: +1 -1 - util/pl/VC-16.pl (1.3.2.1), "Exp", lines: +2 -2 - util/pl/VC-32.pl (1.11.2.3), "Exp", lines: +2 -2 - util/pl/VC-CE.pl (1.1.2.5), "Exp", lines: +1 -1 - util/pl/ultrix.pl (1.2.8.1), "Exp", lines: +1 -1 - - Pull FIPS back into stable. - -2004-05-12 10:27 levitte - - Changed: - apps/Makefile (1.1.4.2), "Exp", lines: +3 -1 - - Only check for FIPS signatures when FIPS is enabled. - -2004-05-12 10:28 levitte - - Changed: - crypto/des/FILES0 (1.1.4.2), "Exp", lines: +1 -1 - - Makefile.ssl changed name to Makefile. - -2004-05-12 10:28 levitte - - Changed: - fips/rand/fips_rand.c (1.1.2.4), "Exp", lines: +5 -1 - - Only really build this file when OPENSSL_FIPS is defined. And oh, - let's keep internal variables static. - -2004-05-12 10:42 levitte - - Changed: - fips/rand/fingerprint.sha1 (1.1.2.4), "Exp", lines: +1 -1 - - I forgot to modify the signature for fips_rand.c... - -2004-05-12 10:46 levitte - - Changed: - fips/rsa/.cvsignore (1.1.4.1), "Exp", lines: +1 -0 - fips/.cvsignore (1.1.2.3), "Exp", lines: +1 -1 - fips/aes/.cvsignore (1.1.2.3), "Exp", lines: +0 -3 - fips/des/.cvsignore (1.1.2.3), "Exp", lines: +0 -2 - fips/dsa/.cvsignore (1.1.2.3), "Exp", lines: +0 -1 - fips/rand/.cvsignore (1.1.2.3), "Exp", lines: +0 -1 - - Ignore the 'lib' timestamp file. - -2004-05-12 12:07 levitte - - Changed: - fips/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - fips/aes/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - fips/des/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - fips/dsa/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - fips/rand/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - fips/rsa/.cvsignore (1.1.4.2), "Exp", lines: +1 -0 - fips/sha1/.cvsignore (1.1.2.4), "Exp", lines: +1 -0 - - Ignore 'Makefile.save' - -2004-05-12 16:11 ben - - Changed: - crypto/rand/rand.h (1.26.2.8), "Exp", lines: +2 -0 - crypto/rand/rand_err.c (1.6.2.4), "Exp", lines: +2 -0 - fips/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1 - fips/fips.c (1.1.2.4), "Exp", lines: +5 -1 - fips/rand/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1 - fips/rand/fips_rand.c (1.1.2.5), "Exp", lines: +29 -0 - - Blow up in people's faces if they don't reseed. - -2004-05-15 19:51 ben - - Changed: - crypto/dh/dh.h (1.23.2.6), "Exp", lines: +1 -0 - crypto/dh/dh_err.c (1.6.2.3), "Exp", lines: +2 -1 - crypto/dh/dh_gen.c (1.8.8.2), "Exp", lines: +9 -0 - fips/fips_test_suite.c (1.1.4.2), "Exp", lines: +4 -3 - fips/aes/fips_aesavs.c (1.1.2.11), "Exp", lines: +49 -1 - fips/des/fingerprint.sha1 (1.1.2.4), "Exp", lines: +1 -1 - fips/des/fips_desmovs.c (1.1.2.5), "Exp", lines: +49 -1 - fips/des/fips_set_key.c (1.1.4.2), "Exp", lines: +2 -0 - fips/sha1/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1 - fips/sha1/fips_md32_common.h (1.1.2.4), "Exp", lines: +3 -0 - fips/sha1/standalone.sha1 (1.1.2.6), "Exp", lines: +1 -1 - - Fix self-tests, ban some things in FIPS mode, fix copyrights. - -2004-05-17 06:28 levitte - - Changed: - util/mk1mf.pl (1.41.2.11), "Exp", lines: +8 -2 - util/pl/BC-16.pl (1.2.2.2), "Exp", lines: +9 -4 - util/pl/BC-32.pl (1.11.2.5), "Exp", lines: +8 -3 - util/pl/Mingw32.pl (1.12.6.6), "Exp", lines: +7 -2 - util/pl/OS2-EMX.pl (1.1.2.4), "Exp", lines: +7 -2 - util/pl/VC-16.pl (1.3.2.2), "Exp", lines: +7 -2 - util/pl/VC-32.pl (1.11.2.4), "Exp", lines: +7 -2 - util/pl/VC-CE.pl (1.1.2.6), "Exp", lines: +7 -2 - util/pl/linux.pl (1.3.6.1), "Exp", lines: +7 -2 - util/pl/ultrix.pl (1.2.8.2), "Exp", lines: +7 -2 - util/pl/unix.pl (1.2.8.1), "Exp", lines: +7 -2 - - Generate SHA1 files on Windows and other platforms supported by - mk1mf.pl, when building in FIPS mode. - - Note: UNTESTED! - -2004-05-17 06:30 levitte - - Changed: - apps/apps.h (1.44.2.14), "Exp", lines: +3 -0 - apps/openssl.c (1.48.2.10), "Exp", lines: +9 -5 - - Make sure the applications know when we are running in FIPS mode. - We can't use the variable in libcrypto, since it's supposedly - unknown. - - Note: currently only supported in MONOLITH mode. - -2004-05-17 06:31 levitte - - Changed: - apps/enc.c (1.35.2.9), "Exp", lines: +10 -1 - - When in FIPS mode, use SHA1 to digest the key, rather than MD5, as - MD5 isn't a FIPS-approved algorithm. - - Note: this means the user needs to keep track of this, and - we need to add support for that... - -2004-05-19 16:16 levitte - - Changed: - fips/rsa/fingerprint.sha1 (1.1.4.2), "Exp", lines: +2 -2 - fips/rsa/fips_rsa_eay.c (1.1.4.2), "Exp", lines: +8 -8 - fips/rsa/fips_rsa_gen.c (1.1.4.2), "Exp", lines: +1 -1 - fips/dsa/fingerprint.sha1 (1.1.2.5), "Exp", lines: +2 -2 - fips/dsa/fips_dsa_gen.c (1.1.4.2), "Exp", lines: +2 -2 - fips/dsa/fips_dsa_ossl.c (1.1.2.5), "Exp", lines: +4 -4 - fips/aes/fingerprint.sha1 (1.1.2.4), "Exp", lines: +1 -1 - fips/aes/fips_aes_core.c (1.1.2.4), "Exp", lines: +5 -5 - crypto/rsa/rsa.h (1.36.2.11), "Exp", lines: +4 -0 - crypto/aes/aes.h (1.1.2.10), "Exp", lines: +6 -0 - crypto/dsa/dsa.h (1.26.2.5), "Exp", lines: +4 -0 - - Define FIPS_*_SIZE_T for AES, DSA and RSA as well, in preparation - for size_t-ification of those algorithms in future version of - OpenSSL... - -2004-05-27 11:33 levitte - - Changed: - makevms.com (1.35.2.3), "Exp", lines: +27 -0 - - Copy the FIPS files to the temporary openssl include directory. - -2004-05-27 12:04 levitte - - Changed: - fips/fips-lib.com (1.1.2.1), "Exp", lines: +1179 -0 - makevms.com (1.35.2.4), "Exp", lines: +8 -0 - - Compile the FIPS directory on VMS as well. fips-lib.com is - essentially a copy of crypto-lib.com, with just a few edits. - -2004-05-27 12:07 levitte - - Changed: - fips/install.com (1.1.2.1), "Exp", lines: +55 -0 - install.com (1.4.2.2), "Exp", lines: +6 -6 - - Run an installation of FIPS stuff as well. - -2004-05-27 12:19 levitte - - Changed: - test/maketests.com (1.13.2.5), "Exp", lines: +3 -3 - apps/makeapps.com (1.18.2.5), "Exp", lines: +3 -3 - - Make sure o_str.h is reachable. - -2004-06-19 15:15 ben - - Changed: - Makefile.org (1.154.2.80), "Exp", lines: +1 -1 - crypto/dh/dh.h (1.23.2.7), "Exp", lines: +0 -1 - crypto/dh/dh_check.c (1.6.2.1), "Exp", lines: +4 -0 - crypto/dh/dh_err.c (1.6.2.4), "Exp", lines: +0 -1 - crypto/dh/dh_gen.c (1.8.8.3), "Exp", lines: +5 -9 - crypto/dh/dh_key.c (1.16.2.3), "Exp", lines: +4 -0 - fips/Makefile (1.1.4.2), "Exp", lines: +13 -14 - fips/fingerprint.sha1 (1.1.2.6), "Exp", lines: +2 -2 - fips/fips.h (1.1.2.4), "Exp", lines: +1 -0 - fips/fips_err.h (1.1.4.2), "Exp", lines: +1 -0 - fips/fips_make_sha1 (1.1.2.6), "Exp", lines: +3 -0 - fips/fips_test_suite.c (1.1.4.3), "Exp", lines: +13 -9 - fips/openssl_fips_fingerprint (1.1.4.2), "Exp", lines: +1 -2 - - The version that was actually submitted for FIPS testing. - -2004-06-19 15:16 ben - - Changed: - fips/dh/Makefile (1.1.2.1), "Exp", lines: +92 -0 - fips/dh/fingerprint.sha1 (1.1.2.1), "Exp", lines: +3 -0 - fips/dh/fips_dh_check.c (1.1.2.1), "Exp", lines: +119 -0 - fips/dh/fips_dh_gen.c (1.1.2.1), "Exp", lines: +182 -0 - fips/dh/fips_dh_key.c (1.1.2.1), "Exp", lines: +222 -0 - - Add Diffie-Hellman to FIPS. - -2004-06-19 15:18 ben - - Changed: - fips/.cvsignore (1.1.2.5), "Exp", lines: +2 -0 - fips/dh/.cvsignore (1.1.2.1), "Exp", lines: +1 -0 - - Update ignores. - -2004-06-21 11:07 levitte - - Changed: - fips/aes/Makefile (1.1.4.2), "Exp", lines: +7 -5 - fips/des/Makefile (1.1.4.2), "Exp", lines: +7 -5 - fips/dh/Makefile (1.1.2.2), "Exp", lines: +7 -6 - fips/dsa/Makefile (1.1.4.2), "Exp", lines: +7 -6 - fips/rsa/Makefile (1.1.4.2), "Exp", lines: +7 -6 - fips/sha1/Makefile (1.1.4.2), "Exp", lines: +7 -5 - - Make sure we don't try to loop over an empty EXHEADER. In the - Makefiles where this was fixed by commenting away code, change it - to check for an empty EXHEADER instead, so we have less hassle in a - future where EXHEADER changes. - - PR: 900 - -2004-06-21 20:05 levitte - - Changed: - Makefile.org (1.154.2.82), "Exp", lines: +3 -1 - - Standard sh doesn't tolerate ! as part of the conditional command. - - PR: 900 - -2004-06-28 22:33 levitte - - Changed: - fips/dh/fips_dh_check.c (1.1.2.2), "Exp", lines: +6 -0 - fips/dh/fips_dh_gen.c (1.1.2.2), "Exp", lines: +6 -2 - fips/dh/fips_dh_key.c (1.1.2.2), "Exp", lines: +8 -0 - - Make sure the FIPS stuff is only really compiled when in FIPS mode. - -2004-07-12 19:59 ben - - Changed: - fips/fips_test_suite.c (1.1.4.4), "Exp", lines: +39 -6 - fips/dh/fingerprint.sha1 (1.1.2.2), "Exp", lines: +3 -3 - - Corrected test program. - -2004-07-17 14:48 appro - - Changed: - fips/des/Makefile (1.1.4.3), "Exp", lines: +1 -1 - - Eliminate enforced -g from CFLAGS. It switches off optimization - with some compilers, e.g. DEC C. - -2004-07-21 19:41 steve - - Changed: - crypto/pem/pem_all.c (1.20.2.1), "Exp", lines: +119 -0 - - When in FIPS mode write private keys in PKCS#8 and PBES2 format to - avoid use of prohibited MD5 algorithm. - -2004-07-23 15:20 ben - - Changed: - fips/rand/fingerprint.sha1 (1.1.2.7), "Exp", lines: +1 -1 - fips/rand/fips_rand.c (1.1.2.7), "Exp", lines: +22 -7 - fips/rand/fips_randtest.c (1.1.2.5), "Exp", lines: +2 -2 - - Convert to X9.31. - -2004-07-21 19:35 steve - - Changed: - fips/fingerprint.sha1 (1.1.2.7), "Exp", lines: +1 -1 - fips/fips.c (1.1.2.5), "Exp", lines: +3 -3 - fips/rsa/fingerprint.sha1 (1.1.4.3), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_selftest.c (1.1.4.2), "Exp", lines: +8 -8 - - Avoid compiler warnings. - -2004-07-27 02:17 steve - - Changed: - fips/fips_test_suite.c (1.1.4.5), "Exp", lines: +9 -8 - - Stop compiler warnings. - -2004-07-27 02:20 steve - - Changed: - crypto/err/err.c (1.51.2.6), "Exp", lines: +1 -0 - - Add FIPS name to error library. - -2004-07-27 14:22 steve - - Changed: - Makefile.org (1.154.2.84), "Exp", lines: +3 -3 - fips/fips_check_sha1 (1.1.2.6), "Exp", lines: +1 -1 - fips/openssl_fips_fingerprint (1.1.4.3), "Exp", lines: +1 -1 - - Rename libcrypto.sha1 to libcrypto.a.sha1 - -2004-07-27 20:28 steve - - Changed: - ssl/s3_lib.c (1.57.2.11), "Exp", lines: +33 -33 - ssl/ssl.h (1.126.2.20), "Exp", lines: +1 -0 - ssl/ssl_ciph.c (1.33.2.9), "Exp", lines: +11 -0 - ssl/ssl_locl.h (1.47.2.3), "Exp", lines: +2 -1 - - New cipher "strength" FIPS which specifies that a cipher suite is - FIPS compatible. - - New cipherstring "FIPS" is all FIPS compatible ciphersuites - except eNULL. - - Only allow FIPS ciphersuites in FIPS mode. - -2004-07-28 04:24 levitte - - Changed: - makevms.com (1.35.2.6), "Exp", lines: +2 -2 - - From the FIPS directory, darnit! - -2004-07-28 15:47 levitte - - Changed: - makevms.com (1.35.2.7), "Exp", lines: +5 -1 - - Define OPENSSL_FIPS in opensslconf.h if a logical name with the - same name is defined. - - Go up one directory level before dealing with FIPS stuff. - -2004-07-30 00:26 levitte - - Changed: - fips/fips-lib.com (1.1.2.2), "Exp", lines: +3 -3 - - We're building crypto stuff, not ssl stuff. Additionally, we're in - the fips subdirectory, not the crypto one... - -2004-07-30 16:37 levitte - - Changed: - fips/sha1/fingerprint.sha1 (1.1.2.7), "Exp", lines: +2 -2 - fips/sha1/fips_md32_common.h (1.1.2.6), "Exp", lines: +1 -1 - fips/sha1/fips_sha_locl.h (1.1.2.5), "Exp", lines: +2 -2 - fips/sha1/fips_standalone_sha1.c (1.1.2.5), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.8), "Exp", lines: +3 -3 - ssl/ssl_ciph.c (1.33.2.10), "Exp", lines: +2 -2 - fips/rsa/fingerprint.sha1 (1.1.4.4), "Exp", lines: +2 -2 - fips/rsa/fips_rsa_eay.c (1.1.4.3), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_gen.c (1.1.4.3), "Exp", lines: +1 -1 - fips/dh/fingerprint.sha1 (1.1.2.3), "Exp", lines: +1 -1 - fips/dh/fips_dh_gen.c (1.1.2.3), "Exp", lines: +1 -1 - fips/dsa/fingerprint.sha1 (1.1.2.6), "Exp", lines: +2 -2 - fips/dsa/fips_dsa_gen.c (1.1.4.3), "Exp", lines: +4 -3 - fips/dsa/fips_dsa_ossl.c (1.1.2.6), "Exp", lines: +2 -2 - fips/des/fingerprint.sha1 (1.1.2.5), "Exp", lines: +2 -2 - fips/des/fips_des_enc.c (1.1.2.5), "Exp", lines: +2 -2 - fips/des/fips_set_key.c (1.1.4.3), "Exp", lines: +3 -3 - fips/fingerprint.sha1 (1.1.2.8), "Exp", lines: +2 -2 - fips/fips.c (1.1.2.6), "Exp", lines: +76 -23 - fips/fips.h (1.1.2.5), "Exp", lines: +2 -3 - fips/fips_locl.h (1.1.4.2), "Exp", lines: +7 -2 - fips/aes/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1 - fips/aes/fips_aes_core.c (1.1.2.5), "Exp", lines: +1 -1 - crypto/rand/md_rand.c (1.69.2.5), "Exp", lines: +1 -1 - crypto/rand/rand_lib.c (1.15.2.5), "Exp", lines: +2 -1 - crypto/dsa/dsa_sign.c (1.10.2.6), "Exp", lines: +2 -2 - crypto/dsa/dsa_vrf.c (1.10.2.6), "Exp", lines: +1 -1 - crypto/pem/pem_all.c (1.20.2.2), "Exp", lines: +2 -2 - crypto/cryptlib.c (1.32.2.12), "Exp", lines: +122 -6 - crypto/crypto.h (1.62.2.8), "Exp", lines: +8 -1 - crypto/md32_common.h (1.22.2.7), "Exp", lines: +2 -2 - - To protect FIPS-related global variables, add locking mechanisms - around them. - - NOTE: because two new locks are added, this adds potential - binary incompatibility with earlier versions in the 0.9.7 series. - However, those locks will only ever be touched when FIPS_mode_set() - is called and after, thanks to a variable that's only changed from - 0 to 1 once (when FIPS_mode_set() is called). So basically, as - long as FIPS mode hasn't been engaged explicitely by the calling - application, the new locks are treated as if they didn't exist at - all, thus not becoming a problem. Applications that are built or - rebuilt to use FIPS functionality will need to be recompiled in any - case, thus not being a problem either. - -2004-08-02 16:15 levitte - - Changed: - crypto/cryptlib.c (1.32.2.13), "Exp", lines: +4 -4 - - Let's lock a write lock when changing values, shall we? - - Thanks to Dr Stephen Henson - for making me aware of this error. - -2004-08-05 20:11 steve - - Changed: - fips/fingerprint.sha1 (1.1.2.9), "Exp", lines: +1 -1 - fips/fips.c (1.1.2.7), "Exp", lines: +1 -1 - - Stop compiler giving bogus shadow warning. - -2004-08-09 14:13 levitte - - Changed: - makevms.com (1.35.2.8), "Exp", lines: +1 -1 - - In the fips directory, we use FIPS-LIB.COM, not CRYPTO-LIB.COM... - -2004-08-09 14:14 levitte - - Changed: - fips/fips-lib.com (1.1.2.3), "Exp", lines: +4 -4 - - Correct typos and include directory specifications. - -2004-08-10 11:11 levitte - - Changed: - fips/fips-lib.com (1.1.2.4), "Exp", lines: +2 -1 - - Update the VMS fips library builder with the DH library. - -2004-08-10 12:04 levitte - - Changed: - fips/rand/fingerprint.sha1 (1.1.2.8), "Exp", lines: +1 -1 - fips/rand/fips_rand.c (1.1.2.8), "Exp", lines: +7 -1 - - With DEC C in ANSI C mode, we need to define _XOPEN_SOURCE_EXTENDED - to get struct timeval and gettimeofday(). - -2004-09-06 16:19 levitte - - Changed: - fips/fips.c (1.1.2.8), "Exp", lines: +5 -4 - - Replace the bogus checks of n with proper uses of feof(), ferror() - and clearerr(). - -2004-09-06 16:21 levitte - - Changed: - fips/sha1/fips_sha_locl.h (1.1.2.6), "Exp", lines: +2 -2 - - num is an unsigned long, but since it was transfered from - crypto/sha/sha_locl.h, where it is in fact an int, we need to check - for less-than-zero as if it was an int... - -2004-10-08 12:03 ben - - Changed: - fips/fingerprint.sha1 (1.1.2.10), "Exp", lines: +1 -1 - fips/sha1/fingerprint.sha1 (1.1.2.8), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.9), "Exp", lines: +1 -1 - - Update fingerprints. - -2004-10-14 07:51 levitte - - Changed: - VMS/mkshared.com (1.3.2.1), "Exp", lines: +8 -0 - - We need to check for OPENSSL_FIPS when building shared libraries, - so we get correct transfer vectors for those functions when - required. - -2004-10-26 13:47 steve - - Changed: - util/mkfiles.pl (1.12.2.2), "Exp", lines: +1 -0 - - Add fips/dh directory to mkfiles.pl - -2004-10-26 14:17 levitte - - Changed: - fips/sha1/Makefile (1.1.4.4), "Exp", lines: +3 -1 - util/mkfiles.pl (1.12.2.3), "Exp", lines: +1 -0 - fips/Makefile (1.1.4.5), "Exp", lines: +7 -1 - crypto/sha/Makefile (1.1.4.4), "Exp", lines: +1 -7 - - fips/dh was missing in mkfiles.pl. make update - -2004-10-26 15:01 steve - - Changed: - util/mkfiles.pl (1.12.2.4), "Exp", lines: +0 -1 - - Only add fips/dh once... - -2004-11-01 09:20 levitte - - Changed: - fips/rand/fingerprint.sha1 (1.1.2.9), "Exp", lines: +1 -1 - fips/rand/fips_rand.c (1.1.2.9), "Exp", lines: +3 -1 - - Make sure _XOPEN_SOURCE_EXTENDED is correctly defined, and only if - not already defined. - -2004-12-09 19:03 appro - - vChanged: - crypto/Makefile (1.1.4.4), "Exp", lines: +2 -0 - - Postpone linking of shared libcrypto in FIPS build. - -2004-12-09 19:13 appro - - Changed: - fips/fingerprint.sha1 (1.1.2.11), "Exp", lines: +1 -1 - fips/fips.c (1.1.2.9), "Exp", lines: +13 -1 - fips/openssl_fips_fingerprint (1.1.4.4), "Exp", lines: +4 -2 - - Cygwin specific FIPS fix-ups. - -2004-12-09 23:43 appro - - Changed: - Configure (1.314.2.100), "Exp", lines: +2 -3 - crypto/des/des_enc.c (1.11.2.5), "Exp", lines: +2 -2 - - Eliminate false dependency on 386 config option is FIPS context. - At the same time limit assembler support to ELF platforms [that's - what is there, ELF modules]. - -2004-12-10 12:37 appro - - Changed: - Configure (1.314.2.101), "Exp", lines: +10 -3 - crypto/des/des_enc.c (1.11.2.6), "Exp", lines: +2 -2 - - Respect no-asm with fips option and disable FIPS DES assembler in - shared context [because it's not PIC]. - -2004-12-10 14:15 appro - - Changed: - fips/sha1/fingerprint.sha1 (1.1.2.10), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.11), "Exp", lines: +1 -1 - fips/sha1/asm/sx86-elf.s (1.1.4.3), "Exp", lines: +32 -32 - - Solaris x86 assembler update. - -2004-12-10 17:30 appro - - Changed: - fips/fips_check_sha1 (1.1.2.7), "Exp", lines: +1 -1 - fips/openssl_fips_fingerprint (1.1.4.5), "Exp", lines: +1 -1 - fips/sha1/Makefile (1.1.4.6), "Exp", lines: +1 -1 - - Adapt FIPS sub-tree for mingw. - -2005-01-03 18:46 steve - - Changed: - fips/rsa/fingerprint.sha1 (1.1.4.5), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_selftest.c (1.1.4.3), "Exp", lines: +55 -11 - - RSA KAT. - -2005-01-11 17:54 levitte - - Changed: - fips/rsa/fingerprint.sha1 (1.1.4.6), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_selftest.c (1.1.4.4), "Exp", lines: +2 -2 - - Clear signed vs. unsigned conflicts. Change the fingerprint - accordingly. - -2005-01-11 19:25 levitte - - Changed: - ssl/ssltest.c (1.53.2.24), "Exp", lines: +2 -2 - fips/rand/fips_randtest.c (1.1.2.6), "Exp", lines: +3 -3 - fips/sha1/fips_sha1test.c (1.1.2.5), "Exp", lines: +10 -4 - fips/des/fips_desmovs.c (1.1.2.6), "Exp", lines: +8 -7 - fips/dsa/fips_dsatest.c (1.1.2.5), "Exp", lines: +2 -2 - apps/openssl.c (1.48.2.12), "Exp", lines: +1 -1 - fips/aes/fips_aesavs.c (1.1.2.12), "Exp", lines: +8 -7 - - Use EXIT() instead of exit(). - -2005-01-26 21:00 steve - - Changed: - apps/dgst.c (1.23.2.13), "Exp", lines: +10 -0 - apps/pkcs12.c (1.60.2.13), "Exp", lines: +8 -1 - crypto/crypto.h (1.62.2.9), "Exp", lines: +49 -0 - crypto/md32_common.h (1.22.2.9), "Exp", lines: +1 -1 - crypto/bf/bf_skey.c (1.6.2.1), "Exp", lines: +2 -1 - crypto/bf/blowfish.h (1.9.2.1), "Exp", lines: +4 -1 - crypto/cast/c_skey.c (1.5.6.1), "Exp", lines: +3 -1 - crypto/cast/cast.h (1.7.2.1), "Exp", lines: +4 -1 - crypto/evp/bio_md.c (1.11.2.3), "Exp", lines: +2 -7 - crypto/evp/digest.c (1.21.2.7), "Exp", lines: +11 -0 - crypto/evp/e_aes.c (1.6.2.11), "Exp", lines: +11 -11 - crypto/evp/e_des.c (1.5.2.9), "Exp", lines: +5 -3 - crypto/evp/e_des3.c (1.8.2.8), "Exp", lines: +6 -6 - crypto/evp/evp.h (1.86.2.16), "Exp", lines: +17 -0 - crypto/evp/evp_enc.c (1.28.2.11), "Exp", lines: +15 -1 - crypto/evp/evp_err.c (1.23.2.4), "Exp", lines: +6 -1 - crypto/evp/evp_locl.h (1.7.2.7), "Exp", lines: +17 -2 - crypto/evp/m_dss.c (1.8.2.1), "Exp", lines: +1 -1 - crypto/evp/m_md2.c (1.9.2.1), "Exp", lines: +1 -0 - crypto/evp/m_md4.c (1.8.2.1), "Exp", lines: +1 -0 - crypto/evp/m_md5.c (1.9.2.1), "Exp", lines: +1 -0 - crypto/evp/m_mdc2.c (1.9.2.1), "Exp", lines: +1 -0 - crypto/evp/m_sha.c (1.8.2.2), "Exp", lines: +1 -0 - crypto/evp/m_sha1.c (1.8.2.1), "Exp", lines: +1 -1 - crypto/evp/names.c (1.7.2.1), "Exp", lines: +3 -0 - crypto/hmac/hmac.c (1.12.2.3), "Exp", lines: +7 -0 - crypto/hmac/hmac.h (1.14.2.2), "Exp", lines: +1 -0 - crypto/idea/i_skey.c (1.5.6.1), "Exp", lines: +13 -0 - crypto/idea/idea.h (1.10.2.1), "Exp", lines: +4 -0 - crypto/md2/md2.h (1.11.2.1), "Exp", lines: +3 -0 - crypto/md2/md2_dgst.c (1.13.2.4), "Exp", lines: +3 -1 - crypto/md4/md4.h (1.3.2.1), "Exp", lines: +3 -0 - crypto/md4/md4_dgst.c (1.2.2.2), "Exp", lines: +1 -1 - crypto/md5/md5.h (1.10.2.3), "Exp", lines: +3 -0 - crypto/md5/md5_dgst.c (1.16.2.2), "Exp", lines: +1 -1 - crypto/mdc2/mdc2.h (1.9.2.1), "Exp", lines: +3 -1 - crypto/mdc2/mdc2dgst.c (1.13.2.1), "Exp", lines: +3 -1 - crypto/rc2/rc2.h (1.10.2.1), "Exp", lines: +4 -1 - crypto/rc2/rc2_skey.c (1.4.6.1), "Exp", lines: +13 -0 - crypto/rc4/rc4.h (1.10.2.2), "Exp", lines: +3 -0 - crypto/rc4/rc4_skey.c (1.10.8.2), "Exp", lines: +2 -1 - crypto/rc5/rc5.h (1.5.2.1), "Exp", lines: +4 -1 - crypto/rc5/rc5_skey.c (1.4.6.1), "Exp", lines: +14 -0 - crypto/ripemd/ripemd.h (1.8.2.1), "Exp", lines: +3 -0 - crypto/ripemd/rmd_dgst.c (1.13.2.2), "Exp", lines: +2 -1 - crypto/sha/sha.h (1.11.2.2), "Exp", lines: +3 -0 - crypto/sha/sha_locl.h (1.16.2.3), "Exp", lines: +4 -0 - crypto/x509/x509_cmp.c (1.22.2.4), "Exp", lines: +7 -1 - crypto/x509/x509_vfy.c (1.56.2.13), "Exp", lines: +1 -1 - ssl/s3_clnt.c (1.53.2.18), "Exp", lines: +2 -0 - ssl/s3_enc.c (1.31.2.9), "Exp", lines: +3 -0 - ssl/s3_srvr.c (1.85.2.23), "Exp", lines: +2 -0 - ssl/t1_enc.c (1.27.2.9), "Exp", lines: +2 -0 - - FIPS algorithm blocking. - - Non FIPS algorithms are not normally allowed in FIPS mode. - - Any attempt to use them via high level functions will - return an error. - - The low level non-FIPS algorithm functions cannot return - errors so they produce assertion failures. HMAC also has to give an - assertion error because it (erroneously) can't return an error - either. - - There are exceptions (such as MD5 in TLS and non - cryptographic use of algorithms) and applications can override the - blocking and use non FIPS algorithms anyway. - - For low level functions the override is perfomed by - prefixing the algorithm initalization function with "private_" for - example private_MD5_Init(). - - For high level functions an override is performed by - setting a flag in the context. - -2005-01-27 02:49 steve - - Changed: - apps/dgst.c (1.23.2.14), "Exp", lines: +9 -5 - crypto/crypto.h (1.62.2.10), "Exp", lines: +3 -0 - crypto/evp/digest.c (1.21.2.8), "Exp", lines: +34 -0 - crypto/hmac/hmac.c (1.12.2.4), "Exp", lines: +9 -0 - - More FIPS algorithm blocking. - - Catch attempted use of non FIPS algorithms with HMAC. - - Give an assertion error for applications that ignore FIPS - digest errors. - - Make -non-fips-allow work with dgst and HMAC. - -2005-01-28 15:03 steve - - Changed: - apps/dgst.c (1.23.2.15), "Exp", lines: +2 -1 - apps/enc.c (1.35.2.13), "Exp", lines: +38 -4 - crypto/evp/e_rc4.c (1.11.2.2), "Exp", lines: +1 -0 - crypto/evp/evp.h (1.86.2.17), "Exp", lines: +3 -0 - crypto/evp/evp_enc.c (1.28.2.12), "Exp", lines: +60 -15 - crypto/evp/evp_locl.h (1.7.2.8), "Exp", lines: +1 -0 - test/testenc (1.3.8.2), "Exp", lines: +8 -8 - - Further FIPS algorithm blocking. - - Fixes to cipher blocking and enabling code. - - Add option -non-fips-allow to 'enc' and update testenc. - -2005-01-31 02:33 steve - - Changed: - ssl/s23_clnt.c (1.20.2.7), "Exp", lines: +16 -0 - ssl/s23_srvr.c (1.41.2.6), "Exp", lines: +9 -0 - ssl/s3_clnt.c (1.53.2.19), "Exp", lines: +0 -8 - ssl/s3_enc.c (1.31.2.10), "Exp", lines: +1 -0 - ssl/s3_srvr.c (1.85.2.24), "Exp", lines: +0 -8 - ssl/ssl.h (1.126.2.21), "Exp", lines: +1 -0 - ssl/ssl_cert.c (1.48.2.10), "Exp", lines: +0 -8 - ssl/ssl_err.c (1.41.2.4), "Exp", lines: +2 -1 - ssl/ssl_lib.c (1.110.2.13), "Exp", lines: +8 -9 - ssl/t1_enc.c (1.27.2.10), "Exp", lines: +0 -18 - - Only allow TLS is FIPS mode. - - Remove old FIPS_allow_md5() calls. - -2005-02-05 19:24 steve - - Changed: - apps/req.c (1.88.2.18), "Exp", lines: +8 -1 - apps/x509.c (1.67.2.20), "Exp", lines: +8 -1 - - In FIPS mode use SHA1 as default digest in x509 and req utilities. - -2005-03-15 10:46 appro - - Changed: - Makefile.org (1.154.2.96), "Exp", lines: +1 -1 - crypto/Makefile (1.1.4.6), "Exp", lines: +2 -3 - fips/Makefile (1.1.4.8), "Exp", lines: +4 -1 - - Real Bourne shell doesn't accept ! as in "if ! grep ..." Fix this - in crypto/Makefile and make Makefile.org and fips/Makefile more - discreet. - -2005-03-22 18:29 steve - - Changed: - fips/fingerprint.sha1 (1.1.2.12), "Exp", lines: +1 -1 - fips/fips.c (1.1.2.10), "Exp", lines: +1 -0 - - Fix memory leak. - -2005-03-27 05:36 steve - - Changed: - crypto/evp/e_null.c (1.9.2.1), "Exp", lines: +1 -1 - ssl/s3_lib.c (1.57.2.13), "Exp", lines: +3 -3 - - Allow 'null' cipher and appropriate Kerberos ciphersuites in FIPS - mode. - -2005-04-14 14:44 steve - - Changed: - fips/fipshashes.sha1 (1.1.2.1), "Exp", lines: +29 -0 - util/checkhash.pl (1.1.2.1), "Exp", lines: +181 -0 - - Perl script that checks or rebuilds FIPS hash files. This works on - both Unix and Windows. - - Merge all FIPS hash files into a single hash file - fips/fips.sha1 - -2005-04-15 05:27 steve - - Changed: - fips/Makefile (1.1.4.9), "Exp", lines: +1 -1 - fips/aes/Makefile (1.1.4.4), "Exp", lines: +1 -4 - fips/des/Makefile (1.1.4.6), "Exp", lines: +1 -4 - fips/dh/Makefile (1.1.2.5), "Exp", lines: +1 -4 - fips/dsa/Makefile (1.1.4.4), "Exp", lines: +1 -4 - fips/rand/Makefile (1.1.4.3), "Exp", lines: +1 -4 - fips/rsa/Makefile (1.1.4.5), "Exp", lines: +1 -4 - fips/sha1/Makefile (1.1.4.9), "Exp", lines: +1 -7 - - Update hash checking in makefiles to use new perl script. - -2005-04-17 06:37 steve - - Changed: - util/checkhash.pl (1.1.2.2), "Exp", lines: +163 -127 - - Modify checkhash.pl so it can be run standalone or included as a - funtion in another perl script. - -2005-04-17 16:00 appro - - Changed: - fips/sha1/Makefile (1.1.4.10), "Exp", lines: +9 -5 - - Bring back fips_standalone_sha1. - -2005-04-17 16:17 appro - - Deleted: - fips/sha1/asm/sx86-elf.s (1.1.4.4) - Changed: - Configure (1.314.2.114), "Exp", lines: +1 -1 - fips/fipshashes.sha1 (1.1.2.2), "Exp", lines: +1 -1 - fips/sha1/Makefile (1.1.4.11), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.13), "Exp", lines: +1 -1 - fips/sha1/asm/fips-sx86-elf.s (1.1.2.1), "Exp", lines: +1568 -0 - - Rename fips/sha1/sx86-elf.s to fips/sha1/fips-sx86-elf.s. - -2005-04-17 16:21 steve - - Changed: - util/checkhash.pl (1.1.2.3), "Exp", lines: +2 -0 - - Return 0 for successful hash check. - -2005-04-17 16:54 appro - - Changed: - Configure (1.314.2.116), "Exp", lines: +8 -1 - Makefile.org (1.154.2.99), "Exp", lines: +3 -2 - crypto/aes/aes_cbc.c (1.1.2.11), "Exp", lines: +2 -0 - fips/fipshashes.sha1 (1.1.2.4), "Exp", lines: +1 -0 - fips/aes/Makefile (1.1.4.5), "Exp", lines: +4 -2 - fips/aes/asm/fips-ax86-elf.s (1.1.2.1), "Exp", lines: +1822 -0 - - Throw in fips/aes/asm/fips-ax86-elf.s. - -2005-04-17 16:35 appro - - Changed: - Configure (1.314.2.115), "Exp", lines: +1 -1 - fips/fipshashes.sha1 (1.1.2.3), "Exp", lines: +1 -1 - fips/des/asm/fips-dx86-elf.s (1.1.4.2), "Exp", lines: +108 -98 - - Regenerate fips/des/asm/fips-dx86-elf.s with -fPIC flag. - -2005-04-17 17:26 appro - - Changed: - crypto/cryptlib.c (1.32.2.18), "Exp", lines: +6 -55 - crypto/crypto.h (1.62.2.11), "Exp", lines: +0 -3 - fips/fips.c (1.1.2.11), "Exp", lines: +62 -8 - fips/fips.h (1.1.2.7), "Exp", lines: +2 -3 - fips/fips_locl.h (1.1.4.3), "Exp", lines: +6 -3 - fips/fipshashes.sha1 (1.1.2.5), "Exp", lines: +4 -4 - fips/rand/fips_rand.c (1.1.2.10), "Exp", lines: +3 -1 - fips/rsa/fips_rsa_gen.c (1.1.4.4), "Exp", lines: +4 -2 - - Resolve minor binary compatibility issues in fips. - -2005-04-17 18:22 appro - - Changed: - fips/fipshashes.sha1 (1.1.2.6), "Exp", lines: +12 -12 - fips/des/fips_des_locl.h (1.1.2.4), "Exp", lines: +1 -1 - fips/des/fips_set_key.c (1.1.4.4), "Exp", lines: +2 -2 - fips/dh/fips_dh_key.c (1.1.2.3), "Exp", lines: +1 -1 - fips/dsa/fips_dsa_ossl.c (1.1.2.7), "Exp", lines: +1 -1 - fips/dsa/fips_dsa_selftest.c (1.1.4.2), "Exp", lines: +3 -3 - fips/rand/fips_rand.c (1.1.2.11), "Exp", lines: +2 -2 - fips/rand/fips_rand.h (1.1.2.5), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_eay.c (1.1.4.4), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_gen.c (1.1.4.5), "Exp", lines: +1 -1 - fips/rsa/fips_rsa_selftest.c (1.1.4.5), "Exp", lines: +11 -11 - fips/sha1/fips_sha1_selftest.c (1.1.4.2), "Exp", lines: +1 -1 - fips/sha1/fips_sha1dgst.c (1.1.2.5), "Exp", lines: +1 -1 - fips/sha1/standalone.sha1 (1.1.2.14), "Exp", lines: +2 -2 - - Minor fips const-ification. - -2005-04-18 07:02 steve - - Changed: - crypto/bf/bf_skey.c (1.6.2.2), "Exp", lines: +1 -0 - crypto/cast/c_skey.c (1.5.6.2), "Exp", lines: +1 -0 - crypto/idea/i_skey.c (1.5.6.2), "Exp", lines: +1 -0 - crypto/rc2/rc2_skey.c (1.4.6.2), "Exp", lines: +1 -0 - crypto/rc4/rc4_skey.c (1.10.8.3), "Exp", lines: +1 -0 - crypto/rc5/rc5_skey.c (1.4.6.2), "Exp", lines: +1 -0 - - Pick up definition of FIPS_mode() in fips.h to avoid warnings. - -2005-04-18 10:34 steve - - Deleted: - fips/fingerprint.sha1 (1.1.2.14) - fips/fips_check_sha1 (1.1.2.8) - fips/fips_make_sha1 (1.1.2.7) - fips/aes/fingerprint.sha1 (1.1.2.7) - fips/des/fingerprint.sha1 (1.1.2.6) - fips/dh/fingerprint.sha1 (1.1.2.4) - fips/dsa/fingerprint.sha1 (1.1.2.7) - fips/rand/fingerprint.sha1 (1.1.2.10) - fips/rsa/fingerprint.sha1 (1.1.4.7) - fips/sha1/fingerprint.sha1 (1.1.2.12) - Changed: - fips/sha1/Makefile (1.1.4.12), "Exp", lines: +1 -4 - - Remove obsolete fingerprint.sha1 files and associated scripts. - Delete test in fips/sha1/Makefile: the top level test checks the - same files. - -2005-04-19 09:11 appro - - Deleted: - fips/fipshashes.sha1 (1.1.2.7) - fips/sha1/standalone.sha1 (1.1.2.15) - Changed: - fips/fipshashes.c (1.1.2.1), "Exp", lines: +32 -0 - util/checkhash.pl (1.1.2.4), "Exp", lines: +7 -4 - - Maintain fingerprint hashes as C source. - -2005-04-19 09:17 appro - - Changed: - util/checkhash.pl (1.1.2.5), "Exp", lines: +1 -1 - - Complete the transition C-code hashes. - -2005-04-21 19:06 steve - - Changed: - apps/openssl.c (1.48.2.13), "Exp", lines: +0 -2 - fips/fips.c (1.1.2.12), "Exp", lines: +0 -27 - fips/fips.h (1.1.2.8), "Exp", lines: +0 -2 - fips/fipshashes.c (1.1.2.2), "Exp", lines: +2 -2 - - Remove defunct FIPS_allow_md5() and related functions. - -2005-04-22 06:15 appro - - Changed: - fips/fips.c (1.1.2.13), "Exp", lines: +3 -3 - fips/fips_err.h (1.1.4.4), "Exp", lines: +3 -3 - fips/fipshashes.c (1.1.2.4), "Exp", lines: +2 -2 - - Move some variables to .bss. - diff --git a/sys/src/ape/lib/openssl/doc/HOWTO/certificates.txt b/sys/src/ape/lib/openssl/doc/HOWTO/certificates.txt deleted file mode 100644 index a8a34c7ab..000000000 --- a/sys/src/ape/lib/openssl/doc/HOWTO/certificates.txt +++ /dev/null @@ -1,105 +0,0 @@ - - HOWTO certificates - -1. Introduction - -How you handle certificates depend a great deal on what your role is. -Your role can be one or several of: - - - User of some client software - - User of some server software - - Certificate authority - -This file is for users who wish to get a certificate of their own. -Certificate authorities should read ca.txt. - -In all the cases shown below, the standard configuration file, as -compiled into openssl, will be used. You may find it in /etc/, -/usr/local/ssl/ or somewhere else. The name is openssl.cnf, and -is better described in another HOWTO . If you want to -use a different configuration file, use the argument '-config {file}' -with the command shown below. - - -2. Relationship with keys - -Certificates are related to public key cryptography by containing a -public key. To be useful, there must be a corresponding private key -somewhere. With OpenSSL, public keys are easily derived from private -keys, so before you create a certificate or a certificate request, you -need to create a private key. - -Private keys are generated with 'openssl genrsa' if you want a RSA -private key, or 'openssl gendsa' if you want a DSA private key. -Further information on how to create private keys can be found in -another HOWTO . The rest of this text assumes you have -a private key in the file privkey.pem. - - -3. Creating a certificate request - -To create a certificate, you need to start with a certificate -request (or, as some certificate authorities like to put -it, "certificate signing request", since that's exactly what they do, -they sign it and give you the result back, thus making it authentic -according to their policies). A certificate request can then be sent -to a certificate authority to get it signed into a certificate, or if -you have your own certificate authority, you may sign it yourself, or -if you need a self-signed certificate (because you just want a test -certificate or because you are setting up your own CA). - -The certificate request is created like this: - - openssl req -new -key privkey.pem -out cert.csr - -Now, cert.csr can be sent to the certificate authority, if they can -handle files in PEM format. If not, use the extra argument '-outform' -followed by the keyword for the format to use (see another HOWTO -). In some cases, that isn't sufficient and you will -have to be more creative. - -When the certificate authority has then done the checks the need to -do (and probably gotten payment from you), they will hand over your -new certificate to you. - -Section 5 will tell you more on how to handle the certificate you -received. - - -4. Creating a self-signed test certificate - -If you don't want to deal with another certificate authority, or just -want to create a test certificate for yourself. This is similar to -creating a certificate request, but creates a certificate instead of -a certificate request. This is NOT the recommended way to create a -CA certificate, see ca.txt. - - openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 - - -5. What to do with the certificate - -If you created everything yourself, or if the certificate authority -was kind enough, your certificate is a raw DER thing in PEM format. -Your key most definitely is if you have followed the examples above. -However, some (most?) certificate authorities will encode them with -things like PKCS7 or PKCS12, or something else. Depending on your -applications, this may be perfectly OK, it all depends on what they -know how to decode. If not, There are a number of OpenSSL tools to -convert between some (most?) formats. - -So, depending on your application, you may have to convert your -certificate and your key to various formats, most often also putting -them together into one file. The ways to do this is described in -another HOWTO , I will just mention the simplest case. -In the case of a raw DER thing in PEM format, and assuming that's all -right for yor applications, simply concatenating the certificate and -the key into a new file and using that one should be enough. With -some applications, you don't even have to do that. - - -By now, you have your cetificate and your private key and can start -using the software that depend on it. - --- -Richard Levitte diff --git a/sys/src/ape/lib/openssl/doc/HOWTO/keys.txt b/sys/src/ape/lib/openssl/doc/HOWTO/keys.txt deleted file mode 100644 index 7ae2a3a11..000000000 --- a/sys/src/ape/lib/openssl/doc/HOWTO/keys.txt +++ /dev/null @@ -1,73 +0,0 @@ - - HOWTO keys - -1. Introduction - -Keys are the basis of public key algorithms and PKI. Keys usually -come in pairs, with one half being the public key and the other half -being the private key. With OpenSSL, the private key contains the -public key information as well, so a public key doesn't need to be -generated separately. - -Public keys come in several flavors, using different cryptographic -algorithms. The most popular ones associated with certificates are -RSA and DSA, and this HOWTO will show how to generate each of them. - - -2. To generate a RSA key - -A RSA key can be used both for encryption and for signing. - -Generating a key for the RSA algorithm is quite easy, all you have to -do is the following: - - openssl genrsa -des3 -out privkey.pem 2048 - -With this variant, you will be prompted for a protecting password. If -you don't want your key to be protected by a password, remove the flag -'-des3' from the command line above. - - NOTE: if you intend to use the key together with a server - certificate, it may be a good thing to avoid protecting it - with a password, since that would mean someone would have to - type in the password every time the server needs to access - the key. - -The number 2048 is the size of the key, in bits. Today, 2048 or -higher is recommended for RSA keys, as fewer amount of bits is -consider insecure or to be insecure pretty soon. - - -3. To generate a DSA key - -A DSA key can be used for signing only. This is important to keep -in mind to know what kind of purposes a certificate request with a -DSA key can really be used for. - -Generating a key for the DSA algorithm is a two-step process. First, -you have to generate parameters from which to generate the key: - - openssl dsaparam -out dsaparam.pem 2048 - -The number 2048 is the size of the key, in bits. Today, 2048 or -higher is recommended for DSA keys, as fewer amount of bits is -consider insecure or to be insecure pretty soon. - -When that is done, you can generate a key using the parameters in -question (actually, several keys can be generated from the same -parameters): - - openssl gendsa -des3 -out privkey.pem dsaparam.pem - -With this variant, you will be prompted for a protecting password. If -you don't want your key to be protected by a password, remove the flag -'-des3' from the command line above. - - NOTE: if you intend to use the key together with a server - certificate, it may be a good thing to avoid protecting it - with a password, since that would mean someone would have to - type in the password every time the server needs to access - the key. - --- -Richard Levitte diff --git a/sys/src/ape/lib/openssl/doc/HOWTO/proxy_certificates.txt b/sys/src/ape/lib/openssl/doc/HOWTO/proxy_certificates.txt deleted file mode 100644 index 3d36b02f6..000000000 --- a/sys/src/ape/lib/openssl/doc/HOWTO/proxy_certificates.txt +++ /dev/null @@ -1,322 +0,0 @@ - - HOWTO proxy certificates - -0. WARNING - -NONE OF THE CODE PRESENTED HERE HAVE BEEN CHECKED! They are just an -example to show you how things can be done. There may be typos or -type conflicts, and you will have to resolve them. - -1. Introduction - -Proxy certificates are defined in RFC 3820. They are really usual -certificates with the mandatory extension proxyCertInfo. - -Proxy certificates are issued by an End Entity (typically a user), -either directly with the EE certificate as issuing certificate, or by -extension through an already issued proxy certificate.. They are used -to extend rights to some other entity (a computer process, typically, -or sometimes to the user itself), so it can perform operations in the -name of the owner of the EE certificate. - -See http://www.ietf.org/rfc/rfc3820.txt for more information. - - -2. A warning about proxy certificates - -Noone seems to have tested proxy certificates with security in mind. -Basically, to this date, it seems that proxy certificates have only -been used in a world that's highly aware of them. What would happen -if an unsuspecting application is to validate a chain of certificates -that contains proxy certificates? It would usually consider the leaf -to be the certificate to check for authorisation data, and since proxy -certificates are controlled by the EE certificate owner alone, it's -would be normal to consider what the EE certificate owner could do -with them. - -subjectAltName and issuerAltName are forbidden in proxy certificates, -and this is enforced in OpenSSL. The subject must be the same as the -issuer, with one commonName added on. - -Possible threats are, as far as has been imagined so far: - - - impersonation through commonName (think server certificates). - - use of additional extensions, possibly non-standard ones used in - certain environments, that would grant extra or different - authorisation rights. - -For this reason, OpenSSL requires that the use of proxy certificates -be explicitely allowed. Currently, this can be done using the -following methods: - - - if the application calls X509_verify_cert() itself, it can do the - following prior to that call (ctx is the pointer passed in the call - to X509_verify_cert()): - - X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS); - - - in all other cases, proxy certificate validation can be enabled - before starting the application by setting the envirnoment variable - OPENSSL_ALLOW_PROXY with some non-empty value. - -There are thoughts to allow proxy certificates with a line in the -default openssl.cnf, but that's still in the future. - - -3. How to create proxy cerificates - -It's quite easy to create proxy certificates, by taking advantage of -the lack of checks of the 'openssl x509' application (*ahem*). But -first, you need to create a configuration section that contains a -definition of the proxyCertInfo extension, a little like this: - - [ v3_proxy ] - # A proxy certificate MUST NEVER be a CA certificate. - basicConstraints=CA:FALSE - - # Usual authority key ID - authorityKeyIdentifier=keyid,issuer:always - - # Now, for the extension that marks this certificate as a proxy one - proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:1,policy:text:AB - -It's also possible to give the proxy extension in a separate section: - - proxyCertInfo=critical,@proxy_ext - - [ proxy_ext ] - language=id-ppl-anyLanguage - pathlen=0 - policy=text:BC - -The policy value has a specific syntax, {syntag}:{string}, where the -syntag determines what will be done with the string. The recognised -syntags are as follows: - - text indicates that the string is simply the bytes, not - encoded in any kind of way: - - policy=text:räksmörgås - - Previous versions of this design had a specific tag - for UTF-8 text. However, since the bytes are copied - as-is anyway, there's no need for it. Instead, use - the text: tag, like this: - - policy=text:räksmörgÃ¥s - - hex indicates the string is encoded in hex, with colons - between each byte (every second hex digit): - - policy=hex:72:E4:6B:73:6D:F6:72:67:E5:73 - - Previous versions of this design had a tag to insert a - complete DER blob. However, the only legal use for - this would be to surround the bytes that would go with - the hex: tag with what's needed to construct a correct - OCTET STRING. Since hex: does that, the DER tag felt - superfluous, and was therefore removed. - - file indicates that the text of the policy should really be - taken from a file. The string is then really a file - name. This is useful for policies that are large - (more than a few of lines) XML documents, for example. - -The 'policy' setting can be split up in multiple lines like this: - - 0.policy=This is - 1.polisy= a multi- - 2.policy=line policy. - -NOTE: the proxy policy value is the part that determines the rights -granted to the process using the proxy certificate. The value is -completely dependent on the application reading and interpretting it! - -Now that you have created an extension section for your proxy -certificate, you can now easily create a proxy certificate like this: - - openssl req -new -config openssl.cnf \ - -out proxy.req -keyout proxy.key - openssl x509 -req -CAcreateserial -in proxy.req -days 7 \ - -out proxy.crt -CA user.crt -CAkey user.key \ - -extfile openssl.cnf -extensions v3_proxy - -It's just as easy to create a proxy certificate using another proxy -certificate as issuer (note that I'm using a different configuration -section for it): - - openssl req -new -config openssl.cnf \ - -out proxy2.req -keyout proxy2.key - openssl x509 -req -CAcreateserial -in proxy2.req -days 7 \ - -out proxy2.crt -CA proxy.crt -CAkey proxy.key \ - -extfile openssl.cnf -extensions v3_proxy2 - - -4. How to have your application interpret the policy? - -The basic way to interpret proxy policies is to prepare some default -rights, then do a check of the proxy certificate against the a chain -of proxy certificates, user certificate and CA certificates, and see -what rights came out by the end. Sounds easy, huh? It almost is. - -The slightly complicated part is how to pass data between your -application and the certificate validation procedure. - -You need the following ingredients: - - - a callback routing that will be called for every certificate that's - validated. It will be called several times for each certificates, - so you must be attentive to when it's a good time to do the proxy - policy interpretation and check, as well as to fill in the defaults - when the EE certificate is checked. - - - a structure of data that's shared between your application code and - the callback. - - - a wrapper function that sets it all up. - - - an ex_data index function that creates an index into the generic - ex_data store that's attached to an X509 validation context. - -This is some cookbook code for you to fill in: - - /* In this example, I will use a view of granted rights as a bit - array, one bit for each possible right. */ - typedef struct your_rights { - unsigned char rights[total_rights / 8]; - } YOUR_RIGHTS; - - /* The following procedure will create an index for the ex_data - store in the X509 validation context the first time it's called. - Subsequent calls will return the same index. */ - static int get_proxy_auth_ex_data_idx(void) - { - static volatile int idx = -1; - if (idx < 0) - { - CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); - if (idx < 0) - { - idx = X509_STORE_CTX_get_ex_new_index(0, - "for verify callback", - NULL,NULL,NULL); - } - CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE); - } - return idx; - } - - /* Callback to be given to the X509 validation procedure. */ - static int verify_callback(int ok, X509_STORE_CTX *ctx) - { - if (ok == 1) /* It's REALLY important you keep the proxy policy - check within this secion. It's important to know - that when ok is 1, the certificates are checked - from top to bottom. You get the CA root first, - followed by the possible chain of intermediate - CAs, followed by the EE certificate, followed by - the possible proxy certificates. */ - { - X509 *xs = ctx->current_cert; - - if (xs->ex_flags & EXFLAG_PROXY) - { - YOUR_RIGHTS *rights = - (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx, - get_proxy_auth_ex_data_idx()); - PROXY_CERT_INFO_EXTENSION *pci = - X509_get_ext_d2i(xs, NID_proxyCertInfo, NULL, NULL); - - switch (OBJ_obj2nid(pci->proxyPolicy->policyLanguage)) - { - case NID_Independent: - /* Do whatever you need to grant explicit rights to - this particular proxy certificate, usually by - pulling them from some database. If there are none - to be found, clear all rights (making this and any - subsequent proxy certificate void of any rights). - */ - memset(rights->rights, 0, sizeof(rights->rights)); - break; - case NID_id_ppl_inheritAll: - /* This is basically a NOP, we simply let the current - rights stand as they are. */ - break; - default: - /* This is usually the most complex section of code. - You really do whatever you want as long as you - follow RFC 3820. In the example we use here, the - simplest thing to do is to build another, temporary - bit array and fill it with the rights granted by - the current proxy certificate, then use it as a - mask on the accumulated rights bit array, and - voilà, you now have a new accumulated rights bit - array. */ - { - int i; - YOUR_RIGHTS tmp_rights; - memset(tmp_rights.rights, 0, sizeof(tmp_rights.rights)); - - /* process_rights() is supposed to be a procedure - that takes a string and it's length, interprets - it and sets the bits in the YOUR_RIGHTS pointed - at by the third argument. */ - process_rights((char *) pci->proxyPolicy->policy->data, - pci->proxyPolicy->policy->length, - &tmp_rights); - - for(i = 0; i < total_rights / 8; i++) - rights->rights[i] &= tmp_rights.rights[i]; - } - break; - } - PROXY_CERT_INFO_EXTENSION_free(pci); - } - else if (!(xs->ex_flags & EXFLAG_CA)) - { - /* We have a EE certificate, let's use it to set default! - */ - YOUR_RIGHTS *rights = - (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx, - get_proxy_auth_ex_data_idx()); - - /* The following procedure finds out what rights the owner - of the current certificate has, and sets them in the - YOUR_RIGHTS structure pointed at by the second - argument. */ - set_default_rights(xs, rights); - } - } - return ok; - } - - static int my_X509_verify_cert(X509_STORE_CTX *ctx, - YOUR_RIGHTS *needed_rights) - { - int i; - int (*save_verify_cb)(int ok,X509_STORE_CTX *ctx) = ctx->verify_cb; - YOUR_RIGHTS rights; - - X509_STORE_CTX_set_verify_cb(ctx, verify_callback); - X509_STORE_CTX_set_ex_data(ctx, get_proxy_auth_ex_data_idx(), &rights); - X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS); - ok = X509_verify_cert(ctx); - - if (ok == 1) - { - ok = check_needed_rights(rights, needed_rights); - } - - X509_STORE_CTX_set_verify_cb(ctx, save_verify_cb); - - return ok; - } - -If you use SSL or TLS, you can easily set up a callback to have the -certificates checked properly, using the code above: - - SSL_CTX_set_cert_verify_callback(s_ctx, my_X509_verify_cert, &needed_rights); - - --- -Richard Levitte diff --git a/sys/src/ape/lib/openssl/doc/README b/sys/src/ape/lib/openssl/doc/README deleted file mode 100644 index 6ecc14d99..000000000 --- a/sys/src/ape/lib/openssl/doc/README +++ /dev/null @@ -1,12 +0,0 @@ - - apps/openssl.pod .... Documentation of OpenSSL `openssl' command - crypto/crypto.pod ... Documentation of OpenSSL crypto.h+libcrypto.a - ssl/ssl.pod ......... Documentation of OpenSSL ssl.h+libssl.a - openssl.txt ......... Assembled documentation files for OpenSSL [not final] - ssleay.txt .......... Assembled documentation of ancestor SSLeay [obsolete] - standards.txt ....... Assembled pointers to standards, RFCs or internet drafts - that are related to OpenSSL. - - An archive of HTML documents for the SSLeay library is available from - http://www.columbia.edu/~ariel/ssleay/ - diff --git a/sys/src/ape/lib/openssl/doc/apps/CA.pl.pod b/sys/src/ape/lib/openssl/doc/apps/CA.pl.pod deleted file mode 100644 index ed69952f3..000000000 --- a/sys/src/ape/lib/openssl/doc/apps/CA.pl.pod +++ /dev/null @@ -1,179 +0,0 @@ - -=pod - -=head1 NAME - -CA.pl - friendlier interface for OpenSSL certificate programs - -=head1 SYNOPSIS - -B -[B<-?>] -[B<-h>] -[B<-help>] -[B<-newcert>] -[B<-newreq>] -[B<-newreq-nodes>] -[B<-newca>] -[B<-xsign>] -[B<-sign>] -[B<-signreq>] -[B<-signcert>] -[B<-verify>] -[B] - -=head1 DESCRIPTION - -The B script is a perl script that supplies the relevant command line -arguments to the B command for some common certificate operations. -It is intended to simplify the process of certificate creation and management -by the use of some simple options. - -=head1 COMMAND OPTIONS - -=over 4 - -=item B, B<-h>, B<-help> - -prints a usage message. - -=item B<-newcert> - -creates a new self signed certificate. The private key and certificate are -written to the file "newreq.pem". - -=item B<-newreq> - -creates a new certificate request. The private key and request are -written to the file "newreq.pem". - -=item B<-newreq-nodes> - -is like B<-newreq> except that the private key will not be encrypted. - -=item B<-newca> - -creates a new CA hierarchy for use with the B program (or the B<-signcert> -and B<-xsign> options). The user is prompted to enter the filename of the CA -certificates (which should also contain the private key) or by hitting ENTER -details of the CA will be prompted for. The relevant files and directories -are created in a directory called "demoCA" in the current directory. - -=item B<-pkcs12> - -create a PKCS#12 file containing the user certificate, private key and CA -certificate. It expects the user certificate and private key to be in the -file "newcert.pem" and the CA certificate to be in the file demoCA/cacert.pem, -it creates a file "newcert.p12". This command can thus be called after the -B<-sign> option. The PKCS#12 file can be imported directly into a browser. -If there is an additional argument on the command line it will be used as the -"friendly name" for the certificate (which is typically displayed in the browser -list box), otherwise the name "My Certificate" is used. - -=item B<-sign>, B<-signreq>, B<-xsign> - -calls the B program to sign a certificate request. It expects the request -to be in the file "newreq.pem". The new certificate is written to the file -"newcert.pem" except in the case of the B<-xsign> option when it is written -to standard output. - - -=item B<-signCA> - -this option is the same as the B<-signreq> option except it uses the configuration -file section B and so makes the signed request a valid CA certificate. This -is useful when creating intermediate CA from a root CA. - -=item B<-signcert> - -this option is the same as B<-sign> except it expects a self signed certificate -to be present in the file "newreq.pem". - -=item B<-verify> - -verifies certificates against the CA certificate for "demoCA". If no certificates -are specified on the command line it tries to verify the file "newcert.pem". - -=item B - -one or more optional certificate file names for use with the B<-verify> command. - -=back - -=head1 EXAMPLES - -Create a CA hierarchy: - - CA.pl -newca - -Complete certificate creation example: create a CA, create a request, sign -the request and finally create a PKCS#12 file containing it. - - CA.pl -newca - CA.pl -newreq - CA.pl -signreq - CA.pl -pkcs12 "My Test Certificate" - -=head1 DSA CERTIFICATES - -Although the B creates RSA CAs and requests it is still possible to -use it with DSA certificates and requests using the L command -directly. The following example shows the steps that would typically be taken. - -Create some DSA parameters: - - openssl dsaparam -out dsap.pem 1024 - -Create a DSA CA certificate and private key: - - openssl req -x509 -newkey dsa:dsap.pem -keyout cacert.pem -out cacert.pem - -Create the CA directories and files: - - CA.pl -newca - -enter cacert.pem when prompted for the CA file name. - -Create a DSA certificate request and private key (a different set of parameters -can optionally be created first): - - openssl req -out newreq.pem -newkey dsa:dsap.pem - -Sign the request: - - CA.pl -signreq - -=head1 NOTES - -Most of the filenames mentioned can be modified by editing the B script. - -If the demoCA directory already exists then the B<-newca> command will not -overwrite it and will do nothing. This can happen if a previous call using -the B<-newca> option terminated abnormally. To get the correct behaviour -delete the demoCA directory if it already exists. - -Under some environments it may not be possible to run the B script -directly (for example Win32) and the default configuration file location may -be wrong. In this case the command: - - perl -S CA.pl - -can be used and the B environment variable changed to point to -the correct path of the configuration file "openssl.cnf". - -The script is intended as a simple front end for the B program for use -by a beginner. Its behaviour isn't always what is wanted. For more control over the -behaviour of the certificate commands call the B command directly. - -=head1 ENVIRONMENT VARIABLES - -The variable B if defined allows an alternative configuration -file location to be specified, it should contain the full path to the -configuration file, not just its directory. - -=head1 SEE ALSO - -L, L, L, L, -L - -=cut diff --git a/sys/src/ape/lib/openssl/doc/apps/asn1parse.pod b/sys/src/ape/lib/openssl/doc/apps/asn1parse.pod deleted file mode 100644 index 542d96906..000000000 --- a/sys/src/ape/lib/openssl/doc/apps/asn1parse.pod +++ /dev/null @@ -1,171 +0,0 @@ -=pod - -=head1 NAME - -asn1parse - ASN.1 parsing tool - -=head1 SYNOPSIS - -B B -[B<-inform PEM|DER>] -[B<-in filename>] -[B<-out filename>] -[B<-noout>] -[B<-offset number>] -[B<-length number>] -[B<-i>] -[B<-oid filename>] -[B<-strparse offset>] -[B<-genstr string>] -[B<-genconf file>] - -=head1 DESCRIPTION - -The B command is a diagnostic utility that can parse ASN.1 -structures. It can also be used to extract data from ASN.1 formatted data. - -=head1 OPTIONS - -=over 4 - -=item B<-inform> B - -the input format. B is binary format and B (the default) is base64 -encoded. - -=item B<-in filename> - -the input file, default is standard input - -=item B<-out filename> - -output file to place the DER encoded data into. If this -option is not present then no data will be output. This is most useful when -combined with the B<-strparse> option. - -=item B<-noout> - -don't output the parsed version of the input file. - -=item B<-offset number> - -starting offset to begin parsing, default is start of file. - -=item B<-length number> - -number of bytes to parse, default is until end of file. - -=item B<-i> - -indents the output according to the "depth" of the structures. - -=item B<-oid filename> - -a file containing additional OBJECT IDENTIFIERs (OIDs). The format of this -file is described in the NOTES section below. - -=item B<-strparse offset> - -parse the contents octets of the ASN.1 object starting at B. This -option can be used multiple times to "drill down" into a nested structure. - -=item B<-genstr string>, B<-genconf file> - -generate encoded data based on B, B or both using -ASN1_generate_nconf() format. If B only is present then the string -is obtained from the default section using the name B. The encoded -data is passed through the ASN1 parser and printed out as though it came -from a file, the contents can thus be examined and written to a file -using the B option. - -=back - -=head2 OUTPUT - -The output will typically contain lines like this: - - 0:d=0 hl=4 l= 681 cons: SEQUENCE - -..... - - 229:d=3 hl=3 l= 141 prim: BIT STRING - 373:d=2 hl=3 l= 162 cons: cont [ 3 ] - 376:d=3 hl=3 l= 159 cons: SEQUENCE - 379:d=4 hl=2 l= 29 cons: SEQUENCE - 381:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Subject Key Identifier - 386:d=5 hl=2 l= 22 prim: OCTET STRING - 410:d=4 hl=2 l= 112 cons: SEQUENCE - 412:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier - 417:d=5 hl=2 l= 105 prim: OCTET STRING - 524:d=4 hl=2 l= 12 cons: SEQUENCE - -..... - -This example is part of a self signed certificate. Each line starts with the -offset in decimal. B specifies the current depth. The depth is increased -within the scope of any SET or SEQUENCE. B gives the header length -(tag and length octets) of the current type. B gives the length of -the contents octets. - -The B<-i> option can be used to make the output more readable. - -Some knowledge of the ASN.1 structure is needed to interpret the output. - -In this example the BIT STRING at offset 229 is the certificate public key. -The contents octets of this will contain the public key information. This can -be examined using the option B<-strparse 229> to yield: - - 0:d=0 hl=3 l= 137 cons: SEQUENCE - 3:d=1 hl=3 l= 129 prim: INTEGER :E5D21E1F5C8D208EA7A2166C7FAF9F6BDF2059669C60876DDB70840F1A5AAFA59699FE471F379F1DD6A487E7D5409AB6A88D4A9746E24B91D8CF55DB3521015460C8EDE44EE8A4189F7A7BE77D6CD3A9AF2696F486855CF58BF0EDF2B4068058C7A947F52548DDF7E15E96B385F86422BEA9064A3EE9E1158A56E4A6F47E5897 - 135:d=1 hl=2 l= 3 prim: INTEGER :010001 - -=head1 NOTES - -If an OID is not part of OpenSSL's internal table it will be represented in -numerical form (for example 1.2.3.4). The file passed to the B<-oid> option -allows additional OIDs to be included. Each line consists of three columns, -the first column is the OID in numerical format and should be followed by white -space. The second column is the "short name" which is a single word followed -by white space. The final column is the rest of the line and is the -"long name". B displays the long name. Example: - -C<1.2.3.4 shortName A long name> - -=head1 EXAMPLES - -Parse a file: - - openssl asn1parse -in file.pem - -Parse a DER file: - - openssl asn1parse -inform DER -in file.der - -Generate a simple UTF8String: - - openssl asn1parse -genstr 'UTF8:Hello World' - -Generate and write out a UTF8String, don't print parsed output: - - openssl asn1parse -genstr 'UTF8:Hello World' -noout -out utf8.der - -Generate using a config file: - - openssl asn1parse -genconf asn1.cnf -noout -out asn1.der - -Example config file: - - asn1=SEQUENCE:seq_sect - - [seq_sect] - - field1=BOOL:TRUE - field2=EXP:0, UTF8:some random string - - -=head1 BUGS - -There should be options to change the format of output lines. The output of some -ASN.1 types is not well handled (if at all). - -=cut diff --git a/sys/src/ape/lib/openssl/doc/apps/ca.pod b/sys/src/ape/lib/openssl/doc/apps/ca.pod deleted file mode 100644 index 5618c2dc9..000000000 --- a/sys/src/ape/lib/openssl/doc/apps/ca.pod +++ /dev/null @@ -1,671 +0,0 @@ - -=pod - -=head1 NAME - -ca - sample minimal CA application - -=head1 SYNOPSIS - -B B -[B<-verbose>] -[B<-config filename>] -[B<-name section>] -[B<-gencrl>] -[B<-revoke file>] -[B<-crl_reason reason>] -[B<-crl_hold instruction>] -[B<-crl_compromise time>] -[B<-crl_CA_compromise time>] -[B<-crldays days>] -[B<-crlhours hours>] -[B<-crlexts section>] -[B<-startdate date>] -[B<-enddate date>] -[B<-days arg>] -[B<-md arg>] -[B<-policy arg>] -[B<-keyfile arg>] -[B<-key arg>] -[B<-passin arg>] -[B<-cert file>] -[B<-selfsign>] -[B<-in file>] -[B<-out file>] -[B<-notext>] -[B<-outdir dir>] -[B<-infiles>] -[B<-spkac file>] -[B<-ss_cert file>] -[B<-preserveDN>] -[B<-noemailDN>] -[B<-batch>] -[B<-msie_hack>] -[B<-extensions section>] -[B<-extfile section>] -[B<-engine id>] -[B<-subj arg>] -[B<-utf8>] -[B<-multivalue-rdn>] - -=head1 DESCRIPTION - -The B command is a minimal CA application. It can be used -to sign certificate requests in a variety of forms and generate -CRLs it also maintains a text database of issued certificates -and their status. - -The options descriptions will be divided into each purpose. - -=head1 CA OPTIONS - -=over 4 - -=item B<-config filename> - -specifies the configuration file to use. - -=item B<-name section> - -specifies the configuration file section to use (overrides -B in the B section). - -=item B<-in filename> - -an input filename containing a single certificate request to be -signed by the CA. - -=item B<-ss_cert filename> - -a single self signed certificate to be signed by the CA. - -=item B<-spkac filename> - -a file containing a single Netscape signed public key and challenge -and additional field values to be signed by the CA. See the B -section for information on the required format. - -=item B<-infiles> - -if present this should be the last option, all subsequent arguments -are assumed to the the names of files containing certificate requests. - -=item B<-out filename> - -the output file to output certificates to. The default is standard -output. The certificate details will also be printed out to this -file. - -=item B<-outdir directory> - -the directory to output certificates to. The certificate will be -written to a filename consisting of the serial number in hex with -".pem" appended. - -=item B<-cert> - -the CA certificate file. - -=item B<-keyfile filename> - -the private key to sign requests with. - -=item B<-key password> - -the password used to encrypt the private key. Since on some -systems the command line arguments are visible (e.g. Unix with -the 'ps' utility) this option should be used with caution. - -=item B<-selfsign> - -indicates the issued certificates are to be signed with the key -the certificate requests were signed with (given with B<-keyfile>). -Cerificate requests signed with a different key are ignored. If -B<-spkac>, B<-ss_cert> or B<-gencrl> are given, B<-selfsign> is -ignored. - -A consequence of using B<-selfsign> is that the self-signed -certificate appears among the entries in the certificate database -(see the configuration option B), and uses the same -serial number counter as all other certificates sign with the -self-signed certificate. - -=item B<-passin arg> - -the key password source. For more information about the format of B -see the B section in L. - -=item B<-verbose> - -this prints extra details about the operations being performed. - -=item B<-notext> - -don't output the text form of a certificate to the output file. - -=item B<-startdate date> - -this allows the start date to be explicitly set. The format of the -date is YYMMDDHHMMSSZ (the same as an ASN1 UTCTime structure). - -=item B<-enddate date> - -this allows the expiry date to be explicitly set. The format of the -date is YYMMDDHHMMSSZ (the same as an ASN1 UTCTime structure). - -=item B<-days arg> - -the number of days to certify the certificate for. - -=item B<-md alg> - -the message digest to use. Possible values include md5, sha1 and mdc2. -This option also applies to CRLs. - -=item B<-policy arg> - -this option defines the CA "policy" to use. This is a section in -the configuration file which decides which fields should be mandatory -or match the CA certificate. Check out the B section -for more information. - -=item B<-msie_hack> - -this is a legacy option to make B work with very old versions of -the IE certificate enrollment control "certenr3". It used UniversalStrings -for almost everything. Since the old control has various security bugs -its use is strongly discouraged. The newer control "Xenroll" does not -need this option. - -=item B<-preserveDN> - -Normally the DN order of a certificate is the same as the order of the -fields in the relevant policy section. When this option is set the order -is the same as the request. This is largely for compatibility with the -older IE enrollment control which would only accept certificates if their -DNs match the order of the request. This is not needed for Xenroll. - -=item B<-noemailDN> - -The DN of a certificate can contain the EMAIL field if present in the -request DN, however it is good policy just having the e-mail set into -the altName extension of the certificate. When this option is set the -EMAIL field is removed from the certificate' subject and set only in -the, eventually present, extensions. The B keyword can be -used in the configuration file to enable this behaviour. - -=item B<-batch> - -this sets the batch mode. In this mode no questions will be asked -and all certificates will be certified automatically. - -=item B<-extensions section> - -the section of the configuration file containing certificate extensions -to be added when a certificate is issued (defaults to B -unless the B<-extfile> option is used). If no extension section is -present then, a V1 certificate is created. If the extension section -is present (even if it is empty), then a V3 certificate is created. - -=item B<-extfile file> - -an additional configuration file to read certificate extensions from -(using the default section unless the B<-extensions> option is also -used). - -=item B<-engine id> - -specifying an engine (by it's unique B string) will cause B -to attempt to obtain a functional reference to the specified engine, -thus initialising it if needed. The engine will then be set as the default -for all available algorithms. - -=item B<-subj arg> - -supersedes subject name given in the request. -The arg must be formatted as I, -characters may be escaped by \ (backslash), no spaces are skipped. - -=item B<-utf8> - -this option causes field values to be interpreted as UTF8 strings, by -default they are interpreted as ASCII. This means that the field -values, whether prompted from a terminal or obtained from a -configuration file, must be valid UTF8 strings. - -=item B<-multivalue-rdn> - -this option causes the -subj argument to be interpretedt with full -support for multivalued RDNs. Example: - -I - -If -multi-rdn is not used then the UID value is I<123456+CN=John Doe>. - -=back - -=head1 CRL OPTIONS - -=over 4 - -=item B<-gencrl> - -this option generates a CRL based on information in the index file. - -=item B<-crldays num> - -the number of days before the next CRL is due. That is the days from -now to place in the CRL nextUpdate field. - -=item B<-crlhours num> - -the number of hours before the next CRL is due. - -=item B<-revoke filename> - -a filename containing a certificate to revoke. - -=item B<-crl_reason reason> - -revocation reason, where B is one of: B, B, -B, B, B, B, -B or B. The matching of B is case -insensitive. Setting any revocation reason will make the CRL v2. - -In practive B is not particularly useful because it is only used -in delta CRLs which are not currently implemented. - -=item B<-crl_hold instruction> - -This sets the CRL revocation reason code to B and the hold -instruction to B which must be an OID. Although any OID can be -used only B (the use of which is discouraged by RFC2459) -B or B will normally be used. - -=item B<-crl_compromise time> - -This sets the revocation reason to B and the compromise time to -B