Changeset 646 for trunk


Ignore:
Timestamp:
05/24/12 20:40:48 (7 years ago)
Author:
Nicholas Riley
Message:

StreamVision?.py: When we can't see the AirPlay? button, assume AirPlay? is in use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StreamVision/StreamVision.py

    r645 r646  
    102102    systemEvents = app(id='com.apple.systemEvents')
    103103    iTunesWindow = systemEvents.application_processes[u'iTunes'].windows[u'iTunes']
    104     remote_speakers = iTunesWindow.buttons[its.attributes['AXDescription'].value.beginswith(u'AirPlay')].title()
     104    # Can't get AirPlay status with iTunes Mini Player or window on other Space.
     105    try:
     106        remote_speakers = iTunesWindow.buttons[its.attributes['AXDescription'].value.beginswith(u'AirPlay')].title()
     107    except CommandError: # window on another Space?
     108        return True
    105109    return remote_speakers and remote_speakers[0] not in (None, k.missing_value)
    106110
Note: See TracChangeset for help on using the changeset viewer.