コード例 #1
0
def nonStaging(pac, cmdline, filename):
    if cmdline.list:
        pac.printInfo()
    elif cmdline.list_harder:
        pac.printDetailInfo()
    elif cmdline.file_info:
        file = pac.getFileById(cmdline.file_info)
        if file is not None:
            print("          id    offset       size  compress  size  filename")
            file.printDetailInfo()
    elif cmdline.extract_id:
        with open(filename, "rb") as binfile:
            idlist = map(int, cmdline.extract_id.split(","))
            if cmdline.raw:
                location = datastruct.adjustSeparatorForFS("raw-extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.dumpFileId(fid, location, binfile)
            else:
                location = datastruct.adjustSeparatorForFS("extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.extractFileId(fid, location, binfile, debuggy=cmdline.debug)

    elif cmdline.extract:
        threads = Broker(len(pac.files))
        for fid in pac.listFileIDs():
            threads.appendNfire(extractJob, (pac, fid, cmdline, filename))
        threads.stop()
        print("Extraction job completed")
コード例 #2
0
def nonStaging(pac, cmdline, filename):
    if cmdline.list:
        pac.printInfo()
    elif cmdline.list_harder:
        pac.printDetailInfo()
    elif cmdline.file_info:
        file = pac.getFileById(cmdline.file_info)
        if file is not None:
            print("          id    offset       size  compress  size  filename")
            file.printDetailInfo()
    elif cmdline.extract_id:
        with open(filename, "rb") as binfile:
            idlist = map(int, cmdline.extract_id.split(","))
            if cmdline.raw:
                location = datastruct.adjustSeparatorForFS("raw-extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.dumpFileId(fid, location, binfile)
            else:
                location = datastruct.adjustSeparatorForFS("extract/")
                if cmdline.extract:
                    location = cmdline.extract
                for fid in idlist:
                    pac.extractFileId(fid, location, binfile, debuggy=cmdline.debug)

    elif cmdline.extract:
        threads = Broker(len(pac.files))
        for fid in pac.listFileIDs():
            threads.appendNfire(extractJob, (pac, fid, cmdline, filename))
        threads.stop()
        print("Extraction job completed")
コード例 #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.adjustSeparatorForFS(separator.join(fullpath))
     return None