# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):
# 
# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):


import codecs
import configparser
import datetime
import io
import os
import re
import sys
from configparser import NoOptionError, NoSectionError
from datetime import timedelta
from dateutil.relativedelta import FR as FRIDAY
from dateutil.relativedelta import MO as MONDAY
from dateutil.relativedelta import relativedelta as delta
from did import utils
from did.utils import log

    @property
    def plugins(self):
        """ Custom plugins """
        try:
            return self.parser.get("general", "plugins")
        except BaseException:
            return None

    @property
    def quarter(self):
        """ The first month of the quarter, 1 by default """
        try:
            month = self.parser.get("general", "quarter", fallback=1)
            month = int(month) % 3
        except ValueError:
            raise ConfigError(
                f"Invalid quarter start '{month}', should be integer.")
        return month

    @property
    def email(self):
        """ User email(s) """
        try:
            return self.parser.get("general", "email")
        except NoSectionError as error:
            log.debug(error)
            raise ConfigFileError(
                "No general section found in the config file.")
        except NoOptionError as error:

# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):
# 
# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):


# Path: did/base.py
import codecs
import configparser
import datetime
import io
import os
import re
import sys
from configparser import NoOptionError, NoSectionError
from datetime import timedelta
from dateutil.relativedelta import FR as FRIDAY
from dateutil.relativedelta import MO as MONDAY
from dateutil.relativedelta import relativedelta as delta
from did import utils
from did.utils import log


    @property
    def plugins(self):
        """ Custom plugins """
        try:
            return self.parser.get("general", "plugins")
        except BaseException:
            return None

    @property
    def quarter(self):
        """ The first month of the quarter, 1 by default """
        try:
            month = self.parser.get("general", "quarter", fallback=1)
            month = int(month) % 3
        except ValueError:
            raise ConfigError(
                f"Invalid quarter start '{month}', should be integer.")
        return month

    @property
    def email(self):
        """ User email(s) """
        try:
            return self.parser.get("general", "email")
        except NoSectionError as error:
            log.debug(error)
            raise ConfigFileError(
                "No general section found in the config file.")
        except NoOptionError as error:

            log.debug(error)