def handle(self, *args, **kwargs): if len(args) == 0: raise Exception("this management command requires arguments of one or many lga ids") if not kwargs['no_spawn_process']: if not kwargs['_hup_subprocess']: self.start_subprocess(*args) else: self.handle_in_subprocess(*args) else: for lga in _strings_in_list(args): load_lgas([lga])
def handle_in_subprocess(*args): load_lgas(_strings_in_list(args)) os.rename('nohup.out', 'load_script.log') os.unlink('load_script.pid')