[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Request for review: python-apt inline documentation



Hi,

I spent some time writing lots of inline documentation
for the low-level python-apt modules, and it would be
great to have it reviewed. I therefore attached a text
export of this documentation by running pydoc on the
modules.

I will soon complete reviewing and updating the longer
documentation[0] written in reStructuredText and will
then ask for a review as well.

Please note that this documentation is targeted at
advanced developers and not at normal users (it's
API reference).

The style of the attached documentation mostly
follows what I've seen in Python:

	- 'name' for parameter names and attribute
          names and similar stuff; and also for
          strings.

Please CC me in your replies.

[0] apt.alioth.debian.org/python-apt-doc

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Help on module apt_pkg:

NAME
    apt_pkg - Classes and functions wrapping the apt-pkg library.

FILE
    /home/jak/Desktop/python-apt/debian-sid/apt_pkg.so

DESCRIPTION
    The apt_pkg module provides several classes and functions for accessing
    the functionality provided by the apt-pkg library. It allows parsing of
    index files, configuration files, installation/removal of packages and
    much more

CLASSES
    __builtin__.object
        Acquire
        AcquireItem
            AcquireFile
        AcquireItemDesc
        AcquireWorker
        ActionGroup
        Cache
        Cdrom
        Configuration
        DepCache
        Dependency
        DependencyList
        Description
        FileLock
        HashString
        Hashes
        IndexFile
        IndexRecords
        MetaIndex
        Package
        PackageFile
        PackageList
        PackageManager
        PackageRecords
        Policy
        ProblemResolver
        SourceList
        SourceRecords
        SystemLock
        TagFile
        TagSection
        Version
    
    class Acquire(__builtin__.object)
     |  Acquire(progress: apt_pkg.AcquireProgress) -> Acquire()
     |  
     |  Create a new Acquire object. The parameter 'progress' can be used to
     |  specify an apt_pkg.AcquireProgress() object, which will display the
     |  progress of the fetching.
     |  
     |  Methods defined here:
     |  
     |  run(...)
     |      run() -> int
     |      
     |      Run the fetcher and return one of RESULT_CANCELLED,
     |      RESULT_CONTINUE, RESULT_FAILED.
     |  
     |  shutdown(...)
     |      shutdown()
     |      
     |      Shut the fetcher down, removing all items from it.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  fetch_needed
     |      The total amount of data to be fetched.
     |  
     |  items
     |      A list of all items as apt_pkg.AcquireItem objects.
     |  
     |  partial_present
     |      The amount of data which is already available.
     |  
     |  total_needed
     |      The amount of data that needs to fetched plus the amount of data
     |      which has already been fetched.
     |  
     |  workers
     |      A list of all active workers as apt_pkg.AcquireWorker objects.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  RESULT_CANCELLED = 2
     |  
     |  RESULT_CONTINUE = 0
     |  
     |  RESULT_FAILED = 1
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395d75e0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class AcquireFile(AcquireItem)
     |  AcquireFile(owner, uri[, md5, size, descr, short_descr, destdir,destfile])
     |  
     |  Represent a file to be fetched. The parameter 'owner' points to
     |  an apt_pkg.Acquire object and the parameter 'uri' to the source
     |  location. The destination can be specified by either 'destdir'
     |  for specifying the destination directory or 'destfile' for
     |  specifying the path to the destination file.
     |  
     |  The parameters 'short_descr' and 'descr' can be used to specify
     |  a short description and a longer description for the item. This
     |  information is used by progress classes to refer to the item.
     |  
     |  The parameters 'md5' and 'size' are used to verify the resulting
     |  file. The parameter 'size' is also to calculate the total amount
     |  of data to be fetched and is useful for resuming a interrupted
     |  download.
     |  
     |  All parameters can be given by name (i.e. as keyword arguments).
     |  
     |  Method resolution order:
     |      AcquireFile
     |      AcquireItem
     |      __builtin__.object
     |  
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395d7c20>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from AcquireItem:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AcquireItem:
     |  
     |  complete
     |      A boolean value determining whether the item has been fetched
     |      completely
     |  
     |  desc_uri
     |      A string describing the URI from which the item is acquired.
     |  
     |  destfile
     |      The path to the file where the item will be stored
     |  
     |  error_text
     |      If an error occured, a string describing the error; empty string
     |      otherwise
     |  
     |  filesize
     |      The size of the file. If unknown, it is set to 0.
     |  
     |  id
     |      The ID of the item. An integer which can be set by progress classes.
     |  
     |  is_trusted
     |      Whether the item is trusted or not.
     |  
     |  local
     |      Whether we are fetching a local item (copy:/) or not.
     |  
     |  mode
     |      A string indicating the current mode e.g. 'Fetching'.
     |  
     |  partialsize
     |      The amount of data which has already been fetched.
     |  
     |  status
     |      The status of the item.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from AcquireItem:
     |  
     |  STAT_AUTH_ERROR = 4
     |  
     |  STAT_DONE = 2
     |  
     |  STAT_ERROR = 3
     |  
     |  STAT_FETCHING = 1
     |  
     |  STAT_IDLE = 0
    
    class AcquireItem(__builtin__.object)
     |  Representation of an Acquire item. It is not possible to create
     |  instances of this class, but it is possible to create instances
     |  of the AcquireFile subclass.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  complete
     |      A boolean value determining whether the item has been fetched
     |      completely
     |  
     |  desc_uri
     |      A string describing the URI from which the item is acquired.
     |  
     |  destfile
     |      The path to the file where the item will be stored
     |  
     |  error_text
     |      If an error occured, a string describing the error; empty string
     |      otherwise
     |  
     |  filesize
     |      The size of the file. If unknown, it is set to 0.
     |  
     |  id
     |      The ID of the item. An integer which can be set by progress classes.
     |  
     |  is_trusted
     |      Whether the item is trusted or not.
     |  
     |  local
     |      Whether we are fetching a local item (copy:/) or not.
     |  
     |  mode
     |      A string indicating the current mode e.g. 'Fetching'.
     |  
     |  partialsize
     |      The amount of data which has already been fetched.
     |  
     |  status
     |      The status of the item.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  STAT_AUTH_ERROR = 4
     |  
     |  STAT_DONE = 2
     |  
     |  STAT_ERROR = 3
     |  
     |  STAT_FETCHING = 1
     |  
     |  STAT_IDLE = 0
    
    class AcquireItemDesc(__builtin__.object)
     |  Describe an AcquireItem. This class provides the description of the
     |  item and the uri the item is fetched from. It is used in progress
     |  classes to get the descriptions to display.
     |  
     |  Data descriptors defined here:
     |  
     |  description
     |      A string describing the item.
     |  
     |  owner
     |      The owner of the item, an apt_pkg.AcquireItem object.
     |  
     |  shortdesc
     |      A short string describing the item (e.g. package name).
     |  
     |  uri
     |      The URI from which to download this item.
    
    class AcquireWorker(__builtin__.object)
     |  Acquire workers represent exactly one subprocess used for fetching
     |  files. This subprocess is created from the methods stored in
     |  Dir::Bin::Methods.
     |  
     |  Data descriptors defined here:
     |  
     |  current_item
     |      The item currently fetched, as an apt_pkg.AcquireItemDesc object.
     |  
     |  current_size
     |      The amount of data fetched for the item.
     |  
     |  resumepoint
     |      The amount of data which was already fetched prior to resuming the
     |      download.
     |  
     |  status
     |      The status of the worker, as a string.
     |  
     |  total_size
     |      The total size of the item.
    
    class ActionGroup(__builtin__.object)
     |  ActionGroup(depcache)
     |  
     |  Create a new ActionGroup() object. The parameter *depcache* refers to an
     |  apt_pkg.DepCache() object.
     |  
     |  ActionGroups disable certain cleanup actions, so modifying many packages
     |  is much faster.
     |  
     |  ActionGroup() can also be used with the 'with' statement, but be aware
     |  that the ActionGroup() is active as soon as it is created, and not just
     |  when entering the context. This means you can write::
     |  
     |      with apt_pkg.ActionGroup(depcache):
     |          depcache.markInstall(pkg)
     |  
     |  Once the block of the with statement is left, the action group is 
     |  automatically released from the cache.
     |  
     |  Methods defined here:
     |  
     |  __enter__(...)
     |      __enter__() -> Enter, for the 'with' statement. Does nothing.
     |  
     |  __exit__(...)
     |      __exit__(...) -> Release the action group, for 'with' statement.
     |  
     |  release(...)
     |      release()
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395daa20>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Cache(__builtin__.object)
     |  Cache([progress]) -> Cache() object.
     |  
     |  The cache provides access to the packages and other stuff.
     |  
     |  The optional parameter *progress* can be used to specify an 
     |  apt.progress.OpProgress() object (or similar) which displays
     |  the opening progress. If not specified, the progress is
     |  displayed in simple text form.
     |  
     |  The cache can be used like a mapping of package names to Package
     |  objects.
     |  
     |  Methods defined here:
     |  
     |  __contains__(...)
     |      x.__contains__(y) <==> y in x
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __len__(...)
     |      x.__len__() <==> len(x)
     |  
     |  update(...)
     |      update(progress, sources: SourceList, pulse_interval: int) -> bool
     |      
     |      Update the index files used by the cache. A call to this method
     |      does not affect the current Cache object, instead a new one
     |      should be created in order to use the changed index files.
     |      
     |      The parameter 'progress' takes an apt.progress.base.AcquireProgress
     |      object as its argument which will display the progress of fetching
     |      the index files. The parameter 'sources' takes an apt_pkg.SourceList
     |      object which lists the sources. The parameter 'progress' takes an
     |      integer describing the interval (in microseconds) in which the
     |      pulse() method of the 'progress' object will be called.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  depends_count
     |      The number of apt_pkg.Dependency objects stored in the cache.
     |  
     |  file_list
     |      A list of apt_pkg.PackageFile objects stored in the cache.
     |  
     |  package_count
     |      The number of apt_pkg.Package objects stored in the cache.
     |  
     |  package_file_count
     |      The number of apt_pkg.PackageFile objects stored in the cache.
     |  
     |  packages
     |      A list of apt_pkg.Package objects stored in the cache.
     |  
     |  provides_count
     |      The number of provided packages.
     |  
     |  ver_file_count
     |      The number of (Version, PackageFile) relations.
     |  
     |  version_count
     |      The number of apt_pkg.Version objects stored in the cache.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395d93a0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Cdrom(__builtin__.object)
     |  Cdrom()
     |  
     |  Cdrom objects can be used to identify Debian installation media and to
     |  add them to /etc/apt/sources.list.
     |  
     |  Methods defined here:
     |  
     |  add(...)
     |      add(progress: apt_pkg.CdromProgress) -> bool
     |      
     |      Add the given CD-ROM to the sources.list. Returns True on success, may
     |      raise an error on failure or return False.
     |  
     |  ident(...)
     |      ident(progress: apt_pkg.CdromProgress) -> str
     |      
     |      Try to identify the CD-ROM and if successful return the identity as a
     |      string. Otherwise, return None or raise an error.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395da120>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Configuration(__builtin__.object)
     |  Configuration()
     |  
     |  Configuration objects represent the configuration of apt. They map
     |  keys to values and store configuration parsed from files like
     |  /etc/apt/apt.conf. The most important object is apt_pkg.config
     |  which points to the global configuration object. Additional objects
     |  can be created, but this is normally not needed.
     |  
     |  Methods defined here:
     |  
     |  __contains__(...)
     |      x.__contains__(y) <==> y in x
     |  
     |  __delitem__(...)
     |      x.__delitem__(y) <==> del x[y]
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __setitem__(...)
     |      x.__setitem__(i, y) <==> x[i]=y
     |  
     |  clear(...)
     |      clear(key: str)
     |      
     |      Unset the option at the given key and all sub options.
     |  
     |  exists(...)
     |      exists(key: str) -> bool
     |      
     |      Check whether the given key exists.
     |  
     |  find(...)
     |      find(key: str[, default: str = '']) -> str
     |      
     |      Find the value for the given key and return it. If the
     |      given key does not exist, return default instead.
     |  
     |  find_b(...)
     |      find_i(key: str[, default: bool = False]) -> bool
     |      
     |      Same as find, but only for boolean values.
     |  
     |  find_dir(...)
     |      find_dir(key: str[, default: str = '']) -> str
     |      
     |      Same as find_file(), but for directories. The difference is
     |      that this function adds a trailing slash to the result.
     |  
     |  find_file(...)
     |      find_file(key: str[, default: str = '']) -> str
     |      
     |      Same as find(), but for filenames. In the APT configuration, there
     |      is a special section Dir:: for storing filenames. find_file() locates
     |      the given key and then goes up and prepends the directory names to the
     |      return value, e.g. for:
     |      
     |          apt_pkg.config['Dir'] = 'a'
     |          apt_pkg.config['Dir::D'] = 'b'
     |          apt_pkg.config['Dir::D::F'] = 'c'
     |      
     |      find_file('Dir::D::F') returns 'a/b/c'. There is also a special
     |      configuration setting RootDir which will always be prepended to the
     |      result (the default being ''). Thus, if RootDir is 'x', the example
     |      would return 'x/a/b/c'.
     |  
     |  find_i(...)
     |      find_i(key: str[, default: int = 0]) -> int
     |      
     |      Same as find, but only for integer values.
     |  
     |  get(...)
     |      find(key: str[, default: str = '']) -> str
     |      
     |      Find the value for the given key and return it. If the
     |      given key does not exist, return default instead.
     |  
     |  has_key(...)
     |      exists(key: str) -> bool
     |      
     |      Check whether the given key exists.
     |  
     |  keys(...)
     |      keys([root: str]) -> list
     |      
     |      Return a list of all keys in the configuration object. If 'root'
     |      is given, limit the list to those below the root.
     |  
     |  list(...)
     |      list([root: str]) -> list
     |      
     |      Return a list of all items at the given root.
     |  
     |  my_tag(...)
     |      my_tag() -> str
     |      
     |      Return the tag of the root of this Configuration object. For the
     |      default object, this is an empty string. For a subtree('APT') of
     |      such an object, it would be 'APT' (given as an example).
     |  
     |  set(...)
     |      set(key: str, value: str)
     |      
     |      Set the given key to the given value. To set int or bool values,
     |      encode them using str(value). One can then use find_i()/find_b()
     |      to retrieve their value again.
     |  
     |  subtree(...)
     |      sub_tree(key: str) -> apt_pkg.Configuration
     |      
     |      Return a new apt_pkg.Configuration objects which starts at the
     |      given option. Example:
     |      
     |          apttree = config.subtree('APT')
     |          apttree['Install-Suggests'] = config['APT::Install-Suggests']
     |  
     |  value_list(...)
     |      value_list([root: str]) -> list
     |      
     |      Same as list(), but instead of returning the keys, return the values.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395da5a0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class DepCache(__builtin__.object)
     |  DepCache(cache: apt_pkg.Cache)
     |  
     |  A DepCache() holds extra information on the state of the packages.
     |  
     |  The parameter 'cache' refers to an apt_pkg.Cache() object.
     |  
     |  Methods defined here:
     |  
     |  commit(...)
     |      commit(acquire_progress, install_progress)
     |      
     |      Commit all the marked changes. This method takes two arguments,
     |      'acquire_progress' takes an apt.progress.base.AcquireProgress
     |      object and 'install_progress' an apt.progress.base.InstallProgress
     |      object.
     |  
     |  fix_broken(...)
     |      fix_broken() -> bool
     |      
     |      Fix broken packages.
     |  
     |  get_candidate_ver(...)
     |      get_candidate_ver(pkg: apt_pkg.Package) -> apt_pkg.Version
     |      
     |      Return the candidate version for the package, normally the version
     |      with the highest pin (changeable using set_candidate_ver).
     |  
     |  init(...)
     |      init(progress: apt.progress.base.OpProgress)
     |      
     |      Initialize the depcache (done on construct automatically)
     |  
     |  is_auto_installed(...)
     |      is_auto_installed(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked as automatically installed.
     |  
     |  is_garbage(...)
     |      is_garbage(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is garbage, i.e. whether it is automatically
     |      installed and the reverse dependencies are not installed anymore.
     |  
     |  is_inst_broken(...)
     |      is_inst_broken(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is broken, ignoring marked changes.
     |  
     |  is_now_broken(...)
     |      is_now_broken(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is broken, taking marked changes into account.
     |  
     |  is_upgradable(...)
     |      is_upgradable(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is upgradable.
     |  
     |  mark_auto(...)
     |      mark_auto(pkg: apt_pkg.Package, auto: bool)
     |      
     |      Mark package as automatically installed (if auto=True),
     |      or as not automatically installed (if auto=False).
     |  
     |  mark_delete(...)
     |      mark_delete(pkg: apt_pkg.Package[, purge: bool = False])
     |      
     |      Mark package for deletion, and if 'purge' is True also for purging.
     |  
     |  mark_install(...)
     |      mark_install(pkg: apt_pkg.Package[, auto_inst=True, from_user=True])
     |      
     |      Mark the package for installation. The parameter 'auto_inst' controls
     |      whether the dependencies of the package are marked for installation
     |      as well. The parameter 'from_user' controls whether the package is
     |      registered as NOT automatically installed.
     |  
     |  mark_keep(...)
     |      mark_keep(pkg: apt_pkg.Package)
     |      
     |      Mark package for keep
     |  
     |  marked_delete(...)
     |      marked_delete(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked for removal.
     |  
     |  marked_downgrade(...)
     |      marked_downgrade(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked for downgrade.
     |  
     |  marked_install(...)
     |      marked_install(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked for installation.
     |  
     |  marked_keep(...)
     |      marked_keep(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package should be kept.
     |  
     |  marked_reinstall(...)
     |      marked_reinstall(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked for re-installation.
     |  
     |  marked_upgrade(...)
     |      marked_upgrade(pkg: apt_pkg.Package) -> bool
     |      
     |      Check whether the package is marked for upgrade.
     |  
     |  minimize_upgrade(...)
     |      minimize_upgrade() -> bool
     |      
     |      Go over the entire set of packages and try to keep each package
     |      marked for upgrade. If a conflict is generated then the package
     |      is restored.
     |  
     |  read_pinfile(...)
     |      read_pinfile([file: str])
     |      
     |      Read the pin policy
     |  
     |  set_candidate_ver(...)
     |      set_candidate_ver(pkg: apt_pkg.Package, ver: apt_pkg.Version) -> bool
     |      
     |      Set the candidate version of 'pkg' to 'ver'.
     |  
     |  set_reinstall(...)
     |      set_reinstall(pkg: apt_pkg.Package, reinstall: bool)
     |      
     |      Set if the package should be reinstalled (reinstall = True or False).
     |  
     |  upgrade(...)
     |      upgrade([dist_upgrade: bool = True]) -> bool
     |      
     |      Mark the packages for upgrade under the same conditions apt-get
     |      upgrade does. If 'dist_upgrade' is True, also allow packages to
     |      be upgraded if they require installation/removal of other packages;
     |      just like apt-get dist-upgrade.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  broken_count
     |      The number of packages with broken dependencies in the cache.
     |  
     |  deb_size
     |      The size of the packages which are needed for the changes to be
     |      applied.
     |  
     |  del_count
     |      The number of packages marked for removal.
     |  
     |  inst_count
     |      The number of packages marked for installation.
     |  
     |  keep_count
     |      The number of packages marked for keep.
     |  
     |  policy
     |      The apt_pkg.Policy object used by this cache.
     |  
     |  usr_size
     |      The amount of space required for installing/removing the packages,
     |      i.e. the Installed-Size of all packages marked for installation
     |      minus the Installed-Size of all packages for for removal.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395da720>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Dependency(__builtin__.object)
     |  Represent a dependency from one package version to a package,
     |  and (optionally) a version relation (e.g. >= 1). Dependency
     |  objects also provide useful functions like all_targets() or
     |  smart_target_pkg() for selecting packages to satisfy the
     |  dependency.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  all_targets(...)
     |      all_targets() -> list
     |      
     |      A list of all apt_pkg.Version objects satisfying the dependency.
     |  
     |  smart_target_pkg(...)
     |      smart_target_pkg() -> apt_pkg.Package
     |      
     |      Return the first package which provides a package with the name
     |      of the target package.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  comp_type
     |      The type of comparison, as a string (one of '<', '<=', '=', '>=', '>').
     |  
     |  dep_type
     |      The type of the dependency, may be translated
     |  
     |  dep_type_enum
     |      Same as dep_type, but with a numeric value instead of a string. Can
     |      be compared against the TYPE_ constants defined in this class.
     |  
     |  dep_type_untranslated
     |      Same as dep_type, but guaranteed to be untranslated.
     |  
     |  id
     |      The numeric ID of this dependency object.
     |  
     |  parent_pkg
     |      The apt_pkg.Package object of the package which depends.
     |  
     |  parent_ver
     |      The apt_pkg.Version object of the package which depends.
     |  
     |  target_pkg
     |      The apt_pkg.Package object of the package depended upon
     |  
     |  target_ver
     |      The version of the package depended upon as a string
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  TYPE_CONFLICTS = 5
     |  
     |  TYPE_DEPENDS = 1
     |  
     |  TYPE_DPKG_BREAKS = 8
     |  
     |  TYPE_ENHANCES = 9
     |  
     |  TYPE_OBSOLETES = 7
     |  
     |  TYPE_PREDEPENDS = 2
     |  
     |  TYPE_RECOMMENDS = 3
     |  
     |  TYPE_REPLACES = 6
     |  
     |  TYPE_SUGGESTS = 3
    
    class DependencyList(__builtin__.object)
     |  A simple list-like type for representing multiple dependency
     |  objects in an efficient manner; without having to generate
     |  all Dependency objects in advance.
     |  
     |  Methods defined here:
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __len__(...)
     |      x.__len__() <==> len(x)
    
    class Description(__builtin__.object)
     |  Represent a package description and some attributes. Needed for
     |  things like translated descriptions.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  file_list
     |      A list of all apt_pkg.PackageFile objects related to this description.
     |  
     |  language_code
     |      The language code of the description. Empty string for untranslated
     |      descriptions.
     |  
     |  md5
     |      The MD5 hash of the description.
    
    class FileLock(__builtin__.object)
     |  SystemLock(filename: str)
     |  
     |  Context manager for locking using a file. The lock is established
     |  as soon as the method __enter__() is called. It is released when
     |  __exit__() is called.
     |  
     |  This should be used via the 'with' statement, e.g.::
     |  
     |     with apt_pkg.FileLock(filename):
     |         ...
     |  
     |  Once the block is left, the lock is released automatically. The object
     |  can be used multiple times::
     |  
     |     lock = apt_pkg.FileLock(filename)
     |     with lock:
     |         ...
     |     with lock:
     |         ...
     |  
     |  Methods defined here:
     |  
     |  __enter__(...)
     |      Lock the system.
     |  
     |  __exit__(...)
     |      Unlock the system.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dbc00>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class HashString(__builtin__.object)
     |  HashString(type, hash) OR HashString('type:hash')
     |  
     |  Create a new HashString object. The first form allows you to specify
     |  a type and a hash, and the second form a single string where type and
     |  hash are separated by a colon, e.g.::
     |  
     |     HashString('MD5Sum', '6cc1b6e6655e3555ac47e5b5fe26d04e')
     |  
     |  Valid options for 'type' are: MD5Sum, SHA1, SHA256.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  __str__(...)
     |      x.__str__() <==> str(x)
     |  
     |  verify_file(...)
     |      verify_file(filename: str) -> bool
     |      
     |      Verify that the file indicated by filename matches the hash.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  hashtype
     |      The type of the hash, as a string (possible: MD5Sum,SHA1,SHA256).
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395db380>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Hashes(__builtin__.object)
     |  Hashes([object: (bytes, file)])
     |  
     |  Calculate hashes for the given object. It can be used to create all
     |  supported hashes for a file.
     |  
     |  The parameter *object* can be a bytes (3.X) / str (2.X) object, or an
     |  object providing the fileno() method or an integer describing a file
     |  descriptor.
     |  
     |  Methods defined here:
     |  
     |  __init__(...)
     |      x.__init__(...) initializes x; see x.__class__.__doc__ for signature
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  md5
     |      The MD5Sum of the file as a string.
     |  
     |  sha1
     |      The SHA1Sum of the file as a string.
     |  
     |  sha256
     |      The SHA256Sum of the file as a string.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395db160>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class IndexFile(__builtin__.object)
     |  Represent an index file, i.e. package indexes, translation indexes,
     |  and source indexes.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  archive_uri(...)
     |      archive_uri(path: str) -> str
     |      
     |      Return the URI to the given path in the archive.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  describe
     |      A string describing the index file.
     |  
     |  exists
     |      A boolean value determining whether the index file exists.
     |  
     |  has_packages
     |      A boolean value determining whether the index file has packages.
     |  
     |  is_trusted
     |      A boolean value determining whether the file can be trusted; e.g.
     |      because it is from a source with a GPG signed Release file.
     |  
     |  label
     |      The label of the index file.
     |  
     |  size
     |      The size of the files, measured in bytes.
    
    class IndexRecords(__builtin__.object)
     |  IndexRecords()
     |  
     |  Representation of a Release file.
     |  
     |  Methods defined here:
     |  
     |  get_dist(...)
     |      get_dist() -> str
     |      
     |      Return a distribution set in the release file.
     |  
     |  load(...)
     |      load(filename: str)
     |      
     |      Load the file given by filename.
     |  
     |  lookup(...)
     |      lookup(key: str) -> (HashString, int)
     |      
     |      Lookup the filename given by 'key', return a tuple (hash, size),
     |      whereas the first element 'hash' is an apt_pkg.HashString object
     |      and the second element 'size' an int object.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395db880>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class MetaIndex(__builtin__.object)
     |  Represent a meta index, i.e. a Release file. This class provides
     |  some information about those release files, e.g. whether they
     |  are signed or not.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  dist
     |      The distribution, as a string.
     |  
     |  index_files
     |      A list of all IndexFile objects associated with this meta index.
     |  
     |  is_trusted
     |      A boolean value determining whether the file can be trusted.
     |  
     |  uri
     |      The uri the meta index is located at.
    
    class Package(__builtin__.object)
     |  Represent a package. A package is uniquely identified by its name
     |  and each package can have zero or more versions which can be
     |  accessed via the version_list property. Packages can be installed
     |  and removed by apt_pkg.DepCache.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  auto
     |      Ignore it, it does nothing. You want to use
     |      DepCache.is_auto_installed instead.
     |  
     |  current_state
     |      The current state, can be compared against the constants
     |      CURSTATE_CONFIG_FILES, CURSTATE_HALF_CONFIGURED,
     |      CURSTATE_HALF_INSTALLED, CURSTATE_INSTALLED, CURSTATE_NOT_INSTALLED,
     |      CURSTATE_UNPACKED of the apt_pkg module.
     |  
     |  current_ver
     |      The version of the package currently installed or None.
     |  
     |  essential
     |      Boolean value determining whether the package is essential.
     |  
     |  id
     |      The numeric ID of the package
     |  
     |  important
     |      Boolean value determining whether the package has the 'important'
     |      flag set ('Important: yes' in the Packages file). Not used anymore.
     |  
     |  inst_state
     |      The state of the install, can be compared against the constants
     |      INSTSTATE_HOLD, INSTSTATE_HOLD_REINSTREQ, INSTSTATE_OK,
     |      INSTSTATE_REINSTREQ of the apt_pkg module.
     |  
     |  name
     |      The name of the package.
     |  
     |  provides_list
     |      A list of all packages providing this package. The list contains
     |      tuples in the format (providesname, providesver, version)
     |      whereas 'version' is an apt_pkg.Version object.
     |  
     |  rev_depends_list
     |      An apt_pkg.DependencyList object of all reverse dependencies.
     |  
     |  section
     |      The section of the package.
     |  
     |  selected_state
     |      The state of the selection; can be compared against the constants
     |      SELSTATE_DEINSTALL, SELSTATE_HOLD, SELSTATE_INSTALL, SELSTATE_PURGE,
     |      SELSTATE_UNKNOWN of the apt_pkg module.
     |  
     |  version_list
     |      A list of all apt_pkg.Version objects for this package.
    
    class PackageFile(__builtin__.object)
     |  A package file is an index file stored in the cache with some
     |  additional pieces of information.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  architecture
     |      The architecture of the package file. Unused, empty string nowadays.
     |  
     |  archive
     |      The archive of the package file (i.e. 'Suite' in the Release file).
     |  
     |  component
     |      The component of this package file (e.g. 'main').
     |  
     |  filename
     |      The path to the file.
     |  
     |  id
     |      The numeric ID of this PackageFile object.
     |  
     |  index_type
     |      A string describing the type of index. Known values are
     |      'Debian Package Index', 'Debian Translation Index', and
     |      'Debian dpkg status file'.
     |  
     |  label
     |      The label set in the release file (e.g. 'Debian').
     |  
     |  not_automatic
     |      Whether the NotAutomatic flag is set in the Release file.
     |  
     |  not_source
     |      Whether there is no source this file comes from; i.e. whether packages
     |      listed in this file can not be downloaded.
     |  
     |  origin
     |      The origin set in the release file.
     |  
     |  site
     |      The hostname of the location this file comes from.
     |  
     |  size
     |      The size of the file.
     |  
     |  version
     |      The version set in the release file (e.g. '5.0.X' for lenny, where X is
     |      is a point release).
    
    class PackageList(__builtin__.object)
     |  A PackageList is an internally used structure to represent
     |  the 'packages' attribute of apt_pkg.Cache objects in a more
     |  efficient manner by creating Package objects only when they
     |  are accessed.
     |  
     |  Methods defined here:
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __len__(...)
     |      x.__len__() <==> len(x)
    
    class PackageManager(__builtin__.object)
     |  PackageManager(depcache: apt_pkg.DepCache)
     |  
     |  PackageManager objects allow the fetching of packages marked for
     |  installation and the installation of those packages. The parameter
     |  'depcache' specifies an apt_pkg.DepCache object where information
     |  about the package selections is retrieved from.
     |  
     |  Methods defined here:
     |  
     |  do_install(...)
     |      do_install(status_fd: int) -> int
     |      
     |      Install the packages and return one of the class constants
     |      RESULT_COMPLETED, RESULT_FAILED, RESULT_INCOMPLETE. The argument
     |      status_fd can be used to specify a file descriptor where APT will
     |      write status information on (see README.progress-reporting in the
     |      apt source code for information what is written there).
     |  
     |  fix_missing(...)
     |      fix_missing() -> bool
     |      
     |      Fix the installation if a package could not be downloaded.
     |  
     |  get_archives(...)
     |      get_archives(fetcher: Acquire, list: SourceList, recs: PackageRecords) -> bool
     |      
     |      Download the packages marked for installation via the Acquire object
     |      'fetcher', using the information found in 'list' and 'recs'.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  RESULT_COMPLETED = 0
     |  
     |  RESULT_FAILED = 1
     |  
     |  RESULT_INCOMPLETE = 2
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dc0a0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class PackageRecords(__builtin__.object)
     |  PackageRecords(cache: apt_pkg.Cache)
     |  
     |  Package Records contain information about packages. Those objects
     |  can be used to retrieve information such as maintainer or filename
     |  of a package. They can also be used to retrieve the raw records
     |  of the packages (i.e. those stanzas stored in Packages files).
     |  
     |  Methods defined here:
     |  
     |  lookup(...)
     |      lookup((packagefile: apt_pkg.PackageFile, index: int)) -> bool
     |      
     |      Changes to a new package
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  filename
     |      The filename of the package, as stored in the 'Filename' field.
     |  
     |  homepage
     |      The homepage of the package, as stored in the 'Homepage' field.
     |  
     |  long_desc
     |      The long description of the packages; i.e. all lines in the
     |      'Description' field except for the first one.
     |  
     |  maintainer
     |      The maintainer of the package, as stored in the 'Maintainer' field.
     |  
     |  md5_hash
     |      The MD5 hash value of the package, as stored in the 'MD5Sum' field.
     |  
     |  name
     |      The name of the package, as stored in the 'Package' field.
     |  
     |  record
     |      The raw record, suitable for parsing by apt_pkg.TagSection.
     |  
     |  sha1_hash
     |      The SHA1 hash value, as stored in the 'SHA1' field.
     |  
     |  sha256_hash
     |      The SHA256 hash value, as stored in the 'SHA256' field.
     |  
     |  short_desc
     |      The short description of the package, i.e. the first line of the
     |      'Description' field.
     |  
     |  source_pkg
     |      The name of the source package, if different from the name of the
     |      binary package. This information is retrieved from the 'Source' field.
     |  
     |  source_ver
     |      The version of the source package, if it differs from the version
     |      of the binary package. Just like 'source_pkg', this information
     |      is retrieved from the 'Source' field.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dc2a0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Policy(__builtin__.object)
     |  Policy(cache)
     |  
     |  Representation of the policy of the Cache object given by cache. This
     |  provides a superset of policy-related functionality compared to the
     |  DepCache class. The DepCache can be used for most purposes, but there
     |  may be some cases where a special policy class is needed.
     |  
     |  Methods defined here:
     |  
     |  create_pin(...)
     |      create_pin(type: str, pkg: str, data: str, priority: int)
     |      
     |      Create a pin for the policy. The parameter 'type' refers to one of the
     |      following strings: 'Version', 'Release', 'Origin'. The argument 'pkg'
     |      is the name of the package, the parameter 'data' refers to the value
     |      e.g. unstable for type='Release' and the other possible options. 
     |      The parameter 'priority' gives the priority of the pin.
     |  
     |  get_candidate_ver(...)
     |      get_match(package: apt_pkg.Package) -> apt_pkg.Version
     |      
     |      Get the best package for the job.
     |  
     |  get_match(...)
     |      get_match(package: apt_pkg.Package) -> apt_pkg.Version
     |      
     |      Return a matching version for the given package.
     |  
     |  get_priority(...)
     |      get_priority(package: apt_pkg.Package) -> int
     |      
     |      Return the priority of the package.
     |  
     |  read_pindir(...)
     |      read_pindir(dirname: str) -> bool
     |      
     |      Read the pin files in the given dir (e.g. '/etc/apt/preferences.d')
     |      and add them to the policy.
     |  
     |  read_pinfile(...)
     |      read_pinfile(filename: str) -> bool
     |      
     |      Read the pin file given by filename (e.g. '/etc/apt/preferences')
     |      and add it to the policy.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dca00>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class ProblemResolver(__builtin__.object)
     |  ProblemResolver(depcache: apt_pkg.DepCache)
     |  
     |  ProblemResolver objects take care of resolving problems
     |  with dependencies. They mark packages for installation/
     |  removal and try to satisfy all dependencies.
     |  
     |  Methods defined here:
     |  
     |  clear(...)
     |      clear(pkg: apt_pkg.Package)
     |      
     |      Revert the actions done by protect()/remove() on the package.
     |  
     |  install_protect(...)
     |      install_protect()
     |      
     |      Install all protected packages.
     |  
     |  protect(...)
     |      protect(pkg: apt_pkg.Package)
     |      
     |      Mark the package as protected in the resolver, meaning that its
     |      state will not be changed.
     |  
     |  remove(...)
     |      remove(pkg: apt_pkg.Package)
     |      
     |      Mark the package for removal in the resolver.
     |  
     |  resolve(...)
     |      resolve([fix_broken: bool = True]) -> bool
     |      
     |      Try to intelligently resolve problems by installing and removing
     |      packages. If 'fix_broken' is True, apt will try to repair broken
     |      dependencies of installed packages.
     |  
     |  resolve_by_keep(...)
     |      resolve_by_keep() -> bool
     |      
     |      Try to resolve problems only by using keep.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395da8a0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class SourceList(__builtin__.object)
     |  SourceList()
     |  
     |  Represent the list of sources stored in /etc/apt/sources.list and
     |  similar files.
     |  
     |  Methods defined here:
     |  
     |  find_index(...)
     |      find_index(pkgfile: apt_pkg.PackageFile) -> apt_pkg.IndexFile
     |      
     |      Return the index file for the given package file, or None if none
     |      could be found.
     |  
     |  get_indexes(...)
     |      get_indexes(acquire: apt_pkg.Acquire[, all: bool=False]) -> bool
     |      
     |      Add all indexes (i.e. stuff like Release files, Packages files)
     |      to the Acquire object 'acquire'. If 'all' is True, all indexes
     |      will be added, otherwise only changed indexes will be added.
     |  
     |  read_main_list(...)
     |      read_main_list() -> bool
     |      
     |      Read /etc/apt/sources.list and similar files to populate the list
     |      of indexes.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  list
     |      A list of MetaIndex() objects.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dcc60>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class SourceRecords(__builtin__.object)
     |  SourceRecords()
     |  
     |  Provide an easy way to look up the records of source packages and
     |  provide easy attributes for some widely used fields of the record.
     |  
     |  Methods defined here:
     |  
     |  lookup(...)
     |      lookup(name: str) -> bool
     |      
     |      Lookup the source package with the given name. Each call moves
     |      the position of the records parser forward. If there are no
     |      records anymore, return None. If the lookup failed this way,
     |      access to any of the attributes will result in an AttributeError.
     |  
     |  restart(...)
     |      restart()
     |      
     |      Restart the lookup process. This moves the parser to the first
     |      package and lookups can now be made just like on a new object.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  binaries
     |      A list of the names of the binaries produced by this source package.
     |  
     |  build_depends
     |      A dictionary describing the build-time dependencies of the package,
     |      the format is the same as used for apt_pkg.Version.depends_list_str.
     |  
     |  files
     |      A list of tuples (md5: str, size: int, path: str, type: str), whereas
     |      'type' can be 'diff' (includes .debian.tar.gz), 'dsc', 'tar'.
     |  
     |  index
     |      The index file associated with this record as a list of
     |      apt_pkg.IndexFile objects.
     |  
     |  maintainer
     |      The maintainer of the package.
     |  
     |  package
     |      The name of the source package.
     |  
     |  record
     |      The raw record, suitable for parsing using apt_pkg.TagSection.
     |  
     |  section
     |      The section of the source package.
     |  
     |  version
     |      The version of the source package.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dc680>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class SystemLock(__builtin__.object)
     |  SystemLock()
     |  
     |  Context manager for locking the package system. The lock is established
     |  as soon as the method __enter__() is called. It is released when
     |  __exit__() is called.
     |  
     |  This should be used via the 'with' statement, e.g.::
     |  
     |     with apt_pkg.SystemLock():
     |         ...
     |  
     |  Once the block is left, the lock is released automatically. The object
     |  can be used multiple times::
     |  
     |     lock = apt_pkg.SystemLock()
     |     with lock:
     |         ...
     |     with lock:
     |         ...
     |  
     |  Methods defined here:
     |  
     |  __enter__(...)
     |      Lock the system.
     |  
     |  __exit__(...)
     |      Unlock the system.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dba80>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class TagFile(__builtin__.object)
     |  TagFile(file)
     |  
     |  TagFile() objects provide access to debian control files, which consists
     |  of multiple RFC822-like formatted sections.
     |  
     |  To provide access to those sections, TagFile objects provide an iterator
     |  which yields TagSection objects for each section.
     |  
     |  TagFile objects also provide another API which uses a shared TagSection
     |  object in the 'section' member. The functions step() and jump() can be
     |  used to navigate in the file; and offset() tells the current position.
     |  
     |  It is important to not mix the use of both APIs, because this can have
     |  unwanted effects.
     |  
     |  The parameter 'file' refers to an object providing a fileno() method or
     |  a file descriptor (an integer)
     |  
     |  Methods defined here:
     |  
     |  __iter__(...)
     |      x.__iter__() <==> iter(x)
     |  
     |  jump(...)
     |      jump(offset: int) -> bool
     |      
     |      Jump to the given offset, returns True on success. Note that jumping to
     |      an offset is not very reliable, and the 'section' attribute does not
     |      always point to the section one would expect it to.
     |  
     |  next(...)
     |      x.next() -> the next value, or raise StopIteration
     |  
     |  offset(...)
     |      offset() -> int
     |      
     |      Return the current offset.
     |  
     |  step(...)
     |      step() -> bool
     |      
     |      Step forward in the file
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  section
     |      The current section, as a TagSection object.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dd2c0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class TagSection(__builtin__.object)
     |  TagSection(text: str)
     |  
     |  TagSection() objects provide methods to access rfc822-style formatted
     |  header sections, like those in debian/control or Packages files.
     |  
     |  TagSection() behave like read-only dictionaries and also provide access
     |  to the functions provided by the C++ class (e.g. find)
     |  
     |  Methods defined here:
     |  
     |  __contains__(...)
     |      x.__contains__(y) <==> y in x
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __len__(...)
     |      x.__len__() <==> len(x)
     |  
     |  __str__(...)
     |      x.__str__() <==> str(x)
     |  
     |  bytes(...)
     |      bytes() -> int
     |      
     |      Return the number of bytes this section is large.
     |  
     |  find(...)
     |      find(name: str[, default = None]) -> str
     |      
     |      Find the key given by 'name' and return the value. If the key can
     |      not be found, return 'default'.
     |  
     |  find_flag(...)
     |      find_flag(name: str) -> int
     |      
     |      Return 1 if the value at the key is 'yes' or a similar value describing
     |      a boolean true. If the field does not exist, or does not have such a
     |      value, return 0.
     |  
     |  find_raw(...)
     |      find_raw(name: str[, default = None] -> str
     |      
     |      Same as find(), but returns the complete key : value field; instead of
     |      just the value.
     |  
     |  get(...)
     |      find(name: str[, default = None]) -> str
     |      
     |      Find the key given by 'name' and return the value. If the key can
     |      not be found, return 'default'.
     |  
     |  has_key(...)
     |      has_key(name: str) -> bool
     |      
     |      Return True if the key given by 'name' exists, False otherwise.
     |  
     |  keys(...)
     |      keys() -> list
     |      
     |      Return a list of all keys.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f5e395dd140>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class Version(__builtin__.object)
     |  Version Object
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  arch
     |      The architecture of this specific version of the package.
     |  
     |  depends_list
     |      A dictionary mapping dependency types to lists (A) of lists (B) of
     |      apt_pkg.Dependency objects. The lists (B) represent or dependencies
     |      like 'a || b'.
     |  
     |  depends_list_str
     |      Same as depends_list, except that the apt_pkg.Dependency objects
     |      are 3-tuples of the form (name, version, operator); whereas operator
     |      is one of '<', '<=', '=', '>=', '>'.
     |  
     |  downloadable
     |      Whether the version can be downloaded.
     |  
     |  file_list
     |      A list of tuples (pf: apt_pkg.PackageFile, index: int) for the
     |      PackageFile objects related to this package. The index can be used
     |      to retrieve the record of this package version.
     |  
     |  hash
     |      The numeric hash of the version used in the internal storage.
     |  
     |  id
     |      The numeric ID of the package.
     |  
     |  installed_size
     |      The installed size of this package version.
     |  
     |  parent_pkg
     |      The parent package of this version.
     |  
     |  priority
     |      The priority of the package as an integer, can be compared against
     |      the constants PRI_EXTRA, PRI_IMPORTANT, PRI_OPTIONAL, PRI_REQUIRED,
     |      PRI_STANDARD of the apt_pkg module.
     |  
     |  priority_str
     |      The priority of the package, as a string.
     |  
     |  provides_list
     |      A list of all packages provides by this version. See
     |      Package.provides_list for a description of the format.
     |  
     |  section
     |      The section of this package version.
     |  
     |  size
     |      The size of the package file.
     |  
     |  translated_description
     |      An apt_pkg.Description object for the translated description if
     |      available or the untranslated fallback.
     |  
     |  ver_str
     |      The version string.

FUNCTIONS
    base64_encode(...)
        base64_encode(value: bytes) -> str
        
        Encode the given bytestring using the Base64. The input may not
        contain '
    
    check_dep(...)
        check_dep(pkg_ver: str, dep_op: str, dep_ver: str) -> bool
        
        Check that the given requirement is fulfilled; i.e. that the version
        string given by 'pkg_ver' matches the version string 'dep_ver' under
        the condition specified by the operator 'dep_op' (<,<=,=,>=,>).
        
        This functions returns True if 'pkg_ver' matches 'dep_ver' under the
        condition 'dep_op'; e.g. this returns True:
        
            apt_pkg.check_dep('1', '<=', '2')
    
    check_domain_list(...)
        check_domain_list(host: str, domains: str) -> bool
        
        Check if the host given by 'host' belongs to one of the domains
        specified in the comma separated string 'domains'. An example
        would be:
        
            check_domain_list('alioth.debian.org','debian.net,debian.org')
        
        which would return True because alioth belongs to debian.org.
    
    dequote_string(...)
        dequote_string(string: str) -> str
        
        Dequote the given string by replacing all HTTP encoded values such
        as '%20' with their decoded value (e.g. ' ').
    
    get_lock(...)
        get_lock(file: str, errors: bool) -> int
        
        Create an empty file of the given name and lock it. If the locking
        succeeds, return the file descriptor of the lock file. Afterwards,
        locking the file from another process will fail and thus cause
        get_lock() to return -1 or raise an Error (if 'errors' is True).
        
        From Python 2.6 on, it is recommended to use the context manager
        provided by apt_pkg.FileLock instead using the with-statement.
    
    gettext(...)
        gettext(msg: str[, domain: str = 'python-apt']) -> str
        
        Translate the given string. Much Faster than Python's version and only
        does translations after setlocale() has been called.
    
    init(...)
        init()
        
        Short hand for doing init_config() and init_system(). When working
        with command line arguments, first call init_config() then parse
        the command line and finally call init_system().
    
    init_config(...)
        init_config()
        
        Load the default configuration and the config file.
    
    init_system(...)
        init_system()
        
        Construct the underlying system.
    
    md5sum(...)
        md5sum(object) -> str
        
        Return the md5sum of the object. 'object' may either be a string, in
        which case the md5sum of the string is returned, or a file() object
        (or file descriptor), in which case the md5sum of its contents is
        returned.
    
    parse_commandline(...)
        parse_commandLine(config: Configuration, options: list, argv: list) -> list
        
        Parse the command line in 'argv' into the configuration space. The
        list 'options' contains a list of 3-tuples or 4-tuples in the form:
        
           (short_option: str, long_option: str, variable: str[, type: str])
        
        The element 'short_option' is one character, the 'long_option' element
        is the name of the long option, the element 'variable' the name of the
        configuration option the result will be stored in and type is one of
        'HasArg', 'IntLevel', 'Boolean', 'InvBoolean', 'ConfigFile',
        'ArbItem'. The default type is 'Boolean'. Read the online documentation
        and the tutorial therin about writing an apt-cdrom clone for more details.
    
    parse_depends(...)
        parse_depends(s: str) -> list
        
        Parse the dependencies given by 's' and return a list of lists. Each of
        these lists represents one or more options for an or-dependency in the form
        of tuples ``(pkg, ver, comptype)``. In this tuple, the element 'pkg' is the
        name of the package, the element 'ver' the version [or '' if no version was
        requested. The element 'ver' is a comparison operator such as <,<=,=,>=,>.
    
    parse_src_depends(...)
        parse_src_depends(s: str) -> list
        
        Parse the dependencies given by 's' and return a list of lists. Each of
        these lists represents one or more options for an or-dependency in the form
        of tuples ``(pkg, ver, comptype)``. In this tuple, the element 'pkg' is the
        name of the package, the element 'ver' the version [or '' if no version was
        requested. The element 'ver' is a comparison operator such as <,<=,=,>=,>.
        
        Dependencies may be restricted to certain architectures and the result
        only contains those dependencies for the architecture set in the
        configuration variable APT::Architecture
    
    pkgsystem_lock(...)
        pkgsystem_lock() -> bool
        
        Acquire the global lock for the package system by using /var/lib/dpkg/lock
        to do the locking. From Python 2.6 on, the apt_pkg.SystemLock context
        manager is available and should be used instead.
    
    pkgsystem_unlock(...)
        pkgsystem_unlock() -> bool
        
        Release the global lock for the package system.
    
    quote_string(...)
        quote_string(string: str, repl: str) -> str
        
        Quote the string 'string' by encoding a standard set of characters
        plus the characters given 'repl' using their HTTP value, e.g.
        '%20' for ' '.
    
    read_config_dir(...)
        read_config_dir(configuration: apt_pkg.Configuration, dirname: str)
        
        Read all configuration files in the dir given by 'dirname' in the
        correct order.
    
    read_config_file(...)
        read_config_file(configuration: apt_pkg.Configuration, filename: str)
        
        Read the configuration file given by filename and set the options
        defined therein in the configuration object.
    
    read_config_file_isc(...)
        read_config_file(configuration: apt_pkg.Configuration, filename: str)
        
        Read the configuration file given by filename and set the options
        defined therein in the configuration object.
    
    rewrite_section(...)
        rewrite_section(section: TagSection, order: list, rewrite_list: list) -> str
        
        Rewrite the section given by 'section' using 'rewrite_list', and order the
        fields according to 'order'.
        
        The parameter 'order' is a list object containing the names of the fields
        in the order they should appear in the rewritten section.
        apt_pkg.REWRITE_PACKAGE_ORDER and apt_pkg.REWRITE_SOURCE_ORDER are two
        predefined lists for rewriting package and source sections, respectively
        
        The parameter 'rewrite_list' is a list of tuples of the form
        ``(tag, newvalue[, renamed_to])``, whereas 'tag' describes the field which
        should be changed, 'newvalue' the value which should be inserted or None
        to delete the field, and the optional renamed_to can be used to rename the
        field.
    
    sha1sum(...)
        sha1sum(object) -> str
        
        Return the sha1sum of the object. 'object' may either be a string, in
        which case the sha1sum of the string is returned, or a file() object
        (or file descriptor), in which case the sha1sum of its contents is
        returned.
    
    sha256sum(...)
        sha256sum(object) -> str
        
        Return the sha256sum of the object. 'object' may either be a string, in
        which case the sha256sum of the string is returned, or a file() object
        (or file descriptor), in which case the sha256sum of its contents is
        returned.
    
    size_to_str(...)
        size_to_str(bytes: int) -> str
        
        Return a string describing the size in a human-readable manner using
        SI prefix and base-10 units, e.g. '1k' for 1000, '1M' for 1000000, etc.
    
    str_to_time(...)
        str_to_time(rfc_time: str) -> int
        
        Convert the given RFC 1123 formatted string to an Unix timestamp.
    
    string_to_bool(...)
        string_to_bool(string: str) -> int
        
        Return 1 if the string is a value such as 'yes', 'true', '1';
        0 if the string is a value such as 'no', 'false','0'; -1 if
        the string is not recognized.
    
    time_rfc1123(...)
        time_rfc1123(unixtime: int) -> str
        
        Format the given Unix time according to the requirements of
        RFC 1123.
    
    time_to_str(...)
        time_to_str(seconds: int) -> str
        
        Return a string describing the number of seconds in a human
        readable manner using days, hours, minutes and seconds.
    
    upstream_version(...)
        upstream_version(ver: str) -> str
        
        Return the upstream version for the package version given by 'ver'.
    
    uri_to_filename(...)
        uri_to_filename(uri: str) -> str
        
        Return a filename based on the given URI after replacing some
        parts not suited for filenames (e.g. '/').
    
    version_compare(...)
        version_compare(a: str, b: str) -> int
        
        Compare the given versions; return -1 if 'a' is smaller than 'b',
        0 if they are equal, and 2 if 'a' is larger than 'b'.

DATA
    CURSTATE_CONFIG_FILES = 5
    CURSTATE_HALF_CONFIGURED = 2
    CURSTATE_HALF_INSTALLED = 4
    CURSTATE_INSTALLED = 6
    CURSTATE_NOT_INSTALLED = 0
    CURSTATE_UNPACKED = 1
    DATE = 'Apr  1 2010'
    INSTSTATE_HOLD = 2
    INSTSTATE_HOLD_REINSTREQ = 3
    INSTSTATE_OK = 0
    INSTSTATE_REINSTREQ = 1
    LIB_VERSION = '4.8.0'
    PRI_EXTRA = 5
    PRI_IMPORTANT = 1
    PRI_OPTIONAL = 4
    PRI_REQUIRED = 2
    PRI_STANDARD = 3
    REWRITE_PACKAGE_ORDER = ['Package', 'Essential', 'Status', 'Priority',...
    REWRITE_SOURCE_ORDER = ['Package', 'Source', 'Binary', 'Version', 'Pri...
    SELSTATE_DEINSTALL = 3
    SELSTATE_HOLD = 2
    SELSTATE_INSTALL = 1
    SELSTATE_PURGE = 4
    SELSTATE_UNKNOWN = 0
    TIME = '19:53:30'
    VERSION = '0.7.25.3'
    config = <apt_pkg.Configuration object at 0x7f5e3ae78148>


Help on module apt_inst:

NAME
    apt_inst - Functions for working with AR,tar archives and .deb packages.

FILE
    /home/jak/Desktop/python-apt/debian-sid/apt_inst.so

DESCRIPTION
    This module provides useful classes and functions to work with
    archives, modelled after the 'TarFile' class in the 'tarfile' module.

CLASSES
    __builtin__.object
        ArArchive
            DebFile
        ArMember
        TarFile
        TarMember
    
    class ArArchive(__builtin__.object)
     |  ArArchive(file: str/int/file)
     |  
     |  An ArArchive object represents an archive in the 4.4 BSD AR format, 
     |  which is used for e.g. deb packages.
     |  
     |  The parameter 'file' may be a string specifying the path of a file, or
     |  a file-like object providing the fileno() method. It may also be an int
     |  specifying a file descriptor (returned by e.g. os.open()).
     |  The recommended way is to pass in the path to the file.
     |  
     |  Methods defined here:
     |  
     |  __contains__(...)
     |      x.__contains__(y) <==> y in x
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __iter__(...)
     |      x.__iter__() <==> iter(x)
     |  
     |  extract(...)
     |      extract(name: str[, target: str]) -> bool
     |      
     |      Extract the member given by 'name' into the directory given
     |      by 'target'. If the extraction failed, raise OSError. In case
     |      of success, return True if the file owner could be set or
     |      False if this was not possible. If the requested member
     |      does not exist, raise LookupError.
     |  
     |  extractall(...)
     |      extractall([target: str]) -> bool
     |      
     |      Extract all into the directory given by 'target'. If the extraction
     |      failed, raise an error. Otherwise, return True if the owner could
     |      be set or False if the owner could not be changed.
     |  
     |  extractdata(...)
     |      extractdata(name: str) -> bytes
     |      
     |      Return the contents of the member, as a bytes object. Raise
     |      LookupError if there is no ArMember with the given name.
     |  
     |  getmember(...)
     |      getmember(name: str) -> ArMember
     |      
     |      Return a ArMember object for the member given by name. Raise
     |      LookupError if there is no ArMember with the given name.
     |  
     |  getmembers(...)
     |      getmembers() -> list
     |      
     |      Return a list of all members in the AR archive.
     |  
     |  getnames(...)
     |      getnames() -> list
     |      
     |      Return a list of the names of all members in the AR archive.
     |  
     |  gettar(...)
     |      gettar(name: str, comp: str) -> TarFile
     |      
     |      Return a TarFile object for the member given by 'name' which will be
     |      decompressed using the compression algorithm given by 'comp'.
     |      This is almost equal to:
     |      
     |         member = arfile.getmember(name)
     |         tarfile = TarFile(file, member.start, member.size, 'gzip')'
     |      
     |      It just opens a new TarFile on the given position in the stream.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f81f5c857c0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class ArMember(__builtin__.object)
     |  An ArMember object represents a single file within an AR archive. For
     |  Debian packages this can be e.g. control.tar.gz. This class provides
     |  information about this file, such as the mode and size.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  gid
     |      The group id of the owner.
     |  
     |  mode
     |      The mode of the file.
     |  
     |  mtime
     |      Last time of modification.
     |  
     |  name
     |      The name of the file.
     |  
     |  size
     |      The size of the files.
     |  
     |  start
     |      The offset in the archive where the file starts.
     |  
     |  uid
     |      The user id of the owner.
    
    class DebFile(ArArchive)
     |  DebFile(file: str/int/file)
     |  
     |  A DebFile object represents a file in the .deb package format.
     |  
     |  The parameter 'file' may be a string specifying the path of a file, or
     |  a file-like object providing the fileno() method. It may also be an int
     |  specifying a file descriptor (returned by e.g. os.open()).
     |  The recommended way is to pass in the path to the file.
     |  
     |  It differs from ArArchive by providing the members 'control', 'data'
     |  and 'version' for accessing the control.tar.gz,data.tar.{gz,bz2,lzma}
     |  ,debian-binary members in the archive.
     |  
     |  Method resolution order:
     |      DebFile
     |      ArArchive
     |      __builtin__.object
     |  
     |  Data descriptors defined here:
     |  
     |  control
     |      The TarFile object associated with the control.tar.gz member.
     |  
     |  data
     |      The TarFile object associated with the data.tar.{gz,bz2,lzma} member.
     |  
     |  debian_binary
     |      The package version, as contained in debian-binary.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f81f5c85940>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from ArArchive:
     |  
     |  __contains__(...)
     |      x.__contains__(y) <==> y in x
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __iter__(...)
     |      x.__iter__() <==> iter(x)
     |  
     |  extract(...)
     |      extract(name: str[, target: str]) -> bool
     |      
     |      Extract the member given by 'name' into the directory given
     |      by 'target'. If the extraction failed, raise OSError. In case
     |      of success, return True if the file owner could be set or
     |      False if this was not possible. If the requested member
     |      does not exist, raise LookupError.
     |  
     |  extractall(...)
     |      extractall([target: str]) -> bool
     |      
     |      Extract all into the directory given by 'target'. If the extraction
     |      failed, raise an error. Otherwise, return True if the owner could
     |      be set or False if the owner could not be changed.
     |  
     |  extractdata(...)
     |      extractdata(name: str) -> bytes
     |      
     |      Return the contents of the member, as a bytes object. Raise
     |      LookupError if there is no ArMember with the given name.
     |  
     |  getmember(...)
     |      getmember(name: str) -> ArMember
     |      
     |      Return a ArMember object for the member given by name. Raise
     |      LookupError if there is no ArMember with the given name.
     |  
     |  getmembers(...)
     |      getmembers() -> list
     |      
     |      Return a list of all members in the AR archive.
     |  
     |  getnames(...)
     |      getnames() -> list
     |      
     |      Return a list of the names of all members in the AR archive.
     |  
     |  gettar(...)
     |      gettar(name: str, comp: str) -> TarFile
     |      
     |      Return a TarFile object for the member given by 'name' which will be
     |      decompressed using the compression algorithm given by 'comp'.
     |      This is almost equal to:
     |      
     |         member = arfile.getmember(name)
     |         tarfile = TarFile(file, member.start, member.size, 'gzip')'
     |      
     |      It just opens a new TarFile on the given position in the stream.
    
    class TarFile(__builtin__.object)
     |  TarFile(file: str/int/file[, min: int, max: int, comp: str])
     |  
     |  The parameter 'file' may be a string specifying the path of a file, or
     |  a file-like object providing the fileno() method. It may also be an int
     |  specifying a file descriptor (returned by e.g. os.open()).
     |  
     |  The parameter 'min' describes the offset in the file where the archive
     |  begins and the parameter 'max' is the size of the archive.
     |  
     |  The compression of the archive is set by the parameter 'comp'. It can
     |  be set to any program supporting the -d switch, the default being gzip.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  extractall(...)
     |      extractall([rootdir: str]) -> True
     |      
     |      Extract the archive in the current directory. The argument 'rootdir'
     |      can be used to change the target directory.
     |  
     |  extractdata(...)
     |      extractdata(member: str) -> bytes
     |      
     |      Return the contents of the member, as a bytes object. Raise
     |      LookupError if there is no member with the given name.
     |  
     |  go(...)
     |      go(callback: callable[, member: str]) -> True
     |      
     |      Go through the archive and call the callable callback for each
     |      member with 2 arguments. The first argument is the TarMember and
     |      the second one is the data, as bytes.
     |      
     |      The optional parameter 'member' can be used to specify the member for
     |      which call the callback. If not specified, it will be called for all
     |      members. If specified and not found, LookupError will be raised.
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x7f81f5c85fa0>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
    
    class TarMember(__builtin__.object)
     |  Represent a single member of a 'tar' archive.
     |  
     |  This class, which has been modelled after 'tarfile.TarInfo', represents
     |  information about a given member in an archive.
     |  
     |  Methods defined here:
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  isblk(...)
     |      Determine whether the member is a block device.
     |  
     |  ischr(...)
     |      Determine whether the member is a character device.
     |  
     |  isdev(...)
     |      Determine whether the member is a device (block,character or FIFO).
     |  
     |  isdir(...)
     |      Determine whether the member is a directory.
     |  
     |  isfifo(...)
     |      Determine whether the member is a FIFO.
     |  
     |  isfile(...)
     |      Determine whether the member is a regular file.
     |  
     |  islnk(...)
     |      Determine whether the member is a hardlink.
     |  
     |  isreg(...)
     |      Determine whether the member is a regular file, same as isfile().
     |  
     |  issym(...)
     |      Determine whether the member is a symbolic link.
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  gid
     |      The owner's group id
     |  
     |  linkname
     |      The target of the link.
     |  
     |  major
     |      The major ID of the device.
     |  
     |  minor
     |      The minor ID of the device.
     |  
     |  mode
     |      The mode (permissions).
     |  
     |  mtime
     |      Last time of modification.
     |  
     |  name
     |      The name of the file.
     |  
     |  size
     |      The size of the file.
     |  
     |  uid
     |      The owner's user id.



Reply to: