Print the current (unexported) contents of the archive
345264
def contents(self, maxlen=70):
        ""
        lines = []
        if len(self._files) == 0:
            print("Empty %s" % self.__class__.__name__)
            return

        fnames = [self._truncate_name(maxlen=maxlen, *k) for k in self._files]
        max_len = max([len(f) for f in fnames])
        for name,v in zip(fnames, self._files.values()):
            mime_type = v[1].get('mime_type', 'no mime type')
            lines.append('%s : %s' % (name.ljust(max_len), mime_type))
        print('\n'.join(lines))
44480
def get_dump(self):
  """"""
  res = []
  for section in self.sections():
   sec = []
   for option in self.options(section):
    sec.append([option, self.get(section, option)])
   res.append([section, sec])
  return res
1170387
def Dump(title=None):
    
    if title:
        print(title)
    for counter in sorted(CounterList):
        CounterList[counter].display()
6658
def print_update(self):
        
        print("\r\n")
        now = datetime.datetime.now()
        print("Update info: (from: %s)" % now.strftime("%c"))

        current_total_size = self.total_stined_bytes + self.total_new_bytes

        if self.total_errored_items:
            print(" * WARNING: %i omitted files!" % self.total_errored_items)

        print(" * fast backup: %i files" % self.total_fast_backup)

        print(
            " * new content saved: %i files (%s %.1f%%)"
            % (
                self.total_new_file_count,
                human_filesize(self.total_new_bytes),
                to_percent(self.total_new_bytes, current_total_size),
            )
        )

        print(
            " * stint space via hardlinks: %i files (%s %.1f%%)"
            % (
                self.total_file_link_count,
                human_filesize(self.total_stined_bytes),
                to_percent(self.total_stined_bytes, current_total_size),
            )
        )

        duration = default_timer() - self.start_time
        performance = current_total_size / duration / 1024.0 / 1024.0
        print(" * present performance: %.1fMB/s\n" % performance)
155116
def _get_archive_tmp_dir(filename):
    """"""
    head, tail = os.path.split(filename)
    return os.path.join(head, _ARCHIVE_TMP_DIR_TEMPLATE.format(tail))
1290188
def extract_archive(archive, verbosity=0, outdir=None, program=None, interactive=True):
    """"""
    util.check_existing_filename(archive)
    if verbosity >= 0:
        util.log_info("Extracting %s ..." % archive)
    return _extract_archive(archive, verbosity=verbosity, interactive=interactive, outdir=outdir, program=program)
218831
def _output_current_byte(self):
        
        if self.tape[self.pointer] is None:
            print "{}".format(chr(0)),
        else:
            print "{}".format(chr(int(self.tape[self.pointer]))),
35168
def list_zip(archive, compression, cmd, verbosity, interactive):
    """"""
    try:
        with zipfile.ZipFile(archive, "r") as zfile:
            for name in zfile.namelist():
                if verbosity >= 0:
                    print(name)
    except Exception as err:
        msg = "error listing %s: %s" % (archive, err)
        raise util.PatoolError(msg)
    return None
776417
def unpack_archive(archive_format, archive_path, source_path):
    """"""
    if archive_format not in ('zip', 'tar'):
        raise ValueError('Unknown archive format "%s".' % archive_format)
    if archive_format == 'zip':
        with zipfile.ZipFile(archive_path) as archive:
            archive.extractall(source_path)
    if archive_format == 'tar':
        with tarfile.open(archive_path) as archive:
            archive.extractall(source_path)
707923
def contents(self):
        """"""
        rslt = []
        for (dpos, dlen, ulen, flag, typcd, nm) in self.toc:
            rslt.append(nm)
        return rslt
306779
def contents(self):
        
        data = find_dataset_path(
            self.name, data_home=self.data_home, ext=None
        )
        return os.listdir(data)
764577
def archive(self, target_path=None, zip_path=None):
        
        if target_path:
            self.target_path = target_path

        if zip_path:
            self.zip_path = zip_path

        if self.has_path is False or os.path.isdir(self.target_path) is False:
            raise RuntimeError("")

        zip = zipfile.ZipFile(
            self.zip_path,
            'w',
            zipfile.ZIP_DEFLATED
        )

        for root, _, files in os.walk(self.target_path):
            for file in files:
                if file in ARCHIVE_IGNORE_FILES:
                    continue

                current_dir = os.path.relpath(root, self.target_path)

                if current_dir == ".":
                    file_path = file
                else:
                    file_path = os.path.join(current_dir, file)

                print("Archive {}".format(file))

                zip.write(
                    os.path.join(root, file),
                    file_path
                )

        zip.close()
404420
private void listArchive(Archive archive,
                               RelativeDirectory subdirectory,
                               Set<JavaFileObject.Kind> fileKinds,
                               boolean recurse,
                               ListBuffer<JavaFileObject> resultList) {
        // Get the files directly in the subdir
        List<String> files = archive.getFiles(subdirectory);
        if (files != null) {
            for (; !files.isEmpty(); files = files.tail) {
                String file = files.head;
                if (isValidFile(file, fileKinds)) {
                    resultList.append(archive.getFileObject(subdirectory, file));
                }
            }
        }
        if (recurse) {
            for (RelativeDirectory s: archive.getSubdirectories()) {
                if (subdirectory.contains(s)) {
                    // Because the archive map is a flat list of directories,
                    // the enclosing loop will pick up all child subdirectories.
                    // Therefore, there is no need to recurse deeper.
                    listArchive(archive, s, fileKinds, false, resultList);
                }
            }
        }
    }
1335264
def dump(self):
        """"""
        print "-----MqttPkt------"
        print "command = ", self.command
        print "have_remaining = ", self.have_remaining
        print "remaining_count = ", self.remaining_count
        print "mid = ", self.mid
        print "remaining_mult = ", self.remaining_mult
        print "remaining_length = ", self.remaining_length
        print "packet_length = ", self.packet_length
        print "to_process = ", self.to_process
        print "pos = ", self.pos
        print "payload = ", self.payload
        print "------------------"
382462
def history(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)
    var = ctx.obj.api.get_archive(archive_name)
    click.echo(pprint.pformat(var.get_history()))
870159
def dump(self):
        
        print("pagesize=%08x, reccount=%08x, pagecount=%08x" % (self.pagesize, self.reccount, self.pagecount))
        self.dumpfree()
        self.dumptree(self.firstindex)
798310
def get_file_contents(self, pointer=False):
        '''
        
        '''
        if self.pointer:
            if pointer:
                return self.old_pointed
            else:
                return self.old_data
        else:
            return self.old_data