# HG changeset patch # User M. George Hansen # Date 1307743059 36000 # Node ID e97972cc7110dcac1c29cd21d183083710b9b2f2 # Parent 2e2d6d9009a342a1a9bc1ff41ff9ac25401c4ff9# Parent de378945b839b67082d6f8c0f09517ba143dcadd Merged WAF fork with Beliar's Windows launcher fix. * Removed SCons and distutils scripts since they aren't needed any more. diff -r 2e2d6d9009a3 -r e97972cc7110 SConstruct --- a/SConstruct Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -import sys -import os -import platform -import compileall -import fnmatch -from copy import copy -from collections import Sequence -from types import StringType -from multiprocessing import cpu_count - -from SCons.Util import is_Sequence, is_Dict -from SCons.Tool.install import copyFunc - -#def recursive_glob(topdir_path, include_pattern='*', exclude_pattern=''): -# """ -# Locate all files matching supplied filename pattern in and below -# supplied root directory. -# """ -# for dir_path, subdir_names, file_names in \ -# os.walk(os.path.abspath(topdir_path)): -# for file_name in fnmatch.filter(file_names, include_pattern): -# if not fnmatch.fnmatch(file_name, exclude_pattern): -# file_path = os.path.join(dir_path, file_name) -# yield File(file_path) -# for subdir_name in copy(subdir_names): -# if not fnmatch.fnmatch(subdir_name, include_pattern) or \ -# fnmatch.fnmatch(subdir_name, exclude_pattern): -# subdir_names.remove(subdir_name) -# else: -# subdir_path = os.path.join(dir_path, subdir_name) - -def InstallChmod(env, dest, source, mode): - targets = env.Install(dest, source) - for target in targets: - env.AddPostAction(target, Chmod(target, mode)) - return targets - -def InstallExecutable(env, dest, source): - return env.InstallChmod(dest, source, mode=0755) - -def InstallReadOnly(env, dest, source): - if not isinstance(source, Sequence): - source = [source] - targets = [] - for entry in map(Entry, source): - entry.disambiguate() - if entry.isdir(): - target = env.InstallChmod(dest, entry, mode=0755) - elif entry.isfile(): - target = env.InstallChmod(dest, entry, mode=0644) - else: - # Something really weird happened and entry is not a Dir or a - # File... (Note: Yes this can happen!) - error_message = \ - 'expected entry to be a Dir or a File, but got {0!r}' - raise ValueError(error_message.format(entry)) - targets.append(target) - return targets - -def SubstfileEscape(env, *args, **kwargs): - subst_dict = kwargs.get('SUBST_DICT') or env.get('SUBST_DICT') - escape_sequences = kwargs.get('ESCAPE_SEQUENCES') or env.get('ESCAPE_SEQUENCES') - if subst_dict is not None and escape_sequences is not None: - if not is_Dict(subst_dict) and is_Sequence(subst_dict): - subst_dict = dict(subst_dict) - else: - error_message = 'SUBST_DICT must be dict or sequence' - raise SCons.Errors.UserError(error_message) - escaped_subst_dict = {} - for key, value in subst_dict.items(): - escaped_value = value - for seq, escaped_seq in escape_sequences.items(): - escaped_value = escaped_value.replace(seq, escaped_seq) - escaped_subst_dict[key] = escaped_value - kwargs['SUBST_DICT'] = escaped_subst_dict - - target = env.Substfile(*args, **kwargs) - return target - -AddMethod(Environment, InstallChmod) -AddMethod(Environment, InstallExecutable) -AddMethod(Environment, InstallReadOnly) -AddMethod(Environment, SubstfileEscape) - -EnsurePythonVersion(2, 6) - -AddOption( - '--stand-alone', - dest='stand_alone', - action='store_true', - default=False, - help='install the entire program under installation prefix instead of in ' - 'various system folders' -) -AddOption( - '--no-compile', - dest='compile', - action='store_false', - default=True, - help='don\'t compile any Python modules into .pyc files before installing', -) -SetOption('num_jobs', cpu_count()) - -def is_abs_path(key, val, env): - if not os.path.isabs(val): - error_message = '${key} must be an absolute path' - raise ValueError(error_message.format(key=key)) - env[key] = os.path.normpath(val) - -variables = Variables() -# NOTE M. George Hansen 2011-05-13: Path variables are based on the GNU -# standards as defined at http://www.gnu.org/prep/standards/html_node/Directory-Variables.html - -# Platform-specific variable defaults. -# FIXME M. George Hansen 2011-05-12: Define the MacOS-specific -# environmental variables (and check version...) -platform_name = platform.system() -if platform_name in ['Linux', 'MacOS']: - if GetOption('stand_alone'): - PREFIX_DEFAULT = '/opt' - else: - PREFIX_DEFAULT = '/usr/local' - BIN_DIR_DEFAULT = '$EXEC_PREFIX/bin' - DATA_ROOT_DIR_DEFAULT = '$PREFIX/share/$PROJECT_NAME' - SYS_CONF_DIR_DEFAULT = '$PREFIX/etc/$PROJECT_NAME' - INCLUDE_DIR_DEFAULT = '$PREFIX/include/$PROJECT_NAME' - DOC_DIR_DEFAULT = '$DATA_ROOT_DIR/doc/$PROJECT_NAME' - LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib' - dist_name, dist_version, dist_id = \ - platform.linux_distribution(full_distribution_name=False) - if dist_name in ['debian', 'Ubuntu']: - # Debian uses dist-packages instead of site-packages for Python - # versions > 2.5. - PY_PACKAGES_DIR_DEFAULT = '$EXEC_PREFIX/lib/python$PY_VERSION_SHORT/' \ - 'dist-packages' - else: - PY_PACKAGES_DIR_DEFAULT = '$EXEC_PREFIX/lib/python$PY_VERSION_SHORT/' \ - 'site-packages' - PY_HEADERS_DIR_DEFAULT = '/usr/include/python$PY_VERSION_SHORT' - PY_LIB_DIR_DEFAULT = '/usr/lib' - PY_LIB_NAME = 'python$PY_VERSION_SHORT' -elif platform_name == 'Windows': - try: - PREFIX_DEFAULT = os.environ['PROGRAMFILES'] + r'\$PROGRAM_NAME' - except KeyError: - PREFIX_DEFAULT = '' - error_message = '%PROGRAMFILES% environmental variable is not ' \ - 'set, unable to determine path to Program Files ' \ - 'folder' - raise SConfWarning(error_message) - BIN_DIR_DEFAULT = '$EXEC_PREFIX' - DATA_ROOT_DIR_DEFAULT = '$PREFIX/data' - SYS_CONF_DIR_DEFAULT = '$PREFIX/config' - INCLUDE_DIR_DEFAULT = '$PREFIX/include' - DOC_DIR_DEFAULT = '$PREFIX/doc/' - LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib' - # FIXME M. George Hansen 2011-05-12: Does sys.prefix include the - # PythonX.Y part on Windows? - python_prefix = sys.prefix - if GetOption('stand_alone'): - PY_PACKAGES_DIR_DEFAULT = '$PREFIX/lib' - else: - PY_PACKAGES_DIR_DEFAULT = \ - os.path.join(python_prefix, 'Lib', 'site-packages') - PY_HEADERS_DIR_DEFAULT = os.path.join(python_prefix, 'include') - PY_LIB_DIR_DEFAULT = os.path.join(python_prefix, 'libs') - PY_LIB_NAME = 'python$PY_VERSION_MAJOR$PY_VERSION_MINOR' - -# Platform-independant variables: -variables.AddVariables( - PathVariable( - 'PREFIX', - 'directory under which most or all of the program components should ' - 'be installed', - PREFIX_DEFAULT, - is_abs_path, - ), - PathVariable( - 'EXEC_PREFIX', - 'directory under which machine-specific compiled libraries and ' - 'objects should be installed', - '$PREFIX', - is_abs_path, - ), - PathVariable( - 'BIN_DIR', - 'directory where program executables should be installed', - BIN_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'DATA_ROOT_DIR', - 'directory under which read-only, architecture-independant data files ' - 'should be installed', - DATA_ROOT_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'DATA_DIR', - 'directory where read-only, architecture-independant data files ' - 'should be installed', - '$DATA_ROOT_DIR', - is_abs_path, - ), - PathVariable( - 'SYS_CONF_DIR', - 'directory where read-only, machine-specific data files should be ' - 'installed', - SYS_CONF_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'INCLUDE_DIR', - 'directory where C/C++ header files should be installed', - INCLUDE_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'DOC_DIR', - 'directory where program documentation should be installed', - DOC_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'LIB_DIR', - 'directory where platform-dependant, compiled library and object ' - 'files should be installed', - LIB_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'PY_PACKAGES_DIR', - 'directory where pure Python modules and packages should be installed', - PY_PACKAGES_DIR_DEFAULT, - is_abs_path, - ), - PathVariable( - 'PY_HEADERS_DIR', - 'directory where Python.h can be found', - PY_HEADERS_DIR_DEFAULT, - ), - PathVariable( - 'PY_LIB_DIR', - 'directory where the Python shared library can be found', - PY_LIB_DIR_DEFAULT, - ), - BoolVariable( - 'DEBUG', - 'if True, compile the program launcher executable with debugging ' - 'symbols', - False, - ), -) - -python_version_tuple = platform.python_version_tuple() - -environment = Environment( - tools=['default', 'cpython', 'textfile', 'packaging'], - variables=variables, - PROJECT_NAME='parpg', - PROJECT_VERSION_MAJOR=0, - PROJECT_VERSION_MINOR=2, - PROJECT_VERSION_PATCH=0, - PROJECT_VERSION_SHORT='${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MAJOR}', - PROJECT_VERSION_LONG='${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.' - '${PROJECT_VERSION_PATCH}', - PYTHON=sys.executable, - PY_VERSION_MAJOR=python_version_tuple[0], - PY_VERSION_MINOR=python_version_tuple[1], - PY_VERSION_PATCH=python_version_tuple[2], - PY_VERSION_SHORT='${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}', - PY_VERSION_LONG='${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}.' - '${PY_VERSION_PATCH}', - PY_LIB_NAME=PY_LIB_NAME, - BUILD_DIR=Dir('build'), -) -if environment['DEBUG']: - if platform_name == 'Windows': - environment['CCPDBFLAGS'] = '/Z7 /Od' - environment.AppendUnique(LINKFLAGS='/DEBUG') - else: - environment.AppendUnique(CCFLAGS=['-gdwarf-2', '-g3']) - -Help(variables.GenerateHelpText(environment)) - -local_config_dict = { - '@PREFIX@': '${BUILD_DIR.abspath}', - '@LIB_DIR@': '${BUILD_DIR.abspath}', - '@PY_PACKAGES_DIR@': '${BUILD_DIR.abspath}', - '@BIN_DIR@': '${BUILD_DIR.abspath}', - '@SYS_CONF_DIR@': '${BUILD_DIR.abspath}', - '@DATA_DIR@': '${BUILD_DIR.abspath}/data', - '@PYTHON@': '$PYTHON', -} -system_config_dict = [('@{0}@'.format(key), environment.Dictionary()[key]) for - key in ('PREFIX', 'LIB_DIR', 'PY_PACKAGES_DIR', - 'BIN_DIR', 'SYS_CONF_DIR', 'DATA_DIR', 'PYTHON')] - -build_py_packages = environment.Install( - '$BUILD_DIR', - 'src/parpg', -) -#build_py_packages = environment.InstallPython( -# '$BUILD_DIR/parpg', -# py_sources, -# PYTHON_COMPILE=GetOption('compile'), -#) -py_packages = environment.InstallPython( - '$PY_PACKAGES_DIR', - build_py_packages, - PYTHON_COMPILE=GetOption('compile'), -) - -data_subdirs = Glob('data/*') -build_data = environment.Install( - '$BUILD_DIR/data', - data_subdirs, -) -# FIXME M. George Hansen 2011-06-05: Chmod should make dirs 0755 and files -# 0644. -#environment.AddPostAction(build_data, Chmod(build_data, 0755)) -data = environment.Install( - '$DATA_DIR', - build_data, -) -build_config_file = environment.Substfile( - '$BUILD_DIR/parpg.cfg', - 'parpg.cfg.in', - SUBST_DICT=local_config_dict, -) -environment.AddPostAction(build_config_file, Chmod(build_config_file, 0644)) -config_file = environment.Substfile( - '$SYS_CONF_DIR/parpg.cfg', - 'parpg.cfg.in', - SUBST_DICT=system_config_dict, -) -environment.AddPostAction(config_file, Chmod(config_file, 0644)) - -if platform_name == 'Windows': - launcher_source = 'parpg.bat' - launcher_name = 'parpg.bat' -else: - launcher_source = 'parpg.sh' - launcher_name = 'parpg' -# FIXME M. George Hansen 2011-05-20: Do any other sequences need to be escaped? -build_launcher = environment.SubstfileEscape( - '$BUILD_DIR/$LAUNCHER_SOURCE', - 'bin/${LAUNCHER_SOURCE}.in', - LAUNCHER_SOURCE=launcher_source, - LAUNCHER_NAME=launcher_name, - SUBST_DICT=system_config_dict, - ESCAPE_SEQUENCES={'\\': r'\\\\', '"': r'\\"'}, -) -environment.AddPostAction(build_launcher, Chmod(build_launcher, 0755)) -launcher = environment.InstallAs( - '$BIN_DIR/$LAUNCHER_NAME', - build_launcher, -) - -# TODO M. George Hansen 2011-05-12: Implement package builder. -#package = environment.Package( -# NAME='parpg', -# VERSION='0.2.0', -# PACKAGEVERSION=0, -# LICENSE='gpl', -# SUMMARY='', -# DESCRIPTION='', -# X_RPM_GROUP='Application/parpg', -#) - -build = Alias( - 'build', - [build_launcher, build_config_file, build_py_packages, build_data], -) -install = Alias( - 'install', - [build, launcher, config_file, py_packages, data], -) - -Default(build) diff -r 2e2d6d9009a3 -r e97972cc7110 bin/parpg.bat.in --- a/bin/parpg.bat.in Fri Jun 10 11:29:38 2011 -1000 +++ b/bin/parpg.bat.in Fri Jun 10 11:57:39 2011 -1000 @@ -2,4 +2,4 @@ SET PYTHONPATH=%PYTHONPATH%;"@PYTHONDIR@" CD %~dp0 -START "@PYTHON@" -m parpg.main "@SYSCONFDIR@" %* \ No newline at end of file +"@PYTHON@" -m parpg.main "@SYSCONFDIR@" %* diff -r 2e2d6d9009a3 -r e97972cc7110 setup.py --- a/setup.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,292 +0,0 @@ -#!/usr/bin/env python2 -""" -Cross-system setup script responsible for creating source and binary -packages for Linux, Windows, and Mac -""" -import sys -import os -import string -from distutils.core import setup, Command, Distribution as _Distribution -from distutils.command import (install as distutils_install, - build as distutils_build) -from distutils.util import subst_vars, convert_path - -distutils_install.SCHEME_KEYS += ('config',) - -# Update existing installation schemes with the new config key. -distutils_install.INSTALL_SCHEMES['unix_prefix'].update( - { - 'data' : '$base/share/$dist_name', - 'config': '$base/etc/$dist_name' - } -) -distutils_install.INSTALL_SCHEMES['unix_local'].update( - { - 'data' : '$base/local/share/$dist_name', - 'config': '$base/local/etc/$dist_name' - } -) -distutils_install.INSTALL_SCHEMES['deb_system'].update( - { - 'data' : '$base/share/$dist_name', - 'config': '$base/etc/$dist_name' - } -) -distutils_install.INSTALL_SCHEMES['unix_home'].update( - { - 'data' : '$base/share/$dist_name', - 'config': '$base/etc/$dist_name' - } -) -distutils_install.INSTALL_SCHEMES['unix_user'].update( - { - 'data' : '$userbase/share/$dist_name', - 'config': '$userbase/etc/$dist_name' - } -) -distutils_install.WINDOWS_SCHEME.update( - { - 'config': '$base' - } -) -distutils_install.INSTALL_SCHEMES['nt_user'].update( - { - 'config': '$userbase', - } -) -distutils_install.INSTALL_SCHEMES['mac'].update( - { - 'config': '$base', - } -) -distutils_install.INSTALL_SCHEMES['mac_user'].update( - { - 'config': '$userbase', - } -) -distutils_install.INSTALL_SCHEMES['os2'].update( - { - 'config': '$base', - } -) -distutils_install.INSTALL_SCHEMES['os2_home'].update( - { - 'config': '$userbase', - } -) - - -class build_templates(Command): - description = '"build" template files (copy to build directory, ' \ - 'substituting build variables)' - user_options = [ - ('build-dir=', 'd', 'directory to "build" (copy) to'), - ('force', 'f', 'forcibly build everything (ignore file timestamps)'), - ] - boolean_options = ['force'] - - def initialize_options(self): - self.build_base = None - self.build_dir = None - self.force = None - self.config_vars = None - self.templates = None - - def finalize_options(self): - self.set_undefined_options( - 'build', - ('build_base', 'build_base'), - ('force', 'force'), - ) - self.build_dir = os.path.join(self.build_base, 'templates') - self.set_undefined_options('install', ('config_vars', 'config_vars')) - self.templates = self.distribution.templates - - def run(self): - if self.has_templates(): - self.build_templates() - - def build_templates(self): - build_dir = self.build_dir - for template_path, outfile_rel_path in self.templates.items(): - outfile_path = os.path.join(build_dir, outfile_rel_path) - self.copy_file(template_path, outfile_path, preserve_mode=False) - self.substitute_template(outfile_path) - - def substitute_template(self, file_path): - with file(file_path, 'r') as template_file: - template_content = template_file.read() - template = string.Template(template_content) - config_vars = self.config_vars - file_content = template.substitute(config_vars) - with file(file_path, 'w') as config_file: - config_file.write(file_content) - - def has_templates(self): - return self.distribution.has_templates() - - -class install_config(Command): - description = 'install configuration files' - user_options = [ - ('install-dir=', 'd', 'directory to install configuration files to'), - ('force', 'f', 'force installation (overwrite existing files)'), - ('skip-build', None, 'skip the build steps'), - ] - boolean_options = ['force', 'skip-build'] - - def initialize_options(self): - self.install_dir = None - self.force = 0 - self.skip_build = None - self.config_files = None - self.config_templates = None - self.config_vars = None - - def finalize_options(self): - self.set_undefined_options( - 'install', - ('install_config', 'install_dir'), - ('force', 'force'), - ('skip_build', 'skip_build'), - ('config_vars', 'config_vars'), - ) - self.config_files = self.distribution.config_files - self.config_templates = self.distribution.config_templates - - def run(self): - install_dir = self.install_dir - outfiles = [] - for file_path in self.config_files: - output_file_path = os.path.join(install_dir, file_path) - output_dir_path = os.path.dirname(output_file_path) - self.mkpath(output_dir_path) - outfile = self.copy_file(file_path, output_dir_path, - preserve_mode=0) - outfiles.append(outfile) - self.outfiles = outfiles - - def get_inputs(self): - return self.distribution.config_files or [] - - def get_outputs(self): - return self.outfiles or [] - - -class install(distutils_install.install): - user_options = distutils_install.install.user_options + [ - ('install-config=', None, - 'installation directory for system-wide configuration files') - ] - - def has_config(self): - return self.distribution.has_config() - - def has_templates(self): - return self.distribution.has_templates() - - def initialize_options(self): - self.install_config = None - distutils_install.install.initialize_options(self) - - def finalize_options(self): - distutils_install.install.finalize_options(self) - # FIXME M. George Hansen 2011-05-11: Probably shouldn't be using a - # private method here... - self._expand_attrs(['install_config']) - self.convert_paths('config') - self.config_vars['config'] = self.install_config - if self.root is not None: - self.change_roots('config') - install_scheme = self.install_scheme - for key, value in install_scheme.items(): - if os.name in ['posix', 'nt']: - value = os.path.expanduser(value) - value = subst_vars(value, self.config_vars) - value = convert_path(value) - self.config_vars[key] = value - - def select_scheme(self, name): - # Store the selected scheme for later processing. - distutils_install.install.select_scheme(self, name) - self.install_scheme = distutils_install.INSTALL_SCHEMES[name] - - def get_program_files_path(self): - assert sys.platform == 'win32' - try: - program_files_path = os.environ['ProgramFiles'] - except KeyError: - # ProgramFiles environmental variable isn't set, so we'll have to - # find it ourselves. Bit of a hack, but better than nothing. - program_files_path = '' - try: - import win32api - except ImportError: - program_files_path = '' - else: - drive_names = \ - [drive_name for drive_name in - win32api.GetLogicalDriveStrings().split('\000') if - drive_name] - for drive_name in drive_names: - search_path = os.path.join(drive_name, 'Program Files') - if os.path.isdir(search_path): - program_files_path = search_path - if not program_files_path: - error_message = 'unable to determine path to Program Files' - raise error_message - - return program_files_path - - sub_commands = distutils_install.install.sub_commands + [ - ('install_config', has_config), - ] - - -class build(distutils_build.build): - def has_templates(self): - return self.distribution.has_templates() - - sub_commands = [('build_templates', has_templates)] + \ - distutils_build.build.sub_commands - - -class Distribution(_Distribution): - def __init__(self, attrs=None): - self.templates = {} - self.config_files = [] - _Distribution.__init__(self, attrs) - - def has_config(self): - return self.config_files and len(self.config_files) > 0 - - def has_templates(self): - return self.templates and len(self.templates) > 0 - - -setup( - name='parpg', - scripts=['parpg'], - templates={'system.cfg': 'system.cfg.in', 'parpg': 'parpg.in'}, - config_files=['system.cfg'], - packages=['parpg'], - modules=['src/main.py'], - package_dir={'parpg': 'src/parpg'}, - version='0.2.0', - url='http://www.parpg.net', - description='', - long_description='', - cmdclass={'install': install, 'install_config': install_config, - 'build': build, 'build_templates': build_templates}, - distclass=Distribution, - classifiers=[ - 'Programming Language :: Python', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Development Status :: 2 - Pre-Alpha', - 'Operating System :: OS Independent', - 'Natural Language :: English', - 'Topic :: Games/Entertainment :: Role-Playing', - ], -) diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/__init__.py diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/copyrecurse/CopyRecurseAction.py --- a/site_scons/site_tools/copyrecurse/CopyRecurseAction.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -from .copytree import copytree - -def copyRecurseAction(target, source, env): - try: - include_pattern = env['INCLUDE_PATTERN'] - except KeyError: - include_pattern = '*' - try: - exclude_pattern = env['EXCLUDE_PATTERN'] - except KeyError: - exclude_pattern = '.*' - copytree(str(source[0]), str(target[0]), include_pattern, exclude_pattern) \ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/copyrecurse/__init__.py --- a/site_scons/site_tools/copyrecurse/__init__.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -import os - -from .CopyRecurseAction import copyRecurseAction - -def emit(target, source, env): - target = [env.fs.Entry(os.path.join(str(target[0]), str(source[0])))] - return target, source - -def generate(env): - CopyRecurseBuilder = env.Builder( - action=copyRecurseAction, - emitter=emit, - source_factory=env.fs.Entry, - target_factory=env.fs.Dir, - multi=1, - ) - env.Append(BUILDERS={'CopyRecurse': CopyRecurseBuilder}) - -def exists(env): - return True diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/copyrecurse/copytree.py --- a/site_scons/site_tools/copyrecurse/copytree.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -import os.path -import shutil -import fnmatch - -def copytree(src, dest, include_pattern='*', exclude_pattern='.*', - symlinks=False): - """My own copyTree which does not fail if the directory exists. - - Recursively copy a directory tree using copy2(). - - If the optional symlinks flag is true, symbolic links in the - source tree result in symbolic links in the destination tree; if - it is false, the contents of the files pointed to by symbolic - links are copied. - - Behavior is meant to be identical to GNU 'cp -R'. - """ - def copyItems(src, dest, include_pattern='*', exclude_pattern='.*', - symlinks=False): - """Function that does all the work. - - It is necessary to handle the two 'cp' cases: - - destination does exist - - destination does not exist - - See 'cp -R' documentation for more details - """ - for item in os.listdir(src): - if not fnmatch.fnmatch(item, include_pattern) or \ - fnmatch.fnmatch(item, exclude_pattern): - # Thow out anything that isn't matched by our include filter - # or that is matched by our exclude filter. - continue - srcPath = os.path.join(src, item) - if os.path.isdir(srcPath): - srcBasename = os.path.basename(srcPath) - destDirPath = os.path.join(dest, srcBasename) - if not os.path.exists(destDirPath): - os.makedirs(destDirPath) - copyItems(srcPath, destDirPath, include_pattern, - exclude_pattern) - elif os.path.islink(item) and symlinks: - linkto = os.readlink(item) - os.symlink(linkto, dest) - else: - shutil.copy2(srcPath, dest) - - # case 'cp -R src/ dest/' where dest/ already exists - if os.path.exists(dest): - destPath = os.path.join(dest, os.path.basename(src)) - if not os.path.exists(destPath): - os.makedirs(destPath) - # case 'cp -R src/ dest/' where dest/ does not exist - else: - os.makedirs(dest) - destPath = dest - # actually copy the files - copyItems(src, destPath, include_pattern, exclude_pattern) \ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/__init__.py --- a/site_scons/site_tools/cpython/__init__.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -"""SCons.Tool.cpython - -Tool-specific initialization for Python binary builder. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - -# -# Copyright (c) 2001-7,2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "src/engine/SCons/Tool/python.py 3263 2008/07/31 13:50:51 MatiGruca" - -import os -try: - import py_compile -except ImportError: - raise SCons.Errors.InternalError, "Couldn't import py_compile module" -try: - import compileall -except ImportError: - raise SCons.Errors.InternalError, "Couldn't import compileall module" -import glob - -import SCons.Action -import SCons.Builder -import SCons.Errors -import SCons.Node -from SCons.Tool.install import installFunc, add_targets_to_INSTALLED_FILES -from SCons.Tool.install import copyFunc - -########################################################################## -# Create Python builder -def createPythonBuilder(env): - """ - This is a utility function that creates the InstallPython - Builder in an Environment if it's not there already. - - If it's there already, we return the existing one. - - This builder is based on Install/InstallAs methods. It makes use - of those builder's functions: installFunc(), and - add_targets_to_INSTALLED_FILES()). - """ - - try: - InstallPythonBuilder = env['BUILDERS']['InstallPython'] - except KeyError: - installpython_action = SCons.Action.Action(installFunc, '$PYTHON_PYCOMSTR') - InstallPythonBuilder = SCons.Builder.Builder( - action=installpython_action, - src_suffix='$PYTHON_SUFFIX', - target_factory=env.fs.Entry, - source_factory=env.fs.Entry, - multi=1, - emitter=[add_targets_to_INSTALLED_FILES], - name='InstallPythonBuilder' - ) - - return InstallPythonBuilder - -def InstallPython(env, target=None, source=None): - """ - InstallPython creates .pyc or .pyo files for .py source files - and adds them to the list of targets along with the source files. - They are later copied to the destination (target) directory. - - InstallPython takes a target (destination) directory as its first - argument and a list of source files/directories as a second argument. - - InstallPython returns the list of target files to copy to the - target directory. - """ - try: - target_nodes = env.arg2nodes(target, env.fs.Dir) - except TypeError: - raise SCons.Errors.UserError, "Target `%s' of Install() is a file, but should be a directory. Perhaps you have the InstallPython() arguments backwards?" % str(dir) - - source_nodes = env.arg2nodes(source, env.fs.Entry) - targets = [] - - # import `compileall` module only if there is a dir in sources list - dir_in_sources = any(entry.isdir() for entry in sources) - - compile_py = env['PYTHON_COMPILE'] - optimize = env['PYTHON_OPTIMIZE'] - if optimize: - PYTHON_TARGETSUFFIX = 'o' - else: - PYTHON_TARGETSUFFIX = 'c' - - for target_node in target_nodes: - for source_node in source_nodes: - # add *.py and *.pyc files from a directory to tgt list - if source_node.isdir() and compile_py: - compileall.compile_dir(str(source_node), maxlevels=0, quiet=True) - glob_path = os.path.join(source_node.path, '*.py') - py_and_pycs = glob.glob(glob_path) + glob.glob(glob_path + 'c') - for file_name in py_and_pycs: - target = env.Entry('.'+os.sep+filename, dnode) - targets.extend(apply(PythonInstallBuilder, (env, target, filename), kw)) - # add *.py and *.pyo files from a directory to tgt list - elif isinstance(src, SCons.Node.FS.Dir): - to_compile = [] - py_files = glob.glob(src.path + os.sep + '*.py') - for py_file in py_files: - to_compile.append(py_file) - target_path = '.' + os.sep + py_file - - # add '.py' file to tgt list - py_src = env.fs.Entry(py_file) - py_tgt = env.fs.Entry(target_path, dnode) - tgt.extend(apply(PIB, (env, py_tgt, py_src), kw)) - - # add '.pyo' file to tgt list - pyo_src = env.fs.Entry(py_file + CPYTHON_TARGETSUFFIX) - pyo_tgt = env.fs.Entry(target_path + CPYTHON_TARGETSUFFIX, dnode) - tgt.extend(apply(PIB, (env, pyo_tgt, pyo_src), kw)) - act = SCons.Action.CommandAction('@$CPYTHON_PYCOM %s' % (' '.join(to_compile))) - act([], [], env) - # add single '.py' and '.pyc' or '.pyo' file to tgt list - else: - # add '.py' file to tgt list - target = env.fs.Entry('.'+os.sep+src.path, dnode) - tgt.extend(apply(PIB, (env, target, src), kw)) - - # .pyc or .pyo source and target files - pyco_src = env.fs.Entry(src.path + CPYTHON_TARGETSUFFIX) - pyco_tgt = env.fs.Entry(target.path + CPYTHON_TARGETSUFFIX) - - if compile_pyc: - py_compile.compile(src.path) - else: - act = SCons.Action.CommandAction('@$CPYTHON_PYCOM %s' % (src.path)) - act([], [], env) - - # add '.pyc' or '.pyo' file to tgt list - tgt.extend(apply(PIB, (env, pyco_tgt, pyco_src), kw)) - - return tgt - -def generate(env): - try: - env['INSTALL'] - except KeyError: - env['INSTALL'] = copyFunc - - global InstallPythonBuilder - InstallPythonBuilder = createPythonBuilder(env) - - env['PYTHON_OPTIMIZE'] = False # generate '.pyc' files by default - env['PYTHON_OPTIMIZE_FLAGS'] = '-O' - env['PYTHON_COMPILE_CMD'] = "-m py_compile $SOURCES" - env['PYTHON_PYCOM'] = '$PYTHON ${PYTHON_OPTIMIZE_FLAGS if ' \ - 'PYTHON_OPTIMIZE} $CPYTHON_COMPILE_CMD' - env['PYTHON_PYCOMSTR'] = 'Install file: "$SOURCE" as "$TARGET"' - env['PYTHON_SUFFIX'] = '.py' # extension for Python source files - - try: - env.Append(BUILDERS={'InstallPython': InstallPythonBuilder}) - except AttributeError: - # Looks like we use a pre-0.98 version of SCons... - from SCons.Script.SConscript import SConsEnvironment - SConsEnvironment.InstallPython = InstallPythonBuilder - -def exists(env): - return 1 diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/SConstruct --- a/site_scons/site_tools/cpython/doc/SConstruct Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -# -# A simple SConstruct for creating PDF files from Docbook XML -# sources. It's plain and ugly...but does its job ;). -# - -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -import os - -bld_fo = Builder(action = 'xsltproc ./pdf.xsl $SOURCE > $TARGET', - suffix = '.fo', - src_suffix = '.xml', - single_source = True) - -bld_html = Builder(action = 'xsltproc ./html.xsl $SOURCE > $TARGET', - suffix = '.html', - src_suffix = '.xml', - single_source = True) - -bld_pdf = Builder(action = 'fop $SOURCE $TARGET', - suffix = '.pdf', - src_suffix = '.fo', - single_source = True) - -env = Environment(ENV = os.environ, - BUILDERS = {'Fo' : bld_fo, - 'Html' : bld_html, - 'Pdf' : bld_pdf}) - -env.Pdf('manual', env.Fo('manual')) -env.Pdf('reference', env.Fo('reference')) - -env.Html('manual','manual') -env.Html('reference','reference') - diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/html.xsl --- a/site_scons/site_tools/cpython/doc/html.xsl Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/manual.html --- a/site_scons/site_tools/cpython/doc/manual.html Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -CPython, a binary builder for Python installs

CPython, a binary builder for Python installs

Dirk Baechle


Table of Contents

1. Examples

This first version of a Python Binary Builder is based on the work of -Mati Gruca's Google Summer of Code 2008 project -(last SVN branch). -

The “InstallPython” method creates .pyc or .pyo files for .py source files -and adds them to the list of targets along with the source files. -They are later copied to the destination (target) directory. -

The “InstallPython” Builder takes a target (destination) directory as its first -argument and a list of source files/directories as a second argument. -It returns the list of target files to copy to the -target directory. -

1. Examples

A simple example of an “SConstruct” file: -

env = Environment()
-hello = File('hello.py')
-env.InstallPython('/usr/local/bin/', hello)
-env.Alias('install', '/usr/local/bin/')
-

SCons” invoked with the “-Q install” parameter will compile the “hello.py” file into -“hello.pyc”, and copy both files into “/usr/local/bin/” directory. -

Sample output: -

$ scons -Q install
-Install file: "hello.py" as "/usr/local/bin/hello.py"
-Install file: "hello.pyc" as "/usr/local/bin/hello.pyc"
-

InstallPython” can also compile Python source files into optimized -binary files (“.pyo” suffix) instead of ordinary binaries (“.pyc” files). To -achieve this, change the call to “Environment()” and set the “CPYTHON_PYC” -variable to '0' (zero): -

env = Environment(CPYTHON_PYC=0)
-hello = File('hello.py')
-env.InstallPython('/usr/local/bin/', hello)
-env.Alias('install', '/usr/local/bin/')
-

Sample output: -

$ scons -Q install
-Install file: "hello.py" as "/usr/local/bin/hello.py"
-Install file: "hello.pyo" as "/usr/local/bin/hello.pyo"
-

The “InstallPython” method accepts both, files and directories, as its source arguments: -

env = Environment()
-pyfiles = Dir('pyfiles/')
-env.InstallPython('/usr/local/bin/', pyfiles)
-env.Alias('install', '/usr/local/bin')
-

Running “scons -Q install” will copy all the “.py” files from “pyfiles” directory -into “/usr/local/bin/pyfiles” directory along with corresponding “.pyc” files. -

Sample output: -

$ scons -Q install
-Install file: "pyfiles/hello.py" as "/usr/local/bin/pyfiles/hello.py"
-Install file: "pyfiles/hello.pyc" as "/usr/local/bin/pyfiles/hello.pyc"
-Install file: "pyfiles/hello2.py" as "/usr/local/bin/pyfiles/hello2.py"
-Install file: "pyfiles/hello2.pyc" as "/usr/local/bin/pyfiles/hello2.pyc"
-

Mixing files and directories is also possible: -

env = Environment()
-hello = File('hello.py')
-pyfiles = Dir('pyfiles/')
-env.InstallPython('/usr/local/bin/', [hello, pyfiles])
-env.Alias('install', '/usr/local/bin')
-

Sample output: -

$ scons -Q install
-Install file: "hello.py" as "/usr/local/bin/hello.py"
-Install file: "hello.pyc" as "/usr/local/bin/hello.pyc"
-Install file: "pyfiles/hello.py" as "/usr/local/bin/pyfiles/hello.py"
-Install file: "pyfiles/hello.pyc" as "/usr/local/bin/pyfiles/hello.pyc"
-Install file: "pyfiles/hello2.py" as "/usr/local/bin/pyfiles/hello2.py"
-Install file: "pyfiles/hello2.pyc" as "/usr/local/bin/pyfiles/hello2.pyc"
-
diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/manual.pdf --- a/site_scons/site_tools/cpython/doc/manual.pdf Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +0,0 @@ -%PDF-1.3 -%ª«¬­ -4 0 obj -<< /Type /Info -/Producer (FOP 0.20.5) >> -endobj -5 0 obj -<< /Length 2241 /Filter [ /ASCII85Decode /FlateDecode ] - >> -stream -Gb".=gMWKOo\El*U6X_/adBVYWRQ\MgLe(GG$DphWG8FJ`n4mU_$`5:qXo2C#%e&FG.)gXnrPkeF6CcXi61q,p5W=0+jZq7Ho80kD9]tTD652#+a_\^l.DI@4DiHn73ZH@BI3&D'@bBD[]H%8:^QVa:=7_O)5X/bO'B+(EE=XaO=O&CW"QosZK^+^_02/5^jj21;dl\]in;N>jn*S>3PCrSF2El98).f2U'_RCXhs[(>ZG'%C]rR&($A#b_##N5ii5:%Lq;rrF.eOf+)BfXVB\!hap'Em,:I%*?0D)=37S^JBA#>n"PrFR>MU-%e5`s,.#DefK)rnc)o,aNr=am-ctpIWq3Nna.Z@"f^M!s?VohBU0aduLufChh&YF:j5WC/(!To6\]l[oBnnfSB#KA%s_9t,C`H>T6-Xc1kW/1`?XI3(ka7@lXVOa&u%>,#K7Hb>H8btOO1s1^]a6i*1jZs9Ye#f(DP-\SqgK&7L`^_r2RKDiKNJW-::B[X\h\B>96R*r[-5f?R:@3,S`92T^Uo!\*%S@C`2#icms:6n*S?TClm(B#*_4=+1!=&Cab$WD04YSW"on,.2RM\b0>\ZOQfc%GL^#-]HU1$H]p8hu6:I$-$`*(7pY>+rJi#?+7%812Q*9h1:T=#YtT_^;6//)'"C&#DAk<(6gH!3=m?*,>/,TRJ-.c;f,L[u7$q/Q1dTrT]KQa$-@DBkK/]cE6oC@=$G`+mV?D9(0C`UQB\H7i[OqYE[>BO%em3"ke:itCS-E;]-3(Ue>0<-n^OED]&H0?;cLm5)10VgTMfUkH5KahJK.H*52d[;Jdl'B(bb6%!9!`rkOWqM6jVO0$=]e)YO5BXco@>\F4;H'I0.aZq+=i;,E4p,qB^NAhp,"N==9Z\TX+HAURqRp>p:*PW4a\]Ifn?$J[_?N)n'WIPUjjQ'$BH;IFp*jOq13VDME5h52U8Ds/*/fb>@oUe.0lKaT`.-_8k^OUl,[QK5=6C(?l83]oE%98O+[OZfV.)B;8nY+500gUr0(bdM?iG=E&E/L!`CX@(DO.Lk'[)UWNXi7R&=]k^L4h.nauY)Kj[GI^DSB_;JGW4^l;Ko%dF_oc_IikQ&Hi-t?DqV`suX&]'l%e#jA72Z7LDr_%ui8G[eqc#"L2A+jap/ATWBgl">Pc\@)"p%eH#Brl;#7<81EM#`*6.9,SPPR@tNh'f0*/'e@\rTNq\VZ5c',>D:FPS2-+@:'lFcqcr6OhP!.GaShf7mqS_=V,AT=l]kYLl4#N)9r-K3u'+*N$"gun,:(`K9TNTu;n#C$nVS6t$gK0&,t@:M@pJRnm=Jr$0Qr(5'7V@[ofEVdf#"La0@bC3urnN>m[p:\=VlQ#M"X7)2;#K@Wi'3J1+F#c`qRK+q7112C:0^0R3kTJRJ(JkGq*1FY?_&b,_rrM>g&Rb~> -endstream -endobj -6 0 obj -<< /Type /Page -/Parent 1 0 R -/MediaBox [ 0 0 612 792 ] -/Resources 3 0 R -/Contents 5 0 R -/Annots 7 0 R ->> -endobj -7 0 obj -[ -8 0 R -10 0 R -11 0 R -12 0 R -13 0 R -14 0 R -15 0 R -] -endobj -8 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 72.0 565.62 121.44 555.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A 9 0 R -/H /I ->> -endobj -10 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 368.828 534.62 545.608 524.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://www.scons.org/wiki/GSoC2008/MatiGruca) -/S /URI >> -/H /I ->> -endobj -11 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 72.0 523.62 99.77 513.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://www.scons.org/wiki/GSoC2008/MatiGruca) -/S /URI >> -/H /I ->> -endobj -12 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 190.92 523.62 390.92 513.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://www.scons.org/wiki/GSoC2008/MatiGruca) -/S /URI >> -/H /I ->> -endobj -13 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 479.57 523.62 551.5 513.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://scons.tigris.org/source/browse/scons/branches/py-builder/) -/S /URI >> -/H /I ->> -endobj -14 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 750.58 523.62 765.02 513.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://scons.tigris.org/source/browse/scons/branches/py-builder/) -/S /URI >> -/H /I ->> -endobj -15 0 obj -<< /Type /Annot -/Subtype /Link -/Rect [ 72.0 512.62 320.31 502.62 ] -/C [ 0 0 0 ] -/Border [ 0 0 0 ] -/A << /URI (http://scons.tigris.org/source/browse/scons/branches/py-builder/) -/S /URI >> -/H /I ->> -endobj -16 0 obj -<< /Length 1221 /Filter [ /ASCII85Decode /FlateDecode ] - >> -stream -Gau0DgMWKG&:O:STW1mfWEHQ/fLgSU/QF<$lG[[9+#"l.8sj`%\'O.^#hKG8;*_cVnWpM"ZaYkGr).k6qo-h(#@6]lnAF*XdjHQZhI>mN4TCW\AX'&F]F3\"ld'KKR_7q(B<*:P2;6hKl^gP!omXV,np.7q.%N"k2Rf"PneRj'_a4tMnfnV0,;&6$o_al]3H3dc">SrV@[-p=iAK[2+gb78#Ki2Q-66q:`7MVAV6bNm@^*JB$FX&LH(=rPFXK\!S8??BHa)#]l=D>Dag0bmRAG84ng#i1Y*-ZMLof^\7P=kRl[>X0fDj`mPeMj8\%J_P5XW/lg+!46hX%33ied]3kp!g>>^V-9Qr1[]-]%`;"%D5Fadq'bg-L/#XK_LI6u62"nfQ\4+#Z>)rq$)%%ePa\8P7['nE3*pbpEhNR#qf@ceh=%J][7QDs3dhuZSLn6eOl$m,p&[P1nfT.LAYCOH(8V&b18q&VtiEfC:n@e=3UUJ^O9*XZ*60;"_9PCs-hSPZ*-"eoXi(X`R5mj[:;1p6FfH1MNe(`1"g1hBfH8#.&uE,<+kaUE2EAoVhFBi_(!6M2oLf4c+Mk@8\9e9Q>b[9F;Z[$BmZj@u%Mqa@U(hG$YA3,0"1U1Oe6fp+X&]78V=fmG+'FcJZcUL/RWV\L8-rf!C:WBK(^0O.#-E+HNA("RhC(WlYlKbfK*B?/@#N/j]8508T&BRg(KnXIqqt`2Sme62/*>'oL:)ClpcC([I^>(Kac4_)*$('r!0,3CIe~> -endstream -endobj -17 0 obj -<< /Type /Page -/Parent 1 0 R -/MediaBox [ 0 0 612 792 ] -/Resources 3 0 R -/Contents 16 0 R ->> -endobj -18 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F3 -/BaseFont /Helvetica-Bold -/Encoding /WinAnsiEncoding >> -endobj -19 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -20 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -21 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F9 -/BaseFont /Courier -/Encoding /WinAnsiEncoding >> -endobj -1 0 obj -<< /Type /Pages -/Count 2 -/Kids [6 0 R 17 0 R ] >> -endobj -2 0 obj -<< /Type /Catalog -/Pages 1 0 R - >> -endobj -3 0 obj -<< -/Font << /F3 18 0 R /F5 19 0 R /F1 20 0 R /F9 21 0 R >> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -9 0 obj -<< -/S /GoTo -/D [6 0 R /XYZ 67.0 443.62 null] ->> -endobj -xref -0 22 -0000000000 65535 f -0000005801 00000 n -0000005866 00000 n -0000005916 00000 n -0000000015 00000 n -0000000071 00000 n -0000002404 00000 n -0000002524 00000 n -0000002591 00000 n -0000006028 00000 n -0000002722 00000 n -0000002918 00000 n -0000003109 00000 n -0000003303 00000 n -0000003516 00000 n -0000003730 00000 n -0000003942 00000 n -0000005256 00000 n -0000005364 00000 n -0000005477 00000 n -0000005587 00000 n -0000005695 00000 n -trailer -<< -/Size 22 -/Root 2 0 R -/Info 4 0 R ->> -startxref -6091 -%%EOF diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/manual.xml --- a/site_scons/site_tools/cpython/doc/manual.xml Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - -
- CPython, a binary builder for Python installs - - - Dirk Baechle - - -This first version of a Python Binary Builder is based on the work of -Mati Gruca's Google Summer of Code 2008 project -(last SVN branch). - -The InstallPython method creates .pyc or .pyo files for .py source files -and adds them to the list of targets along with the source files. -They are later copied to the destination (target) directory. - -The InstallPython Builder takes a target (destination) directory as its first -argument and a list of source files/directories as a second argument. -It returns the list of target files to copy to the -target directory. - -
Examples -A simple example of an SConstruct file: - -env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') - -SCons invoked with the -Q install parameter will compile the hello.py file into -hello.pyc, and copy both files into /usr/local/bin/ directory. - -Sample output: - -$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyc" as "/usr/local/bin/hello.pyc" - -InstallPython can also compile Python source files into optimized -binary files (.pyo suffix) instead of ordinary binaries (.pyc files). To -achieve this, change the call to Environment() and set the CPYTHON_PYC -variable to '0' (zero): - -env = Environment(CPYTHON_PYC=0) -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') - -Sample output: - -$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyo" as "/usr/local/bin/hello.pyo" - -The InstallPython method accepts both, files and directories, as its source arguments: - -env = Environment() -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', pyfiles) -env.Alias('install', '/usr/local/bin') - -Running scons -Q install will copy all the .py files from pyfiles directory -into /usr/local/bin/pyfiles directory along with corresponding .pyc files. - -Sample output: - -$ scons -Q install -Install file: "pyfiles/hello.py" as "/usr/local/bin/pyfiles/hello.py" -Install file: "pyfiles/hello.pyc" as "/usr/local/bin/pyfiles/hello.pyc" -Install file: "pyfiles/hello2.py" as "/usr/local/bin/pyfiles/hello2.py" -Install file: "pyfiles/hello2.pyc" as "/usr/local/bin/pyfiles/hello2.pyc" - -Mixing files and directories is also possible: - -env = Environment() -hello = File('hello.py') -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', [hello, pyfiles]) -env.Alias('install', '/usr/local/bin') - -Sample output: - -$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyc" as "/usr/local/bin/hello.pyc" -Install file: "pyfiles/hello.py" as "/usr/local/bin/pyfiles/hello.py" -Install file: "pyfiles/hello.pyc" as "/usr/local/bin/pyfiles/hello.pyc" -Install file: "pyfiles/hello2.py" as "/usr/local/bin/pyfiles/hello2.py" -Install file: "pyfiles/hello2.pyc" as "/usr/local/bin/pyfiles/hello2.pyc" - -
- -
diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/pdf.xsl --- a/site_scons/site_tools/cpython/doc/pdf.xsl Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - - - - - - - - - -0pt - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - - - - - diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/reference.html --- a/site_scons/site_tools/cpython/doc/reference.html Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ - -SCons tool cpython - Reference
Table of Contents
1. Interna
2. Builders
2.1. InstallPython
3. Variables

This reference lists all the variables that are used within the - "cpython" tool, and the available builders. It is intended - for SCons tool developers and core programmers, as a normal user you - should read the manual instead.


1. Interna

Internally, the builder is based on the - Install/InstallAs methods from - SCons.Tool.install. It makes use of the basic builder's - functions: installFunc(), and - add_targets_to_INSTALLED_FILES().


2. Builders

2.1. InstallPython

The "InstallPython" method creates - .pyc or .pyo files for - .py source files and adds them to the list of targets - along with the source files. They are later copied to the destination - (target) directory.

Example:

env = Environment()
-hello = File('hello.py')
-env.InstallPython('/usr/local/bin/', hello)
-env.Alias('install', '/usr/local/bin/')
-


3. Variables

CPYTHON_PYC

Default value is 1, which means that the - Python source files get compiled to .pyc files. - Set this variable to 0 in order to get - optimized .pyo files, parallel to your - installed sources.

CPYTHON_EXE

The path to the external Python executable, used for - creating optimized .pyo files. Default value is - 'python'.

CPYTHON_PYO_FLAGS

Additional flags for compiling optimized Python files - (.pyo). The default is - '-O'.

CPYTHON_PYO_CMD

The command arguments for compiling optimized Python files - (.pyo). The default value is '-c - 'import sys,py_compile; [py_compile.compile(i) for i in - sys.argv[1:]]''.

CPYTHON_PYCOM

The command line for compiling optimized Python files - (.pyo). Default is '$CPYTHON_EXE - $CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD'.

CPYTHON_PYCOMSTR

The message string for the - 'CPYTHON_PYCOM' command. Default is - 'Install file: "$SOURCE" as "$TARGET"'.

CPYTHON_SUFFIX

Default value is '.py'. The suffix for Python source - files.

\ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/reference.pdf Binary file site_scons/site_tools/cpython/doc/reference.pdf has changed diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/reference.xml --- a/site_scons/site_tools/cpython/doc/reference.xml Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ - - - -
- - SCons tool <quote>cpython</quote> - Reference - - - Dirk - - Baechle - - - 2010-07-28 - - - - This reference lists all the variables that are used within the - cpython tool, and the available builders. It is intended - for SCons tool developers and core programmers, as a normal user you - should read the manual instead. - - -
- Interna - - Internally, the builder is based on the - Install/InstallAs methods from - SCons.Tool.install. It makes use of the basic builder's - functions: installFunc(), and - add_targets_to_INSTALLED_FILES(). -
- -
- Builders - -
- InstallPython - - The InstallPython method creates - .pyc or .pyo files for - .py source files and adds them to the list of targets - along with the source files. They are later copied to the destination - (target) directory. - - Example: - - env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') - -
-
- -
- Variables - - - - CPYTHON_PYC - - - Default value is 1, which means that the - Python source files get compiled to .pyc files. - Set this variable to 0 in order to get - optimized .pyo files, parallel to your - installed sources. - - - - - CPYTHON_EXE - - - The path to the external Python executable, used for - creating optimized .pyo files. Default value is - 'python'. - - - - - CPYTHON_PYO_FLAGS - - - Additional flags for compiling optimized Python files - (.pyo). The default is - '-O'. - - - - - CPYTHON_PYO_CMD - - - The command arguments for compiling optimized Python files - (.pyo). The default value is '-c - 'import sys,py_compile; [py_compile.compile(i) for i in - sys.argv[1:]]''. - - - - - CPYTHON_PYCOM - - - The command line for compiling optimized Python files - (.pyo). Default is '$CPYTHON_EXE - $CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD'. - - - - - CPYTHON_PYCOMSTR - - - The message string for the - 'CPYTHON_PYCOM' command. Default is - 'Install file: "$SOURCE" as "$TARGET"'. - - - - - CPYTHON_SUFFIX - - - Default value is '.py'. The suffix for Python source - files. - - - -
-
\ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/doc/scons.css --- a/site_scons/site_tools/cpython/doc/scons.css Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -body { - background: #ffffff; - margin: 10px; - padding: 0; - font-family:palatino, georgia, verdana, arial, sans-serif; - } - - -a { - color: #80572a; - } - -a:hover { - color: #d72816; - text-decoration: none; - } - -tt { - color: #a14447; - } - -pre { - background: #e0e0e0; - } - -#main { - border: 1px solid; - border-color: black; - background-color: white; - background-image: url(../images/sconsback.png); - background-repeat: repeat-y 50% 0; - background-position: right top; - margin: 30px auto; - width: 750px; - } - -#banner { - background-image: url(../images/scons-banner.jpg); - border-bottom: 1px solid; - height: 95px; - } - -#menu { - font-family: sans-serif; - font-size: small; - line-height: 0.9em; - float: right; - width: 220px; - clear: both; - margin-top: 10px; - } - -#menu li { - margin-bottom: 7px; - } - -#menu li li { - margin-bottom: 2px; - } - -#menu li.submenuitems { - margin-bottom: 2px; - } - -#menu a { - text-decoration: none; - } - -#footer { - border-top: 1px solid black; - text-align: center; - font-size: small; - color: #822; - margin-top: 4px; - background: #eee; - } - -ul.hack { - list-style-position:inside; - } - -ul.menuitems { - list-style-type: none; - } - -ul.submenuitems { - list-style-type: none; - font-size: smaller; - margin-left: 0; - padding-left: 16px; - } - -ul.subsubmenuitems { - list-style-type: none; - font-size: smaller; - margin-left: 0; - padding-left: 16px; - } - -ol.upper-roman { - list-style-type: upper-roman; - } - -ol.decimal { - list-style-type: decimal; - } - -#currentpage { - font-weight: bold; - } - -#bodycontent { - margin: 15px; - width: 520px; - font-size: small; - line-height: 1.5em; - } - -#bodycontent li { - margin-bottom: 6px; - list-style-type: square; - } - -#sconsdownloadtable downloadtable { - display: table; - margin-left: 5%; - border-spacing: 12px 3px; - } - -#sconsdownloadtable downloadrow { - display: table-row; - } - -#sconsdownloadtable downloadentry { - display: table-cell; - text-align: center; - vertical-align: bottom; - } - -#sconsdownloadtable downloaddescription { - display: table-cell; - font-weight: bold; - text-align: left; - } - -#sconsdownloadtable downloadversion { - display: table-cell; - font-weight: bold; - text-align: center; - } - -#sconsdocversiontable sconsversiontable { - display: table; - margin-left: 10%; - border-spacing: 12px 3px; - } - -#sconsdocversiontable sconsversionrow { - display: table-row; - } - -#sconsdocversiontable docformat { - display: table-cell; - font-weight: bold; - text-align: center; - vertical-align: bottom; - } - -#sconsdocversiontable sconsversion { - display: table-cell; - font-weight: bold; - text-align: left; - } - -#sconsdocversiontable docversion { - display: table-cell; - font-weight: bold; - text-align: center; - } - -#osrating { - margin-left: 35px; - } - - -h2 { - color: #272; - color: #c01714; - font-family: sans-serif; - font-weight: normal; - } - -h2.pagetitle { - font-size: xx-large; - } -h3 { - margin-bottom: 10px; - } - -.date { - font-size: small; - color: gray; - } - -.link { - margin-bottom: 22px; - } - -.linkname { - } - -.linkdesc { - margin: 10px; - margin-top: 0; - } - -.quote { - margin-top: 20px; - margin-bottom: 10px; - background: #f8f8f8; - border: 1px solid; - border-color: #ddd; - } - -.quotetitle { - font-weight: bold; - font-size: large; - margin: 10px; - } - -.quotedesc { - margin-left: 20px; - margin-right: 10px; - margin-bottom: 15px; - } - -.quotetext { - margin-top: 20px; - margin-left: 20px; - margin-right: 10px; - font-style: italic; - } - -.quoteauthor { - font-size: small; - text-align: right; - margin-top: 10px; - margin-right: 7px; - } - -.sconslogo { - font-style: normal; - font-weight: bold; - color: #822; - } - -.downloadlink { - } - -.downloaddescription { - margin-left: 1em; - margin-bottom: 0.4em; - } diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/SConstruct --- a/site_scons/site_tools/cpython/test/basic/SConstruct Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -env = Environment(tools=['cpython']) -hello = File('pyfiles/hello.py') -hello2 = File('pyfiles/hello2.py') -pydir = Dir('pyfiles2') -env.InstallPython('pybuilderdir', [hello, hello2, pydir]) -env.Alias('install', 'pybuilderdir') diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/SConstruct-cflag --- a/site_scons/site_tools/cpython/test/basic/SConstruct-cflag Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -env = Environment(tools=['cpython'], CPYTHON_PYC=1) -hello = File('pyfiles/hello.py') -hello2 = File('pyfiles/hello2.py') -pydir = Dir('pyfiles2') -env.InstallPython('pybuilderdir', [hello, hello2, pydir]) -env.Alias('install', 'pybuilderdir') diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/SConstruct-oflag --- a/site_scons/site_tools/cpython/test/basic/SConstruct-oflag Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -env = Environment(tools=['cpython'], CPYTHON_PYC=0) -hello = File('pyfiles/hello.py') -hello2 = File('pyfiles/hello2.py') -pydir = Dir('pyfiles2') -env.InstallPython('pybuilderdir', [hello, hello2, pydir]) -env.Alias('install', 'pybuilderdir') diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/image/pyfiles/hello.py --- a/site_scons/site_tools/cpython/test/basic/image/pyfiles/hello.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#!/usr/bin/env python -print 'Hello world' diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/image/pyfiles/hello2.py --- a/site_scons/site_tools/cpython/test/basic/image/pyfiles/hello2.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#!/usr/bin/env python -print 'Hello world version 2' diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello.py --- a/site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#!/usr/bin/env python -print 'Hello world' diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello2.py --- a/site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello2.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#!/usr/bin/env python -print 'Hello world version 2' diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/sconstest-cflag-compile.py --- a/site_scons/site_tools/cpython/test/basic/sconstest-cflag-compile.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test compilation of Python modules to .pyc files. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConstruct-cflag','SConstruct') -test.file_fixture('../../__init__.py','site_scons/site_tools/cpython/__init__.py') -test.run(arguments = 'install') - -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello2.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello2.pyc')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/sconstest-noflags-compile.py --- a/site_scons/site_tools/cpython/test/basic/sconstest-noflags-compile.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test compilation of Python modules with the default settings. This should create -a bunch of .pyc files. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConstruct') -test.file_fixture('../../__init__.py','site_scons/site_tools/cpython/__init__.py') -test.run(arguments = 'install') - -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello2.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello.pyc')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello2.pyc')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file diff -r 2e2d6d9009a3 -r e97972cc7110 site_scons/site_tools/cpython/test/basic/sconstest-oflag-compile.py --- a/site_scons/site_tools/cpython/test/basic/sconstest-oflag-compile.py Fri Jun 10 11:29:38 2011 -1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test compilation of Python modules to .pyo files (optimized). -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConstruct-oflag','SConstruct') -test.file_fixture('../../__init__.py','site_scons/site_tools/cpython/__init__.py') -test.run(arguments = 'install') - -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello.pyo')) -test.must_exist(test.workpath('pybuilderdir/pyfiles/hello2.pyo')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello.pyo')) -test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello2.pyo')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file