blob: 43e5fc18bcadc7c7e27bbf361255add23803f00e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
"""distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.cmd import install_misc
from stat import ST_MODE
class install_scripts(install_misc):
description = "install scripts"
def finalize_options (self):
self._install_dir_from('install_scripts')
def run (self):
self._copy_files(self.distribution.scripts)
if os.name == 'posix':
# Set the executable bits (owner, group, and world) on
# all the scripts we just installed.
files = self.get_outputs()
for file in files:
if self.dry_run:
self.announce("changing mode of %s" % file)
else:
mode = (os.stat(file)[ST_MODE]) | 0111
self.announce("changing mode of %s to %o" % (file, mode))
os.chmod(file, mode)
def get_inputs (self):
return self.distribution.scripts or []
# class install_scripts
|