From dd501324ce4686a14403112f970a47a884f02f78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Larchev=C3=AAque?= Date: Mon, 27 Feb 2012 12:37:13 -0500 Subject: [PATCH] 1.4 --- CHANGES | 5 +++++ auf/recipe/django/__init__.py | 8 +------- auf/recipe/django/boilerplate.py | 1 + auf/recipe/django/recipe.py | 32 +++++++++++++++++++++++++++++++- setup.py | 2 +- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index d7d5bd0..6ca09aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.4 +=== + +* fix surchage TPL buildout + 1.3 === diff --git a/auf/recipe/django/__init__.py b/auf/recipe/django/__init__.py index bbe6dde..5fed729 100644 --- a/auf/recipe/django/__init__.py +++ b/auf/recipe/django/__init__.py @@ -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 diff --git a/auf/recipe/django/boilerplate.py b/auf/recipe/django/boilerplate.py index 3aa64a4..4a98ca9 100644 --- a/auf/recipe/django/boilerplate.py +++ b/auf/recipe/django/boilerplate.py @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- + import zc.buildout.easy_install diff --git a/auf/recipe/django/recipe.py b/auf/recipe/django/recipe.py index abcc991..b17f91e 100644 --- a/auf/recipe/django/recipe.py +++ b/auf/recipe/django/recipe.py @@ -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 diff --git a/setup.py b/setup.py index 4cb7fd9..cb0b059 100644 --- 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, -- 1.7.10.4