muammar / mkchromecast

Cast macOS and Linux Audio/Video to your Google Cast and Sonos Devices
http://mkchromecast.com
Other
2.21k stars 137 forks source link

Creates an "Mkchromecast" class to encapsulate and centralize access to parsed arguments. #429

Closed xsdg closed 9 months ago

xsdg commented 9 months ago

Uses the Singleton pattern to ensure that arguments are only parsed once.

Also, drops some deprecated arguments.

The main benefit here is in explicitly declaring the type of each attribute, so that mypy/pytype have the information to determine whether they're being used appropriately (and in particular, whether usage points are correctly guarding against attribute values that may be None).

Follow-on commits will update the points of use to use this new API.

xsdg commented 9 months ago

This is part of #425