Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pywps/app/Process.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,17 @@ def clean(self):
"""Clean the process working dir and other temporary files
"""
LOGGER.info("Removing temporary working directory: %s" % self.workdir)
if os.path.isdir(self.workdir):
shutil.rmtree(self.workdir)
if self._grass_mapset and os.path.isdir(self._grass_mapset):
LOGGER.info("Removing temporary GRASS GIS mapset: %s" % self._grass_mapset)
shutil.rmtree(self._grass_mapset)
try:
if os.path.isdir(self.workdir):
shutil.rmtree(self.workdir)
if self._grass_mapset and os.path.isdir(self._grass_mapset):
LOGGER.info("Removing temporary GRASS GIS mapset: %s" % self._grass_mapset)
shutil.rmtree(self._grass_mapset)
except WindowsError as err:
LOGGER.error('Windows Error: %s', err)
except Exception as err:
LOGGER.error('Unable to remove directory: %s', err)


def set_workdir(self, workdir):
"""Set working dir for all inputs and outputs
Expand Down