- Timestamp:
- 07/10/13 17:08:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r665 r666 2 2 # -*- coding: utf-8 -*- 3 3 4 from aem.ae import newdesc 4 5 from appscript import app, k, its, CommandError 5 from AppKit import NSApplication, NSApplicationDefined, NSBeep, NSSystemDefined, NSURL, NSWorkspace 6 from Foundation import NSDistributedNotificationCenter, NSSearchPathForDirectoriesInDomains, NSCachesDirectory, NSUserDomainMask 6 from AppKit import (NSApplication, NSApplicationDefined, NSBeep, NSImage, 7 NSSystemDefined, NSURL, NSWorkspace) 8 from Foundation import (NSDistributedNotificationCenter, 9 NSSearchPathForDirectoriesInDomains, 10 NSCachesDirectory, NSUserDomainMask) 7 11 from PyObjCTools import AppHelper 8 12 from Carbon.CarbonEvt import RegisterEventHotKey, GetApplicationEventTarget 9 13 from Carbon.Events import cmdKey, shiftKey, controlKey 10 from AudioDevice import default_output_device_is_airplay, set_default_output_device_changed_callback 14 from AudioDevice import (default_output_device_is_airplay, 15 set_default_output_device_changed_callback) 11 16 import httplib2 12 17 import os … … 41 46 if usingStereo: 42 47 description += '\n(AirPlay)' 48 49 if 'image' in kw: 50 image = (NSImage.alloc().initWithData_(buffer(kw['image'])) 51 .TIFFRepresentation()) 52 kw['image'] = newdesc('TIFF', image) 43 53 44 54 growl.notify( … … 212 222 else: 213 223 if response['content-type'].startswith('image/'): 214 file(self.imagePath, 'w').write(content) 215 kw['image_from_location'] = self.imagePath 224 kw['image'] = content 216 225 growlNotify(cleanStreamTitle(iTunes.current_stream_title()), 217 226 cleanStreamTrackName(trackName), **kw) … … 226 235 if artwork: 227 236 try: 228 kw[' pictImage'] = artwork[0].data_()237 kw['image'] = artwork[0].data_().data 229 238 except CommandError: 230 239 pass
Note:
See TracChangeset
for help on using the changeset viewer.