(self)
Check the local directory.
Check the local directory.
Check the local directory .
async def remove_local_directory(self):
        """Check the local directory."""
        import os
        import shutil
        from asyncio import sleep

        try:
            if self.information.category == "python_script":
                local_path = "{}/{}.py".format(
                    self.content.path.local, self.information.name
                )
            elif self.information.category == "theme":
                local_path = "{}/{}.yaml".format(
                    self.content.path.local, self.information.name
                )
            else:
                local_path = self.content.path.local

            if os.path.exists(local_path):
                self.logger.debug(f"Removing {local_path}")

                if self.information.category in ["python_script", "theme"]:
                    os.remove(local_path)
                else:
                    shutil.rmtree(local_path)

                while os.path.exists(local_path):
                    await sleep(1)

        except Exception as exception:
            self.logger.debug(f"Removing {local_path} failed with {exception}")
            return
async def remove_local_directory ( self ) : import os import shutil from asyncio import sleep try : if self . information . category == "python_script" : local_path = "{}/{}.py" . format ( self . content . path . local , self . information . name ) elif self . information . category == "theme" : local_path = "{}/{}.yaml" . format ( self . content . path . local , self . information . name ) else : local_path = self . content . path . local if os . path . exists ( local_path ) : self . logger . debug ( f"Removing {local_path}" ) if self . information . category in [ "python_script" , "theme" ] : os . remove ( local_path ) else : shutil . rmtree ( local_path ) while os . path . exists ( local_path ) : await sleep ( 1 ) except Exception as exception : self . logger . debug ( f"Removing {local_path} failed with {exception}" ) return