Package animio :: Module setup :: Class BuildScripts
[hide private]
[frames] | no frames]

Class BuildScripts

source code

                    distutils.cmd.Command --+    
                                            |    
distutils.command.build_scripts.build_scripts --+
                                                |
                                               BuildScripts

Uses our way to adjust the first line of the script, additionally rename the executable to indicate the required interpreter. Otherwise scripts would override each other anyway.
Instance Methods [hide private]
 
copy_scripts(self)
Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie.
source code
 
finalize_options(self)
Set final values for all the options that this command supports.
source code
 
initialize_options(self)
Set default values for all the options that this command supports.
source code

Inherited from distutils.command.build_scripts.build_scripts: get_source_files, run

Inherited from distutils.cmd.Command: __getattr__, __init__, announce, copy_file, copy_tree, debug_print, dump_options, ensure_dirname, ensure_filename, ensure_finalized, ensure_string, ensure_string_list, execute, get_command_name, get_finalized_command, get_sub_commands, make_archive, make_file, mkpath, move_file, reinitialize_command, run_command, set_undefined_options, spawn, warn

Inherited from distutils.cmd.Command (private): _ensure_stringlike, _ensure_tested_string

Class Methods [hide private]
 
handle_scripts(cls, scripts, adjust_first_line, suffix='')
Handle the given scripts to work for later installation :param scripts: paths to scripts to hanlde :param adjust_first_line: if True, the first line will receive the actual python version to match the version of the this python interpreter :param suffix: if given, the suffix is assumed to be a suffix for all scripts.
source code
Class Variables [hide private]
  re_script_first_line = re.compile(r'^(#!.*python)[0-9\.]*([ \t...

Inherited from distutils.command.build_scripts.build_scripts: boolean_options, description, user_options

Inherited from distutils.cmd.Command: sub_commands

Method Details [hide private]

copy_scripts(self)

source code 

Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy.

Overrides: distutils.command.build_scripts.build_scripts.copy_scripts
(inherited documentation)

finalize_options(self)

source code 

Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.finalize_options
(inherited documentation)

handle_scripts(cls, scripts, adjust_first_line, suffix='')
Class Method

source code 
Handle the given scripts to work for later installation
:param scripts: paths to scripts to hanlde
:param adjust_first_line: if True, the first line will receive the actual 
        python version to match the version of the this python interpreter
:param suffix: if given, the suffix is assumed to be a suffix for all scripts.
        If scripts want to execfile each other, the name of the script needs adjustment
        to actually work, which is unknown to the script in advance. Hence we fix
        the string ourselves.
        The suffix is assumed to be appended to all input script files, revealing the 
        original script basename if the suffix is removed. The latter one is searched for 
        in the script.

initialize_options(self)

source code 

Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.initialize_options
(inherited documentation)

Class Variable Details [hide private]

re_script_first_line

Value:
re.compile(r'^(#!.*python)[0-9\.]*([ \t].*)?$')