/[collab-qa]/udd/udd/upload_history_gatherer.py
ViewVC logotype

Diff of /udd/udd/upload_history_gatherer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1067 by neronus-guest, Sat Aug 9 16:32:42 2008 UTC revision 1068 by neronus-guest, Mon Aug 11 13:33:24 2008 UTC
# Line 1  Line 1 
1  # Last-Modified: <Sat 09 Aug 2008 18:32:29 CEST>  # Last-Modified: <Sun Aug 10 15:21:06 2008>
2  # This file is part of the Ultimate Debian Database Project  # This file is part of the Ultimate Debian Database Project
3    
4  from gatherer import gatherer  from gatherer import gatherer
# Line 8  import gzip Line 8  import gzip
8  import psycopg2  import psycopg2
9  import sys  import sys
10    
11  date_translation = {  def get_gatherer(config, connection, source):
12      'Deb': 'Feb',    return upload_history_gatherer(config, connection, source)
     'Augl': 'Aug',  
     'Fev': 'Feb' }  
   
 def get_gatherer(config, connection):  
   return upload_history_gatherer(config, connection)  
13    
14  class upload_history_gatherer(gatherer):  class upload_history_gatherer(gatherer):
15    def __init__(self, connection, config):    def __init__(self, connection, config, source):
16      gatherer.__init__(self, connection, config)      gatherer.__init__(self, connection, config, source)
17        if not 'path' in self.my_config:
   def run(self, source):  
     if not 'path' in self.config[source]:  
18        raise aux.ConfigException('path not specified for source ' + source)        raise aux.ConfigException('path not specified for source ' + source)
19      path = self.config[source]['path']  
20      def run(self):
21        path = self.my_config['path']
22    
23      cursor = self.cursor()      cursor = self.cursor()
24    
25      cursor.execute("DELETE FROM upload_history")      cursor.execute("DELETE FROM " + self.my_config['table'])
26    
27      cursor.execute("PREPARE uh_insert AS INSERT INTO upload_history VALUES \      cursor.execute("PREPARE uh_insert AS INSERT INTO %s VALUES \
28          ($1, $2, $3, $4, $5, $6, $7, $8)")          ($1, $2, $3, $4, $5, $6, $7, $8)" % self.my_config['table'])
29    
30      for name in glob(path + '/debian-devel-*'):      for name in glob(path + '/debian-devel-*'):
31        print name        print name

Legend:
Removed from v.1067  
changed lines
  Added in v.1068

  ViewVC Help
Powered by ViewVC 1.1.5