]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxaddons/setup.py
1 import distutils
.command
.install_lib
2 import distutils
.command
.install
4 from distutils
.core
import setup
6 class wxaddon_install_lib(distutils
.command
.install_lib
.install_lib
):
7 """need to change self.install_dir to the actual library dir"""
9 install_cmd
= self
.get_finalized_command('install')
10 self
.install_dir
= os
.path
.join(getattr(install_cmd
, 'install_purelib'), "wxaddons")
11 return distutils
.command
.install_lib
.install_lib
.run(self
)
13 class wxaddon_install(distutils
.command
.install
.install
):
15 result
= distutils
.command
.install
.install
.run(self
)
17 metadata_file
= 'addon.info'
18 if os
.path
.exists(metadata_file
):
21 fields
= email
.message_from_string(open(metadata_file
).read())
22 config
= wx
.Config("wxaddons-receipts")
23 config
.SetPath(fields
['name'])
24 for field
in fields
._headers
:
25 config
.Write(field
[0], field
[1])
28 def wxaddon(**kwargs
):
29 kwargs
['cmdclass'] = {'install_lib' : wxaddon_install_lib
,
30 'install' : wxaddon_install
}