Mercurial > hg > PyCrawler
comparison query.py @ 2:6d8b6a689b2b default tip
changed to bs4
author | dwinter |
---|---|
date | Mon, 15 Oct 2012 15:09:35 +0200 |
parents | 768cb7284374 |
children |
comparison
equal
deleted
inserted
replaced
1:768cb7284374 | 2:6d8b6a689b2b |
---|---|
110 except UnicodeDecodeError: | 110 except UnicodeDecodeError: |
111 return False | 111 return False |
112 if not result: | 112 if not result: |
113 return False | 113 return False |
114 # generate list of argument dictionaries for the insert many statement | 114 # generate list of argument dictionaries for the insert many statement |
115 args = [{"page_id":result.inserted_primary_key[0], "keyword":unicode(k), "weight":w} for k,w in data["keywords"].items()] | 115 args = [{"page_id":result.inserted_primary_key[0], "keyword":unicode(k.lower()), "weight":w} for k,w in data["keywords"].items()] |
116 # Add all the keywords | 116 # Add all the keywords |
117 if len(args) > 0: | 117 if len(args) > 0: |
118 result2 = self.connection.execute(self.keyword_table.insert(),args) | 118 result2 = self.connection.execute(self.keyword_table.insert(),args) |
119 if not result2: | 119 if not result2: |
120 return False | 120 return False |