Revision: 4054 Author: btongminh Date: 2007-08-16 20:46:28 +0000 (Thu, 16 Aug 2007)
Log Message: ----------- Fixing previous revision.
Modified Paths: -------------- trunk/pywikipedia/checkusage.py trunk/pywikipedia/delinker.py
Modified: trunk/pywikipedia/checkusage.py =================================================================== --- trunk/pywikipedia/checkusage.py 2007-08-16 20:45:50 UTC (rev 4053) +++ trunk/pywikipedia/checkusage.py 2007-08-16 20:46:28 UTC (rev 4054) @@ -214,7 +214,8 @@ self.http = None if no_db: return
- self.mysql_host, self.mysql_host_prefix = mysql_host, mysql_host_prefix + self.mysql_host_prefix = mysql_host_prefix + if 'host' in mysql_kwargs: del mysql_kwargs['host'] self.mysql_kwargs = mysql_kwargs self.use_autoconn = use_autoconn self.mysql_retry_timeout = mysql_retry_timeout @@ -234,8 +235,8 @@ # Mapping database name -> (lang, family object) self.families = {}
- database, cursor = self.connect(mysql_host_prefix + str(mysql_default_server)) - self.clusters[mysql_default_server] = (database, cursor) + database, cursor = self.connect_mysql(mysql_host_prefix + str(mysql_default_server)) + self.databases[mysql_default_server] = (database, cursor)
# Find where the databases are located cursor.execute('SELECT dbname, domain, server FROM toolserver.wiki ORDER BY size DESC LIMIT %s', (limit, )) @@ -251,7 +252,7 @@ # self.clusters[server] = (_database, _cursor) #if not server in self.clusters: # self.clusters[server] = self.connect(sql_host_prefix + str(server)) - self.clusters[server] = self.connect_mysql(sql_host_prefix + str(server)) + self.databases[server] = self.connect_mysql(sql_host_prefix + str(server)) self.sites[dbname] = family(domain) self.families[dbname] = (self.sites[dbname][0], @@ -339,7 +340,7 @@ def close(self): - for connection, cursor in self.clusters.itervalues(): + for connection, cursor in self.databases.itervalues(): try: connection.close() except:
Modified: trunk/pywikipedia/delinker.py =================================================================== --- trunk/pywikipedia/delinker.py 2007-08-16 20:45:50 UTC (rev 4053) +++ trunk/pywikipedia/delinker.py 2007-08-16 20:46:28 UTC (rev 4054) @@ -54,7 +54,7 @@ return unicode(s) def connect_database(): engine = config.CommonsDelinker['sql_engine'] - kwargs = config.CommonsDelinker['sql_config'] + kwargs = config.CommonsDelinker['sql_config'].copy() if engine == 'mysql': import mysql_autoconnection # This setting is required for MySQL