# Path: tomate/pomodoro/event.py
# class Bus:
#     def __init__(self):
#         self._bus = blinker.NamedSignal("tomate")
# 
#     def connect(self, event: Events, receiver: Receiver, weak: bool = True):
#         self._bus.connect(receiver, sender=event, weak=weak)
# 
#     def is_connect(self, event: Events, receiver: Receiver) -> bool:
#         return receiver in self._bus.receivers_for(event)
# 
#     def send(self, event: Events, payload: Any = None) -> List[Any]:
#         # drop receiver, index 0, from the result
#         return [result[1] for result in self._bus.send(event, payload=payload)]
# 
#     def disconnect(self, event: Events, receiver: Receiver):
#         self._bus.disconnect(receiver, sender=event)
# 
# class Events(enum.Enum):
#     TIMER_START = 0
#     TIMER_UPDATE = 1
#     TIMER_STOP = 2
#     TIMER_END = 3
# 
#     SESSION_READY = 4
#     SESSION_START = 5
#     SESSION_INTERRUPT = 6
#     SESSION_CHANGE = 7
#     SESSION_END = 8
#     SESSION_RESET = 9
# 
#     WINDOW_SHOW = 10
#     WINDOW_HIDE = 11
# 
#     CONFIG_CHANGE = 12


import logging
import os
from collections import namedtuple
from configparser import RawConfigParser
from typing import List, Union
from wiring import SingletonScope, inject
from wiring.scanning import register
from xdg import BaseDirectory, IconTheme
from .event import Bus, Events
    def icon_paths(self) -> List[str]:
        return remove_duplicates(self._load_data_paths("icons"))

    def _resource_path(self, *resources) -> str:
        for resource in self._load_data_paths(*resources):
            if os.path.exists(resource):
                return resource

        raise EnvironmentError("Resource '%s' not found!" % resources[-1])

    def _load_data_paths(self, *resources) -> List[str]:
        return [path for path in BaseDirectory.load_data_paths(*resources)]

    def icon_path(self, iconname, size=None, theme=None) -> str:
        icon_path = IconTheme.getIconPath(iconname, size, theme, extensions=["png", "svg", "xpm"])

        if icon_path is not None:
            return icon_path

        raise EnvironmentError("Icon '%s' not found!" % iconname)

    def get_int(self, section: str, option: str, fallback=None) -> int:
        return self.get(section, option, fallback, method="getint")

    def get_bool(self, section: str, option: str, fallback=None) -> bool:
        return self.get(section, option, fallback, method="getboolean")

    def get(self, section: str, option: str, fallback=None, method="get") -> Union[str, int, bool]:
        section = self.normalize(section)
        option = self.normalize(option)

# Path: tomate/pomodoro/event.py
# class Bus:
#     def __init__(self):
#         self._bus = blinker.NamedSignal("tomate")
# 
#     def connect(self, event: Events, receiver: Receiver, weak: bool = True):
#         self._bus.connect(receiver, sender=event, weak=weak)
# 
#     def is_connect(self, event: Events, receiver: Receiver) -> bool:
#         return receiver in self._bus.receivers_for(event)
# 
#     def send(self, event: Events, payload: Any = None) -> List[Any]:
#         # drop receiver, index 0, from the result
#         return [result[1] for result in self._bus.send(event, payload=payload)]
# 
#     def disconnect(self, event: Events, receiver: Receiver):
#         self._bus.disconnect(receiver, sender=event)
# 
# class Events(enum.Enum):
#     TIMER_START = 0
#     TIMER_UPDATE = 1
#     TIMER_STOP = 2
#     TIMER_END = 3
# 
#     SESSION_READY = 4
#     SESSION_START = 5
#     SESSION_INTERRUPT = 6
#     SESSION_CHANGE = 7
#     SESSION_END = 8
#     SESSION_RESET = 9
# 
#     WINDOW_SHOW = 10
#     WINDOW_HIDE = 11
# 
#     CONFIG_CHANGE = 12


# Path: tomate/pomodoro/config.py
import logging
import os
from collections import namedtuple
from configparser import RawConfigParser
from typing import List, Union
from wiring import SingletonScope, inject
from wiring.scanning import register
from xdg import BaseDirectory, IconTheme
from .event import Bus, Events

    def icon_paths(self) -> List[str]:
        return remove_duplicates(self._load_data_paths("icons"))

    def _resource_path(self, *resources) -> str:
        for resource in self._load_data_paths(*resources):
            if os.path.exists(resource):
                return resource

        raise EnvironmentError("Resource '%s' not found!" % resources[-1])

    def _load_data_paths(self, *resources) -> List[str]:
        return [path for path in BaseDirectory.load_data_paths(*resources)]

    def icon_path(self, iconname, size=None, theme=None) -> str:
        icon_path = IconTheme.getIconPath(iconname, size, theme, extensions=["png", "svg", "xpm"])

        if icon_path is not None:
            return icon_path

        raise EnvironmentError("Icon '%s' not found!" % iconname)

    def get_int(self, section: str, option: str, fallback=None) -> int:
        return self.get(section, option, fallback, method="getint")

    def get_bool(self, section: str, option: str, fallback=None) -> bool:
        return self.get(section, option, fallback, method="getboolean")

    def get(self, section: str, option: str, fallback=None, method="get") -> Union[str, int, bool]:
        section = self.normalize(section)
        option = self.normalize(option)

        if not self.parser.has_section(section):