# 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
        option = self.normalize(option)
        if not self.parser.has_section(section):
            self.parser.add_section(section)

        logger.debug("action=get section=%s option=%s", section, option)

        return getattr(self.parser, method)(section, option, fallback=fallback)

    def set(self, section: str, option: str, value) -> None:
        logger.debug("action=set section=%s option=%s value=%s", section, option, value)

        section = self.normalize(section)
        option = self.normalize(option)
        if not self.parser.has_section(section):
            self.parser.add_section(section)
        self.parser.set(section, option, value)
        self.save()

        payload = Payload(action="set", section=section, option=option, value=value)
        self._bus.send(Events.CONFIG_CHANGE, payload=payload)

    def remove(self, section, option) -> None:
        logger.debug("action=remove section=%s option=%s", section, option)

        section = self.normalize(section)
        option = self.normalize(option)
        self.parser.remove_option(section, option)
        self.save()

        payload = Payload(action="remove", section=section, option=option, value="")

# 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

        option = self.normalize(option)
        if not self.parser.has_section(section):
            self.parser.add_section(section)

        logger.debug("action=get section=%s option=%s", section, option)

        return getattr(self.parser, method)(section, option, fallback=fallback)

    def set(self, section: str, option: str, value) -> None:
        logger.debug("action=set section=%s option=%s value=%s", section, option, value)

        section = self.normalize(section)
        option = self.normalize(option)
        if not self.parser.has_section(section):
            self.parser.add_section(section)
        self.parser.set(section, option, value)
        self.save()

        payload = Payload(action="set", section=section, option=option, value=value)
        self._bus.send(Events.CONFIG_CHANGE, payload=payload)

    def remove(self, section, option) -> None:
        logger.debug("action=remove section=%s option=%s", section, option)

        section = self.normalize(section)
        option = self.normalize(option)
        self.parser.remove_option(section, option)
        self.save()

        payload = Payload(action="remove", section=section, option=option, value="")

        self._bus.send(Events.CONFIG_CHANGE, payload=payload)