app/soc/tasks/start.py
changeset 2911 2ddd386d1dbd
parent 2910 60d56cf01b54
child 2912 55adeea795ab
equal deleted inserted replaced
2910:60d56cf01b54 2911:2ddd386d1dbd
     1 #!/usr/bin/python2.5
       
     2 #
       
     3 # Copyright 2009 the Melange authors.
       
     4 #
       
     5 # Licensed under the Apache License, Version 2.0 (the "License");
       
     6 # you may not use this file except in compliance with the License.
       
     7 # You may obtain a copy of the License at
       
     8 #
       
     9 #   http://www.apache.org/licenses/LICENSE-2.0
       
    10 #
       
    11 # Unless required by applicable law or agreed to in writing, software
       
    12 # distributed under the License is distributed on an "AS IS" BASIS,
       
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    14 # See the License for the specific language governing permissions and
       
    15 # limitations under the License.
       
    16 
       
    17 """Tasks conversion starter.
       
    18 """
       
    19 
       
    20 __authors__ = [
       
    21   '"Sverre Rabbelier" <sverre@rabbelier.nl>',
       
    22   ]
       
    23 
       
    24 
       
    25 from django import http
       
    26 from django.template import loader
       
    27 
       
    28 from soc.tasks import convert
       
    29 
       
    30 
       
    31 def getDjangoURLPatterns():
       
    32   """Returns the URL patterns for the view in this module.
       
    33   """
       
    34 
       
    35   patterns = [(r'tasks/start$',
       
    36                'soc.tasks.start.startTasks')]
       
    37 
       
    38   return patterns
       
    39 
       
    40 
       
    41 def startTasks(request):
       
    42   """Presents a view that allows the user to start conversion tasks.
       
    43   """
       
    44 
       
    45   template = 'soc/tasks/start.html'
       
    46 
       
    47   context = {
       
    48       'page_name': 'Task starter',
       
    49       'options': convert.runner.getOptions(),
       
    50     }
       
    51 
       
    52   content = loader.render_to_string(template, dictionary=context)
       
    53   return http.HttpResponse(content)