Simplify module information with python configuration

This commit is contained in:
Cédric Krier committed 2012-08-15 18:02:38 +02:00
1 parent 5ef918c348
commit 360764e606
5 files changed
+38 -64

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_production
==================
The production module of the Tryton application platform.
See __tryton__.py
Installing
----------
-52
View File
@@ -1,52 +0,0 @@
#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': 'Production Management',
'name_ca_ES': 'Producció',
'name_de_DE': 'Produktion',
'name_es_ES': 'Producción',
'name_fr_FR': 'Production',
'version': '2.5.0',
'author': 'B2CK',
'email': 'info@b2ck.com',
'website': 'http://www.tryton.org/',
'description': '''Production Management with:
- Bill of Material
- Production Order
''',
'description_ca_ES': '''Gestió de la producció amb:
- Llistes de Material (LdM)
- Ordres de producció
''',
'description_es_ES': '''Gestión de la producción con:
- Listas de Material (LdM)
- Órdenes de producción
''',
'description_de_DE': '''Verwaltung der Produktion mit
- Stücklisten
- Produktionsaufträgen
''',
'description_fr_FR': '''Gestion de la production, avec:
- Nomenclature
- Ordre de production
''',
'depends': [
'ir',
'res',
'product',
'company',
'stock',
],
'xml': [
'production.xml',
'configuration.xml',
'bom.xml',
'product.xml',
'stock.xml',
],
'translation': [
'locale/de_DE.po',
'locale/es_ES.po',
'locale/fr_FR.po',
]
}
+22 -11
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,21 +32,21 @@ requires.append('trytond >= %s.%s, < %s.%s' %
setup(name='trytond_production',
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 for production',
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.production': '.'},
packages=[
'trytond.modules.production',
'trytond.modules.production.tests',
],
],
package_data={
'trytond.modules.production': info.get('xml', []) \
+ info.get('translation', []),
},
+ ['tryton.cfg', 'locale/*.po'],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
@@ -57,7 +68,7 @@ setup(name='trytond_production',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
],
],
license='GPL-3',
install_requires=requires,
zip_safe=False,
@@ -67,4 +78,4 @@ setup(name='trytond_production',
""",
test_suite='tests',
test_loader='trytond.test_loader:Loader',
)
)
+15
View File
@@ -0,0 +1,15 @@
[tryton]
version=2.5.0
depends:
company
ir
product
res
stock
xml:
production.xml
configuration.xml
bom.xml
product.xml
stock.xml