drime

French rhyme dictionary with web and CLI interface
git clone https://a3nm.net/git/drime/
Log | Files | Refs | README

commit 56a35afb5d21d5f51c62f6f685fff85859937970
parent f9d1dff14c55394a180f99e0b179b1a240c86f27
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed,  9 Nov 2011 12:05:59 +0100

use my own escape function

Diffstat:
lexique2sql.py | 23+++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/lexique2sql.py b/lexique2sql.py @@ -12,7 +12,6 @@ import haspirater import metric from common import is_vowels, is_consonants, sure_end_fem import sys -import _mysql seen = {} @@ -90,17 +89,17 @@ class Word: @property def render_sql(self): return ('INSERT INTO words VALUES("' - + _mysql.escape_string(self.word) + '", "' - + _mysql.escape_string(self.phon) + '", "' - + _mysql.escape_string(self.base) + '", "' - + _mysql.escape_string(self.kind) + '", ' - + _mysql.escape_string(str(self.freq)) + ', ' - + _mysql.escape_string(str(self.nsyl[0])) + ', ' - + _mysql.escape_string(str(self.nsyl[1])) + ', "' - + _mysql.escape_string(self.ending) + '", "' - + _mysql.escape_string(self.phon_ending) + '", ' - + _mysql.escape_string(str(int(self.elidable))) + ', ' - + _mysql.escape_string(str(int(self.feminine))) + ');' + + escape(self.word) + '", "' + + escape(self.phon) + '", "' + + escape(self.base) + '", "' + + escape(self.kind) + '", ' + + escape(str(self.freq)) + ', ' + + escape(str(self.nsyl[0])) + ', ' + + escape(str(self.nsyl[1])) + ', "' + + escape(self.ending) + '", "' + + escape(self.phon_ending) + '", ' + + escape(str(int(self.elidable))) + ', ' + + escape(str(int(self.feminine))) + ');' ) @property