3 __date__ ="$2009-09-08 14:31:26$"
4 from django.core.management.base import NoArgsCommand
5 from toolbar.models import Button
6 from django.utils import simplejson as json
9 class Command(NoArgsCommand):
11 def handle_noargs(self, **options):
12 buttons = Button.objects.all()
16 v = json.loads(b.params)
19 print 'On button %s: ' % b.label, b.params
21 # try to fix the bad json
26 if params[-1] == u')':
29 v = json.loads(re.sub(u'([\\w-]+)\\s*:', u'"\\1": ', params).encode('utf-8'))
30 b.params = json.dumps(v)