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 _make_proxy(self, key, match):
        proxy_type = match.group("type")
        key = match.group("key").strip()
        if proxy_type == "env":
            proxy = EnvProxy(key)
        else:
            proxy = ResolverMethodProxy(self._resolver, proxy_type, key)
        filters = [f for f in [rf.strip() for rf in match.group("filters").split("|")] if f]
        for filter_name in filters:
            if filter_name == "jsondecode":
                proxy = JSONDecodeFilter(proxy)
            elif filter_name == "base64decode":
                proxy = Base64DecodeFilter(proxy)
            elif filter_name.startswith("element:"):
                key = filter_name.split(":", 1)[-1]
                proxy = ElementFilter(key, proxy)
            else:
                raise ValueError("Unknown filter %s", filter_name)
        return proxy