From: <ou...@us...> - 2003-06-30 22:58:52
|
Update of /cvsroot/freevo/freevo/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv26236/helpers Modified Files: musicsqlimport.py Log Message: Move escape(sql) into escape, and use it now. Index: musicsqlimport.py =================================================================== RCS file: /cvsroot/freevo/freevo/helpers/musicsqlimport.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** musicsqlimport.py 30 Jun 2003 20:20:44 -0000 1.6 --- musicsqlimport.py 30 Jun 2003 22:35:05 -0000 1.7 *************** *** 25,37 **** return 0 - def escape(sql): - if sql: - sql = sql.replace('\'','\'\'') - return sql - return 'null' - - # Only call once... how do we check if the tables exist? - - def check_db(): # verify the database exists --- 25,28 ---- *************** *** 75,80 **** VALUES = "(null,\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',%i,%i,%i,\'%s\',%f,%i,\'%s\',\'%s\',%i,\'%s\')" \ ! % (escape(dirtitle),md5,escape(os.path.dirname(filename)),escape(os.path.basename(filename)), \ ! 'mp3',escape(a['artist']),escape(a['title']),escape(a['album']),inti(a['date']),trackno, \ trackof, 100,0,0,'0','262',0,'null') --- 66,71 ---- VALUES = "(null,\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',%i,%i,%i,\'%s\',%f,%i,\'%s\',\'%s\',%i,\'%s\')" \ ! % (util.escape(dirtitle),md5,util.escape(os.path.dirname(filename)),util.escape(os.path.basename(filename)), \ ! 'mp3',util.escape(a['artist']),util.escape(a['title']),util.escape(a['album']),inti(a['date']),trackno, \ trackof, 100,0,0,'0','262',0,'null') |