Show
Ignore:
Timestamp:
01/18/08 23:39:41 (16 years ago)
Author:
jerome
Message:

Added modules to store utility functions and application
intialization code, which has nothing to do in classes.
Modified tool.py accordingly (far from being finished)
Use these new modules where necessary.
Now converts all command line arguments to unicode before
beginning to work. Added a proper logging method for already
encoded query strings.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r3291 r3294  
    581581        self.close() 
    582582         
     583    def querydebug(self, qmsg) :     
     584        """Logs a database query, where all queries are already UTF-8 encoded.""" 
     585        self.tool.logdebug(qmsg.decode("UTF-8", "replace")) 
     586         
    583587    def getFromCache(self, cachetype, key) : 
    584588        """Tries to extract something from the cache.""" 
     
    728732        return gpquotas         
    729733         
    730     def databaseToUnicode(self, text) : 
    731         """Converts from database format (UTF-8) to unicode.""" 
    732         if text is not None : 
    733             return text.decode("UTF-8", "replace") 
    734         else :  
    735             return None 
    736          
    737     def unicodeToDatabase(self, text) : 
    738         """Converts from unicode to database format (UTF-8).""" 
    739         if text is not None :  
    740             return text.encode("UTF-8", "replace") 
    741         else :     
    742             return None 
    743              
    744734    def cleanDates(self, startdate, enddate) :     
    745735        """Clean the dates to create a correct filter."""