1.4
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Mon, 27 Feb 2012 17:37:13 +0000 (12:37 -0500)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Mon, 27 Feb 2012 17:37:13 +0000 (12:37 -0500)
CHANGES
auf/recipe/django/__init__.py
auf/recipe/django/boilerplate.py
auf/recipe/django/recipe.py
setup.py

diff --git a/CHANGES b/CHANGES
index d7d5bd0..6ca09aa 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+1.4
+===
+
+* fix surchage TPL buildout
+
 1.3
 ===
 
index bbe6dde..5fed729 100644 (file)
@@ -1,12 +1,6 @@
 # -*- encoding: utf-8 -*-
 
-import zc.buildout
-import djangorecipe.boilerplate
-from boilerplate import auf_script_template, auf_buildout_file
-
 # surcharge du tpl de base de buildout pour generer le script dans bin
-djangorecipe.boilerplate.script_template = auf_script_template
-zc.buildout.easy_install.script_template = auf_buildout_file
-
+#djangorecipe.boilerplate.script_template = auf_script_template
 
 from recipe import Recipe
index 3aa64a4..4a98ca9 100644 (file)
@@ -1,4 +1,5 @@
 # -*- encoding: utf-8 -*-
+
 import zc.buildout.easy_install
 
 
index abcc991..b17f91e 100644 (file)
@@ -61,11 +61,41 @@ class Recipe(OriginalDjangoRecipe):
         self.create_file(os.path.join(project_dir, 'dashboard.py'), dashboard_file, self.options)
 
     def create_manage_script(self, extra_paths, ws):
+        _script_template = zc.buildout.easy_install.script_template
+        zc.buildout.easy_install.script_template = auf_buildout_file
         project = self.options.get('projectegg', self.options['project'])
-        return zc.buildout.easy_install.scripts(
+        scripts =  zc.buildout.easy_install.scripts(
             [(self.options.get('control-script', self.name),
               'auf.recipe.django.manage', 'main')],
             ws, self.options['executable'], self.options['bin-directory'],
             extra_paths=extra_paths,
             arguments="'%s.%s'" % (project,
                                    self.options['settings']))
+        zc.buildout.easy_install.script_template = _script_template
+        return scripts
+
+    def make_scripts(self, extra_paths, ws):
+        scripts = []
+        _script_template = zc.buildout.easy_install.script_template
+        for protocol in ('wsgi', 'fcgi'):
+            zc.buildout.easy_install.script_template = \
+                zc.buildout.easy_install.script_header + \
+                    auf_script_template[protocol]
+            if self.options.get(protocol, '').lower() == 'true':
+                project = self.options.get('projectegg',
+                                           self.options['project'])
+                scripts.extend(
+                    zc.buildout.easy_install.scripts(
+                        [('%s.%s' % (self.options.get('control-script',
+                                                      self.name),
+                                     protocol),
+                          'djangorecipe.%s' % protocol, 'main')],
+                        ws,
+                        self.options['executable'],
+                        self.options['bin-directory'],
+                        extra_paths=extra_paths,
+                        arguments="'%s.%s', logfile='%s'" % (
+                            project, self.options['settings'],
+                            self.options.get('logfile'))))
+        zc.buildout.easy_install.script_template = _script_template
+        return scripts
index 4cb7fd9..cb0b059 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 import sys, os
 
 name = 'auf.recipe.django'
-version = '1.3'
+version = '1.4'
 
 setup(name=name,
       version=version,