r393 - in branches/rewrite: . src
Otavio Salvador
partial-mirror-devel@lists.alioth.debian.org
Sat, 11 Dec 2004 18:20:51 -0700
Author: otavio
Date: Sat Dec 11 18:20:50 2004
New Revision: 393
Modified:
branches/rewrite/ (props changed)
branches/rewrite/src/Dists.py
Log:
r432@nurf: otavio | 2004-12-12T01:20:10.603480Z
Include namespace.
Modified: branches/rewrite/src/Dists.py
==============================================================================
--- branches/rewrite/src/Dists.py (original)
+++ branches/rewrite/src/Dists.py Sat Dec 11 18:20:50 2004
@@ -20,15 +20,14 @@
# Add a control on md5sum to check wich files has to be updated
-from apt_pkg import ParseTagFile
-from os.path import basename, dirname
-from os import link
-
-from Download import *
-from FileSystem import *
-from Package import *
-from PackageList import *
-from Config import InvalidOption
+import apt_pkg
+import os, os.path
+
+import Config
+import Download
+import FileSystem
+import Package
+import PackageList
class Dists:
"""
@@ -38,11 +37,11 @@
def __init__ (self, backend):
self._backend = backend
self._files = []
- self._fs = FileSystem(backend["mirror_dir"], backend["name"])
+ self._fs = FileSystem.FileSystem(backend["mirror_dir"], backend["name"])
# Package lists
- self.__bin = PackageList()
- self.__source = PackageList()
+ self.__bin = PackageList.PackageList()
+ self.__source = PackageList.PackageList()
def _fill_files(self):
# If we already have it doen't rerun
@@ -86,20 +85,20 @@
return files
def upgrade(self):
- bin = PackageList()
- source = PackageList()
+ bin = PackageList.PackageList()
+ source = PackageList.PackageList()
for f in self.get_index():
# Choose object type
if basename(f) == 'Packages':
- pkg = Package
+ pkg = Package.Package
pkglist = bin
elif basename(f) == 'Sources':
- pkg = SourcePackage
+ pkg = Package.SourcePackage
pkglist = source
# Load file on list
- parse = ParseTagFile(open(f, "r"))
+ parse = apt_pkg.ParseTagFile(open(f, "r"))
print "Loading", f
while parse.Step() == 1:
p = pkg(parse.Section)
@@ -108,7 +107,7 @@
pkgfilter = []
try:
pkgfilter = self._backend._cfg.getOption('filter', self._backend._name)
- except InvalidOption:
+ except Config.InvalidOption:
pass
# Apply filter or use as final list
@@ -137,7 +136,7 @@
def update (self):
""" Get only files that need updates """
self._fill_files()
- download = Download()
+ download = Download.Download()
for server, filename in self._files:
self._fs.create(os.path.dirname(filename))
download.get(server, filename)