Author: poeml Date: Thu Nov 26 22:35:59 2009 New Revision: 48 URL: http://svn.mirrorbrain.org/viewvc/mod_stats?rev=48&view=rev Log: improve the apache config parser a bit Modified: trunk/tools/dlcount.py Modified: trunk/tools/dlcount.py URL: http://svn.mirrorbrain.org/viewvc/mod_stats/trunk/tools/dlcount.py?rev=48&r1=47&r2=48&view=diff ============================================================================== --- trunk/tools/dlcount.py (original) +++ trunk/tools/dlcount.py Thu Nov 26 22:35:59 2009 @@ -182,16 +182,18 @@ # ignore comment lines if line.startswith('#'): continue + # and empty lines + if not line: + continue # split line into 1st word plus rest # will fail if it's not a valid config line try: word, val = line.split(None, 1) - except ValueError: - continue + except: + sys.exit('error: can\'t parse the line %r' % line) if word.lower() not in known_directives_lower: sys.exit('unknown config directive: %r' % word) - continue directive = word.lower() val = val _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Thu Nov 26 2009 - 21:36:00 GMT
This archive was generated by hypermail 2.2.0 : Thu Nov 26 2009 - 21:45:10 GMT