Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
    def get_file(self, file_name, temp_path=None):
        if not temp_path:
            temp_path = self._downloader.temp_path
        temp_path = os.path.realpath(os.path.join(temp_path, self._name))

        _dest_file = Archive.extract_file(self._packed_path, temp_path, file_name)

        return _dest_file
Beispiel #4
0
    def get_file(self, file_name, temp_path=None):
        if not temp_path:
            temp_path = self._downloader.temp_path
        temp_path = os.path.realpath(os.path.join(temp_path, self._name))

        _dest_file = Archive.extract_file(self._packed_path, temp_path,
                                          file_name)

        return _dest_file
Beispiel #5
0
    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
Beispiel #6
0
 def pack(self, src_path):
     Archive.create(self.packed_path, src_path)
Beispiel #7
0
 def pack(self):
     Archive.create(self._args['<OUT>'], self._args['<SOURCE>'])
Beispiel #8
0
 def pack(self):
     Archive.create(self._args['<OUT>'], self._args['<SOURCE>'])
Beispiel #9
0
 def pack(self, src_path):
     Archive.create(self._packed_path, src_path)