Exemplo n.º 1
0
 def __init__(self):
     self.fromurl = ''
     self.linklist = []
     self.parse_content = ''
     self.content = ''
     self.wordlist = []
     confdictory = confparser.confdictory('database')
     if len(confdictory) == 0:
         logger.warning('config file load error')
         return
     self.dbcontrol = dbcontrol(confdictory['user'], \
        confdictory['password'])
Exemplo n.º 2
0
	def __init__(self):
		self.fromurl = ''
		self.linklist = []
		self.parse_content = ''
		self.content = ''
		self.wordlist = []
		confdictory = confparser.confdictory('database')
		if len(confdictory) == 0:
			logger.warning('config file load error')
			return
		self.dbcontrol = dbcontrol(confdictory['user'], \
					confdictory['password'])
Exemplo n.º 3
0
	def __init__(self,query_words):
		if isinstance(query_words,str):
			self.wordlist = query_words.split(' ')
			#reslist 存放wordlist的对应结果
			self.reslist = []
			confdictory = confparser.confdictory('database')
			if not confdictory.has_key('user'):# or !confdictory.has_key['dbpass']:
				logger.warning('config parser can not be loaded')
				return None
			self.engine = dbcontrol(confdictory['user'],confdictory['password'])
			if self.engine == None:
				logger.warning({'msg':'database connect error','dbname':confdictory['dbuser'],'dbpass':confdictory['dbpass']})
				return None
		else:
			logger.warning('query words format error')
Exemplo n.º 4
0
 def __init__(self, query_words):
     if isinstance(query_words, str):
         self.wordlist = query_words.split(' ')
         #reslist 存放wordlist的对应结果
         self.reslist = []
         confdictory = confparser.confdictory('database')
         if not confdictory.has_key(
                 'user'):  # or !confdictory.has_key['dbpass']:
             logger.warning('config parser can not be loaded')
             return None
         self.engine = dbcontrol(confdictory['user'],
                                 confdictory['password'])
         if self.engine == None:
             logger.warning({
                 'msg': 'database connect error',
                 'dbname': confdictory['dbuser'],
                 'dbpass': confdictory['dbpass']
             })
             return None
     else:
         logger.warning('query words format error')