minideblib.DpkgControl
index
minideblib/DpkgControl.py

DpkgControl.py
#
# This module implements control file parsing.
#
DpkgParagraph is a low-level class, that reads/parses a single paragraph
# from a file object.
#
DpkgControl uses DpkgParagraph in a loop, pulling out the value of a
# defined key(package), and using that as a key in it's internal
# dictionary.
#
DpkgSourceControl grabs the first paragraph from the file object, stores
# it in object.source, then passes control to DpkgControl.load, to parse
# the rest of the file.
#
# To test this, pass it a filetype char, a filename, then, optionally,
# the key to a paragraph to display, and if a fourth arg is given, only
# show that field.
#
# Copyright 2001 Adam Heath <doogie@debian.org>
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

 
Modules
       
minideblib.SafeWriteFile
os
re
string
sys

 
Classes
       
minideblib.DpkgDatalist.DpkgOrderedDatalist(minideblib.OrderedDict.OrderedDict, minideblib.DpkgDatalist._DpkgDatalist)
DpkgControl
DpkgSourceControl
DpkgParagraph

 
class DpkgControl(minideblib.DpkgDatalist.DpkgOrderedDatalist)
    
Method resolution order:
DpkgControl
minideblib.DpkgDatalist.DpkgOrderedDatalist
minideblib.OrderedDict.OrderedDict
UserDict.UserDict
minideblib.DpkgDatalist._DpkgDatalist

Methods defined here:
load(self, f)
setCaseSensitive(self, value)
setkey(self, key)

Data and other attributes defined here:
caseSensitive = 0
key = 'package'

Methods inherited from minideblib.DpkgDatalist.DpkgOrderedDatalist:
__init__(self, fn='')

Methods inherited from minideblib.OrderedDict.OrderedDict:
__cmp__(self, dict)
__delitem__(self, key)
__setitem__(self, key, value)
clear(self)
copy(self)
items(self)
keys(self)
update(self, dict)
values(self)

Methods inherited from UserDict.UserDict:
__contains__(self, key)
__getitem__(self, key)
__len__(self)
__repr__(self)
get(self, key, failobj=None)
has_key(self, key)
iteritems(self)
iterkeys(self)
itervalues(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, failobj=None)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

Methods inherited from minideblib.DpkgDatalist._DpkgDatalist:
store(self, fn=None)
Store variable data in a file.

 
class DpkgParagraph(minideblib.DpkgDatalist.DpkgOrderedDatalist)
    
Method resolution order:
DpkgParagraph
minideblib.DpkgDatalist.DpkgOrderedDatalist
minideblib.OrderedDict.OrderedDict
UserDict.UserDict
minideblib.DpkgDatalist._DpkgDatalist

Methods defined here:
load(self, f)
Paragraph data from a file object.
setCaseSensitive(self, value)

Data and other attributes defined here:
caseSensitive = 0
trueFieldCasing = {}

Methods inherited from minideblib.DpkgDatalist.DpkgOrderedDatalist:
__init__(self, fn='')

Methods inherited from minideblib.OrderedDict.OrderedDict:
__cmp__(self, dict)
__delitem__(self, key)
__setitem__(self, key, value)
clear(self)
copy(self)
items(self)
keys(self)
update(self, dict)
values(self)

Methods inherited from UserDict.UserDict:
__contains__(self, key)
__getitem__(self, key)
__len__(self)
__repr__(self)
get(self, key, failobj=None)
has_key(self, key)
iteritems(self)
iterkeys(self)
itervalues(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, failobj=None)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

Methods inherited from minideblib.DpkgDatalist._DpkgDatalist:
store(self, fn=None)
Store variable data in a file.

 
class DpkgSourceControl(DpkgControl)
    
Method resolution order:
DpkgSourceControl
DpkgControl
minideblib.DpkgDatalist.DpkgOrderedDatalist
minideblib.OrderedDict.OrderedDict
UserDict.UserDict
minideblib.DpkgDatalist._DpkgDatalist

Methods defined here:
__repr__(self)
load(self, f)

Data and other attributes defined here:
source = None

Methods inherited from DpkgControl:
setCaseSensitive(self, value)
setkey(self, key)

Data and other attributes inherited from DpkgControl:
caseSensitive = 0
key = 'package'

Methods inherited from minideblib.DpkgDatalist.DpkgOrderedDatalist:
__init__(self, fn='')

Methods inherited from minideblib.OrderedDict.OrderedDict:
__cmp__(self, dict)
__delitem__(self, key)
__setitem__(self, key, value)
clear(self)
copy(self)
items(self)
keys(self)
update(self, dict)
values(self)

Methods inherited from UserDict.UserDict:
__contains__(self, key)
__getitem__(self, key)
__len__(self)
get(self, key, failobj=None)
has_key(self, key)
iteritems(self)
iterkeys(self)
itervalues(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, failobj=None)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

Methods inherited from minideblib.DpkgDatalist._DpkgDatalist:
store(self, fn=None)
Store variable data in a file.