File: setup.py

package info (click to toggle)
etk.docking 0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 572 kB
  • ctags: 597
  • sloc: python: 4,862; makefile: 107; sh: 6
file content (100 lines) | stat: -rw-r--r-- 3,702 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:sw=4:et:ai

# Copyright © 2010 etk.docking Contributors
#
# This file is part of etk.docking.
#
# etk.docking is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# etk.docking is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with etk.docking. If not, see <http://www.gnu.org/licenses/>.


import os
import re
import fnmatch

from ez_setup import use_setuptools; use_setuptools()
from setuptools import setup, find_packages


def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

def version():
    file = os.path.join(os.path.dirname(__file__), 'lib', 'etk', 'docking', '__init__.py')
    return re.compile(r".*__version__ = '(.*?)'", re.S).match(read(file)).group(1)

def _get_data_files(dest, src, filter):
    path = os.path.abspath(os.path.join(os.path.dirname(__file__), src))
    files = []

    if os.path.isdir(path):
        for item in fnmatch.filter(os.listdir(path), filter):
            if os.path.isfile(os.path.join(path, item)):
                files.append(('%s/%s' % (src, item)))
    else:
        print 'get_data_files: "%s" does not exist, ignoring' % src

    return files

def get_data_files(*args):
    data_files = []

    for (dest, src, filter) in args:
        path = os.path.abspath(os.path.join(os.path.dirname(__file__), src))

        if os.path.isdir(path):
            data_files.append(('%s' % dest, _get_data_files('%s' % dest, '%s' % src, filter)))

            for item in os.listdir(path):
                if os.path.isdir(os.path.join(path, item)):
                    data_files.append(('%s/%s' % (dest, item), _get_data_files('%s/%s' % (dest, item), '%s/%s' % (src, item), filter)))
        else:
            print 'get_data_files: "%s" does not exist, ignoring' % src

    return data_files


setup(namespace_packages = ['etk'],
      name = 'etk.docking',
      version = version(),
      description = 'PyGTK Docking Widgets',
      long_description = read('README'),
      author = 'etk.docking Contributors',
      author_email = 'etk-list@googlegroups.com',
      url = 'http://github.com/dieterv/etk.docking/',
      download_url = 'http://github.com/dieterv/etk.docking/downloads/',
      license = 'GNU Lesser General Public License',
      classifiers = ['Development Status :: 4 - Beta',
                    'Environment :: X11 Applications :: GTK',
                    'Intended Audience :: Developers',
                    'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
                    'Natural Language :: English',
                    'Operating System :: MacOS :: MacOS X',
                    'Operating System :: Microsoft :: Windows',
                    'Operating System :: POSIX',
                    'Programming Language :: Python',
                    'Topic :: Software Development :: Libraries :: Python Modules'],

      install_requires = ['setuptools',
                          'simplegeneric >= 0.6'],
      zip_safe = False,
      include_package_data = True,

      packages = find_packages('lib'),
      package_dir = {'': 'lib'},
      data_files = get_data_files(),

      tests_require = ['nose'],
      test_suite = 'nose.collector')