File: setup.py

package info (click to toggle)
playitslowly 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 176 kB
  • ctags: 134
  • sloc: python: 856; makefile: 6; sh: 3
file content (83 lines) | stat: -rwxr-xr-x 2,796 bytes parent folder | download
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python
import sys
import os

from distutils.core import setup
from distutils.command.install import install, write_file
from distutils.command.install_egg_info import to_filename, safe_name

class new_install(install):
    def initialize_options(self):
        install.initialize_options(self)

    def run(self):
        install.run(self)
        # hack to remove old module
        old_path = os.path.join(self.install_libbase, "playitslowly", "playitslowly.py")
        for p in (old_path + x for x in ("o", "c", "")):
            if os.path.exists(p):
                self.execute(os.unlink, (p, ), "Removing old file %r" % p)

        # write install-info
        basename = "%s-py%s.install-info" % (
            to_filename(safe_name(self.distribution.get_name())),
            sys.version[:3]
        )
        install_info = os.path.join(self.install_libbase, basename)
        outputs = self.get_outputs()
        if self.root:               # strip any package prefix
            root_len = len(self.root)
            for counter in xrange(len(outputs)):
                outputs[counter] = outputs[counter][root_len:]
        self.execute(write_file,
                (install_info, outputs),
                "writing install-info to '%s'" % install_info)



def ls_r(dir):
    def do_reduce(a, b):
        files = []
        for f in b[2]:
            files.append(os.path.join(b[0], f))
        a.append((b[0], files))
        return a
    return reduce(do_reduce, os.walk(dir), [])

kwargs = {
      'cmdclass': {'install': new_install},
      'name': 'playitslowly',
      'version': "1.4.0",
      'description': 'A tool to help you when transcribing music. It allows you to play a piece of music at a different speed or pitch.',
      'author': 'Jonas Wagner',
      'author_email': 'veers@gmx.ch',
      'url': 'http://29a.ch/playitslowly/',
      'packages': ['playitslowly'],
      'scripts': ['bin/playitslowly'],
      'options': {'py2exe':{
          'packages': 'encodings',
          'includes': 'cairo, pango, pangocairo, atk, gobject',
          'dist_dir': 'dist/win32',
          'optimize': 2,
          }},
      'data_files': ls_r('share'),
      'license': 'GNU GPL v3',
      'classifiers': ['Development Status :: 4 - Beta',
        'Environment :: X11 Applications :: GTK',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: GNU General Public License (GPL)',
        'Natural Language :: English',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        ]
}

try:
    import py2exe
    kwargs['windows'] = [{'script': 'bin/playitslowly',
          'icon_resources': [(1, 'playitslowly.ico')],
          'dest_base': 'playitslowly'}]
except ImportError:
    pass

setup(**kwargs)