# Path: stagehand/toolbox/xmlconfig.py
# def get_value(value, type):
# def format_content(node):
# def nodefilter(node, *names):
#     def __init__(self, package):
#     def _get_schema(self, node):
#     def parse(self, node, fd, deep=''):
#     def _parse_var(self, node, fd, deep, first, defaults_list):
#     def _parse_config(self, node, fd, deep, first, defaults):
#     def _parse_group(self, node, fd, deep, first, defaults):
#     def _parse_list(self, node, fd, deep, first, defaults):
#     def _parse_dict(self, node, fd, deep, first, defaults):
# def _convert(xml, out, package, cfgmodule):
# def convert(infile, outfile, package, cfgmodule='config'):
# def to_code(xml, package=None, cfgmodule='config'):
# def to_object(xml, package=None, cfgmodule='config'):
# class Parser:
# 
# Path: stagehand/coffee.py
# class CSCompileError(ValueError):
# def cscompile(src, dst=None, is_html=None):
#     def subfunc(match):
# def cscompile_with_cache(src, cachedir, is_html=None):


import sys
import os
import platform
import glob
import shutil
from distutils.command.build_scripts import build_scripts as _build_scripts
from distutils.command.build_py import build_py as _build_py
from distutils.cmd import Command
from distutils.core import setup
from distutils import log
from stagehand.toolbox import xmlconfig
from stagehand import coffee
    def _compile_coffee(self):
        # If the user extracts a tarball without preserving mtime, it may be possible
        # for a not-actually-stale compiled coffee file to have a slightly older mtime
        # than the source.  Here we determine the mtimes of newest and oldest data
        # files and if the range is within 10 seconds we assume that's the case and
        # avoid compiling, since we don't want to require users to have coffee
        # installed.
        oldest = newest = 0
        for path, files in self.distribution.data_files:
            for f in files:
                age = os.path.getmtime(f)
                oldest = min(oldest, age) or age
                newest = max(newest, age) or age
        # Assume untarring isn't going to take more than 10 seconds, so if
        # the range is within this then we don't compile.
        force_no_compile = newest - oldest < 10

        for path, files in self.distribution.data_files:
            for f in files:
                if os.path.splitext(f)[1] not in ('.tmpl', '.coffee'):
                    continue
                fc = f + '.compiled'
                if os.path.exists(fc) and force_no_compile:
                    # Touch the compiled file to ensure it is newer than the source.
                    os.utime(fc, None)
                elif not os.path.exists(fc) or os.path.getmtime(f) > os.path.getmtime(fc):
                    is_html = False if f.endswith('.coffee') else True
                    print('compiling coffeescript %s -> %s' % (f, fc))
                    try:
                        coffee.cscompile(f, fc, is_html)

# Path: stagehand/toolbox/xmlconfig.py
# def get_value(value, type):
# def format_content(node):
# def nodefilter(node, *names):
#     def __init__(self, package):
#     def _get_schema(self, node):
#     def parse(self, node, fd, deep=''):
#     def _parse_var(self, node, fd, deep, first, defaults_list):
#     def _parse_config(self, node, fd, deep, first, defaults):
#     def _parse_group(self, node, fd, deep, first, defaults):
#     def _parse_list(self, node, fd, deep, first, defaults):
#     def _parse_dict(self, node, fd, deep, first, defaults):
# def _convert(xml, out, package, cfgmodule):
# def convert(infile, outfile, package, cfgmodule='config'):
# def to_code(xml, package=None, cfgmodule='config'):
# def to_object(xml, package=None, cfgmodule='config'):
# class Parser:
# 
# Path: stagehand/coffee.py
# class CSCompileError(ValueError):
# def cscompile(src, dst=None, is_html=None):
#     def subfunc(match):
# def cscompile_with_cache(src, cachedir, is_html=None):


# Path: setup.py
import sys
import os
import platform
import glob
import shutil
from distutils.command.build_scripts import build_scripts as _build_scripts
from distutils.command.build_py import build_py as _build_py
from distutils.cmd import Command
from distutils.core import setup
from distutils import log
from stagehand.toolbox import xmlconfig
from stagehand import coffee

    def _compile_coffee(self):
        # If the user extracts a tarball without preserving mtime, it may be possible
        # for a not-actually-stale compiled coffee file to have a slightly older mtime
        # than the source.  Here we determine the mtimes of newest and oldest data
        # files and if the range is within 10 seconds we assume that's the case and
        # avoid compiling, since we don't want to require users to have coffee
        # installed.
        oldest = newest = 0
        for path, files in self.distribution.data_files:
            for f in files:
                age = os.path.getmtime(f)
                oldest = min(oldest, age) or age
                newest = max(newest, age) or age
        # Assume untarring isn't going to take more than 10 seconds, so if
        # the range is within this then we don't compile.
        force_no_compile = newest - oldest < 10

        for path, files in self.distribution.data_files:
            for f in files:
                if os.path.splitext(f)[1] not in ('.tmpl', '.coffee'):
                    continue
                fc = f + '.compiled'
                if os.path.exists(fc) and force_no_compile:
                    # Touch the compiled file to ensure it is newer than the source.
                    os.utime(fc, None)
                elif not os.path.exists(fc) or os.path.getmtime(f) > os.path.getmtime(fc):
                    is_html = False if f.endswith('.coffee') else True
                    print('compiling coffeescript %s -> %s' % (f, fc))
                    try:
                        coffee.cscompile(f, fc, is_html)

                    except coffee.CSCompileError as e: