Changeset 639


Ignore:
Timestamp:
04/24/11 20:35:29 (8 years ago)
Author:
Nicholas Riley
Message:

Fix verbiage since I have more than one iOS device now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Update Podcasts/update_podcasts.py

    r630 r639  
    1414    iTunes.playlists[its.special_kind == AEEnum('kSpP')].reveal()
    1515    podcast_status = iTunes_main_pane().outlines[1].rows.static_texts[1].value
     16    # XXX this can fail if iTunes is hidden; fix it
    1617    while any(status in (u'downloading', u'queued for download')
    1718              for status in podcast_status.get()):
    1819        time.sleep(0.5)
    1920
    20 def sync_iPod(iTunes):
     21def sync_devices(iTunes):
    2122    try:
    2223        iTunes.update()
    2324    except CommandError:
    24         print >> sys.stderr, 'No iPod detected.  Waiting for iPod...'
     25        print >> sys.stderr, 'No iOS devices detected.  Waiting for an iOS device...'
    2526        while True:
    2627            time.sleep(0.5)
     
    3132                pass
    3233
    33     # show iPod
     34    # show first iOS device
    3435    iTunes.sources[its.kind == AEEnum('kPod')].sources[1].library_playlists[1].reveal()
    3536
     
    5253    print >> sys.stderr, 'Starting podcast update...'
    5354    iTunes.updateAllPodcasts()
    54     print >> sys.stderr, 'Synchronizing iPod...'
    55     sync_iPod(iTunes)
     55    print >> sys.stderr, 'Synchronizing iOS devices...'
     56    sync_devices(iTunes)
    5657    print >> sys.stderr, 'Updating podcasts...'
    5758    iTunes.updateAllPodcasts()
    5859    wait_for_podcast_update(iTunes)
    59     print >> sys.stderr, 'Synchronizing iPod...'
    60     sync_iPod(iTunes)
     60    print >> sys.stderr, 'Synchronizing iOS devices...'
     61    sync_devices(iTunes)
    6162    app(id='net.sabi.UpdatePodcasts').quit()
Note: See TracChangeset for help on using the changeset viewer.