Exemplo n.º 1
0
def delete_track_using_href():
    """Delete a track using its href."""

    # Create a bundle with no track.
    print '*** Creating a bundle with no tracks...'
    bundle_ref = clarify.create_bundle(name='track tester')
    href = bundle_ref['_links']['clarify:tracks']['href']

    # Add a track.
    print '*** Adding a track to the bundle...'
    track_ref = clarify.create_track(href,
                                     media_url=MEDIA_URL1,
                                     label='short-lived track')

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)

    # Delete the track.
    print '*** Deleting track by href...'
    track_href = track_ref['_links']['self']['href']
    clarify.delete_track(track_href)

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)
Exemplo n.º 2
0
def delete_all_tracks():
    """Create a bundle, add tracks, delete them."""

    # Create a bundle with no track.
    print '*** Creating a bundle with no tracks...'
    bundle_ref = clarify.create_bundle(name='track tester')
    href = bundle_ref['_links']['clarify:tracks']['href']

    # Add three tracks.
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL1, label='first label')
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL2, label='second label')
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL3, label='third label')

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)

    # Update the track.
    print '*** Deleting all tracks...'
    clarify.delete_track_at_index(href)

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)
Exemplo n.º 3
0
def delete_track_using_href():
    """Delete a track using its href."""

    # Create a bundle with no track.
    print '*** Creating a bundle with no tracks...'
    bundle_ref = clarify.create_bundle(name='track tester')
    href = bundle_ref['_links']['clarify:tracks']['href']

    # Add a track.
    print '*** Adding a track to the bundle...'
    track_ref = clarify.create_track(href, media_url=MEDIA_URL1,
                                     label='short-lived track')

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)

    # Delete the track.
    print '*** Deleting track by href...'
    track_href = track_ref['_links']['self']['href']
    clarify.delete_track(track_href)

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)
Exemplo n.º 4
0
def delete_all_tracks():
    """Create a bundle, add tracks, delete them."""

    # Create a bundle with no track.
    print '*** Creating a bundle with no tracks...'
    bundle_ref = clarify.create_bundle(name='track tester')
    href = bundle_ref['_links']['clarify:tracks']['href']

    # Add three tracks.
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL1, label='first label')
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL2, label='second label')
    print '*** Adding a track to the bundle...'
    clarify.create_track(href, media_url=MEDIA_URL3, label='third label')

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)

    # Update the track.
    print '*** Deleting all tracks...'
    clarify.delete_track_at_index(href)

    # List the tracks.
    track_list = clarify.get_track_list(href)
    for track in track_list['tracks']:
        print_track_quiet(track)
Exemplo n.º 5
0
def track_create_and_list():
    """Create a bundle with a track, print it, add a track, print them."""

    print '*** Creating a bundle with a track...'

    # Create a bundle with a track.
    bundle_ref = clarify.create_bundle(name='track tester',
                                       media_url=MEDIA_URL1)

    # List the tracks.
    track_list_ref = bundle_ref['_links']['clarify:tracks']['href']
    track_list = clarify.get_track_list(track_list_ref)
    for track in track_list['tracks']:
        print_track_quiet(track)

    print '*** Adding a track to the bundle...'

    # Add a track.
    clarify.create_track(track_list_ref, media_url=MEDIA_URL2)

    # List the tracks.
    track_list = clarify.get_track_list(track_list_ref)
    for track in track_list['tracks']:
        print_track_quiet(track)
Exemplo n.º 6
0
def track_create_and_list():
    """Create a bundle with a track, print it, add a track, print them."""

    print '*** Creating a bundle with a track...'

    # Create a bundle with a track.
    bundle_ref = clarify.create_bundle(name='track tester',
                                       media_url=MEDIA_URL1)

    # List the tracks.
    track_list_ref = bundle_ref['_links']['clarify:tracks']['href']
    track_list = clarify.get_track_list(track_list_ref)
    for track in track_list['tracks']:
        print_track_quiet(track)

    print '*** Adding a track to the bundle...'

    # Add a track.
    clarify.create_track(track_list_ref, media_url=MEDIA_URL2)

    # List the tracks.
    track_list = clarify.get_track_list(track_list_ref)
    for track in track_list['tracks']:
        print_track_quiet(track)