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'])
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')
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')