app/soc/tasks/updates/start_update.py
author Lennard de Rijk <ljvderijk@gmail.com>
Tue, 15 Sep 2009 21:57:28 +0200
changeset 2925 d1de20978875
parent 2911 app/soc/tasks/start_update.py@2ddd386d1dbd
child 2928 76d5782542dd
permissions -rw-r--r--
Moved the updater to its own module.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2911
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     2
#
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     3
# Copyright 2009 the Melange authors.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     4
#
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     8
#
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    10
#
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    16
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    17
"""Version update Tasks starters.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    18
"""
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    19
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    20
__authors__ = [
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    21
  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    22
  '"Lennard de Rijk" <ljvderijk@gmail.com>',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    23
  ]
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    24
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    25
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    26
from django import http
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    27
from django.template import loader
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    28
from django.utils.translation import ugettext
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    29
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    30
from soc.views.helper import responses
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    31
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    32
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
def getDjangoURLPatterns():
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    34
  """Returns the URL patterns for the views in this module.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
  """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    36
2925
d1de20978875 Moved the updater to its own module.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2911
diff changeset
    37
  patterns = [
d1de20978875 Moved the updater to its own module.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2911
diff changeset
    38
      (r'tasks/update/start$', 'soc.tasks.updates.start_update.startTasks'),
d1de20978875 Moved the updater to its own module.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2911
diff changeset
    39
      (r'tasks/update/([a-z]+)$', 'soc.tasks.updates.start_update.runner')]
2911
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    40
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    41
  return patterns
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    42
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    43
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    44
def startTasks(request):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    45
  """Presents a view that allows the user to start update tasks.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    46
  """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    47
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    48
  template = 'soc/tasks/start_update.html'
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    49
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    50
  context = responses.getUniversalContext(request)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    51
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    52
  options = runner.getOptions()
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    53
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    54
  sorted_keys = []
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    55
  for key, option in options.iteritems():
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    56
    option['name'] = key
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    57
    sorted_keys.append(
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    58
        (option['from_version'], option['in_version_order'], key))
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    59
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    60
  # sort the keys
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    61
  sorted_keys.sort()
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    62
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    63
  # store only the true option
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    64
  sorted_options = []
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    65
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    66
  for key_tuple in sorted_keys:
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    67
    option_key = key_tuple[2]
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    68
    sorted_options.append(options[option_key])
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    69
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    70
  context.update(
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    71
      page_name='Update Tasks starter',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    72
      options=sorted_options,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    73
      )
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    74
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    75
  content = loader.render_to_string(template, dictionary=context)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    76
  return http.HttpResponse(content)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    77
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    78
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    79
class TaskRunner(object):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    80
  """Runs one of the supported task starters.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    81
  """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    82
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    83
  def __init__(self):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    84
    """Initializes the TaskRunner.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    85
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    86
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    87
    self.options = {
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    88
        'program': self.programConversion(),
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    89
        'student': self.studentConversion(),
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    90
        'organization': self.orgConversion(),
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    91
    }
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    92
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    93
  def getOptions(self):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    94
    """Returns the supported options.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    95
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    96
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    97
    return self.options
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    98
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    99
  def __call__(self, request, option):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   100
    """Starts the specified task.
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   101
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   102
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   103
    context = responses.getUniversalContext(request)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   104
    context['page_name'] = 'Start Update Task'
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   105
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   106
    option = self.options.get(option)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   107
    if not option:
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   108
      template = 'soc/error.html'
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   109
      context['message'] = 'Uknown option "%s".' % option
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   110
    else:
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   111
      template = 'soc/tasks/run_update.html'
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   112
      context['option'] = option
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   113
      context['success'] = option['updater'](request)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   114
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   115
    content = loader.render_to_string(template, dictionary=context)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   116
    return http.HttpResponse(content)
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   117
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   118
  def programConversion(self):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   119
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   120
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   121
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   122
    description = ugettext('This converts the Program models to contain X,Y,Z. '
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   123
                           'Note that this conversion will only work after Q')
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   124
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   125
    # TODO(ljvderijk): implement this
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   126
    updater = lambda x:False
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   127
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   128
    conversion_information = {'from_version': 'V-1',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   129
                              'in_version_order': 2,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   130
                              'description': description,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   131
                              'updater': updater}
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   132
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   133
    return conversion_information
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   134
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   135
  def studentConversion(self):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   136
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   137
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   138
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   139
    description = ugettext('This converts the Student models to contain X,Y,Z.')
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   140
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   141
    # TODO(ljvderijk): implement this
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   142
    updater = lambda x:False
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   143
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   144
    conversion_information = {'from_version': 'V-1',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   145
                              'in_version_order': 1,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   146
                              'description': description,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   147
                              'updater': updater}
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   148
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   149
    return conversion_information
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   150
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   151
  def orgConversion(self):
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   152
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   153
    """
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   154
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   155
    description = ugettext('This converts the Organization models to contain X,Y,Z.')
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   156
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   157
    # TODO(ljvderijk): implement this
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   158
    updater = lambda x:False
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   159
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   160
    conversion_information = {'from_version': 'V-2',
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   161
                              'in_version_order': 1,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   162
                              'description': description,
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   163
                              'updater': updater}
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   164
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   165
    return conversion_information
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   166
2ddd386d1dbd Changed the conversion starter system to an update starter system.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
   167
runner = TaskRunner()