PageRenderTime 583ms CodeModel.GetById 202ms app.highlight 205ms RepoModel.GetById 168ms app.codeStats 1ms

/Lib/plat-mac/lib-scriptpackages/SystemEvents/__init__.py

http://unladen-swallow.googlecode.com/
Python | 144 lines | 119 code | 16 blank | 9 comment | 4 complexity | d0b0c8a2a1737b391cdc76b155c923ef MD5 | raw file
  1"""
  2Package generated from /System/Library/CoreServices/System Events.app
  3"""
  4
  5from warnings import warnpy3k
  6warnpy3k("In 3.x, the SystemEvents package is removed.", stacklevel=2)
  7
  8import aetools
  9Error = aetools.Error
 10import Standard_Suite
 11import Text_Suite
 12import Disk_Folder_File_Suite
 13import Folder_Actions_Suite
 14import Login_Items_Suite
 15import Power_Suite
 16import Processes_Suite
 17import System_Events_Suite
 18
 19
 20_code_to_module = {
 21    '????' : Standard_Suite,
 22    '????' : Text_Suite,
 23    'cdis' : Disk_Folder_File_Suite,
 24    'faco' : Folder_Actions_Suite,
 25    'logi' : Login_Items_Suite,
 26    'powr' : Power_Suite,
 27    'prcs' : Processes_Suite,
 28    'sevs' : System_Events_Suite,
 29}
 30
 31
 32
 33_code_to_fullname = {
 34    '????' : ('SystemEvents.Standard_Suite', 'Standard_Suite'),
 35    '????' : ('SystemEvents.Text_Suite', 'Text_Suite'),
 36    'cdis' : ('SystemEvents.Disk_Folder_File_Suite', 'Disk_Folder_File_Suite'),
 37    'faco' : ('SystemEvents.Folder_Actions_Suite', 'Folder_Actions_Suite'),
 38    'logi' : ('SystemEvents.Login_Items_Suite', 'Login_Items_Suite'),
 39    'powr' : ('SystemEvents.Power_Suite', 'Power_Suite'),
 40    'prcs' : ('SystemEvents.Processes_Suite', 'Processes_Suite'),
 41    'sevs' : ('SystemEvents.System_Events_Suite', 'System_Events_Suite'),
 42}
 43
 44from Standard_Suite import *
 45from Text_Suite import *
 46from Disk_Folder_File_Suite import *
 47from Folder_Actions_Suite import *
 48from Login_Items_Suite import *
 49from Power_Suite import *
 50from Processes_Suite import *
 51from System_Events_Suite import *
 52
 53def getbaseclasses(v):
 54    if not getattr(v, '_propdict', None):
 55        v._propdict = {}
 56        v._elemdict = {}
 57        for superclassname in getattr(v, '_superclassnames', []):
 58            superclass = eval(superclassname)
 59            getbaseclasses(superclass)
 60            v._propdict.update(getattr(superclass, '_propdict', {}))
 61            v._elemdict.update(getattr(superclass, '_elemdict', {}))
 62        v._propdict.update(getattr(v, '_privpropdict', {}))
 63        v._elemdict.update(getattr(v, '_privelemdict', {}))
 64
 65import StdSuites
 66
 67#
 68# Set property and element dictionaries now that all classes have been defined
 69#
 70getbaseclasses(login_item)
 71getbaseclasses(color)
 72getbaseclasses(window)
 73getbaseclasses(application)
 74getbaseclasses(item)
 75getbaseclasses(document)
 76getbaseclasses(character)
 77getbaseclasses(attachment)
 78getbaseclasses(paragraph)
 79getbaseclasses(word)
 80getbaseclasses(attribute_run)
 81getbaseclasses(text)
 82getbaseclasses(file)
 83getbaseclasses(application)
 84getbaseclasses(item)
 85getbaseclasses(folder)
 86getbaseclasses(disk)
 87getbaseclasses(script)
 88getbaseclasses(application)
 89getbaseclasses(folder_action)
 90getbaseclasses(application)
 91getbaseclasses(application)
 92getbaseclasses(process)
 93getbaseclasses(application_process)
 94getbaseclasses(desk_accessory_process)
 95getbaseclasses(application)
 96
 97#
 98# Indices of types declared in this module
 99#
100_classdeclarations = {
101    'logi' : login_item,
102    'colr' : color,
103    'cwin' : window,
104    'capp' : application,
105    'cobj' : item,
106    'docu' : document,
107    'cha ' : character,
108    'atts' : attachment,
109    'cpar' : paragraph,
110    'cwor' : word,
111    'catr' : attribute_run,
112    'ctxt' : text,
113    'file' : file,
114    'capp' : application,
115    'cobj' : item,
116    'cfol' : folder,
117    'cdis' : disk,
118    'scpt' : script,
119    'capp' : application,
120    'foac' : folder_action,
121    'capp' : application,
122    'capp' : application,
123    'prcs' : process,
124    'pcap' : application_process,
125    'pcda' : desk_accessory_process,
126    'capp' : application,
127}
128
129
130class SystemEvents(Standard_Suite_Events,
131        Text_Suite_Events,
132        Disk_Folder_File_Suite_Events,
133        Folder_Actions_Suite_Events,
134        Login_Items_Suite_Events,
135        Power_Suite_Events,
136        Processes_Suite_Events,
137        System_Events_Suite_Events,
138        aetools.TalkTo):
139    _signature = 'sevs'
140
141    _moduleName = 'SystemEvents'
142
143    _elemdict = application._elemdict
144    _propdict = application._propdict