-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
51 lines (40 loc) · 1.6 KB
/
setup.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
import os
from distutils.core import setup
from distutils.command.install_data import install_data
from glob import glob
from src.version import __version__
class InstallData(install_data):
def run(self):
self.data_files.extend(self._nautilus_plugin())
install_data.run(self)
def _nautilus_plugin(self):
files = []
cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
res = cmd.readline().strip()
ret = cmd.close()
if ret is None:
dest = res[5:]
files.append((dest, ['nautilus/postrExtension.py']))
return files
setup(name='Postr',
version=__version__,
description='Flickr Uploader',
author='Ross Burton',
author_email='[email protected]',
url='http://www.burtonini.com/',
scripts=['postr'],
package_dir={'postr': 'src'},
packages=['postr'],
package_data={'postr': ['postr.glade']},
data_files=[('share/applications', ['data/postr.desktop']),
('share/icons/hicolor/16x16/apps', glob('data/16x16/*.png')),
('share/icons/hicolor/22x22/apps', glob('data/22x22/*.png')),
('share/icons/hicolor/24x24/apps', glob('data/24x24/*.png')),
('share/icons/hicolor/32x32/apps', glob('data/32x32/*.png')),
('share/icons/hicolor/scalable/apps', glob('data/scalable/*.svg')),
], cmdclass={'install_data': InstallData}
)
# TODO: install translations
# TODO: update icon cache
# TODO: rewrite in autotools because this is getting silly