Subversion Repositories basico

Rev

Rev 11 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 t00mlabs 1
#!/usr/bin/python3
2
# -*- coding: utf-8 -*-
3
# Authors: Tomás Vírseda <tomasvirseda@gmail.com>
4
# Basico is a SAP Notes manager for SAP Consultants
74 t00mlabs 5
# Copyright (C) 2016-2017 Tomás Vírseda
4 t00mlabs 6
#
7
# Basico is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Basico is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Basico.  If not, see <http://www.gnu.org/licenses/gpl.html>
19
 
20
import os
21
import subprocess
22
from setuptools import setup
23
 
24
 
7 t00mlabs 25
with open('README') as f:
4 t00mlabs 26
    long_description = f.read()
27
 
28
def add_data():
29
    try:
30
        data_files = [
31
            ('basico/share/applications', ['basico/data/desktop/basico.desktop']),
74 t00mlabs 32
            ('basico/data/res', ['basico/data/res/user_agents.txt']),
4 t00mlabs 33
            ('basico/data/icons',
34
                [
74 t00mlabs 35
                    'basico/data/icons/about.png',
4 t00mlabs 36
                    'basico/data/icons/annotation.png',
37
                    'basico/data/icons/bookmark.png',
38
                    'basico/data/icons/browse.png',
39
                    'basico/data/icons/category.png',
40
                    'basico/data/icons/component.png',
41
                    'basico/data/icons/delete.png',
42
                    'basico/data/icons/noproject.png',
43
                    'basico/data/icons/project.png',
44
                    'basico/data/icons/sapnote.png',
45
                    'basico/data/icons/notask.png',
74 t00mlabs 46
                    'basico/data/icons/tags.png',
4 t00mlabs 47
                    'basico/data/icons/task.png',
48
                    'basico/data/icons/tasks.png',
74 t00mlabs 49
                    'basico/data/icons/chronologic.png',
50
                    'basico/data/icons/description.png',
51
                    'basico/data/icons/priority.png',
52
                    'basico/data/icons/type.png',
53
                    'basico/data/icons/chart.png',
54
                    'basico/data/icons/stats.png',
55
                    'basico/data/icons/details.png',
56
                    'basico/data/icons/subwindow.png',
57
                    'basico/data/icons/bsearch.png',
58
                    'basico/data/icons/refresh.png',
59
                    'basico/data/icons/power.png',
4 t00mlabs 60
                ]),
61
            ('basico/data/ui', ['basico/data/ui/basico.ui']),
62
            ('basico/data/share', []),
63
            ("basico/data/share/docs",
64
                    [
8 t00mlabs 65
                    'AUTHORS',
4 t00mlabs 66
                    'LICENSE',
8 t00mlabs 67
                    'README',
4 t00mlabs 68
                    'INSTALL',
8 t00mlabs 69
                    'CREDITS',
70
                    'Changelog'
4 t00mlabs 71
                    ]),
72
            ]
73
 
74
        if not os.path.isdir('mo'):
75
            os.mkdir('mo')
76
        for pofile in os.listdir('po'):
77
            if pofile.endswith('po'):
78
                lang = pofile.strip('.po')
79
                modir = os.path.join('mo', lang)
80
                if not os.path.isdir(modir):
81
                    os.mkdir(modir)
82
                mofile = os.path.join(modir, 'basico.mo')
83
                subprocess.call('msgfmt {} -o {}'.format(os.path.join('po', pofile), mofile), shell=True)
84
                data_files.append(['share/locale/{}/LC_MESSAGES/'.format(lang), [mofile]])
85
        return data_files
86
    except:
87
        return []
88
 
89
if os.name == 'posix':
90
    data_files = add_data()
91
else:
92
    data_files = []
93
 
94
try:
95
    bcommit = subprocess.check_output("svn info", shell=True)
96
    ucommit = bcommit.decode(encoding='UTF-8')
97
    icommit = int(ucommit.split('\n')[6].split(':')[1])
98
    dcommit = ucommit.split('\n')[11][19:29]
99
except Exception as error:
100
    print (error)
101
    dcommit = 'None'
102
    icommit = 0
103
 
104
setup(
105
    name='basico',
74 t00mlabs 106
    version='0.2',
4 t00mlabs 107
    author='Tomás Vírseda',
108
    author_email='tomasvirseda@gmail.com',
11 t00mlabs 109
    url='http://subversion.t00mlabs.net/basico',
110
    description='SAP Notes Manager for SAP Consultants',
4 t00mlabs 111
    long_description=long_description,
74 t00mlabs 112
    download_url = 'http://t00mlabs.net/downloads/basico-0.2.tar.gz',
4 t00mlabs 113
    license='GPLv3',
114
    packages=['basico'],
115
    # distutils does not support install_requires, but pip needs it to be
116
    # able to automatically install dependencies
117
    install_requires=[
118
          'pygal',
119
          'python-dateutil',
120
          'selenium',
121
          'feedparser',
74 t00mlabs 122
          'requests',
4 t00mlabs 123
    ],
124
    include_package_data=True,
125
    data_files=data_files,
126
    zip_safe=False,
127
    platforms='any',
128
    classifiers=[
129
        'Development Status :: 3 - Alpha',
130
        'Environment :: X11 Applications :: Gnome',
131
        'Environment :: X11 Applications :: GTK',
132
        'Intended Audience :: Information Technology',
133
        'Intended Audience :: Other Audience',
134
        'Intended Audience :: System Administrators',
135
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
136
        'Natural Language :: English',
137
        'Operating System :: Microsoft :: Windows',
138
        'Operating System :: POSIX :: Linux',
139
        'Programming Language :: Python :: 3',
140
        'Topic :: Database :: Front-Ends',
141
        'Topic :: System :: Systems Administration',
142
        'Topic :: Utilities'
143
    ],
144
    entry_points={
145
        #~ 'console_scripts': [
146
            #~ 'basico = basico:main',
147
            #~ ],
148
        'gui_scripts': [
149
            'basico = basico.basico:main',
150
            ]
151
        },
152
)