Beispiel #1
0
def nonStaging(pac, cmdline, filename):
    if cmdline.list:
        pac.print_info()
    elif cmdline.list_harder:
        pac.print_detailed_info()
    elif cmdline.file_info:
        file = pac.get_file_by_id(cmdline.file_info)
        if file is not None:
            print("          id    offset       size  compress  size  filename")
            file.print_detailed_info()
    elif cmdline.extract_id:
        with open(filename, "rb") as binfile:
            idlist = map(int, cmdline.extract_id.split(","))
            if cmdline.raw:
                location = datastruct.adjust_separator_for_fs("raw-extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.dump_file_id(fid, location, binfile)
            else:
                location = datastruct.adjust_separator_for_fs("extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.extract_file_id(fid, location, binfile, debuggy=cmdline.debug)

    elif cmdline.extract:
        threads = Broker(len(pac.files))
        for fid in pac.list_file_ids():
            threads.appendNfire(extractJob, (pac, fid, cmdline, filename))
        threads.stop()
        print("Extraction job completed")
 def getCurrentPackagePath(self, separator="\\"):
     indexes = self.virtdir.selectedIndexes()
     fullpath = []
     if len(indexes) > 0:
         index = indexes[0]
         while index.parent().isValid():
             fullpath.append(str(self.virtdir.model().data(index)))
             index = index.parent()
         fullpath.append(str(self.virtdir.model().data(index)))
     fullpath.reverse()
     if len(fullpath) > 0:
         return datastruct.adjust_separator_for_fs(separator.join(fullpath))
     return None
Beispiel #3
0
 def getCurrentPackagePath(self, separator="\\"):
     indexes = self.virtdir.selectedIndexes()
     fullpath = []
     if len(indexes) > 0:
         index = indexes[0]
         while index.parent().isValid():
             fullpath.append(str(self.virtdir.model().data(index)))
             index = index.parent()
         fullpath.append(str(self.virtdir.model().data(index)))
     fullpath.reverse()
     if len(fullpath) > 0:
         return datastruct.adjust_separator_for_fs(separator.join(fullpath))
     return None