r418 - branches/rewrite/src
Sergio Talens-Oliag
partial-mirror-devel@lists.alioth.debian.org
Fri, 17 Dec 2004 06:14:03 -0700
Author: sto
Date: Fri Dec 17 06:14:01 2004
New Revision: 418
Modified:
branches/rewrite/src/Package.py
Log:
Modified docstrings and added Build-Depends-Indep to SourcePackage
Modified: branches/rewrite/src/Package.py
==============================================================================
--- branches/rewrite/src/Package.py (original)
+++ branches/rewrite/src/Package.py Fri Dec 17 06:14:01 2004
@@ -15,15 +15,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# $Id$
+"""
+Classes to represent source and binary packages
+"""
import apt_pkg
class Package:
"""
- This class encapsulates a Package as represented in an apt
+ This class encapsulates a binary debian package as represented in an apt
Packages file.
"""
-
def __init__(self, section):
self._fields = {}
self._fields.update(section)
@@ -44,12 +46,11 @@
class SourcePackage(Package):
"""
- This class changes the format of Files field provided by the
- Sources file to a list of a dictionaries with following format:
-
- { name: value,
- md5sum: value,
- size: value }
+ This class encapsulates a debian source package as represented in an apt
+ Sources file.
+
+ The class transforms the `Files` field provided by the Sources file into a
+ list of dictionaries with three fields: `name`, `md5sum` and `size`.
"""
def __init__(self, section):
# First, we load the default information
@@ -58,6 +59,9 @@
# Handle Build-Depends field
if self._fields.has_key('Build-Depends'):
self._fields['Build-Depends'] = apt_pkg.ParseSrcDepends(self._fields['Build-Depends'])
+ # Handle Build-Depends-Indep field
+ if self._fields.has_key('Build-Depends-Indep'):
+ self._fields['Build-Depends-Indep'] = apt_pkg.ParseSrcDepends(self._fields['Build-Depends-Indep'])
self._fields['Binary'] = self._fields['Binary'].split(', ')