X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=biaweb_db.py;h=c2761f5885fc74a0d2c6ab6e601dd7454f111dfe;hp=80e3915d2cea5366ac419336d4bc11a18d3e5cab;hb=b517d55320f54925d862aca9dedb363b6d3b156d;hpb=2687a3c3b18c3a267ca60ecdd3759ed0856471e0 diff --git a/biaweb_db.py b/biaweb_db.py index 80e3915..c2761f5 100644 --- a/biaweb_db.py +++ b/biaweb_db.py @@ -6,6 +6,20 @@ import os import os.path import time +# function to get the template text for a particular template +def get_template_text (dbname, template_name): + try: + conn = sqlite3.connect (dbname) + c = conn.cursor () + c.execute ("SELECT template_content FROM templates WHERE template_name=?", + (template_name,)) + conn.commit () + row = c.fetchone () + conn.close () + return row[0] + except sqlite3.Error: + return False + # function to retrieve the templates from the database def get_templates (dbname): try: