[Spambayes-checkins] spambayes/spambayes storage.py,1.61,1.62 Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9483

Modified Files:
	storage.py 
Log Message:
[ 1573103 ] Handle charset in configure mySQL storage


Index: storage.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** storage.py	27 Mar 2007 10:57:53 -0000	1.61
--- storage.py	4 Apr 2007 11:49:05 -0000	1.62
***************
*** 519,522 ****
--- 519,523 ----
          self.password = ""
          db_name = "spambayes"
+         self.charset = None
          source_info = data_source_name.split()
          for info in source_info:
***************
*** 529,532 ****
--- 530,535 ----
              elif info.startswith("dbname"):
                  db_name = info[7:]
+             elif info.startswith("charset"):
+                 self.charset = info[8:]
          SQLClassifier.__init__(self, db_name)
  
***************
*** 548,553 ****
              print >> sys.stderr, 'Loading state from',self.db_name,'database'
  
!         self.db = MySQLdb.connect(host=self.host, db=self.db_name,
!                                   user=self.username, passwd=self.password)
  
          c = self.cursor()
--- 551,560 ----
              print >> sys.stderr, 'Loading state from',self.db_name,'database'
  
!         params = {
!           'host': self.host, 'db': self.db_name,
!           'user': self.username, 'passwd': self.password,
!           'charset': self.charset
!         }
!         self.db = MySQLdb.connect(**params)
  
          c = self.cursor()

_______________________________________________
Spambayes-checkins mailing list
pnperxdpv-sarswdlp@python.org
http://mail.python.org/mailman/listinfo/spambayes-checkins


