Index: trunk/tools/editor_trends/map_wiki_editors.py |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | vars = {} |
129 | 129 | |
130 | 130 | |
131 | | -def parse_editors(xml_queue, output, pbar, bots, **kwargs): |
| 131 | +def parse_editors(xml_queue, data_queue, **kwargs): |
132 | 132 | ''' |
133 | 133 | @xml_queue contains the filenames of the files to be parsed |
134 | 134 | @data_queue is an instance of Queue where the extracted data is stored for |
— | — | @@ -142,7 +142,8 @@ |
143 | 143 | output = kwargs.get('output', None) |
144 | 144 | debug = kwargs.get('debug', False) |
145 | 145 | destination = kwargs.get('destination', 'file') |
146 | | - |
| 146 | + bots = kwargs.get('bots', None) |
| 147 | + pbar = kwargs.get('pbar', None) |
147 | 148 | if settings.DEBUG: |
148 | 149 | messages = {} |
149 | 150 | vars = {} |
— | — | @@ -220,7 +221,7 @@ |
221 | 222 | utils.report_error_messages(messages, parse_editors) |
222 | 223 | |
223 | 224 | |
224 | | -def store_editors(data_queue, pids, dbname): |
| 225 | +def store_editors(data_queue, **kwargs): |
225 | 226 | ''' |
226 | 227 | @data_queue is an instance of Queue containing information extracted by |
227 | 228 | parse_editors() |
— | — | @@ -228,10 +229,12 @@ |
229 | 230 | running |
230 | 231 | @dbname is the name of the MongoDB collection where to store the information. |
231 | 232 | ''' |
| 233 | + dbname = kwargs.get('dbname', None) |
232 | 234 | mongo = db.init_mongo_db(dbname) |
233 | 235 | collection = mongo['editors'] |
234 | 236 | mongo.collection.ensure_index('editor') |
235 | 237 | editor_cache = cache.EditorCache(collection) |
| 238 | + |
236 | 239 | while True: |
237 | 240 | try: |
238 | 241 | edit = data_queue.get(block=False) |
Index: trunk/tools/editor_trends/utils/models.py |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | if kw not in IGNORE and not kw.startswith('_'): |
37 | 37 | kwargs[kw] = getattr(self, kw) |
38 | 38 | |
39 | | - self.target(self.input_queue, self.result_queue, self.pbar, kwargs) |
| 39 | + self.target(self.input_queue, self.result_queue, **kwargs) |
40 | 40 | |
41 | 41 | |
42 | 42 | class ProcessResultQueue(multiprocessing.Process): |
— | — | @@ -56,4 +56,4 @@ |
57 | 57 | if kw not in IGNORE and not kw.startswith('_'): |
58 | 58 | kwargs[kw] = getattr(self, kw) |
59 | 59 | |
60 | | - self.target(self.result_queue, self.pids, self.dbname) |
| 60 | + self.target(self.result_queue, **kwargs) |