Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
setup.PyBuildScripts Class Reference
Inheritance diagram for setup.PyBuildScripts:
Inheritance graph
[legend]
Collaboration diagram for setup.PyBuildScripts:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def copy_scripts
def initialize_options
def finalize_options
def get_source_files
def run

Public Attributes

 build_dir
 scripts
 force
 executable
 outfiles

Static Public Attributes

string description = "\"build\" scripts (copy and fixup #! line)"
list user_options
list boolean_options = ['force']

Detailed Description

Definition at line 1819 of file setup.py.


Member Function Documentation

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.

Reimplemented from distutils.command.build_scripts.build_scripts.

Definition at line 1820 of file setup.py.

01820 
01821     def copy_scripts(self):
01822         outfiles, updated_files = build_scripts.copy_scripts(self)
01823         fullversion = '-{0[0]}.{0[1]}'.format(sys.version_info)
01824         minoronly = '.{0[1]}'.format(sys.version_info)
01825         newoutfiles = []
01826         newupdated_files = []
01827         for filename in outfiles:
01828             if filename.endswith('2to3'):
01829                 newfilename = filename + fullversion
01830             else:
01831                 newfilename = filename + minoronly
01832             log.info('renaming {} to {}'.format(filename, newfilename))
01833             os.rename(filename, newfilename)
01834             newoutfiles.append(newfilename)
01835             if filename in updated_files:
01836                 newupdated_files.append(newfilename)
01837         return newoutfiles, newupdated_files

Definition at line 37 of file build_scripts.py.

00037 
00038     def finalize_options(self):
00039         self.set_undefined_options('build',
00040                                    ('build_scripts', 'build_dir'),
00041                                    ('force', 'force'),
00042                                    ('executable', 'executable'))
00043         self.scripts = self.distribution.scripts

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 44 of file build_scripts.py.

00044 
00045     def get_source_files(self):
00046         return self.scripts

Definition at line 30 of file build_scripts.py.

00030 
00031     def initialize_options(self):
00032         self.build_dir = None
00033         self.scripts = None
00034         self.force = None
00035         self.executable = None
00036         self.outfiles = None

Definition at line 47 of file build_scripts.py.

00047 
00048     def run(self):
00049         if not self.scripts:
00050             return
00051         self.copy_scripts()
00052 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 27 of file build_scripts.py.

Definition at line 31 of file build_scripts.py.

string distutils.command.build_scripts.build_scripts.description = "\"build\" scripts (copy and fixup #! line)" [static, inherited]

Definition at line 19 of file build_scripts.py.

Definition at line 34 of file build_scripts.py.

Definition at line 33 of file build_scripts.py.

Definition at line 35 of file build_scripts.py.

Definition at line 32 of file build_scripts.py.

Initial value:
[
        ('build-dir=', 'd', "directory to \"build\" (copy) to"),
        ('force', 'f', "forcibly build everything (ignore file timestamps"),
        ('executable=', 'e', "specify final destination interpreter path"),
        ]

Definition at line 21 of file build_scripts.py.


The documentation for this class was generated from the following file: