def unpack(self, dest_path='', force=False): if not dest_path: dest_path = self._downloader.unpacked_path temp_path = os.path.realpath(os.path.join(dest_path, self._name)) _exists = os.path.exists(temp_path) if not self._not_cached: self._unpacked_path = temp_path if _exists else '' if force or self._not_cached or (not _exists): try: Archive.extract(self._packed_path, temp_path) self._unpacked_path = temp_path except: self._unpacked_path = '' pass
def unpack(self, force=False): if self._downloader.solid(self): self.unpacked_path = self.packed_path else: exists, dest_path = self._downloader.cache.exists_unpacked( package=self, pkg_path=self.unpacked_path) if exists and not self.unpacked_path: self.unpacked_path = dest_path # if force or not exists: # if not dest_path: # dest_path = self._downloader.unpacked_path # temp_path = os.path.realpath(os.path.join(dest_path, self._name)) # _exists = os.path.exists(temp_path) if not self._not_cached: self.unpacked_path = dest_path if exists else '' # temp_path if exists else '' if force or self._not_cached or (not exists): Archive.extract(self.packed_path, dest_path) # temp_path) self.unpacked_path = dest_path # temp_path self._not_cached = False