changeset 146:7dc00829c32f

Instal sat_templates the python's way You can just call 'pip install .' to install sat_templates.
author Xavier Maillard <xavier@maillard.im>
date Sat, 30 Dec 2017 14:13:09 +0100
parents 013cfb6e6650
children 33c7ce833d3f
files setup.py
diffstat 1 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py	Sat Dec 30 14:13:09 2017 +0100
@@ -0,0 +1,59 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# SàT templates: collection of templates 
+# Copyright (C) 2017  Xavier Maillard (xavier@maillard.im)
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program 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 Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import sys
+from setuptools import setup, find_packages
+
+base = None
+NAME = 'sat_templates'
+is_wheel = 'bdist_wheel' in sys.argv
+
+# https://stackoverflow.com/a/36693250
+
+def get_data_templates_files(directory):
+    paths = []
+    for (path, directories, filenames) in os.walk(directory):
+	for filename in filenames:
+		paths.append(os.path.join('..', path, filename))
+    return paths
+
+data_templates_files = get_data_templates_files('default')
+
+setup_info = dict(
+    name=NAME,
+    version= '0.7D',
+    author='Association « Salut à Toi »',
+    author_email='contact@salut-a-toi.org',
+    url='https://salut-a-toi.org',
+    classifiers=['Development Status :: 3 - Alpha',
+                 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
+                 'Operating System :: POSIX :: Linux',
+                 'Topic :: Communications :: Chat'],
+    install_requires=[],
+    packages=['sat_templates'],
+    package_dir={'sat_templates':'default'},
+    package_data={'': data_templates_files },
+    data_files=[(os.path.join(sys.prefix, 'share/locale/fr/LC_MESSAGES'), ['i18n/fr/LC_MESSAGES/sat.mo']),
+                  ('share/doc/%s' % NAME, ['COPYING']),
+                  ],
+    zip_safe=True,
+)
+
+setup(**setup_info)