Changeset 340
- Timestamp:
- 09/10/07 22:13:48 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r339 r340 23 23 kHIDUsage_Csmr_PlayOrPause = 0xCD 24 24 25 growl = app('GrowlHelperApp') 26 27 growl.register( 28 as_application=GROWL_APP_NAME, 29 all_notifications=NOTIFICATIONS_ALL, 30 default_notifications=NOTIFICATIONS_ALL, 31 icon_of_application='iTunes.app') 32 # if we leave off the .app, we can get Classic iTunes's icon 25 def growlRegister(): 26 global growl 27 growl = app(id='com.Growl.GrowlHelperApp') 28 29 growl.register( 30 as_application=GROWL_APP_NAME, 31 all_notifications=NOTIFICATIONS_ALL, 32 default_notifications=NOTIFICATIONS_ALL, 33 icon_of_application='iTunes.app') 34 # if we leave off the .app, we can get Classic iTunes's icon 33 35 34 36 def growlNotify(title, description, **kw): 35 growl.notify( 36 with_name=NOTIFICATION_TRACK_INFO, 37 title=title, 38 description=description, 39 application_name=GROWL_APP_NAME, 40 **kw) 37 try: 38 growl.notify( 39 with_name=NOTIFICATION_TRACK_INFO, 40 title=title, 41 description=description, 42 application_name=GROWL_APP_NAME, 43 **kw) 44 except CommandError: 45 growlRegister() 46 growlNotify(title, description, **kw) 41 47 42 48 def radioParadiseURL(): … … 179 185 def playPauseFront(self): 180 186 systemEvents = app(id='com.apple.systemEvents') 181 frontName = systemEvents.processes[its.frontmost ][1].name()187 frontName = systemEvents.processes[its.frontmost == True][1].name() 182 188 if frontName == 'RealPlayer': 183 189 realPlayer = app(id='com.RealNetworks.RealPlayer') … … 203 209 # XXX detect if "enable access for assistive devices" needs to be enabled 204 210 systemEvents = app(id='com.apple.systemEvents') 205 frontName = systemEvents.processes[its.frontmost ][1].name()211 frontName = systemEvents.processes[its.frontmost == True][1].name() 206 212 if frontName == 'iTunes': 207 213 systemEvents.processes['iTunes'].menu_bars[1]. \ … … 213 219 self.registerZoomWindowHotKey() 214 220 return 215 frontPID = systemEvents.processes[its.frontmost ][1].unix_id()221 frontPID = systemEvents.processes[its.frontmost == True][1].unix_id() 216 222 try: 217 223 zoomed = app(pid=frontPID).windows[1].zoomed … … 257 263 258 264 if __name__ == "__main__": 265 growlRegister() 259 266 AppHelper.runEventLoop() 260 267 try:
Note:
See TracChangeset
for help on using the changeset viewer.