Mercurial > parpg-core
changeset 19:e97972cc7110
Merged WAF fork with Beliar's Windows launcher fix.
* Removed SCons and distutils scripts since they aren't needed any more.
author | M. George Hansen <technopolitica@gmail.com> |
---|---|
date | Fri, 10 Jun 2011 11:57:39 -1000 |
parents | 2e2d6d9009a3 (current diff) de378945b839 (diff) |
children | 07ff8cf8a0f1 |
files | SConstruct bin/parpg.bat.in setup.py site_scons/site_tools/__init__.py site_scons/site_tools/copyrecurse/CopyRecurseAction.py site_scons/site_tools/copyrecurse/__init__.py site_scons/site_tools/copyrecurse/copytree.py site_scons/site_tools/cpython/__init__.py site_scons/site_tools/cpython/doc/SConstruct site_scons/site_tools/cpython/doc/html.xsl site_scons/site_tools/cpython/doc/manual.html site_scons/site_tools/cpython/doc/manual.pdf site_scons/site_tools/cpython/doc/manual.xml site_scons/site_tools/cpython/doc/pdf.xsl site_scons/site_tools/cpython/doc/reference.html site_scons/site_tools/cpython/doc/reference.pdf site_scons/site_tools/cpython/doc/reference.xml site_scons/site_tools/cpython/doc/scons.css site_scons/site_tools/cpython/test/basic/SConstruct site_scons/site_tools/cpython/test/basic/SConstruct-cflag site_scons/site_tools/cpython/test/basic/SConstruct-oflag site_scons/site_tools/cpython/test/basic/image/pyfiles/hello.py site_scons/site_tools/cpython/test/basic/image/pyfiles/hello2.py site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello.py site_scons/site_tools/cpython/test/basic/image/pyfiles2/hello2.py site_scons/site_tools/cpython/test/basic/sconstest-cflag-compile.py site_scons/site_tools/cpython/test/basic/sconstest-noflags-compile.py site_scons/site_tools/cpython/test/basic/sconstest-oflag-compile.py |
diffstat | 27 files changed, 1 insertions(+), 2375 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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@" %*
--- 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', - ], -)
--- 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
--- 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
--- 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
--- 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
--- 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') -
--- 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 @@ -<?xml version='1.0'?> -<!-- - - 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. - ---> -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:fo="http://www.w3.org/1999/XSL/Format" - version="1.0"> - - <xsl:import href="file:///usr/share/docbook-xsl-1.71.1/html/docbook.xsl"/> - -<xsl:param name="l10n.gentext.default.language" select="'en'"/> -<xsl:param name="section.autolabel" select="1"/> -<xsl:param name="html.stylesheet" select="'scons.css'"/> -<xsl:param name="generate.toc"> -/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 -</xsl:param> - -</xsl:stylesheet> -
--- 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 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>CPython, a binary builder for Python installs</title><link rel="stylesheet" href="scons.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2476347"></a>CPython, a binary builder for Python installs</h2></div><div><div class="author"><h3 class="author"><span class="surname">Dirk Baechle</span></h3></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#examples">1. Examples</a></span></dt></dl></div><p>This first version of a Python Binary Builder is based on the work of -<a href="http://www.scons.org/wiki/GSoC2008/MatiGruca" target="_top">Mati Gruca's Google Summer of Code 2008 project</a> -(<a href="http://scons.tigris.org/source/browse/scons/branches/py-builder/" target="_top">last SVN branch</a>). -</p><p>The “<span class="quote"><code class="literal">InstallPython</code></span>” method creates <code class="literal">.pyc</code> or <code class="literal">.pyo</code> files for <code class="literal">.py</code> source files -and adds them to the list of targets along with the source files. -They are later copied to the destination (target) directory. -</p><p>The “<span class="quote"><code class="literal">InstallPython</code></span>” 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. -</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples"></a>1. Examples</h2></div></div></div><p>A simple example of an “<span class="quote"><code class="literal">SConstruct</code></span>” file: -</p><pre class="screen">env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</pre><p>“<span class="quote"><code class="literal">SCons</code></span>” invoked with the “<span class="quote"><code class="literal">-Q install</code></span>” parameter will compile the “<span class="quote"><code class="literal">hello.py</code></span>” file into -“<span class="quote"><code class="literal">hello.pyc</code></span>”, and copy both files into “<span class="quote"><code class="literal">/usr/local/bin/</code></span>” directory. -</p><p>Sample output: -</p><pre class="screen">$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyc" as "/usr/local/bin/hello.pyc" -</pre><p>“<span class="quote"><code class="literal">InstallPython</code></span>” can also compile Python source files into optimized -binary files (“<span class="quote"><code class="literal">.pyo</code></span>” suffix) instead of ordinary binaries (“<span class="quote"><code class="literal">.pyc</code></span>” files). To -achieve this, change the call to “<span class="quote"><code class="literal">Environment()</code></span>” and set the “<span class="quote"><code class="literal">CPYTHON_PYC</code></span>” -variable to '<code class="literal">0</code>' (zero): -</p><pre class="screen">env = Environment(CPYTHON_PYC=0) -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</pre><p>Sample output: -</p><pre class="screen">$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyo" as "/usr/local/bin/hello.pyo" -</pre><p>The “<span class="quote"><code class="literal">InstallPython</code></span>” method accepts both, files and directories, as its source arguments: -</p><pre class="screen">env = Environment() -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', pyfiles) -env.Alias('install', '/usr/local/bin') -</pre><p>Running “<span class="quote"><code class="literal">scons -Q install</code></span>” will copy all the “<span class="quote"><code class="literal">.py</code></span>” files from “<span class="quote"><code class="literal">pyfiles</code></span>” directory -into “<span class="quote"><code class="literal">/usr/local/bin/pyfiles</code></span>” directory along with corresponding “<span class="quote"><code class="literal">.pyc</code></span>” files. -</p><p>Sample output: -</p><pre class="screen">$ 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" -</pre><p>Mixing files and directories is also possible: -</p><pre class="screen">env = Environment() -hello = File('hello.py') -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', [hello, pyfiles]) -env.Alias('install', '/usr/local/bin') -</pre><p>Sample output: -</p><pre class="screen">$ 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" -</pre></div></div></body></html>
--- 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<ZJc<uSrXlN>#+a_\^l.DI@4DiHn73ZH@BI3&D'@bBD[]H%8:^QVa:=7_<p8n)<E2cQ$!X)qO.$,RfD6u5obb9nL_etaPi.5,Yj7Q8<Q<fcJDt;1W1bE'H]itVj9\1ZDfMPIZ<s2<i:SPl"(E[Rj;b1:^amkGe,#a5]F5G,OR6/AKEBP(*SEBAkfUs!FB>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\!<gC5Gqf=;0EBW7uXjHQ-)!=r>hap'Em,:I%*?0D)=37S^JBA#>n"PrFR>MU-%e5`s,.#DefK)rnc)o,aNr=am-ctpIWq3Nn<ILVdPgqB0$*ZcA!&S>a.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`</d23(e*4;7&&LI3+<&2D8`Ym75b*.Xhqu3qcsriL^ImDLij\C`F=dhSukI^;Xhi;Gus0r8f1;dP<n8fVUDgo8@:\fbGFn<Y4ktL1?42mP.8ee$&Qc&Op1YhOu&H5k,kDa<[gXNOC[TZJIcb2;399W!9KMsCU]CW+djE0\[b1u5VhF.%'s5E=1C^op4US"<0U3>92T^Uo!\*%S@C`2#icms:6n*S?TClm<t<7<UTPS\\\\98/(`m"Y+3k@>(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<DTAo&^K/Cal$](7BpF.Ve*7_Be!tFp_;$L#Cn`2s"spqbLMj#f2$%fgdjKgRlFV^)$5p5Wph0IJT-[VW,dTq0c;)]NL0F3_@OVGKBO]jEEDV0Fq1V6Rdo4YOHog_4#UN@:E@ba-Vg:Q38"DDFFk6!PaD@QQO*i@%l$[_&k%TC./P\WQU)(P<SG#O&5n.ZIT7GfF;HFmEZ0^U,PJVu.@dl"k".7-I5i.l5$#Q=hg[=&HqL:\*(of^UeDDP.LtrIZm'<$kY7-WSZn@'Qfu/E`L1,,LW3MJJ;qblcbW6igFQ,B>.aZq+=i;,E4p,qB^NAhp,"N==9Z<PQ1mTXeTA-H#j'rU>\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<ad@N0_;/ZtTSfP$SEYA2^WV>]<kM]D2La&;fp?.4G5CU<bHelX.Eg_pP*YP[PafN6+SK;I</i@4pURC<>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`%\'<fS^^KM_OC7(h&n583b_8'`Z[TNRI9=^Bc[6E2+f!n2HhVLq&EJ0=p>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=<kO0'Zqq<`?rA7b;R"E],2$76>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&[P<YAB2oGH05?<$DjI%7dLQ*V"q_"i)q't^n`d6W=`:*<DsfY8Z<rkS29/-P#tKFm*4)S1*d!W%HD'4Xg/Luqk'B2E+'(OtDJ%Z"*;#)-EhMOje8X0bREA,bg+Q2MP%!QVR.o,^%rf.r/c1=@^bX\4E1<C=7+66U?.Z1js/L+i8[6S4UtFnt>1nfT.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"1U<IRgF*3,#==0)_I?C_kCP;^!#e?TR*"J6MEL`akh#%J)#Nuh%5d#o:oeVWVr\qJkS0[LNl^hgl<Q2FU6%Kg="BnO^Wg<[[Yk?#DE$H*7CC@n2d[WBu/RP*\'Og[d\e/p_D\`R%NjJf^CKp)&JG26)gaX@iP);A_`mB62-<=1TX-[!rQmkbaR^aJg)POC=2#U@>1Oe6fp+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
--- 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" -"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> -<article> - <title>CPython, a binary builder for Python installs</title> - <articleinfo> - <author> - <surname>Dirk Baechle</surname> - </author> - </articleinfo> -<para>This first version of a Python Binary Builder is based on the work of -<ulink url="http://www.scons.org/wiki/GSoC2008/MatiGruca">Mati Gruca's Google Summer of Code 2008 project</ulink> -(<ulink url="http://scons.tigris.org/source/browse/scons/branches/py-builder/">last SVN branch</ulink>). -</para> -<para>The <quote><literal>InstallPython</literal></quote> method creates <literal>.pyc</literal> or <literal>.pyo</literal> files for <literal>.py</literal> source files -and adds them to the list of targets along with the source files. -They are later copied to the destination (target) directory. -</para> -<para>The <quote><literal>InstallPython</literal></quote> 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. -</para> -<section id="examples"><title>Examples</title> -<para>A simple example of an <quote><literal>SConstruct</literal></quote> file: -</para> -<screen>env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</screen> -<para><quote><literal>SCons</literal></quote> invoked with the <quote><literal>-Q install</literal></quote> parameter will compile the <quote><literal>hello.py</literal></quote> file into -<quote><literal>hello.pyc</literal></quote>, and copy both files into <quote><literal>/usr/local/bin/</literal></quote> directory. -</para> -<para>Sample output: -</para> -<screen>$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyc" as "/usr/local/bin/hello.pyc" -</screen> -<para><quote><literal>InstallPython</literal></quote> can also compile Python source files into optimized -binary files (<quote><literal>.pyo</literal></quote> suffix) instead of ordinary binaries (<quote><literal>.pyc</literal></quote> files). To -achieve this, change the call to <quote><literal>Environment()</literal></quote> and set the <quote><literal>CPYTHON_PYC</literal></quote> -variable to '<literal>0</literal>' (zero): -</para> -<screen>env = Environment(CPYTHON_PYC=0) -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</screen> -<para>Sample output: -</para> -<screen>$ scons -Q install -Install file: "hello.py" as "/usr/local/bin/hello.py" -Install file: "hello.pyo" as "/usr/local/bin/hello.pyo" -</screen> -<para>The <quote><literal>InstallPython</literal></quote> method accepts both, files and directories, as its source arguments: -</para> -<screen>env = Environment() -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', pyfiles) -env.Alias('install', '/usr/local/bin') -</screen> -<para>Running <quote><literal>scons -Q install</literal></quote> will copy all the <quote><literal>.py</literal></quote> files from <quote><literal>pyfiles</literal></quote> directory -into <quote><literal>/usr/local/bin/pyfiles</literal></quote> directory along with corresponding <quote><literal>.pyc</literal></quote> files. -</para> -<para>Sample output: -</para> -<screen>$ 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" -</screen> -<para>Mixing files and directories is also possible: -</para> -<screen>env = Environment() -hello = File('hello.py') -pyfiles = Dir('pyfiles/') -env.InstallPython('/usr/local/bin/', [hello, pyfiles]) -env.Alias('install', '/usr/local/bin') -</screen> -<para>Sample output: -</para> -<screen>$ 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" -</screen> -</section> - -</article>
--- 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 @@ -<?xml version='1.0'?> -<!-- - - 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. - ---> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:fo="http://www.w3.org/1999/XSL/Format" - version="1.0"> - - <xsl:import href="file:///usr/share/docbook-xsl-1.71.1/fo/docbook.xsl"/> - -<xsl:param name="l10n.gentext.default.language" select="'en'"/> -<xsl:param name="section.autolabel" select="1"></xsl:param> -<xsl:param name="toc.indent.width" select="0"></xsl:param> -<xsl:param name="body.start.indent">0pt</xsl:param> -<xsl:param name="shade.verbatim" select="1"></xsl:param> -<xsl:param name="generate.toc"> -/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 -</xsl:param> - -<xsl:template match="varlistentry/term"> - <xsl:call-template name="inline.boldseq"/> -</xsl:template> - -</xsl:stylesheet> -
--- 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 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<HTML -><HEAD -><TITLE ->SCons tool cpython - Reference</TITLE -><META -NAME="GENERATOR" -CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD -><BODY -CLASS="article" -BGCOLOR="#FFFFFF" -TEXT="#000000" -LINK="#0000FF" -VLINK="#840084" -ALINK="#0000FF" -><DIV -CLASS="ARTICLE" -><DIV -CLASS="TITLEPAGE" -><H1 -CLASS="title" -><A -NAME="AEN2" ->SCons tool <SPAN -CLASS="QUOTE" ->"cpython"</SPAN -> - Reference</A -></H1 -><H3 -CLASS="author" -><A -NAME="AEN5" ->Dirk Baechle</A -></H3 -><P -CLASS="pubdate" ->2010-07-28<BR></P -><HR></DIV -><DIV -CLASS="TOC" -><DL -><DT -><B ->Table of Contents</B -></DT -><DT ->1. <A -HREF="#interna" ->Interna</A -></DT -><DT ->2. <A -HREF="#AEN20" ->Builders</A -></DT -><DD -><DL -><DT ->2.1. <A -HREF="#AEN22" ->InstallPython</A -></DT -></DL -></DD -><DT ->3. <A -HREF="#AEN33" ->Variables</A -></DT -></DL -></DIV -><BLOCKQUOTE -CLASS="ABSTRACT" -><DIV -CLASS="abstract" -><P -></P -><A -NAME="AEN9" -></A -><P ->This reference lists all the variables that are used within the - <SPAN -CLASS="QUOTE" ->"cpython"</SPAN -> 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.</P -><P -></P -></DIV -></BLOCKQUOTE -><DIV -CLASS="section" -><HR><H2 -CLASS="section" -><A -NAME="interna" ->1. Interna</A -></H2 -><P ->Internally, the builder is based on the - <TT -CLASS="literal" ->Install</TT ->/<TT -CLASS="literal" ->InstallAs</TT -> methods from - <TT -CLASS="literal" ->SCons.Tool.install</TT ->. It makes use of the basic builder's - functions: <TT -CLASS="literal" ->installFunc()</TT ->, and - <TT -CLASS="literal" ->add_targets_to_INSTALLED_FILES()</TT ->.</P -></DIV -><DIV -CLASS="section" -><HR><H2 -CLASS="section" -><A -NAME="AEN20" ->2. Builders</A -></H2 -><DIV -CLASS="section" -><H3 -CLASS="section" -><A -NAME="AEN22" ->2.1. InstallPython</A -></H3 -><P ->The <SPAN -CLASS="QUOTE" ->"<TT -CLASS="literal" ->InstallPython</TT ->"</SPAN -> method creates - <TT -CLASS="literal" ->.pyc</TT -> or <TT -CLASS="literal" ->.pyo</TT -> files for - <TT -CLASS="literal" ->.py</TT -> source files and adds them to the list of targets - along with the source files. They are later copied to the destination - (target) directory.</P -><P ->Example:</P -><P -><PRE -CLASS="screen" ->env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</PRE -></P -></DIV -></DIV -><DIV -CLASS="section" -><HR><H2 -CLASS="section" -><A -NAME="AEN33" ->3. Variables</A -></H2 -><P -><P -></P -><DIV -CLASS="variablelist" -><DL -><DT ->CPYTHON_PYC</DT -><DD -><P ->Default value is <TT -CLASS="literal" ->1</TT ->, which means that the - Python source files get compiled to <TT -CLASS="literal" ->.pyc</TT -> files. - Set this variable to <TT -CLASS="literal" ->0</TT -> in order to get - optimized <TT -CLASS="literal" ->.pyo</TT -> files, parallel to your - installed sources.</P -></DD -><DT ->CPYTHON_EXE</DT -><DD -><P ->The path to the external Python executable, used for - creating optimized <TT -CLASS="literal" ->.pyo</TT -> files. Default value is - '<TT -CLASS="literal" ->python</TT ->'.</P -></DD -><DT ->CPYTHON_PYO_FLAGS</DT -><DD -><P ->Additional flags for compiling optimized Python files - (<TT -CLASS="literal" ->.pyo</TT ->). The default is - '<TT -CLASS="literal" ->-O</TT ->'.</P -></DD -><DT ->CPYTHON_PYO_CMD</DT -><DD -><P ->The command arguments for compiling optimized Python files - (<TT -CLASS="literal" ->.pyo</TT ->). The default value is '<TT -CLASS="literal" ->-c - 'import sys,py_compile; [py_compile.compile(i) for i in - sys.argv[1:]]'</TT ->'.</P -></DD -><DT ->CPYTHON_PYCOM</DT -><DD -><P ->The command line for compiling optimized Python files - (<TT -CLASS="literal" ->.pyo</TT ->). Default is '<TT -CLASS="literal" ->$CPYTHON_EXE - $CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD</TT ->'.</P -></DD -><DT ->CPYTHON_PYCOMSTR</DT -><DD -><P ->The message string for the - '<TT -CLASS="literal" ->CPYTHON_PYCOM</TT ->' command. Default is - '<TT -CLASS="literal" ->Install file: "$SOURCE" as "$TARGET"</TT ->'.</P -></DD -><DT ->CPYTHON_SUFFIX</DT -><DD -><P ->Default value is '.py'. The suffix for Python source - files.</P -></DD -></DL -></DIV -></P -></DIV -></DIV -></BODY -></HTML -> \ No newline at end of file
--- 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" -"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> -<article> - <articleinfo> - <title>SCons tool <quote>cpython</quote> - Reference</title> - - <author> - <firstname>Dirk</firstname> - - <surname>Baechle</surname> - </author> - - <pubdate>2010-07-28</pubdate> - </articleinfo> - - <abstract> - <para>This reference lists all the variables that are used within the - <quote>cpython</quote> 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.</para> - </abstract> - - <section id="interna"> - <title>Interna</title> - - <para>Internally, the builder is based on the - <literal>Install</literal>/<literal>InstallAs</literal> methods from - <literal>SCons.Tool.install</literal>. It makes use of the basic builder's - functions: <literal>installFunc()</literal>, and - <literal>add_targets_to_INSTALLED_FILES()</literal>.</para> - </section> - - <section> - <title>Builders</title> - - <section> - <title>InstallPython</title> - - <para>The <quote><literal>InstallPython</literal></quote> method creates - <literal>.pyc</literal> or <literal>.pyo</literal> files for - <literal>.py</literal> source files and adds them to the list of targets - along with the source files. They are later copied to the destination - (target) directory.</para> - - <para>Example:</para> - - <para><screen>env = Environment() -hello = File('hello.py') -env.InstallPython('/usr/local/bin/', hello) -env.Alias('install', '/usr/local/bin/') -</screen></para> - </section> - </section> - - <section> - <title>Variables</title> - - <para><variablelist> - <varlistentry> - <term>CPYTHON_PYC</term> - - <listitem> - <para>Default value is <literal>1</literal>, which means that the - Python source files get compiled to <literal>.pyc</literal> files. - Set this variable to <literal>0</literal> in order to get - optimized <literal>.pyo</literal> files, parallel to your - installed sources.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_EXE</term> - - <listitem> - <para>The path to the external Python executable, used for - creating optimized <literal>.pyo</literal> files. Default value is - '<literal>python</literal>'.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_PYO_FLAGS</term> - - <listitem> - <para>Additional flags for compiling optimized Python files - (<literal>.pyo</literal>). The default is - '<literal>-O</literal>'.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_PYO_CMD</term> - - <listitem> - <para>The command arguments for compiling optimized Python files - (<literal>.pyo</literal>). The default value is '<literal>-c - 'import sys,py_compile; [py_compile.compile(i) for i in - sys.argv[1:]]'</literal>'.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_PYCOM</term> - - <listitem> - <para>The command line for compiling optimized Python files - (<literal>.pyo</literal>). Default is '<literal>$CPYTHON_EXE - $CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD</literal>'.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_PYCOMSTR</term> - - <listitem> - <para>The message string for the - '<literal>CPYTHON_PYCOM</literal>' command. Default is - '<literal>Install file: "$SOURCE" as "$TARGET"</literal>'.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CPYTHON_SUFFIX</term> - - <listitem> - <para>Default value is '.py'. The suffix for Python source - files.</para> - </listitem> - </varlistentry> - </variablelist></para> - </section> -</article> \ No newline at end of file
--- 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; - }
--- 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')
--- 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')
--- 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')
--- 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'
--- 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'
--- 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'
--- 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'
--- 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
--- 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
--- 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