³ņ vŽBFc@s1dZdd„Zd„Zd„Zd„ZdS(s This module exposes a set of functions used to store and retrieve templates from a database. @author: Lateef Alabi-Oki @organization: The Scribes Project @copyright: Copyright Ā© 2005 Lateef Alabi-Oki @license: GNU GPLv2 or Later @contact: mystilleef@gmail.com trcCsĘddkl}ddkl}|i|ƒpddkl}||ƒn|d}ddkl}ddkl }y||d|d t ƒ}Wn+|j o||dd d t ƒ}nX|S( sƒ Open the template database. @return: A database object representing the template database. @rtype: A database Shelve object. i’’’’(tmetadata_folder(tpath(tmakedirss templates.gdb(topen(terrortflagt writebacktn( t SCRIBES.infoRtosRtexistsRtshelveRtanydbmRtFalse(RRRRt database_fileRRtdatabase((splugins/Templates/Metadata.pytopen_template_database s cCs|iƒdS(s| Close the template database. @param database: The template database object. @type database: A database Shelve object. N(tclose(R((splugins/Templates/Metadata.pytclose_template_database5s cCs$tdƒ}|||s