[Collab-qa-commits] r1036 - udd/src/udd

neronus-guest at alioth.debian.org neronus-guest at alioth.debian.org
Sat Aug 9 16:23:35 UTC 2008


Author: neronus-guest
Date: 2008-08-09 16:23:35 +0000 (Sat, 09 Aug 2008)
New Revision: 1036

Modified:
   udd/src/udd/orphaned_packages_gatherer.py
   udd/src/udd/popcon_gatherer.py
   udd/src/udd/testing_migrations_gatherer.py
   udd/src/udd/upload_history_gatherer.py
Log:
Use tierators to read lines from files instead of reading the whole file at once


Modified: udd/src/udd/orphaned_packages_gatherer.py
===================================================================
--- udd/src/udd/orphaned_packages_gatherer.py	2008-08-09 15:31:37 UTC (rev 1035)
+++ udd/src/udd/orphaned_packages_gatherer.py	2008-08-09 16:23:35 UTC (rev 1036)
@@ -23,9 +23,8 @@
     bug = str(bug)
     dir = bug[4:6]
     f = open(self.my_config['bugs-path'] + '/spool/db-h/' + dir + '/' + bug + '.log', 'r')
-    s = f.read()
     otime = None
-    for l in s.splitlines(False):
+    for l in f:
       m = self.chtitle_re.match(l)
       if m:
         return otime

Modified: udd/src/udd/popcon_gatherer.py
===================================================================
--- udd/src/udd/popcon_gatherer.py	2008-08-09 15:31:37 UTC (rev 1035)
+++ udd/src/udd/popcon_gatherer.py	2008-08-09 16:23:35 UTC (rev 1036)
@@ -51,7 +51,7 @@
     ascii_match = re.compile("^[A-Za-z0-9-.+_]+$")
 
     linenr = 0
-    for line in popcon.readlines():
+    for line in popcon:
       linenr += 1
       name, data = line.split(None, 1)
       if name == "Submissions:":

Modified: udd/src/udd/testing_migrations_gatherer.py
===================================================================
--- udd/src/udd/testing_migrations_gatherer.py	2008-08-09 15:31:37 UTC (rev 1035)
+++ udd/src/udd/testing_migrations_gatherer.py	2008-08-09 16:23:35 UTC (rev 1036)
@@ -1,4 +1,4 @@
-# Last-Modified: <Thu Jul 31 15:40:12 2008>
+# Last-Modified: <Sat 09 Aug 2008 18:19:40 CEST>
 
 # This file is a part of the Ultimate Debian Database Project
 
@@ -35,7 +35,7 @@
       c.execute("PREPARE mig_insert AS INSERT INTO migrations VALUES ($1, $2, $3, $4, $5, $6, $7, $8)")
       
       f = open(src_cfg['path'])
-      for line in f.readlines():
+      for line in f:
 	(package, in_testing, testing_version, in_unstable, unstable_version, sync, sync_version, first_seen) = line.split()
 	for field in ('in_testing', 'in_unstable', 'sync', 'first_seen'):
 	  is_null = False

Modified: udd/src/udd/upload_history_gatherer.py
===================================================================
--- udd/src/udd/upload_history_gatherer.py	2008-08-09 15:31:37 UTC (rev 1035)
+++ udd/src/udd/upload_history_gatherer.py	2008-08-09 16:23:35 UTC (rev 1036)
@@ -1,4 +1,4 @@
-# Last-Modified: <Sun Jul 27 11:53:58 2008>
+# Last-Modified: <Sat 09 Aug 2008 18:19:50 CEST>
 # This file is part of the Ultimate Debian Database Project
 
 from gatherer import gatherer
@@ -43,7 +43,7 @@
       current = {}
       last_field = None
       line_count = 0
-      for line in f.readlines():
+      for line in f:
 	line_count += 1
 	line = line.strip()
 	# Stupid multi-line maintainer fields *grml*




More information about the Collab-qa-commits mailing list