import sqliteproxy

READ_ONLY_DATABASE_PATH = "/usr/local/htc/database/HTC.db"

class databaseAccess(object):
    def __init__(self, db_path = READ_ONLY_DATABASE_PATH):
        self.db_path = db_path

    def getAttribute(self, id, symbol):
        q = "select * from attributes where ID = '" + id + "' AND SYMBOL = '" + symbol + "';"
        rv = sqliteproxy.runQuery(q, self.db_path)
        if rv != None:
            pqr = sqliteproxy.parseQueryResult(rv.decode("utf-8"))
            if len(pqr) == 1:
                return pqr[0][2]
        return ""

if __name__ == "__main__":
    pass
