[apt-proxy-devel] r646 - trunk/apt_proxy

Chris Halls halls at alioth.debian.org
Tue Apr 17 21:51:38 UTC 2007


Author: halls
Date: Tue Apr 17 21:51:38 2007
New Revision: 646

Modified:
   trunk/apt_proxy/cache.py
Log:
* Fix exception if filetype is undefined
* Make log messages more consistent


Modified: trunk/apt_proxy/cache.py
==============================================================================
--- trunk/apt_proxy/cache.py	(original)
+++ trunk/apt_proxy/cache.py	Tue Apr 17 21:51:38 2007
@@ -116,7 +116,7 @@
 
         # decompressors are currently disabled until debugged :)
         if self.factory.config.use_experimental_decompressors:
-            if self.filetype.decompressor is not None:
+            if self.filetype and self.filetype.decompressor is not None:
                 # File needs to be decompressed
                 self.filetype.decompressor(self)
 
@@ -154,7 +154,7 @@
         if len(self.requests) != 0:
             return
 
-        log.debug("Last request removed for %s" % (self.file_path),'cacheEntry')
+        log.debug("Last request removed for %s" % (self.file_path),'CacheEntry')
         self.requests_done()
 
         # TODO - fixme
@@ -536,7 +536,7 @@
     """
     CHUNKSIZE = 16384
     def __init__(self, name, mode='w+b'):
-        log.debug("Creating file: " + name, 'cache')
+        log.debug("Creating file: " + name, 'CacheEntry')
         self.file = file(name, mode, self.CHUNKSIZE)
         self.name = name
     def append(self, data):
@@ -550,7 +550,7 @@
         self.file.seek(0, SEEK_END)
         return data
     def close(self):
-        log.debug("Closing file: " + self.name, 'cache')
+        log.debug("Closing file: " + self.name, 'CacheEntry')
         self.file.close()
         self.file = None
     def close_and_rename(self, new_name):
@@ -560,7 +560,7 @@
         self.close()
         if self.name == new_name:
             return
-        log.debug("renaming file: %s->%s " % (self.name, new_name), 'cache')
+        log.debug("renaming file: %s->%s " % (self.name, new_name), 'CacheEntry')
         os.rename(self.name, new_name)
         self.name = new_name
 
@@ -610,7 +610,7 @@
             if(os.stat(self.path)[stat.ST_SIZE]) < 1:
                 self.failed("Zero length file")
             else:
-                log.debug('Verification skipped for ' + self.path)
+                log.debug('Verification skipped for ' + self.path, 'FileVerifier')
                 self.deferred.callback(None)
         return self.deferred
 
@@ -619,12 +619,12 @@
             self.path = path
             self.reason = reason
     def failed(self, reason):
-        log.msg("cache file verification FAILED for %s: %s"%(self.path, reason), 'verify')
+        log.msg("cache file verification FAILED for %s: %s"%(self.path, reason), 'FileVerifier')
         os.unlink(self.path)
         self.deferred.errback(self.VerificationFailure(self.path, reason))
 
     def passed(self):
-        log.debug("cache file verification passed: %s"%(self.path), 'verify')
+        log.debug("cache file verification passed: %s"%(self.path), 'FileVerifier')
         self.parent.deferred.callback(None)
 
 class FileVerifierProcess(protocol.ProcessProtocol):
@@ -665,7 +665,7 @@
         """
         __pychecker__ = 'unusednames=reason'
         #log.debug("Process Status: %d" %(self.process.status),'verify')
-        #log.debug(self.data, 'verify')
+        log.debug("verification status (%s): %s" % (self.exe, self.process.status), 'FileVerifierProcess')
         if self.laterID:
             self.laterID.cancel()
             if self.process.status == 0:



More information about the apt-proxy-devel mailing list