server/python/django/setup.py
changeset 336 2ab4e8833410
parent 334 de35ce18643a
child 338 34c339f32aeb
--- a/server/python/django/setup.py	Mon Nov 10 11:43:01 2014 +0100
+++ b/server/python/django/setup.py	Thu Nov 13 18:04:33 2014 +0100
@@ -1,33 +1,46 @@
+import os
+import sys
+
 from setuptools import setup, find_packages
 
 # Dynamically calculate the version based on django.VERSION.
 version = __import__('renkanmanager').get_version()
 
+def launch_setup(script_name, script_args):
 
-setup(
-    name='renkanmanager',
-    version=version,
-    url='http://renkan.iri-research.org/',
-    author='I.R.I.',
-    author_email='contact@iri-research.org',
-    description=('Basic Django module for saving renkan'),
-    license='CECILL-B',
-    packages=find_packages(),
-    include_package_data=True,
-    zip_safe=False,
-    classifiers=[
-        'Development Status :: 3 - Alpha',
-        'Environment :: Web Environment',
-        'Framework :: Django',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: CECILL License',
-        'Operating System :: OS Independent',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 2',
-        'Programming Language :: Python :: 2.7',
-        'Topic :: Internet :: WWW/HTTP',
-        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
-        'Topic :: Internet :: WWW/HTTP :: WSGI',
-        'Topic :: Software Development :: Libraries :: Python Modules',
-    ],
-)
+    setup(
+        script_name = script_name,
+        script_args = script_args,
+        name='renkanmanager',
+        version=version,
+        url='http://renkan.iri-research.org/',
+        author='I.R.I.',
+        author_email='contact@iri-research.org',
+        description=('Basic Django module for saving renkan'),
+        license='CECILL-B',
+        packages=find_packages(),
+        include_package_data=True,
+        zip_safe=False,
+        classifiers=[
+            'Development Status :: 3 - Alpha',
+            'Environment :: Web Environment',
+            'Framework :: Django',
+            'Intended Audience :: Developers',
+            'License :: OSI Approved :: CECILL License',
+            'Operating System :: OS Independent',
+            'Programming Language :: Python',
+            'Programming Language :: Python :: 2',
+            'Programming Language :: Python :: 2.7',
+            'Topic :: Internet :: WWW/HTTP',
+            'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+            'Topic :: Internet :: WWW/HTTP :: WSGI',
+            'Topic :: Software Development :: Libraries :: Python Modules',
+        ],
+    )
+    
+if __name__ == "__main__":
+    
+    script_name = os.path.basename(sys.argv[0])
+    script_args = sys.argv[1:]
+    
+    launch_setup(script_name, script_args)