def __init__(self):
		'''创建表'''
		self.conn = sqlite3.connect("./items.db")
		if VERBOSE:
			print 'Database connection OPEN.'
		# Domain 表
		self.conn.execute(CTABLE_DOMAIN)
		# Website 表
		self.conn.execute(CTABLE_WEBSITE)
		# Rule 表 
		self.conn.execute(CTABLE_RULESETS)

		self.conn.commit()
		if VERBOSE:
			cur = self.conn.cursor()
			print 'Tables:',cur.execute("SELECT name FROM sqlite_master WHERE type = 'table'").fetchall()
def _split_horizontal(container):
		r1 = None
		r2 = None
		min_h = int(H_RATIO*container.w)+1
		if container.h < 2*min_h:
			return None
		r1 = Container(container.x,container.y,container.w,randint(min_h, container.h-min_h))
		r2 = Container(container.x,container.y+r1.h,container.w,container.h-r1.h)
		return [r1, r2]