from abc import abstractmethod

from django.core.management.base import BaseCommand


class TaskCommand(BaseCommand):
    def start_progress(self, *args, **options):
        # TODO: needs implementation
        pass

    def update_progress(self, *args, **options):
        # TODO: needs implementation
        pass

    @abstractmethod
    def handle_async(self, *args, **options):
        pass

@@ -23,16 +23,51 @@
 ctmethod
+%0Afrom collections import namedtuple
 %0A%0Afrom d
@@ -112,16 +112,180 @@
 Command%0A
+from django.core.management.base import CommandError%0A%0AProgress = namedtuple(%0A    'Progress',%0A    %5B%0A        'progress',%0A        'total',%0A        'fraction',%0A    %5D%0A)%0A
 %0A%0Aclass 
@@ -322,22 +322,14 @@
 def 
-start_progress
+handle
 (sel
@@ -362,136 +362,562 @@
     
-# TODO: needs implementation%0A        pass%0A%0A    def update_progress(self, *args, **options):%0A        # TODO: needs implementa
+self.progresstracker = None%0A        return self.handle_async(*args, **options)%0A%0A    def start_progress(self, total):%0A        self.progresstracker = Progress(progress=0, total=total, fraction=0)%0A%0A    def update_progress(self, increment):%0A        tracker = self.progresstracker%0A        progress = tracker.progress + increment%0A        if progress %3E tracker.total:%0A            raise CommandError(%22Progress reaches over 100%25.%22)%0A%0A        fraction = 1.0 * progress / tracker.total%0A        updated_tracker = tracker._replace(progress=progress, fraction=frac
 tion
+)
 %0A   
@@ -921,20 +921,54 @@
         
-pass
+self.progresstracker = updated_tracker
 %0A%0A    @a

Add a progress tracker to the async task command