Changeset 628
- Timestamp:
- 08/19/10 00:19:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Update Podcasts/update_podcasts.py
r627 r628 18 18 time.sleep(0.5) 19 19 20 def wait_for_iPod_update(iTunes): 20 def sync_iPod(iTunes): 21 try: 22 iTunes.update() 23 except CommandError: 24 print >> sys.stderr, 'No iPod detected. Waiting for iPod...' 25 while True: 26 time.sleep(0.5) 27 try: 28 iTunes.update() 29 except CommandError: 30 pass 31 21 32 # show iPod 22 33 iTunes.sources[its.kind == AEEnum('kPod')].sources[1].library_playlists[1].reveal() 34 35 # wait for update to complete 23 36 sync_enabled = iTunes_main_pane().buttons[u'Sync'].enabled 24 37 while True: 38 time.sleep(0.5) 25 39 try: 26 40 if sync_enabled.get() == True: … … 28 42 except CommandError: 29 43 pass 30 time.sleep(0.5)31 44 32 45 if __name__ == '__main__': … … 35 48 iTunes.updateAllPodcasts() 36 49 print >> sys.stderr, 'Synchronizing iPod...' 37 iTunes.update() 38 wait_for_iPod_update(iTunes) 50 sync_iPod(iTunes) 39 51 print >> sys.stderr, 'Updating podcasts...' 40 52 iTunes.updateAllPodcasts() 41 53 wait_for_podcast_update(iTunes) 42 54 print >> sys.stderr, 'Synchronizing iPod...' 43 iTunes.update() 44 wait_for_iPod_update(iTunes) 55 sync_iPod(iTunes) 45 56 app(id='net.sabi.UpdatePodcasts').quit()
Note:
See TracChangeset
for help on using the changeset viewer.