def connect(self): 
        try:
            self.connection = pymongo.Connection(self.host, self.port)
            self.db = self.connection[self.name]
        except AutoReconnect:
            raise DatabaseException("It's not possible connect to the database")
def _split_vertical(container):
		r1 = None
		r2 = None
		min_w = int(W_RATIO*container.h)+1
		if container.w < 2*min_w:
			return None
		r1 = Container(container.x,container.y,randint(min_w, container.w-min_w),container.h)
		r2 = Container(container.x+r1.w,container.y,container.w-r1.w,container.h)
		return [r1, r2]