File: exceptions.py

package info (click to toggle)
python-rxv 0.7.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,252 kB
  • sloc: xml: 23,024; python: 1,206; makefile: 5
file content (44 lines) | stat: -rw-r--r-- 1,262 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function


class RXVException(Exception):
    pass


class ResponseException(RXVException):
    """Exception raised when yamaha receiver responded with an error code"""
    pass


ReponseException = ResponseException


class MenuUnavailable(RXVException):
    """Menu control unavailable for current input"""
    pass


class MenuActionUnavailable(RXVException):
    """Menu control action unavailable for current input"""
    def __init__(self, input, action):
        super().__init__(f'{input} does not support menu cursor {action}')


class PlaybackUnavailable(RXVException):
    """Raised when playback function called on unsupported source."""
    def __init__(self, source, action):
        super().__init__('{} does not support {}'.format(source, action))


class CommandUnavailable(RXVException):
    """Raised when command is called on unsupported device."""
    def __init__(self, zone, command):
        super().__init__('{} does not support {}'.format(zone, command))


class UnknownPort(RXVException):
    """Raised when an unknown port is found."""
    def __init__(self, port):
        super().__init__('port {} is not supported'.format(port))