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 select(cls, dataset, selection_mask=None, **selection):
        df = dataset.data
        if selection_mask is None:
            selection_mask = cls.select_mask(dataset, selection)

        indexed = cls.indexed(dataset, selection)
        if selection_mask is not None:
            df = df.loc[selection_mask]
        if indexed and len(df) == 1 and len(dataset.vdims) == 1:
            return df[dataset.vdims[0].name].iloc[0]
        return df