#!/usr/bin/python

__author__ = 'Avleen Vig'

"""General database library for use with GoogleBot"""

import ConfigParser
import MySQLdb

def SetupDb():
  db_config = ConfigParser.ConfigParser()
  db_config.readfp(open('config/database.conf'))
  db_unix_socket = db_config.get('database', 'db_unix_socket')
  db_username = db_config.get('database', 'db_username')
  db_password = db_config.get('database', 'db_password')
  db_name = db_config.get('database', 'db_name')
  db = MySQLdb.connect(unix_socket=db_unix_socket,
      user=db_username,
      passwd=db_password,
      db=db_name)
  return db

if __name__ == '__main__':
  print 'This library is not intended to be run directly'

