r109789 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109788‎ | r109789 | r109790 >
Date:01:25, 23 January 2012
Author:diederik
Status:deferred
Tags:
Comment:
Catch unicode error.
Modified paths:
  • /trunk/analytics/pipeliner/user_agent.py (modified) (history)

Diff [purge]

Index: trunk/analytics/pipeliner/user_agent.py
@@ -61,7 +61,7 @@
6262 This class does all the heavy lifting of aggregating observations, writing output
6363 to a file, and do some simple logging
6464 '''
65 - def __init__(self, observation_class, filename, process_id, number_of_fields=14):
 65+ def __init__(self, observation_class, filename, process_id):
6666 self.start = datetime.now()
6767 self.skipped_records = 0
6868 self.http_valid_codes = {'200':1,'304':1, '302':1}
@@ -72,7 +72,7 @@
7373 self.url = None
7474 self.filename = filename
7575 self.process_id = process_id
76 - self.number_of_fields = number_of_fields
 76+ self.number_of_fields = 14
7777 self.observation_class = observation_class
7878 self.gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
7979 self.error_vars = ['http_invalid_codes', 'invalid_user_agents', 'skipped_records']
@@ -275,7 +275,7 @@
276276
277277
278278 def debug():
279 - pipeline = UserAgentPipeline(UserAgentObservation, 'mobile.log-20110826.gz', 0, 14)
 279+ pipeline = UserAgentPipeline(UserAgentObservation, 'mobile.log-20110826.gz', 0)
280280 pipeline.run()
281281
282282 if __name__ == '__main__':

Status & tagging log