# Path: turbulenz_tools/utils/dependencies.py
# def find_file_in_dirs(filename, dirs, error_on_multiple = False):
#     found = []
#     for d in dirs:
#         fn = join(d, filename)
#         if exists(fn):
#             if error_on_multiple:
#                 if fn not in found:
#                     found.append(fn)
#             else:
#                 return abspath(fn)
#     if error_on_multiple:
#         if len(found) > 1:
#             raise Exception("File '%s' matched several locations: %s" % found)
#         if len(found) == 1:
#             return abspath(found[0])
#     return None
# 
# Path: turbulenz_tools/utils/profiler.py
# class Profiler(object):
# 
#     _profiler_impl = ProfilerDummyImpl()
# 
#     @classmethod
#     def enable(cls):
#         if not isinstance(cls._profiler_impl, ProfilerDummyImpl):
#             raise Exception("Profiler.enable_profiler() called twice")
#         cls._profiler_impl = ProfilerImpl()
# 
#     @classmethod
#     def start(cls, section_name):
#         cls._profiler_impl.start(section_name)
# 
#     @classmethod
#     def stop(cls, section_name):
#         cls._profiler_impl.stop(section_name)
# 
#     @classmethod
#     def get_root_nodes(cls):
#         return cls._profiler_impl.get_root_nodes()
# 
#     @classmethod
#     def dump_data(cls):
#         cls._profiler_impl.dump_data()
# 
# Path: turbulenz_tools/tools/toolsexception.py
# class ToolsException(Exception):
#     pass
# 
# Path: turbulenz_tools/tools/templates.py
# def read_file_utf8(filename):
#     with open(filename, 'rb') as f:
#         text = f.read().decode('utf-8-sig')
# 
#         # This is unpleasant, but it is thorough.  This is the
#         # single-pass equivalent of:
#         # return (in_data.replace('\r\n', '\n').replace('\n\r', '\n'))\
#         #     .replace('\r', '\n');
#         return LF_RE.sub(_sanitize_crlf, text)


from turbulenz_tools.utils.dependencies import find_file_in_dirs
from turbulenz_tools.utils.profiler import Profiler
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.templates import read_file_utf8
from re import compile as re_compile
from logging import getLogger
    from turbulenz_tools.version import SDK_VERSION as engine_version
import os.path
import glob
# Copyright (c) 2012-2014 Turbulenz Limited

"""
This file contains all of the code generation, formatting and default
templates for the build tools.  This includes the set of variables
used to render the html templates, the format of dependency
information and the set of shared options across the code build tools.
"""



__version__ = '1.1.4'

LOG = getLogger(__name__)

############################################################

DEFAULT_HTML_TEMPLATE = """

# Path: turbulenz_tools/utils/dependencies.py
# def find_file_in_dirs(filename, dirs, error_on_multiple = False):
#     found = []
#     for d in dirs:
#         fn = join(d, filename)
#         if exists(fn):
#             if error_on_multiple:
#                 if fn not in found:
#                     found.append(fn)
#             else:
#                 return abspath(fn)
#     if error_on_multiple:
#         if len(found) > 1:
#             raise Exception("File '%s' matched several locations: %s" % found)
#         if len(found) == 1:
#             return abspath(found[0])
#     return None
# 
# Path: turbulenz_tools/utils/profiler.py
# class Profiler(object):
# 
#     _profiler_impl = ProfilerDummyImpl()
# 
#     @classmethod
#     def enable(cls):
#         if not isinstance(cls._profiler_impl, ProfilerDummyImpl):
#             raise Exception("Profiler.enable_profiler() called twice")
#         cls._profiler_impl = ProfilerImpl()
# 
#     @classmethod
#     def start(cls, section_name):
#         cls._profiler_impl.start(section_name)
# 
#     @classmethod
#     def stop(cls, section_name):
#         cls._profiler_impl.stop(section_name)
# 
#     @classmethod
#     def get_root_nodes(cls):
#         return cls._profiler_impl.get_root_nodes()
# 
#     @classmethod
#     def dump_data(cls):
#         cls._profiler_impl.dump_data()
# 
# Path: turbulenz_tools/tools/toolsexception.py
# class ToolsException(Exception):
#     pass
# 
# Path: turbulenz_tools/tools/templates.py
# def read_file_utf8(filename):
#     with open(filename, 'rb') as f:
#         text = f.read().decode('utf-8-sig')
# 
#         # This is unpleasant, but it is thorough.  This is the
#         # single-pass equivalent of:
#         # return (in_data.replace('\r\n', '\n').replace('\n\r', '\n'))\
#         #     .replace('\r', '\n');
#         return LF_RE.sub(_sanitize_crlf, text)


# Path: turbulenz_tools/tools/appcodegen.py
from turbulenz_tools.utils.dependencies import find_file_in_dirs
from turbulenz_tools.utils.profiler import Profiler
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.templates import read_file_utf8
from re import compile as re_compile
from logging import getLogger
    from turbulenz_tools.version import SDK_VERSION as engine_version
import os.path
import glob

# Copyright (c) 2012-2014 Turbulenz Limited

"""
This file contains all of the code generation, formatting and default
templates for the build tools.  This includes the set of variables
used to render the html templates, the format of dependency
information and the set of shared options across the code build tools.
"""



__version__ = '1.1.4'

LOG = getLogger(__name__)

############################################################

DEFAULT_HTML_TEMPLATE = """

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">