# Path: simiki/compat.py

# 
# 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 get_md5(filename):
#     # py3 require md5 with bytes object, otherwise raise
#     # TypeError: Unicode-objects must be encoded before hashing
#     with open(filename, 'rb') as fd:
#         md5_hash = hashlib.md5(fd.read()).hexdigest()
#     return md5_hash


import os
import shutil
import logging
from simiki.compat import raw_input
from simiki.utils import copytree, get_md5
#!/usr/bin/env python
# -*- coding: utf-8 -*-

logger = logging.getLogger(__name__)
yes_answer = ('y', 'yes')


def get_input(text):
    return raw_input(text)


def _update_file(filename, local_path, original_path):
    """
    :filename: file name to be updated, without directory
    :local_path: directory of local filename
    :original_path: directory of original filename
    """
    up_to_date = True

    original_fn = os.path.join(original_path, filename)
    local_fn = os.path.join(local_path, filename)

    try:
        if os.path.exists(local_fn):
            original_fn_md5 = get_md5(original_fn)

# Path: simiki/compat.py

# 
# 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 get_md5(filename):
#     # py3 require md5 with bytes object, otherwise raise
#     # TypeError: Unicode-objects must be encoded before hashing
#     with open(filename, 'rb') as fd:
#         md5_hash = hashlib.md5(fd.read()).hexdigest()
#     return md5_hash


# Path: simiki/updater.py
import os
import shutil
import logging
from simiki.compat import raw_input
from simiki.utils import copytree, get_md5

#!/usr/bin/env python
# -*- coding: utf-8 -*-

logger = logging.getLogger(__name__)
yes_answer = ('y', 'yes')


def get_input(text):
    return raw_input(text)


def _update_file(filename, local_path, original_path):
    """
    :filename: file name to be updated, without directory
    :local_path: directory of local filename
    :original_path: directory of original filename
    """
    up_to_date = True

    original_fn = os.path.join(original_path, filename)
    local_fn = os.path.join(local_path, filename)

    try:
        if os.path.exists(local_fn):
            original_fn_md5 = get_md5(original_fn)

            local_fn_md5 = get_md5(local_fn)