Extractor

from panda3d.core import Extractor
class Extractor

Bases: DTOOL_SUPER_BASE

This class automatically extracts the contents of a Multifile to the current directory (or to a specified directory) in the background.

It is designed to limit its use of system resources and run unobtrusively in the background. After specifying the files you wish to extract via repeated calls to request_subfile(), begin the process by calling run() repeatedly. Each call to run() extracts another small portion of the Multifile. Call run() whenever you have spare cycles until run() returns EU_success.

Inheritance diagram

Inheritance diagram of Extractor

__init__(*args, **kwargs)
getProgress()

C++ Interface: get_progress(Extractor self)

/**
  • Returns the fraction of the Multifile extracted so far.

*/

get_progress()

C++ Interface: get_progress(Extractor self)

/**
  • Returns the fraction of the Multifile extracted so far.

*/

progress
requestAllSubfiles()

C++ Interface: request_all_subfiles(const Extractor self)

/**
  • Requests all subfiles in the Multifile to be extracted. Returns the number

  • requested.

*/

requestSubfile()

C++ Interface: request_subfile(const Extractor self, const Filename subfile_name)

/**
  • Requests a particular subfile to be extracted when step() or run() is

  • called. Returns true if the subfile exists, false otherwise.

*/

request_all_subfiles()

C++ Interface: request_all_subfiles(const Extractor self)

/**
  • Requests all subfiles in the Multifile to be extracted. Returns the number

  • requested.

*/

request_subfile()

C++ Interface: request_subfile(const Extractor self, const Filename subfile_name)

/**
  • Requests a particular subfile to be extracted when step() or run() is

  • called. Returns true if the subfile exists, false otherwise.

*/

reset()

C++ Interface: reset(const Extractor self)

/**
  • Interrupts the Extractor in the middle of its business and makes it ready

  • to accept a new list of subfiles to extract.

*/

run()

C++ Interface: run(const Extractor self)

/**
  • A convenience function to extract the Multifile all at once, when you don’t

  • care about doing it in the background.

  • First, call request_file() or request_all_files() to specify the files you

  • would like to extract, then call run() to do the extraction. Also see

  • step() for when you would like the extraction to happen as a background

  • task.

*/

setExtractDir()

C++ Interface: set_extract_dir(const Extractor self, const Filename extract_dir)

/**
  • Specifies the directory into which all extracted subfiles will be written.

  • Relative paths of subfiles within the Multifile will be written as relative

  • paths to this directory.

*/

setMultifile()

C++ Interface: set_multifile(const Extractor self, const Filename multifile_name)

/**
  • Specifies the filename of the Multifile that the Extractor will read.

  • Returns true on success, false if the mulifile name is invalid.

*/

set_extract_dir()

C++ Interface: set_extract_dir(const Extractor self, const Filename extract_dir)

/**
  • Specifies the directory into which all extracted subfiles will be written.

  • Relative paths of subfiles within the Multifile will be written as relative

  • paths to this directory.

*/

set_multifile()

C++ Interface: set_multifile(const Extractor self, const Filename multifile_name)

/**
  • Specifies the filename of the Multifile that the Extractor will read.

  • Returns true on success, false if the mulifile name is invalid.

*/

step()

C++ Interface: step(const Extractor self)

/**
  • After all of the requests have been made via request_file() or

  • request_all_subfiles(), call step() repeatedly until it stops returning

  • EU_ok.

  • step() extracts the next small unit of data from the Multifile. Returns

  • EU_ok if progress is continuing, EU_error_abort if there is a problem, or

  • EU_success when the last piece has been extracted.

  • Also see run().

*/