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

python-apt man page attached



python-apt had no docs, so I compiled some.

It is attached.

-- 
Bruce Kroeze

"It's important for us to explain to our nation that life is important.
It's not only life of babies, but it's life of children living in, you
know, the dark dungeons of the Internet."
-  GW Bush, Arlington Heights, Ill., Oct. 24, 2000
.TH python-apt 3 "October 20, 2002" "docstring-dump" "Python Apt Reference"

.SH NAME
python-apt \- python interface to libapt
.SH USAGE
.B import apt_pkg

.SH CONSTRUCTORS
.B newConfiguration()
.br
Construct a configuration instance
.sp

.B init()
->
.I None
.br
Legacy. Do
.I InitConfig
then parse the command line then do
.I InitSystem
.sp

.B initconfig()
->
.I None
.br
Load the default configuration and the config file
.sp

.B initsystem()
->
.I None
.br
Construct the underlying system


.SH TAG FILE
.B ParseCommandLine(Configuration,ListOfOptions,List-argv)
->
.I List
.br
This function is like getopt except it manipulates a configuration space.
output is a list of non-option arguments (filenames, etc).
.br
ListOfOptions is a list of tuples of the form:
.br
  ('c',"long-opt or None","Configuration::Variable","optional type")
.br
Where type may be one of HasArg, IntLevel, Boolean, InvBoolean,
ConfigFile, or ArbItem. The default is Boolean.
.sp

.B ParseDepends(s)
->
.I list of tuples
.br
The resulting tuples are (Pkg,Ver,Operation). Each anded dependency is a
list of or'd dependencies.
Source depends are evaluated against the curernt arch and only those that
Match are returned.
.sp

.B ParseSection(Text)
->
.I SectionObject
.sp

.B ParseTagFile(File)
->
.I TagFile

.sp
.B RewriteSection(Section,Order,RewriteList)
->
.I String
.br
The section rewriter allows a section to be taken in, have fields added,
removed or changed and then put back out. During this process the fields
within the section are sorted to corrispond to a proper order. Order is a
list of field names with their proper capitialization.
.I apt_pkg.RewritePackageOrder
and
.I apt_pkg.RewriteSourceOrder
are two predefined orders.
.br
RewriteList is a list of tuples. Each tuple is of the form:
  (Tag,NewValue[,RenamedTo])
.br
Tag specifies the tag in the source section. NewValue is the new value of
that tag and the optional RenamedTo field can cause the tag to be changed.
If NewValue is None then the tag is removed
.br
Ex. ('Source','apt','Package') is used for .dsc files.


.SH COMMAND LINE
.B ReadConfigFile(Configuration,FileName)
->
.I None
.sp

.B ReadConfigFileISC(Configuration,FileName)
->
.I None
.sp

.B ParseCommandLine(Configuration,ListOfOptions,List-argv)
->
.I List
.br									   
This function is like getopt except it manipulates a configuration space.
output is a list of non-option arguments (filenames, etc).
ListOfOptions is a list of tuples of the form:
.br
('c', "long-opt or None", "Configuration::Variable", "optional type")
.br
Where type may be one of HasArg, IntLevel, Boolean, InvBoolean,
ConfigFile, or ArbItem. The default is Boolean.

.SH VERSIONING
.B CheckDep(PkgVer,DepOp,DepVer)
->
.I int
.sp

.B UpstreamVersion(a)
->
.I string
.sp

.B VersionCompare(a,b)
->
.I int

.SH DEPENDS
ParseDepends(s) -> list of tuples
.br
The resulting tuples are (Pkg,Ver,Operation). Each anded dependency is a
list of or'd dependencies. 
.sp

ParseSrcDepends(s) -> list of tuples
.br
The resulting tuples are (Pkg,Ver,Operation). Each anded dependency is a
list of or'd dependencies. 
Source depends are evaluated against the curent arch and only those that
Match are returned.

.SH HASHING
.B md5sum(String)
->
.I String or md5sum(File)
->
.I String
.sp

.B sha1sum(String)
->
.I String or sha1sum(File)
->
.I String

.SH STRINGS
.B Base64Encode(String)
->
.I String
.sp

.B CheckDomainList(String,String)
->
.I Bool
.sp

.B DeQuoteString(String)
->
.I String
.sp

.B QuoteString(String,String)
->
.I String
.sp

.B SizeToStr(int)
->
.I String
.sp

.B StrToTime(String)
->
.I Int
.sp

.B StringToBool(String)
->
.I int
.sp

.B TimeRFC1123(int)
->
.I String
.sp

.B TimeToStr(int)
->
.I String
.sp

.B URItoFileName(String)
->
.I String


.SH CACHE
.B GetCache()
->
.I PkgCache
.sp

.B GetPkgRecords(Cache)
->
.I PkgRecrods


.SH STATIC INFO
.B CPU
.sp
.B Date
.sp
.B OS
.sp
.B LibVersion
.sp
.B Time
.sp
.B Version


.SH Package Object
.B Auto
->
.I boolean
.sp

.B CurrentVer
->
.I VersionObject
.sp

.B Essential
->
.I boolean
.sp

.B ID
->
.I numeric ID
.sp

.B Important
->
.I boolean
.sp

.B InstState
->
.I integer
.br
one of 0-4 (?)
.sp

.B Name
->
.I string
.sp

.B ProvidesList
->
.I List of version tuples
.sp

.B RevDependsList
->
.I DepIterator
.sp

.B Section
->
.I string
.sp

.B SelectedState
->
.I integer
.br
one of 0-4
.sp

.B VersionList
->
.I list of Version Objects

.SH Cache Object
.B DependsCount
->
.I number
.sp

.B FileList
->
.I list of PackageFile Objects
.sp

.B PackageCount
->
.I number
.sp

.B PackageFileCount
->
.I number
.sp

.B Packages
->
.I list of Package Objects
.sp

.B ProvidesCount
->
.I number
.sp

.B VerFileCount
->
.I number
.sp

.B VersionCount
->
.I number

.SH Version Object
.B VerStr
->
.I string
.sp

.B Section
->
.I string
.sp

.B Arch
->
.I string
.s

.B FileList
->
.I List of Version File Objects
.sp

.B DependsList
->
.I dict
.br
dict has one key "depends", value is list of Dependency Objects
.sp

.B DependsListStr
->
.I dict
.br
dict has one key "depends", value is list of tuples (pkg name, version, comparison operator)
.sp

.B ParentPkg
->
.I Package Object
.sp

.B ProvidesList
->
.I list of tuples
.br
pkg name, ???, Version Object
.sp

.B Size
->
.I number
.sp

.B InstalledSize
->
.I number
.sp

.B Hash
->
.I string
.sp

.B ID
->
.I numeric ID
.sp

.B Priority
->
.I numeric priority
.sp

.B PriorityStr
->
.I string

.SH Dependency Object
.B TargetVer
->
.I string
.sp

.B ParentVer
->
.I Version Object
.sp

.B ParentPkg
->
.I Package Object
.sp

.B CompType
->
.I string
.sp

.B DepType
->
.I string
.sp

.B ID
->
.I Numeric ID


.SH Configuration Object
.B Find(Name[,default])
->
.I String/None
.sp

.B FindFile(Name[,default])
->
.I String/None
.sp

.B FindDir(Name[,default])
->
.I String/None
.sp

.B FindI(Name[,default])
->
.I Integer
.sp

.B FindB(Name[,default])
->
.I Integer
.sp

.B Set(Name,Value)
->
.I None
.sp

.B Exists(Name)
->
.I Integer
.sp

.B Clear(Name)
->
.I None
.sp

.B SubTree(Name)
->
.I Configuration
.sp

.B List([root])
->
.I List
.sp

.B ValueList([root])
->
.I List
.sp

.B MyTag()
->
.I String
.sp

.B keys([root])
->
.I List
.sp

.B LoadConfig(Configuration,FileName)
->
.I None
.sp

.B LoadConfigISC(Configuration,FileName)
->
.I None
.sp

.B ParseCommandLine(Configuration,ListOfOptions,List-argv)
->
.I List
.br									   
see
.I COMMAND LINE
section above

.SH PkgRecords Object
.B FileName
->
.I string
.sp

.B MD5Hash
->
.I string
.sp

.B SourcePkg
->
.I string
.sp

.B Maintainer
->
.I string
.sp

.B ShortDesc
->
.I string
.sp

.B LongHesc
->
.I string
.sp

.B Name
->
.I string
.sp


.SH TagFile Object
.B Section
->
.I string
.sp

.B Step()
->
.I Integer
.br
0 means EOF
.sp

.B Offset()
->
.I Integer
.sp

.B Jump(Offset)
->
.I Integer
.sp


.SH TagSec Object
.B get(Name)
->
.I String/None
.sp

.B Find(Name)
->
.I String/None
.sp

.B FindFlag(Name)
->
.I integer/none
.sp

.B keys()
->
.I List
.sp

.B has_key(Name)
->
.I boolean
.sp

.B Exists(Name)
->
.I boolean
.sp

.B Bytes()
->
.I integer

Reply to: