@@ -0,0 +1,1777 @@
+# Copyright 2012 Mike Wakerly %3Copensource@hoho.com%3E%0A#%0A# This file is part of the Pykeg package of the Kegbot project.%0A# For more information on Pykeg or Kegbot, see http://kegbot.org/%0A#%0A# Pykeg is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version 2 of the License, or%0A# (at your option) any later version.%0A#%0A# Pykeg is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU General Public License for more details.%0A#%0A# You should have received a copy of the GNU General Public License%0A# along with Pykeg.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0Afrom optparse import make_option%0Aimport sys%0A%0Afrom django.core.management.base import NoArgsCommand%0Afrom django.core.management.base import CommandError%0Afrom django.contrib.auth.management.commands import createsuperuser%0Afrom django.db.utils import DatabaseError%0A%0Afrom django.contrib.staticfiles.management.commands import collectstatic%0Afrom south.management.commands import migrate%0Afrom south.management.commands import syncdb%0Afrom pykeg.core.management.commands import kb_regen_stats%0A%0Adef run(cmd, args=%5B%5D):%0A  cmdname = cmd.__module__.split('.')%5B-1%5D%0A  arg_str = ' '.join('%25s' %25 a for a in args)%0A  print '--- Running command: %25s %25s' %25 (cmdname, arg_str)%0A  cmd.run_from_argv(%5Bsys.argv%5B0%5D, cmdname%5D + args)%0A%0Aclass Command(NoArgsCommand):%0A  help = u'Perform post-upgrade tasks.'%0A%0A  def handle(self, **options):%0A    run(syncdb.Command(), args=%5B'--noinput', '-v', '0'%5D)%0A    run(migrate.Command(), args=%5B'-v', '0'%5D)%0A    run(kb_regen_stats.Command())%0A    run(collectstatic.Command())%0A

Add kb_upgrade command.