equal
deleted
inserted
replaced
2 from distutils.core import setup |
2 from distutils.core import setup |
3 from distutils.command.install_data import install_data |
3 from distutils.command.install_data import install_data |
4 from distutils.command.install import INSTALL_SCHEMES |
4 from distutils.command.install import INSTALL_SCHEMES |
5 import sys |
5 import sys |
6 |
6 |
7 print("hello 1") |
|
8 |
7 |
9 class osx_install_data(install_data): |
8 class osx_install_data(install_data): |
10 # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../ |
9 # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../ |
11 # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix |
10 # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix |
12 # for this in distutils.command.install_data#306. It fixes install_lib but not |
11 # for this in distutils.command.install_data#306. It fixes install_lib but not |
16 # By the time finalize_options is called, install.install_lib is set to the |
15 # By the time finalize_options is called, install.install_lib is set to the |
17 # fixed directory, so we set the installdir to install_lib. The |
16 # fixed directory, so we set the installdir to install_lib. The |
18 # install_data class uses ('install_data', 'install_dir') instead. |
17 # install_data class uses ('install_data', 'install_dir') instead. |
19 self.set_undefined_options('install', ('install_lib', 'install_dir')) |
18 self.set_undefined_options('install', ('install_lib', 'install_dir')) |
20 install_data.finalize_options(self) |
19 install_data.finalize_options(self) |
21 print("hello 2") |
|
22 |
20 |
23 def fullsplit(path, result=None): |
21 def fullsplit(path, result=None): |
24 """ |
22 """ |
25 Split a pathname into components (the opposite of os.path.join) in a |
23 Split a pathname into components (the opposite of os.path.join) in a |
26 platform-neutral way. |
24 platform-neutral way. |
32 return [tail] + result |
30 return [tail] + result |
33 if head == path: |
31 if head == path: |
34 return result |
32 return result |
35 return fullsplit(head, [tail] + result) |
33 return fullsplit(head, [tail] + result) |
36 |
34 |
37 print("hello 3") |
35 |
38 def launch_setup(script_name, script_args): |
36 def launch_setup(script_name, script_args): |
39 if sys.platform == "darwin": |
37 if sys.platform == "darwin": |
40 cmdclasses = {'install_data': osx_install_data} |
38 cmdclasses = {'install_data': osx_install_data} |
41 else: |
39 else: |
42 cmdclasses = {'install_data': install_data} |
40 cmdclasses = {'install_data': install_data} |
118 ], |
116 ], |
119 ) |
117 ) |
120 |
118 |
121 |
119 |
122 if __name__ == "__main__": |
120 if __name__ == "__main__": |
123 |
121 |
124 print("hello 4") |
|
125 script_name = os.path.basename(sys.argv[0]) |
122 script_name = os.path.basename(sys.argv[0]) |
126 script_args = sys.argv[1:] |
123 script_args = sys.argv[1:] |
127 print("hello 5") |
124 |
128 launch_setup(script_name, script_args) |
125 launch_setup(script_name, script_args) |
129 print("hello 6") |
|