import logging
import os
import sys
from os.path import (
    exists,
    isdir,
    isfile,
    join,
    split,
    splitext,
)

log = logging.getLogger("pyglossary")

from pprint import pformat

from pyglossary.core import rootDir

sys.path.insert(0, rootDir)

from pyglossary import core
from pyglossary.compression import (
    compressionOpen,
    stdCompressions,
)
from pyglossary.core import (
    cacheDir,
    pip,
)
from pyglossary.flags import (
    ALWAYS,
    DEFAULT_NO,
    DEFAULT_YES,
    NEVER,
    YesNoAlwaysNever,
)
from pyglossary.glossary_type import EntryType, GlossaryType
from pyglossary.option import (
    BoolOption,
    DictOption,
    EncodingOption,
    FileSizeOption,
    FloatOption,
    HtmlColorOption,
    IntOption,
    ListOption,
    NewlineOption,
    StrOption,
)
from pyglossary.os_utils import indir
from pyglossary.text_utils import (
    replaceStringTable,
    toBytes,
    toStr,
)

enable = False
lname = ""
format = "Unknown"
description = "Unknown"
extensions = ()  # type: Tuple[str, ...]
extensionCreate = ""  # type: str
singleFile = False
kind = ""
wiki = ""
website = None

# key is option/argument name, value is instance of Option
optionsProp = {}  # type: Dict[str, Option]

sortOnWrite = DEFAULT_NO  # type: YesNoAlwaysNever

__all__ = [
	"ALWAYS",
	"BoolOption",
	"DEFAULT_NO",
	"DEFAULT_YES",
	"DictOption",
	"EncodingOption",
	"EntryType",
	"FileSizeOption",
	"FloatOption",
	"GlossaryType",
	"HtmlColorOption",
	"IntOption",
	"ListOption",
	"NEVER",
	"NewlineOption",
	"StrOption",
	"YesNoAlwaysNever",
	"cacheDir",
	"compressionOpen",
	"core",
	"description",
	"enable",
	"exists",
	"extensionCreate",
	"extensions",
	"format",
	"indir",
	"isdir",
	"isfile",
	"join",
	"kind",
	"lname",
	"log",
	"logging",
	"optionsProp",
	"os",
	"pformat",
	"pip",
	"replaceStringTable",
	"rootDir",
	"singleFile",
	"sortOnWrite",
	"split",
	"splitext",
	"stdCompressions",
	"toBytes",
	"toStr",
	"website",
	"wiki",
]
