# Path: simiki/config.py
# def parse_config(config_file):
#     if not os.path.exists(config_file):
#         raise ConfigFileNotFound("{0} not exists".format(config_file))
# 
#     default_config = _set_default_config()
# 
#     with io.open(config_file, "rt", encoding="utf-8") as fd:
#         config = yaml.load(fd, Loader=yaml.FullLoader)
# 
#     default_config.update(config)
#     config = _post_process(default_config)
# 
#     return config
# 
# Path: simiki/utils.py
# def copytree(src, dst, symlinks=False, ignore=None):
#     """Copy from source directory to destination"""
# 
#     if not os.path.exists(dst):
#         os.makedirs(dst)
#     for item in os.listdir(src):
#         s = os.path.join(src, item)
#         d = os.path.join(dst, item)
#         if os.path.isdir(s):
#             copytree(s, d, symlinks, ignore)
#         else:
#             shutil.copy2(s, d)
# 
# def mkdir_p(path):
#     """Make parent directories as needed, like `mkdir -p`"""
#     try:
#         os.makedirs(path)
#     except OSError as exc:  # Python >2.5
#         # if dir exists, not error
#         if exc.errno == errno.EEXIST and os.path.isdir(path):
#             pass
#         else:
#             raise
# 
# def listdir_nohidden(path):
#     """List not hidden files or directories under path"""
#     for f in os.listdir(path):
#         if isinstance(f, str):
#             f = unicode(f)
#         if not f.startswith('.'):
#             yield f
# 
# Path: simiki/compat.py



import os
import os.path
import shutil
import logging
from simiki.config import parse_config
from simiki.utils import (copytree, mkdir_p, listdir_nohidden)
from simiki.compat import raw_input
        if next(nohidden_dir, False):
            return

        src_demo = os.path.join(self.source_path, self.conf_template_dn,
                                self.demo_fn)
        dst_demo = os.path.join(self.target_path, "content", "intro",
                                self.demo_fn)
        self.get_file(src_demo, dst_demo)

    def get_default_theme(self, theme_path):
        default_theme_name = self.config['theme']
        src_theme = os.path.join(self.source_path, self.config['themes_dir'],
                                 default_theme_name)
        dst_theme = os.path.join(theme_path, default_theme_name)
        if os.path.exists(dst_theme):
            logging.warning('{0} exists'.format(dst_theme))
        else:
            copytree(src_theme, dst_theme)
            logging.info("Copying default theme '{0}' to: {1}"
                         .format(default_theme_name, theme_path))

    def init(self, ask=False, **kwargs):
        content_path = os.path.join(self.target_path, self.config["source"])
        output_path = os.path.join(self.target_path,
                                   self.config["destination"])
        theme_path = os.path.join(self.target_path, self.config['themes_dir'])
        for path in (content_path, output_path, theme_path):
            if os.path.exists(path):
                logging.warning("{0} exists".format(path))
            else:

# Path: simiki/config.py
# def parse_config(config_file):
#     if not os.path.exists(config_file):
#         raise ConfigFileNotFound("{0} not exists".format(config_file))
# 
#     default_config = _set_default_config()
# 
#     with io.open(config_file, "rt", encoding="utf-8") as fd:
#         config = yaml.load(fd, Loader=yaml.FullLoader)
# 
#     default_config.update(config)
#     config = _post_process(default_config)
# 
#     return config
# 
# Path: simiki/utils.py
# def copytree(src, dst, symlinks=False, ignore=None):
#     """Copy from source directory to destination"""
# 
#     if not os.path.exists(dst):
#         os.makedirs(dst)
#     for item in os.listdir(src):
#         s = os.path.join(src, item)
#         d = os.path.join(dst, item)
#         if os.path.isdir(s):
#             copytree(s, d, symlinks, ignore)
#         else:
#             shutil.copy2(s, d)
# 
# def mkdir_p(path):
#     """Make parent directories as needed, like `mkdir -p`"""
#     try:
#         os.makedirs(path)
#     except OSError as exc:  # Python >2.5
#         # if dir exists, not error
#         if exc.errno == errno.EEXIST and os.path.isdir(path):
#             pass
#         else:
#             raise
# 
# def listdir_nohidden(path):
#     """List not hidden files or directories under path"""
#     for f in os.listdir(path):
#         if isinstance(f, str):
#             f = unicode(f)
#         if not f.startswith('.'):
#             yield f
# 
# Path: simiki/compat.py



# Path: simiki/initiator.py
import os
import os.path
import shutil
import logging
from simiki.config import parse_config
from simiki.utils import (copytree, mkdir_p, listdir_nohidden)
from simiki.compat import raw_input

        if next(nohidden_dir, False):
            return

        src_demo = os.path.join(self.source_path, self.conf_template_dn,
                                self.demo_fn)
        dst_demo = os.path.join(self.target_path, "content", "intro",
                                self.demo_fn)
        self.get_file(src_demo, dst_demo)

    def get_default_theme(self, theme_path):
        default_theme_name = self.config['theme']
        src_theme = os.path.join(self.source_path, self.config['themes_dir'],
                                 default_theme_name)
        dst_theme = os.path.join(theme_path, default_theme_name)
        if os.path.exists(dst_theme):
            logging.warning('{0} exists'.format(dst_theme))
        else:
            copytree(src_theme, dst_theme)
            logging.info("Copying default theme '{0}' to: {1}"
                         .format(default_theme_name, theme_path))

    def init(self, ask=False, **kwargs):
        content_path = os.path.join(self.target_path, self.config["source"])
        output_path = os.path.join(self.target_path,
                                   self.config["destination"])
        theme_path = os.path.join(self.target_path, self.config['themes_dir'])
        for path in (content_path, output_path, theme_path):
            if os.path.exists(path):
                logging.warning("{0} exists".format(path))
            else:

                mkdir_p(path)