# -*- coding: utf-8 -*-
'''
Created on Jan 22, 2013

@author: ymh
'''

from django.core.management.base import NoArgsCommand
from ..utils import show_progress
from ldt.ldt_utils.models import Content

class Command(NoArgsCommand):
    
    def handle_noargs(self, **options):
        
        content_list = list(Content.objects.all())
        writer = None
        for i,c in enumerate(content_list):
            writer = show_progress(i+1, len(content_list), "Processing content %s" % c.title, 80, writer)
            c.sync_iri_file()
        