Simplify module information with python configuration

review363001
This commit is contained in:
Cédric Krier committed 2012-06-08 19:34:08 +02:00
1 parent 3daf9a556c
commit 23ad06fd9d
5 files changed
+32 -75

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ include TODO
include COPYRIGHT
include CHANGELOG
include LICENSE
include tryton.cfg
include *.xml
include *.odt
include locale/*.po
-1
View File
@@ -2,7 +2,6 @@ trytond_product
===============
The product module of the Tryton application platform.
See __tryton__.py
Installing
----------
-62
View File
@@ -1,62 +0,0 @@
# -*- coding: utf-8 -*-
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
{
'name': 'Product',
'name_bg_BG': 'Продукт',
'name_ca_ES': 'Productes',
'name_de_DE': 'Artikel',
'name_es_AR': 'Productos',
'name_es_CO': 'Productos',
'name_es_ES': 'Productos',
'name_fr_FR': 'Produit',
'name_nl_NL': 'Producten',
'name_ru_RU': 'ТМЦ',
'version': '2.5.0',
'author': 'B2CK',
'email': 'info@b2ck.com',
'website': 'http://www.tryton.org/',
'description': 'Define products, categories of product, units ' \
'of measure, categories of units of measure.',
'description_bg_BG': 'Задаване на продукти, категории продукти, мерни единици, категории мерни единици.',
'description_ca_ES': '''Defineix productes, categories de producte, unitats
de mesura, categories d'unitats de mesura.''',
'description_de_DE': 'Dient der Erstellung von Artikeln, Artikelkategorien, Maßeinheiten und Kategorien für Maßeinheiten.',
'description_es_AR': '''Define:
- Productos
- Categorías de producto
- Unidades de medida
- Categorías de unidades de medida
''',
'description_es_CO': 'Definición de productos, categorías de producto unidades de medida y categorías de unidades de medida',
'description_es_ES': 'Define productos, categorías de producto, unidades de medida y categorías de unidades de medida.',
'description_fr_FR': '''Défini:
- Produit
- Catégorie de produit
- Unité de mesure
- Catégorie d'unité de mesure
''',
'description_nl_NL': 'Definieert producten, productcategorieën, meeteenheden en categorieën van meeteenheden.',
'description_ru_RU': 'Определение ТМЦ, категорий ТМЦ, единиц измерения, категорий единиц измерения.',
'depends': [
'ir',
'res',
],
'xml': [
'product.xml',
'category.xml',
'uom.xml',
],
'translation': [
'locale/bg_BG.po',
'locale/ca_ES.po',
'locale/cs_CZ.po',
'locale/de_DE.po',
'locale/es_AR.po',
'locale/es_CO.po',
'locale/es_ES.po',
'locale/fr_FR.po',
'locale/nl_NL.po',
'locale/ru_RU.po',
]
}
+22 -12
View File
@@ -4,8 +4,19 @@
from setuptools import setup
import re
import os
import ConfigParser
info = eval(open('__tryton__.py').read())
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
config = ConfigParser.ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
if key in info:
info[key] = info[key].strip().splitlines()
major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
@@ -21,22 +32,21 @@ requires.append('trytond >= %s.%s, < %s.%s' %
setup(name='trytond_product',
version=info.get('version', '0.0.1'),
description=info.get('description', ''),
author=info.get('author', ''),
author_email=info.get('email', ''),
url=info.get('website', ''),
description='Tryton module with products',
long_description=read('README'),
author='Tryton',
url='http://www.tryton.org/',
download_url="http://downloads.tryton.org/" + \
info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
package_dir={'trytond.modules.product': '.'},
packages=[
'trytond.modules.product',
'trytond.modules.product.tests',
],
],
package_data={
'trytond.modules.product': info.get('xml', []) \
+ info.get('translation', []) \
+ ['icons/*.svg'],
},
+ ['tryton.cfg', 'locale/*.po', 'icons/*.svg'],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
@@ -58,7 +68,7 @@ setup(name='trytond_product',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
],
],
license='GPL-3',
install_requires=requires,
zip_safe=False,
@@ -68,4 +78,4 @@ setup(name='trytond_product',
""",
test_suite='tests',
test_loader='trytond.test_loader:Loader',
)
)
+9
View File
@@ -0,0 +1,9 @@
[tryton]
version=2.5.0
depends:
ir
res
xml:
product.xml
category.xml
uom.xml