Subversion Repositories basico

Rev

Rev 17 | 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
5
# Copyright (C) 2016 Tomás Vírseda
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
 
19 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']),
32
            ('basico/data/icons',
33
                [
34
                    'basico/data/icons/annotation.png',
35
                    'basico/data/icons/bookmark.png',
36
                    'basico/data/icons/browse.png',
37
                    'basico/data/icons/category.png',
38
                    'basico/data/icons/component.png',
39
                    'basico/data/icons/delete.png',
40
                    'basico/data/icons/noproject.png',
41
                    'basico/data/icons/project.png',
42
                    'basico/data/icons/sapnote.png',
43
                    'basico/data/icons/notask.png',
44
                    'basico/data/icons/task.png',
45
                    'basico/data/icons/tasks.png',
46
                ]),
47
            ('basico/data/ui', ['basico/data/ui/basico.ui']),
48
            ('basico/data/share', []),
49
            ("basico/data/share/docs",
50
                    [
19 t00mlabs 51
                    'AUTHORS',
4 t00mlabs 52
                    'LICENSE',
19 t00mlabs 53
                    'README',
4 t00mlabs 54
                    'INSTALL',
19 t00mlabs 55
                    'CREDITS',
56
                    'Changelog'
4 t00mlabs 57
                    ]),
58
            ]
59
 
60
        if not os.path.isdir('mo'):
61
            os.mkdir('mo')
62
        for pofile in os.listdir('po'):
63
            if pofile.endswith('po'):
64
                lang = pofile.strip('.po')
65
                modir = os.path.join('mo', lang)
66
                if not os.path.isdir(modir):
67
                    os.mkdir(modir)
68
                mofile = os.path.join(modir, 'basico.mo')
69
                subprocess.call('msgfmt {} -o {}'.format(os.path.join('po', pofile), mofile), shell=True)
70
                data_files.append(['share/locale/{}/LC_MESSAGES/'.format(lang), [mofile]])
71
        return data_files
72
    except:
73
        return []
74
 
75
if os.name == 'posix':
76
    data_files = add_data()
77
else:
78
    data_files = []
79
 
80
try:
81
    bcommit = subprocess.check_output("svn info", shell=True)
82
    ucommit = bcommit.decode(encoding='UTF-8')
83
    icommit = int(ucommit.split('\n')[6].split(':')[1])
84
    dcommit = ucommit.split('\n')[11][19:29]
85
except Exception as error:
86
    print (error)
87
    dcommit = 'None'
88
    icommit = 0
89
 
90
setup(
91
    name='basico',
92
    version='0.1',
93
    author='Tomás Vírseda',
94
    author_email='tomasvirseda@gmail.com',
19 t00mlabs 95
    url='http://subversion.t00mlabs.net/basico',
96
    description='SAP Notes Manager for SAP Consultants',
4 t00mlabs 97
    long_description=long_description,
19 t00mlabs 98
    download_url = 'http://t00mlabs.net/downloads/basico-0.1.tar.gz',
4 t00mlabs 99
    license='GPLv3',
100
    packages=['basico'],
101
    # distutils does not support install_requires, but pip needs it to be
102
    # able to automatically install dependencies
103
    install_requires=[
104
          'pygal',
105
          'python-dateutil',
106
          'selenium',
107
          'feedparser',
108
    ],
109
    include_package_data=True,
110
    data_files=data_files,
111
    zip_safe=False,
112
    platforms='any',
113
    classifiers=[
114
        'Development Status :: 3 - Alpha',
115
        'Environment :: X11 Applications :: Gnome',
116
        'Environment :: X11 Applications :: GTK',
117
        'Intended Audience :: Information Technology',
118
        'Intended Audience :: Other Audience',
119
        'Intended Audience :: System Administrators',
120
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
121
        'Natural Language :: English',
122
        'Operating System :: Microsoft :: Windows',
123
        'Operating System :: POSIX :: Linux',
124
        'Programming Language :: Python :: 3',
125
        'Topic :: Database :: Front-Ends',
126
        'Topic :: System :: Systems Administration',
127
        'Topic :: Utilities'
128
    ],
129
    entry_points={
130
        #~ 'console_scripts': [
131
            #~ 'basico = basico:main',
132
            #~ ],
133
        'gui_scripts': [
134
            'basico = basico.basico:main',
135
            ]
136
        },
137
)