| 1 | #!/usr/bin/python |
|---|
| 2 | # -*- coding: UTF-8 -*- |
|---|
| 3 | # |
|---|
| 4 | # Copyright (c) 2006 Tarek Ziadé <tarek@ziade.org> |
|---|
| 5 | # |
|---|
| 6 | # This program is free software; you can redistribute it and/or |
|---|
| 7 | # modify it under the terms of the GNU General Public License |
|---|
| 8 | # as published by the Free Software Foundation; either version 2 |
|---|
| 9 | # of the License, or (at your option) any later version. |
|---|
| 10 | # |
|---|
| 11 | # This program is distributed in the hope that it will be useful, |
|---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | # GNU General Public License for more details. |
|---|
| 15 | # |
|---|
| 16 | # You should have received a copy of the GNU General Public License |
|---|
| 17 | # along with this program; if not, write to the Free Software |
|---|
| 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 19 | # $Id: $ |
|---|
| 20 | """ recipe creators |
|---|
| 21 | """ |
|---|
| 22 | import os |
|---|
| 23 | from generator import registerTask |
|---|
| 24 | from resttask import RestTask |
|---|
| 25 | |
|---|
| 26 | class RecipeTask(RestTask): |
|---|
| 27 | """creates the recipes""" |
|---|
| 28 | def _getTemplateFile(self, configuration): |
|---|
| 29 | """returns the template""" |
|---|
| 30 | return configuration.templates['recipe'] |
|---|
| 31 | |
|---|
| 32 | def _getTemplateListFile(self, configuration): |
|---|
| 33 | """returns the template list""" |
|---|
| 34 | return configuration.templates['recipelist'] |
|---|
| 35 | |
|---|
| 36 | def _getName(self): |
|---|
| 37 | """returns the task name""" |
|---|
| 38 | return 'recipe' |
|---|
| 39 | |
|---|
| 40 | def _getFolders(self, configuration): |
|---|
| 41 | """returns recipes folders""" |
|---|
| 42 | return configuration.recipes.values() |
|---|
| 43 | |
|---|
| 44 | registerTask(RecipeTask) |
|---|