Ignore:
Timestamp:
09/06/10 17:24:24 (14 years ago)
Author:
Nicholas Riley
Message:

Update for iTunes 10 and to handle "Apply" button.

File:
1 edited

Legend:

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

    r629 r630  
    88
    99def iTunes_main_pane():
    10     return app(u'System Events').application_processes[u'iTunes'].windows[u'iTunes'].splitter_groups[1].scroll_areas[1]
     10    return app(u'System Events').application_processes[u'iTunes'].windows[u'iTunes'].scroll_areas[1]
    1111
    1212def wait_for_podcast_update(iTunes):
     
    3535
    3636    # wait for update to complete
    37     sync_enabled = iTunes_main_pane().buttons[u'Sync'].enabled
    38     while True:
    39         time.sleep(0.5)
     37    def sync_enabled():
    4038        try:
    41             if sync_enabled.get() == True:
    42                 return
     39            iTunes_main_pane().buttons[u'Apply'].click()
    4340        except CommandError:
    4441            pass
     42        try:
     43            return iTunes_main_pane().buttons[u'Sync'].enabled.get()
     44        except CommandError:
     45            pass
     46
     47    while not sync_enabled():
     48        time.sleep(0.5)
    4549
    4650if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.