Changeset 4904 for waeup/trunk/src


Ignore:
Timestamp:
27 Jan 2010, 12:21:05 (15 years ago)
Author:
uli
Message:

Remove temporary dir after distributing processed files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/trunk/src/waeup/datacenter.py

    r4896 r4904  
    280280        may be ``None``.
    281281
     282        If finished file is placed in a location outside the local
     283        storage dir, the complete directory is removed
     284        afterwards. Regular importers should put their stuff in
     285        dedicated temporary dirs.
     286       
    282287        See datacenter.txt for more info about how this works.
    283288        """
     
    317322        elif not successful and not pending:
    318323            self._moveFile(source_path, unfinished_dest)
     324
     325        # If finished and pending-file were created in a location
     326        # outside datacenter storage, we remove it.
     327        if os.path.commonprefix(
     328            [self.storage, finished_file]) != self.storage:
     329            shutil.rmtree(os.path.dirname(finished_file)
    319330        return
    320331
Note: See TracChangeset for help on using the changeset viewer.