Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a separate module that tests whether the stream can be played #20

Open
GijsTimmers opened this issue Jan 7, 2016 · 0 comments
Open

Comments

@GijsTimmers
Copy link
Owner

At the moment, there may be several reasons on why stream cannot be played:

  • mplayer2 is not installed
  • the stream is offline

These are currently being handled by Radio().afspelen(). I don't really like this.

Solution: create a separate class with modules that check whether everything is in place, e.g.

class CheckSetup():
    def stream():
        if stream_is_online:
            STREAM_ONLINE = True

    def mplayer(self):
        if mplayer_works:
            MPLAYER_WORKS = True
    def check(self)
        return(self.stream(), self.mplayer())

if not False in CheckSetup():
    continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant