Changeset 4215:aa1b0927dd45


Ignore:
Timestamp:
04/16/07 14:09:23 (6 years ago)
Author:
Yi Qiang <yqiang@…>
Branch:
default
Message:

Use sqlite3.OptimizedUnciode? as the default text factory everywhere.

Location:
sage/dsage
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sage/dsage/database/clientdb.py

    r4193 r4215  
    2020import datetime 
    2121import os 
    22 import sqlite3 as sqlite 
     22import sqlite3 
    2323 
    2424from twisted.python import log 
     
    6767                if not os.path.isdir(dir): 
    6868                    os.mkdir(dir) 
    69         self.con = sqlite.connect(self.db_file, 
    70                     detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES) 
    71         self.con.text_factory = str 
     69        self.con = sqlite3.connect(self.db_file, 
     70                    detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) 
     71        self.con.text_factory = sqlite3.OptimizedUnicode 
    7272         
    7373        if sql_functions.table_exists(self.con, self.tablename) is None: 
  • sage/dsage/database/jobdb.py

    r4214 r4215  
    405405                   self.db_file, 
    406406                   detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) 
    407         self.con.text_factory = str # Don't want unicode objects  
     407        self.con.text_factory = sqlite3.OptimizedUnicode # Don't want unicode objects  
    408408        if not sql_functions.table_exists(self.con, self.tablename): 
    409409            sql_functions.create_table(self.con, 
  • sage/dsage/database/monitordb.py

    r3866 r4215  
    2020import datetime 
    2121import os 
    22 import sqlite3 as sqlite 
     22import sqlite3 
    2323 
    2424from twisted.python import log 
     
    6767        self.log_level = self.conf['log_level'] 
    6868        self.log_file = self.conf['log_file'] 
    69         self.con = sqlite.connect(self.db_file, 
    70                     detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES) 
    71         self.con.text_factory = str 
     69        self.con = sqlite3.connect(self.db_file, 
     70                    detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) 
     71        self.con.text_factory = sqlite3.OptimizedUnicode 
    7272         
    7373        if sql_functions.table_exists(self.con, self.tablename) is None: 
  • sage/dsage/dsage.py

    r4203 r4215  
    151151                       to log to $DOT_SAGE/dsage/worker.log 
    152152        """ 
     153         
    153154        cmd = 'dsage_worker.py' 
    154155        if blocking: 
Note: See TracChangeset for help on using the changeset viewer.