# Path: lamvery/log.py
# def get_logger(name):
#     global logger
#     if logger is None:
#         logger = logging.getLogger(name)
#         logger.setLevel(logging.INFO)
#         handler = ColoredStreamHandler(stream=sys.stderr)
#         handler.setLevel(logging.INFO)
#         handler.setFormatter(
#             logging.Formatter('%(name)s: %(message)s'))
#         logger.removeHandler(handler)
#         logger.addHandler(handler)
#     return logger
# 
# Path: lamvery/utils.py
# def run_commands(commands, working_dir=os.getcwd()):
#     cwd = os.getcwd()
#     os.chdir(working_dir)
# 
#     for c in commands:
#         try:
#             subprocess.check_output(
#                 c, stderr=subprocess.STDOUT, shell=True)
#         except subprocess.CalledProcessError as e:
#             os.chdir(cwd)
#             raise Exception(e.output)
# 
#     os.chdir(cwd)


import os
import sys
import tempfile
import shutil
import re
import warnings
import json
import lamvery.secret
import lamvery.config
from zipfile import PyZipFile, ZIP_DEFLATED
from lamvery.log import get_logger
from lamvery.utils import run_commands
    def is_exclude_file(self, name):
        if self.is_exclude(name):
            return True
        if name == self._filename:
            return True
        return False

    def is_exclude_dir(self, name):
        if self.is_exclude(name):
            return True
        for ex in EXCLUDE_DIR:
            if name == ex:
                return True
        return False

    def is_source_file(self, name):
        return PYFILE_PATTERN.match(name) is not None

    def _get_paths(self):
        paths = []

        if self._single_file:
            f = self._function_filename
            return [os.path.join(os.getcwd(), f)]

        if self._clean_build:
            for p in os.listdir(self._clean_build_dir):
                paths.append(os.path.join(self._clean_build_dir, p))
            return paths


# Path: lamvery/log.py
# def get_logger(name):
#     global logger
#     if logger is None:
#         logger = logging.getLogger(name)
#         logger.setLevel(logging.INFO)
#         handler = ColoredStreamHandler(stream=sys.stderr)
#         handler.setLevel(logging.INFO)
#         handler.setFormatter(
#             logging.Formatter('%(name)s: %(message)s'))
#         logger.removeHandler(handler)
#         logger.addHandler(handler)
#     return logger
# 
# Path: lamvery/utils.py
# def run_commands(commands, working_dir=os.getcwd()):
#     cwd = os.getcwd()
#     os.chdir(working_dir)
# 
#     for c in commands:
#         try:
#             subprocess.check_output(
#                 c, stderr=subprocess.STDOUT, shell=True)
#         except subprocess.CalledProcessError as e:
#             os.chdir(cwd)
#             raise Exception(e.output)
# 
#     os.chdir(cwd)


# Path: lamvery/build.py
import os
import sys
import tempfile
import shutil
import re
import warnings
import json
import lamvery.secret
import lamvery.config
from zipfile import PyZipFile, ZIP_DEFLATED
from lamvery.log import get_logger
from lamvery.utils import run_commands

    def is_exclude_file(self, name):
        if self.is_exclude(name):
            return True
        if name == self._filename:
            return True
        return False

    def is_exclude_dir(self, name):
        if self.is_exclude(name):
            return True
        for ex in EXCLUDE_DIR:
            if name == ex:
                return True
        return False

    def is_source_file(self, name):
        return PYFILE_PATTERN.match(name) is not None

    def _get_paths(self):
        paths = []

        if self._single_file:
            f = self._function_filename
            return [os.path.join(os.getcwd(), f)]

        if self._clean_build:
            for p in os.listdir(self._clean_build_dir):
                paths.append(os.path.join(self._clean_build_dir, p))
            return paths


        logger = get_logger(__name__)