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: