soco 0.32.0__tar.gz → 0.32.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {soco-0.32.0/soco.egg-info → soco-0.32.2}/PKG-INFO +3 -3
- {soco-0.32.0 → soco-0.32.2}/dev_tools/release.py +30 -146
- {soco-0.32.0 → soco-0.32.2}/pyproject.toml +2 -6
- soco-0.32.2/setup.py +11 -0
- {soco-0.32.0 → soco-0.32.2}/soco/__init__.py +1 -1
- {soco-0.32.0 → soco-0.32.2}/soco/core.py +74 -13
- {soco-0.32.0 → soco-0.32.2/soco.egg-info}/PKG-INFO +3 -3
- {soco-0.32.0 → soco-0.32.2}/tests/test_core.py +75 -1
- {soco-0.32.0 → soco-0.32.2}/tests/test_release_script.py +57 -105
- {soco-0.32.0 → soco-0.32.2}/tests/test_singleton.py +61 -0
- soco-0.32.0/setup.py +0 -27
- {soco-0.32.0 → soco-0.32.2}/AUTHORS.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/LICENSE.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/MANIFEST.in +0 -0
- {soco-0.32.0 → soco-0.32.2}/README.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/dev_tools/analyse_ws.ini +0 -0
- {soco-0.32.0 → soco-0.32.2}/dev_tools/analyse_ws.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/dev_tools/pychecker.bat +0 -0
- {soco-0.32.0 → soco-0.32.2}/dev_tools/pychecker.sh +0 -0
- {soco-0.32.0 → soco-0.32.2}/dev_tools/sonosdump.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/Makefile +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/_static/imageMapResizer.min.js +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/_templates/page.html +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/data-structures-mod.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/events.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/events_asyncio.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/events_twisted.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/index.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/services.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/advanced/topology.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.alarms.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.cache.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.config.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.core.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.data_structures.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.discovery.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.events.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.exceptions.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.favorites.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.groups.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.ms_data_structures.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.music_library.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.music_services.accounts.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.music_services.music_service.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.music_services.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.music_services.token_store.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.example.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.plex.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.sharelink.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.spotify.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.plugins.wimp.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.services.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.snapshot.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.soap.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.utils.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/api/soco.xml.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/authors.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/conf.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/development/index.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/development/release-howto.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/development/unittests.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/examples.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/faq.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/getting_started.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/graphics/data_structures.png +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/graphics/data_structures.svg +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/index.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/make.bat +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/plugins.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/release_notes.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.10.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.11.1.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.11.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.12.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.13.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.14.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.15.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.16.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.17.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.18.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.19.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.20.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.21.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.22.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.23.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.24.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.25.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.26.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.27.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.28.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.29.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.30.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.31.0.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.32.0.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.6.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.7.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.8.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/0.9.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/releases/index.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/requirements.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/doc/tutorial.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/commandline/README.rst +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/commandline/discover.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/commandline/screenshot.png +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/commandline/tunein.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/events_asyncio_verify_listener_fix.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/play_local_files/play_local_files.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/plugins/socoplugins.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/snapshot/basic_snap.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/snapshot/multi_zone_snap.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/.gitignore +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/README.md +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/index.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/requirements.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/screenshot.png +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/settings.py.example +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/css/bootstrap.min.css +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/css/main.css +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/img/blank.jpg +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/img/glyphicons-halflings-white.png +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/img/glyphicons-halflings.png +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/js/bootstrap.min.js +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/static/js/jquery.min.js +0 -0
- {soco-0.32.0 → soco-0.32.2}/examples/webapp/templates/index.html +0 -0
- {soco-0.32.0 → soco-0.32.2}/makefile +0 -0
- {soco-0.32.0 → soco-0.32.2}/pylintrc +0 -0
- {soco-0.32.0 → soco-0.32.2}/requirements-dev.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/requirements.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/setup.cfg +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/alarms.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/cache.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/config.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/data_structure_quirks.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/data_structures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/data_structures_entry.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/discovery.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/events.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/events_asyncio.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/events_base.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/events_twisted.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/exceptions.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/favorites.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/groups.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/ms_data_structures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_library.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_services/__init__.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_services/accounts.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_services/data_structures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_services/music_service.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/music_services/token_store.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/__init__.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/example.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/plex.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/sharelink.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/spotify.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/plugins/wimp.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/services.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/snapshot.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/soap.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/utils.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/xml.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco/zonegroupstate.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco.egg-info/SOURCES.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco.egg-info/dependency_links.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco.egg-info/requires.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/soco.egg-info/top_level.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/conftest.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/album.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/album.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/album_compilation.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/album_favorite.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/album_list.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/artist.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/artist.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/audio_broadcast.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/audio_broadcast.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/composer.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/composer.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/genre.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/genre.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/playlist.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/playlist.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/playlist_favorite.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/radio_show.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/radio_show.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/recent_show.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/same_artist.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/share.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/share.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/source_linein.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/track.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/track.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/data_structures_entry_integration/tracklist.xml +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/bbc.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/cifs.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/pandora.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/sonos_radio.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/tunein.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/data/media_metadata_payloads/tunein_2.json +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/official_and_extended_didl_classes.txt +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/soco_unittest.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_alarms.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_cache.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_data_structures_entry_integration.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_discovery.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_events.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_events_asyncio.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_favorites.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_integration.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_metadata_parsing.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_ms_data_structures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_music_library.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_music_service_data_structures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_musicservices.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_new_datastructures.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_services.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_sharelink.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_snapshot.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_soap.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_utils.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_xml.py +0 -0
- {soco-0.32.0 → soco-0.32.2}/tests/test_zonegroupstate.py +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: soco
|
|
3
|
-
Version: 0.32.
|
|
3
|
+
Version: 0.32.2
|
|
4
4
|
Summary: SoCo (Sonos Controller) is a simple library to control Sonos speakers.
|
|
5
5
|
Author-email: The SoCo-Team <python-soco@googlegroups.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/SoCo/SoCo
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
10
|
Classifier: Operating System :: OS Independent
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.6
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -56,6 +55,7 @@ Requires-Dist: twine; extra == "testing"
|
|
|
56
55
|
Requires-Dist: build; extra == "testing"
|
|
57
56
|
Requires-Dist: importlib-metadata<5; python_version == "3.7" and extra == "testing"
|
|
58
57
|
Dynamic: license-file
|
|
58
|
+
Dynamic: license-expression
|
|
59
59
|
|
|
60
60
|
SoCo
|
|
61
61
|
====
|
|
@@ -19,7 +19,7 @@ See dev_tools/README.md for the steps, prompts and troubleshooting.
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
import argparse
|
|
22
|
-
import
|
|
22
|
+
import datetime
|
|
23
23
|
import os
|
|
24
24
|
import re
|
|
25
25
|
import shlex
|
|
@@ -33,10 +33,8 @@ import urllib.request
|
|
|
33
33
|
INIT_FILE = "soco/__init__.py"
|
|
34
34
|
INDEX_FILE = "doc/releases/index.rst"
|
|
35
35
|
RELEASES_DIR = "doc/releases"
|
|
36
|
-
WORKFLOW_FILE = ".github/workflows/soco-check-jobs.yaml"
|
|
37
36
|
PYPI_URL = "https://pypi.org/pypi/soco/{}/json"
|
|
38
37
|
GITHUB_REPO = "SoCo/SoCo"
|
|
39
|
-
MILESTONES_API = f"repos/{GITHUB_REPO}/milestones"
|
|
40
38
|
ORIGIN_RE = re.compile(r"github\.com[:/]SoCo/SoCo(\.git)?/?$")
|
|
41
39
|
|
|
42
40
|
|
|
@@ -70,12 +68,6 @@ def fixes_branch(version):
|
|
|
70
68
|
return f"v{major}.{minor}.fixes"
|
|
71
69
|
|
|
72
70
|
|
|
73
|
-
def previous_fixes_branch(version):
|
|
74
|
-
"""Return the fixes branch of the previous minor version."""
|
|
75
|
-
major, minor, _ = parse_version(version)
|
|
76
|
-
return f"v{major}.{minor - 1}.fixes"
|
|
77
|
-
|
|
78
|
-
|
|
79
71
|
def next_dev_version(version):
|
|
80
72
|
"""Return the development version that follows a main release."""
|
|
81
73
|
major, minor, _ = parse_version(version)
|
|
@@ -121,8 +113,10 @@ def validate_fix(version, tags):
|
|
|
121
113
|
)
|
|
122
114
|
|
|
123
115
|
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
# Files are read with their line endings kept, which are CRLF in a Windows
|
|
117
|
+
# checkout, so a line may end in \r.
|
|
118
|
+
VERSION_LINE_RE = re.compile(r'^__version__ = "([^"]*)"(?=\r?$)', re.MULTILINE)
|
|
119
|
+
INDEX_ENTRY_RE = re.compile(r"^ (\d\S*)\r?$", re.MULTILINE)
|
|
126
120
|
|
|
127
121
|
|
|
128
122
|
def read_version(init_text):
|
|
@@ -153,7 +147,9 @@ def add_release_to_index(index_text, name):
|
|
|
153
147
|
first = INDEX_ENTRY_RE.search(index_text)
|
|
154
148
|
if first is None:
|
|
155
149
|
raise ReleaseError(f"No release entries found in {INDEX_FILE}")
|
|
156
|
-
|
|
150
|
+
newline = "\r\n" if "\r\n" in index_text else "\n"
|
|
151
|
+
entry = f" {name}{newline}"
|
|
152
|
+
return index_text[: first.start()] + entry + index_text[first.start() :]
|
|
157
153
|
|
|
158
154
|
|
|
159
155
|
def missing_index_entries(index_text, filenames):
|
|
@@ -163,29 +159,18 @@ def missing_index_entries(index_text, filenames):
|
|
|
163
159
|
]
|
|
164
160
|
|
|
165
161
|
|
|
166
|
-
def
|
|
167
|
-
"""Return
|
|
162
|
+
def release_notes_template(version, released_on):
|
|
163
|
+
"""Return the release notes for a main release released on a date.
|
|
168
164
|
|
|
169
|
-
|
|
170
|
-
the edit can be repeated when a release is resumed.
|
|
165
|
+
``released_on`` is an ISO date string, e.g. '2026-10-15'.
|
|
171
166
|
"""
|
|
172
|
-
old_quoted, new_quoted = f"'{old}'", f"'{new}'"
|
|
173
|
-
if old_quoted in workflow_text:
|
|
174
|
-
return workflow_text.replace(old_quoted, new_quoted)
|
|
175
|
-
if new_quoted in workflow_text:
|
|
176
|
-
return workflow_text
|
|
177
|
-
raise ReleaseError(f"{WORKFLOW_FILE} mentions neither {old} nor {new}")
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
def release_notes_template(version):
|
|
181
|
-
"""Return the skeleton release notes for a main release."""
|
|
182
167
|
major, minor, _ = parse_version(version)
|
|
183
168
|
title = f"SoCo {major}.{minor} Release Notes"
|
|
184
169
|
return (
|
|
185
170
|
f"{title}\n"
|
|
186
171
|
f"{'*' * len(title)}\n"
|
|
187
172
|
"\n"
|
|
188
|
-
f"**SoCo {version}** (Released on
|
|
173
|
+
f"**SoCo {version}** (Released on {released_on}) contains new features as\n"
|
|
189
174
|
"well as internal improvements.\n"
|
|
190
175
|
"\n"
|
|
191
176
|
"Please see the GitHub release page for further details:\n"
|
|
@@ -355,16 +340,6 @@ class Repo:
|
|
|
355
340
|
"""Return whether a GitHub release exists for a tag."""
|
|
356
341
|
return self.shell.ok("gh", "release", "view", tag, "-R", GITHUB_REPO)
|
|
357
342
|
|
|
358
|
-
def milestone(self, title):
|
|
359
|
-
"""Return the GitHub milestone named title or vtitle, or None."""
|
|
360
|
-
milestones = json.loads(
|
|
361
|
-
self.shell.query("gh", "api", f"{MILESTONES_API}?state=all&per_page=100")
|
|
362
|
-
)
|
|
363
|
-
for milestone in milestones:
|
|
364
|
-
if milestone["title"] in (title, f"v{title}"):
|
|
365
|
-
return milestone
|
|
366
|
-
return None
|
|
367
|
-
|
|
368
343
|
|
|
369
344
|
AUTO = "auto" # runs without asking
|
|
370
345
|
CONFIRM = "confirm" # irreversible: asks y/n/q first
|
|
@@ -588,13 +563,16 @@ def publish_steps(repo, version, after, branch, subject):
|
|
|
588
563
|
return [tag_step, build_step, upload, github_release]
|
|
589
564
|
|
|
590
565
|
|
|
591
|
-
def main_release_steps(repo, version):
|
|
592
|
-
"""Steps for a main release X.Y.0 from master.
|
|
566
|
+
def main_release_steps(repo, version, today=None):
|
|
567
|
+
"""Steps for a main release X.Y.0 from master.
|
|
568
|
+
|
|
569
|
+
``today`` (an ISO date string) is the release date written into the
|
|
570
|
+
release notes; it defaults to the current date.
|
|
571
|
+
"""
|
|
572
|
+
released_on = today or datetime.date.today().isoformat()
|
|
593
573
|
major, minor, _ = parse_version(version)
|
|
594
574
|
tag = f"v{version}"
|
|
595
|
-
next_minor = f"{major}.{minor + 1}.0"
|
|
596
575
|
next_dev = next_dev_version(version)
|
|
597
|
-
old_branch = previous_fixes_branch(version)
|
|
598
576
|
new_branch = fixes_branch(version)
|
|
599
577
|
notes_file = f"{RELEASES_DIR}/{version}.rst"
|
|
600
578
|
push_args = ("git", "push", "origin", "master")
|
|
@@ -602,71 +580,21 @@ def main_release_steps(repo, version): # pylint: disable=too-many-locals
|
|
|
602
580
|
def released():
|
|
603
581
|
return repo.remote_tag_exists(tag) or repo.committed_version("HEAD") == version
|
|
604
582
|
|
|
605
|
-
|
|
606
|
-
create_milestone = Step(
|
|
607
|
-
f"Create milestone v{next_minor}",
|
|
608
|
-
CONFIRM,
|
|
609
|
-
lambda: repo.milestone(next_minor) is not None,
|
|
610
|
-
run=lambda: repo.shell.run(*create_args),
|
|
611
|
-
commands=[shlex.join(create_args)],
|
|
612
|
-
)
|
|
613
|
-
|
|
614
|
-
def show_milestone():
|
|
615
|
-
milestone = repo.milestone(version)
|
|
616
|
-
if milestone is None:
|
|
617
|
-
print(f" There is no {version} milestone.")
|
|
618
|
-
return
|
|
619
|
-
print(
|
|
620
|
-
f" Milestone {milestone['title']}: {milestone['open_issues']} open, "
|
|
621
|
-
f"{milestone['closed_issues']} closed issues"
|
|
622
|
-
)
|
|
623
|
-
print(f" {milestone['html_url']}")
|
|
624
|
-
|
|
625
|
-
review = Step(
|
|
626
|
-
f"Review the {version} milestone",
|
|
627
|
-
MANUAL,
|
|
628
|
-
released,
|
|
629
|
-
run=show_milestone,
|
|
630
|
-
hint=f"Move unfinished issues to v{next_minor} or later.",
|
|
631
|
-
)
|
|
632
|
-
|
|
633
|
-
def notes_ready():
|
|
634
|
-
return (
|
|
635
|
-
repo.exists(notes_file)
|
|
636
|
-
and repo.read(notes_file) != release_notes_template(version)
|
|
637
|
-
and version in index_entries(repo.read(INDEX_FILE))
|
|
638
|
-
)
|
|
639
|
-
|
|
640
|
-
def prepare_notes():
|
|
583
|
+
def commit_release():
|
|
641
584
|
if not repo.exists(notes_file):
|
|
642
|
-
repo.write(notes_file, release_notes_template(version))
|
|
643
|
-
print(f" Created {notes_file}
|
|
585
|
+
repo.write(notes_file, release_notes_template(version, released_on))
|
|
586
|
+
print(f" Created {notes_file}.")
|
|
644
587
|
index = repo.read(INDEX_FILE)
|
|
645
|
-
|
|
646
|
-
if updated != index:
|
|
647
|
-
repo.write(INDEX_FILE, updated)
|
|
648
|
-
print(f" Added {version} to {INDEX_FILE}.")
|
|
649
|
-
|
|
650
|
-
notes = Step(
|
|
651
|
-
f"Write the release notes in {notes_file}",
|
|
652
|
-
MANUAL,
|
|
653
|
-
notes_ready,
|
|
654
|
-
run=prepare_notes,
|
|
655
|
-
ready=notes_ready,
|
|
656
|
-
hint=f"Edit {notes_file}; it must differ from the template.",
|
|
657
|
-
)
|
|
658
|
-
|
|
659
|
-
def commit_release():
|
|
588
|
+
repo.write(INDEX_FILE, add_release_to_index(index, version))
|
|
660
589
|
repo.write(INIT_FILE, set_version(repo.read(INIT_FILE), version))
|
|
661
590
|
repo.shell.run("git", "add", INIT_FILE, INDEX_FILE, notes_file)
|
|
662
591
|
repo.shell.run("git", "commit", "-m", f"Release {tag}")
|
|
663
592
|
|
|
664
593
|
commit = Step(
|
|
665
|
-
f"
|
|
594
|
+
f"Add {notes_file}, set version {version} and commit",
|
|
666
595
|
AUTO,
|
|
667
596
|
released,
|
|
668
597
|
run=commit_release,
|
|
669
|
-
requires=(notes,),
|
|
670
598
|
)
|
|
671
599
|
push = Step(
|
|
672
600
|
"Push master",
|
|
@@ -678,34 +606,8 @@ def main_release_steps(repo, version): # pylint: disable=too-many-locals
|
|
|
678
606
|
preview=lambda: unpushed_preview(repo, "master"),
|
|
679
607
|
requires=(commit,),
|
|
680
608
|
)
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
)
|
|
684
|
-
|
|
685
|
-
def milestone_closed():
|
|
686
|
-
milestone = repo.milestone(version)
|
|
687
|
-
return milestone is None or milestone["state"] == "closed"
|
|
688
|
-
|
|
689
|
-
def close_milestone():
|
|
690
|
-
number = repo.milestone(version)["number"]
|
|
691
|
-
repo.shell.run(
|
|
692
|
-
"gh",
|
|
693
|
-
"api",
|
|
694
|
-
"--method",
|
|
695
|
-
"PATCH",
|
|
696
|
-
f"{MILESTONES_API}/{number}",
|
|
697
|
-
"-f",
|
|
698
|
-
"state=closed",
|
|
699
|
-
)
|
|
700
|
-
|
|
701
|
-
close = Step(
|
|
702
|
-
f"Close the {version} milestone",
|
|
703
|
-
CONFIRM,
|
|
704
|
-
milestone_closed,
|
|
705
|
-
run=close_milestone,
|
|
706
|
-
commands=[f"gh api --method PATCH {MILESTONES_API}/<number> -f state=closed"],
|
|
707
|
-
requires=(github_release,),
|
|
708
|
-
)
|
|
609
|
+
publish = publish_steps(repo, version, push, "master", f"Release {tag}")
|
|
610
|
+
tag_step = publish[0]
|
|
709
611
|
|
|
710
612
|
def create_branch():
|
|
711
613
|
if not repo.local_branch_exists(new_branch):
|
|
@@ -725,16 +627,12 @@ def main_release_steps(repo, version): # pylint: disable=too-many-locals
|
|
|
725
627
|
)
|
|
726
628
|
|
|
727
629
|
def start_next():
|
|
728
|
-
workflow = repo.read(WORKFLOW_FILE)
|
|
729
|
-
repo.write(
|
|
730
|
-
WORKFLOW_FILE, replace_fixes_branch(workflow, old_branch, new_branch)
|
|
731
|
-
)
|
|
732
630
|
repo.write(INIT_FILE, set_version(repo.read(INIT_FILE), next_dev))
|
|
733
|
-
repo.shell.run("git", "add",
|
|
631
|
+
repo.shell.run("git", "add", INIT_FILE)
|
|
734
632
|
repo.shell.run("git", "commit", "-m", f"Start {major}.{minor + 1} development")
|
|
735
633
|
|
|
736
634
|
start = Step(
|
|
737
|
-
f"Set version {next_dev}
|
|
635
|
+
f"Set version {next_dev} and commit",
|
|
738
636
|
AUTO,
|
|
739
637
|
lambda: repo.committed_version("HEAD") == next_dev,
|
|
740
638
|
run=start_next,
|
|
@@ -749,21 +647,7 @@ def main_release_steps(repo, version): # pylint: disable=too-many-locals
|
|
|
749
647
|
preview=lambda: unpushed_preview(repo, "master"),
|
|
750
648
|
requires=(start,),
|
|
751
649
|
)
|
|
752
|
-
return [
|
|
753
|
-
create_milestone,
|
|
754
|
-
review,
|
|
755
|
-
notes,
|
|
756
|
-
commit,
|
|
757
|
-
push,
|
|
758
|
-
tag_step,
|
|
759
|
-
build,
|
|
760
|
-
upload,
|
|
761
|
-
github_release,
|
|
762
|
-
close,
|
|
763
|
-
branch,
|
|
764
|
-
start,
|
|
765
|
-
push_next,
|
|
766
|
-
]
|
|
650
|
+
return [commit, push, *publish, branch, start, push_next]
|
|
767
651
|
|
|
768
652
|
|
|
769
653
|
def fix_release_steps(repo, version):
|
|
@@ -820,7 +704,7 @@ def preflight(repo, branch, check_index):
|
|
|
820
704
|
origin = repo.origin_url()
|
|
821
705
|
if not ORIGIN_RE.search(origin):
|
|
822
706
|
problems.append(f"origin is {origin}, not {GITHUB_REPO} on GitHub")
|
|
823
|
-
own_files = {INIT_FILE, INDEX_FILE
|
|
707
|
+
own_files = {INIT_FILE, INDEX_FILE}
|
|
824
708
|
other = [name for name in repo.changed_tracked_files() if name not in own_files]
|
|
825
709
|
if other:
|
|
826
710
|
problems.append("Uncommitted changes to tracked files: " + ", ".join(other))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build-system]
|
|
2
2
|
requires = [
|
|
3
|
-
"setuptools >=
|
|
3
|
+
"setuptools >= 84.1.0; python_version >= '3.10'",
|
|
4
4
|
"setuptools >= 78.1.1; python_version == '3.9'",
|
|
5
5
|
"setuptools >= 75.3.4; python_version == '3.8'",
|
|
6
6
|
"setuptools >= 68.0.0; python_version == '3.7'",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Development Status :: 4 - Beta",
|
|
17
17
|
"Intended Audience :: Developers",
|
|
18
|
-
"License :: OSI Approved :: MIT License",
|
|
19
18
|
"Operating System :: OS Independent",
|
|
20
19
|
"Programming Language :: Python :: 3.6",
|
|
21
20
|
"Programming Language :: Python :: 3.7",
|
|
@@ -36,15 +35,12 @@
|
|
|
36
35
|
"Topic :: Software Development :: Libraries :: Python Modules"
|
|
37
36
|
]
|
|
38
37
|
requires-python = ">=3.6"
|
|
39
|
-
dynamic = ["version", "dependencies"]
|
|
38
|
+
dynamic = ["version", "dependencies", "license"]
|
|
40
39
|
|
|
41
40
|
[[project.authors]]
|
|
42
41
|
name = "The SoCo-Team"
|
|
43
42
|
email = "python-soco@googlegroups.com"
|
|
44
43
|
|
|
45
|
-
[project.license]
|
|
46
|
-
text = "MIT License"
|
|
47
|
-
|
|
48
44
|
[project.urls]
|
|
49
45
|
Homepage = "https://github.com/SoCo/SoCo"
|
|
50
46
|
|
soco-0.32.2/setup.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
import setuptools
|
|
4
|
+
from setuptools import setup
|
|
5
|
+
|
|
6
|
+
# The license is set here rather than in pyproject.toml because the SPDX
|
|
7
|
+
# license expression needs setuptools >= 77, which needs Python >= 3.9.
|
|
8
|
+
if int(setuptools.__version__.split(".")[0]) >= 77:
|
|
9
|
+
setup(license_expression="MIT")
|
|
10
|
+
else:
|
|
11
|
+
setup(license="MIT")
|
|
@@ -17,7 +17,7 @@ from .exceptions import SoCoException, UnknownSoCoException
|
|
|
17
17
|
__author__ = "The SoCo-Team <python-soco@googlegroups.com>"
|
|
18
18
|
# Please increment the version number and add the suffix "-dev" after
|
|
19
19
|
# a release, to make it possible to identify in-development code
|
|
20
|
-
__version__ = "0.32.
|
|
20
|
+
__version__ = "0.32.2"
|
|
21
21
|
__website__ = "https://github.com/SoCo/SoCo"
|
|
22
22
|
__license__ = "MIT License"
|
|
23
23
|
|
|
@@ -21,6 +21,7 @@ from requests.exceptions import ConnectTimeout, ReadTimeout
|
|
|
21
21
|
|
|
22
22
|
from . import config
|
|
23
23
|
from .data_structures import (
|
|
24
|
+
DidlMusicTrack,
|
|
24
25
|
DidlObject,
|
|
25
26
|
DidlPlaylistContainer,
|
|
26
27
|
DidlResource,
|
|
@@ -83,9 +84,21 @@ AUDIO_INPUT_FORMATS = {
|
|
|
83
84
|
118489148: "Dolby TrueHD 7.1",
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
|
|
86
88
|
_LOG = logging.getLogger(__name__)
|
|
87
89
|
|
|
88
90
|
|
|
91
|
+
def _create_uri_didl_item(uri, title, mime_type):
|
|
92
|
+
"""Create a DIDL item for an HTTP media URI."""
|
|
93
|
+
resource = DidlResource(uri=uri, protocol_info=f"http-get:*:{mime_type}:*")
|
|
94
|
+
return DidlMusicTrack(
|
|
95
|
+
title=title,
|
|
96
|
+
parent_id="0",
|
|
97
|
+
item_id="1",
|
|
98
|
+
resources=[resource],
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
89
102
|
class _ArgsSingleton(type):
|
|
90
103
|
"""A metaclass which permits only a single instance of each derived class
|
|
91
104
|
sharing the same `_class_group` class attribute to exist for any given set
|
|
@@ -812,7 +825,14 @@ class SoCo(_SocoSingletonBase):
|
|
|
812
825
|
|
|
813
826
|
@only_on_master
|
|
814
827
|
def play_uri(
|
|
815
|
-
self,
|
|
828
|
+
self,
|
|
829
|
+
uri="",
|
|
830
|
+
meta="",
|
|
831
|
+
title="",
|
|
832
|
+
start=True,
|
|
833
|
+
force_radio=False,
|
|
834
|
+
mime_type=None,
|
|
835
|
+
**kwargs,
|
|
816
836
|
):
|
|
817
837
|
"""Play a URI.
|
|
818
838
|
|
|
@@ -828,9 +848,19 @@ class SoCo(_SocoSingletonBase):
|
|
|
828
848
|
meta (str): The metadata to show in the player, DIDL format.
|
|
829
849
|
title (str): The title to show in the player (if no meta).
|
|
830
850
|
start (bool): If the URI that has been set should start playing.
|
|
831
|
-
force_radio (bool):
|
|
851
|
+
force_radio (bool): Forces a URI to play as a radio stream. Cannot
|
|
852
|
+
be used together with ``mime_type``.
|
|
853
|
+
mime_type (str): The MIME type of the media. If provided without
|
|
854
|
+
explicit metadata, track-style DIDL metadata with the
|
|
855
|
+
corresponding protocol info is generated. Cannot be used
|
|
856
|
+
together with ``force_radio=True``. Explicit metadata takes
|
|
857
|
+
precedence.
|
|
832
858
|
kwargs: additional arguments such as timeout.
|
|
833
859
|
|
|
860
|
+
Raises:
|
|
861
|
+
ValueError: If ``mime_type`` and ``force_radio=True`` are both
|
|
862
|
+
provided.
|
|
863
|
+
|
|
834
864
|
On a Sonos controller music is shown with one of the following display
|
|
835
865
|
formats and controls:
|
|
836
866
|
|
|
@@ -869,7 +899,12 @@ class SoCo(_SocoSingletonBase):
|
|
|
869
899
|
not forced to to Radio format.
|
|
870
900
|
|
|
871
901
|
"""
|
|
872
|
-
if
|
|
902
|
+
if mime_type and force_radio:
|
|
903
|
+
raise ValueError("mime_type cannot be used with force_radio=True")
|
|
904
|
+
|
|
905
|
+
if meta == "" and mime_type:
|
|
906
|
+
meta = to_didl_string(_create_uri_didl_item(uri, title, mime_type))
|
|
907
|
+
elif meta == "" and title != "":
|
|
873
908
|
meta_template = (
|
|
874
909
|
'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements'
|
|
875
910
|
'/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" '
|
|
@@ -2391,15 +2426,37 @@ class SoCo(_SocoSingletonBase):
|
|
|
2391
2426
|
return self.music_library.get_music_library_information(*args, **kwargs)
|
|
2392
2427
|
|
|
2393
2428
|
@only_on_master
|
|
2394
|
-
def add_uri_to_queue(
|
|
2429
|
+
def add_uri_to_queue(
|
|
2430
|
+
self,
|
|
2431
|
+
uri,
|
|
2432
|
+
position=0,
|
|
2433
|
+
as_next=False,
|
|
2434
|
+
title="",
|
|
2435
|
+
mime_type=None,
|
|
2436
|
+
**kwargs,
|
|
2437
|
+
):
|
|
2395
2438
|
"""Add the URI to the queue.
|
|
2396
2439
|
|
|
2397
|
-
|
|
2440
|
+
Args:
|
|
2441
|
+
uri (str): URI of the media to add.
|
|
2442
|
+
position (int): The index (1-based) at which the URI should be
|
|
2443
|
+
added. Default is 0 (add URI at the end of the queue).
|
|
2444
|
+
as_next (bool): Whether this URI should be played as the next
|
|
2445
|
+
track in shuffle mode.
|
|
2446
|
+
title (str): The title to show in the player.
|
|
2447
|
+
mime_type (str): The MIME type of the media. If provided, the
|
|
2448
|
+
corresponding HTTP protocol info is included in the DIDL
|
|
2449
|
+
metadata.
|
|
2450
|
+
kwargs: additional arguments such as timeout.
|
|
2451
|
+
|
|
2452
|
+
Returns:
|
|
2453
|
+
int: The index of the new item in the queue.
|
|
2398
2454
|
"""
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2455
|
+
if mime_type:
|
|
2456
|
+
item = _create_uri_didl_item(uri, title, mime_type)
|
|
2457
|
+
else:
|
|
2458
|
+
res = [DidlResource(uri=uri, protocol_info="x-rincon-playlist:*:*:*")]
|
|
2459
|
+
item = DidlObject(resources=res, title=title, parent_id="", item_id="")
|
|
2403
2460
|
return self.add_to_queue(item, position, as_next, **kwargs)
|
|
2404
2461
|
|
|
2405
2462
|
@only_on_master
|
|
@@ -3183,12 +3240,16 @@ class SoCo(_SocoSingletonBase):
|
|
|
3183
3240
|
def soco_reset():
|
|
3184
3241
|
"""Reset the SoCo module.
|
|
3185
3242
|
|
|
3186
|
-
Clears out the singleton instance cache
|
|
3187
|
-
for example when testing. Note that this does
|
|
3188
|
-
connections or release other resources. This function
|
|
3189
|
-
and must not be called while the API is in use from
|
|
3243
|
+
Clears out the singleton instance cache and the zone group states. Use
|
|
3244
|
+
this to reset SoCo state, for example when testing. Note that this does
|
|
3245
|
+
not close any open connections or release other resources. This function
|
|
3246
|
+
is not thread-safe and must not be called while the API is in use from
|
|
3247
|
+
other threads. Unsubscribe from events before calling it, because the
|
|
3248
|
+
zone group states track active subscriptions.
|
|
3190
3249
|
"""
|
|
3191
3250
|
_ArgsSingleton._instances.clear()
|
|
3251
|
+
# Zone group states hold instances created before the reset
|
|
3252
|
+
SoCo.zone_group_states.clear()
|
|
3192
3253
|
|
|
3193
3254
|
|
|
3194
3255
|
# definition section
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: soco
|
|
3
|
-
Version: 0.32.
|
|
3
|
+
Version: 0.32.2
|
|
4
4
|
Summary: SoCo (Sonos Controller) is a simple library to control Sonos speakers.
|
|
5
5
|
Author-email: The SoCo-Team <python-soco@googlegroups.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/SoCo/SoCo
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
10
|
Classifier: Operating System :: OS Independent
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.6
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -56,6 +55,7 @@ Requires-Dist: twine; extra == "testing"
|
|
|
56
55
|
Requires-Dist: build; extra == "testing"
|
|
57
56
|
Requires-Dist: importlib-metadata<5; python_version == "3.7" and extra == "testing"
|
|
58
57
|
Dynamic: license-file
|
|
58
|
+
Dynamic: license-expression
|
|
59
59
|
|
|
60
60
|
SoCo
|
|
61
61
|
====
|
|
@@ -5,7 +5,8 @@ import requests_mock
|
|
|
5
5
|
from conftest import IP_ADDR
|
|
6
6
|
from soco import SoCo
|
|
7
7
|
from soco.core import ARC_ULTRA_PRODUCT_NAME, BEAM_ULTRA_PRODUCT_NAME
|
|
8
|
-
from soco.data_structures import to_didl_string
|
|
8
|
+
from soco.data_structures import DidlMusicTrack, to_didl_string
|
|
9
|
+
from soco.data_structures_entry import from_didl_string
|
|
9
10
|
from soco.exceptions import (
|
|
10
11
|
SoCoSlaveException,
|
|
11
12
|
SoCoUPnPException,
|
|
@@ -769,6 +770,79 @@ class TestAVTransport:
|
|
|
769
770
|
]
|
|
770
771
|
)
|
|
771
772
|
|
|
773
|
+
def test_soco_play_uri_with_mime_type(self, moco):
|
|
774
|
+
uri = "https://example.com/audio/stream"
|
|
775
|
+
|
|
776
|
+
moco.play_uri(uri, title="Example track", mime_type="audio/mpeg")
|
|
777
|
+
|
|
778
|
+
arguments = moco.avTransport.SetAVTransportURI.call_args.args[0]
|
|
779
|
+
metadata = dict(arguments)["CurrentURIMetaData"]
|
|
780
|
+
item = from_didl_string(metadata)[0]
|
|
781
|
+
assert isinstance(item, DidlMusicTrack)
|
|
782
|
+
assert item.title == "Example track"
|
|
783
|
+
assert item.resources[0].uri == uri
|
|
784
|
+
assert item.resources[0].protocol_info == "http-get:*:audio/mpeg:*"
|
|
785
|
+
|
|
786
|
+
def test_soco_play_uri_explicit_metadata_takes_precedence(self, moco):
|
|
787
|
+
metadata = "<DIDL-Lite />"
|
|
788
|
+
|
|
789
|
+
moco.play_uri(
|
|
790
|
+
"https://example.com/audio/stream",
|
|
791
|
+
meta=metadata,
|
|
792
|
+
mime_type="audio/mpeg",
|
|
793
|
+
)
|
|
794
|
+
|
|
795
|
+
arguments = moco.avTransport.SetAVTransportURI.call_args.args[0]
|
|
796
|
+
assert dict(arguments)["CurrentURIMetaData"] == metadata
|
|
797
|
+
|
|
798
|
+
def test_soco_play_uri_rejects_mime_type_with_force_radio(self, moco):
|
|
799
|
+
with pytest.raises(
|
|
800
|
+
ValueError, match="mime_type cannot be used with force_radio=True"
|
|
801
|
+
):
|
|
802
|
+
moco.play_uri(
|
|
803
|
+
"https://example.com/audio/stream",
|
|
804
|
+
mime_type="audio/mpeg",
|
|
805
|
+
force_radio=True,
|
|
806
|
+
)
|
|
807
|
+
|
|
808
|
+
moco.avTransport.SetAVTransportURI.assert_not_called()
|
|
809
|
+
|
|
810
|
+
def test_soco_play_uri_ignores_empty_mime_type(self, moco):
|
|
811
|
+
uri = "https://example.com/audio/stream"
|
|
812
|
+
|
|
813
|
+
moco.play_uri(uri, mime_type="")
|
|
814
|
+
|
|
815
|
+
arguments = moco.avTransport.SetAVTransportURI.call_args.args[0]
|
|
816
|
+
assert dict(arguments)["CurrentURIMetaData"] == ""
|
|
817
|
+
|
|
818
|
+
def test_soco_add_uri_to_queue_with_mime_type(self, moco):
|
|
819
|
+
uri = "https://example.com/audio/stream"
|
|
820
|
+
moco.avTransport.AddURIToQueue.return_value = {"FirstTrackNumberEnqueued": "1"}
|
|
821
|
+
|
|
822
|
+
position = moco.add_uri_to_queue(
|
|
823
|
+
uri, title="Example track", mime_type="audio/mpeg"
|
|
824
|
+
)
|
|
825
|
+
|
|
826
|
+
arguments = moco.avTransport.AddURIToQueue.call_args.args[0]
|
|
827
|
+
assert dict(arguments)["EnqueuedURI"] == uri
|
|
828
|
+
item = from_didl_string(dict(arguments)["EnqueuedURIMetaData"])[0]
|
|
829
|
+
assert isinstance(item, DidlMusicTrack)
|
|
830
|
+
assert item.title == "Example track"
|
|
831
|
+
assert item.resources[0].uri == uri
|
|
832
|
+
assert item.resources[0].protocol_info == "http-get:*:audio/mpeg:*"
|
|
833
|
+
assert position == 1
|
|
834
|
+
|
|
835
|
+
def test_soco_add_uri_to_queue_with_title_and_empty_mime_type(self, moco):
|
|
836
|
+
uri = "https://example.com/audio/stream"
|
|
837
|
+
moco.avTransport.AddURIToQueue.return_value = {"FirstTrackNumberEnqueued": "1"}
|
|
838
|
+
|
|
839
|
+
moco.add_uri_to_queue(uri, title="Example track", mime_type="")
|
|
840
|
+
|
|
841
|
+
arguments = moco.avTransport.AddURIToQueue.call_args.args[0]
|
|
842
|
+
item = from_didl_string(dict(arguments)["EnqueuedURIMetaData"])[0]
|
|
843
|
+
assert item.title == "Example track"
|
|
844
|
+
assert item.resources[0].protocol_info == "x-rincon-playlist:*:*:*"
|
|
845
|
+
|
|
772
846
|
def test_soco_pause(self, moco):
|
|
773
847
|
moco.pause()
|
|
774
848
|
moco.avTransport.Pause.assert_called_once_with(
|