[mirrorbrain-commits] [mod_stats] r30 - /trunk/tools/dlcount.py

From: <poeml_at_mirrorbrain.org>
Date: Wed, 25 Nov 2009 17:11:34 -0000
Author: poeml
Date: Wed Nov 25 18:11:33 2009
New Revision: 30

URL: http://svn.mirrorbrain.org/viewvc/mod_stats?rev=30&view=rev
Log:
- fix logic of detection of double matches

Modified:
    trunk/tools/dlcount.py

Modified: trunk/tools/dlcount.py
URL: http://svn.mirrorbrain.org/viewvc/mod_stats/trunk/tools/dlcount.py?rev=30&r1=29&r2=30&view=diff
==============================================================================
--- trunk/tools/dlcount.py (original)
+++ trunk/tools/dlcount.py Wed Nov 25 18:11:33 2009
_at_@ -272,24 +272,25 @@
         known.append(md)
 
         # apply prefiltering
-        for m, s, mreg in conf['statsprefilter']:
-            url = m.sub(s, url)
+        for r, s, mreg in conf['statsprefilter']:
+            url = r.sub(s, url)
 
         print '%-80s ' % url, 
 
         matched = False
-        for m, s, mreg in conf['statscount']:
-            if matched:
-                sys.exit('warning: %r matches\n   %r\nbut already matched a pevious regexp:\n   %r' % (url, mreg, matched))
-            if m.match(url):
-                print m.sub(s, url)
+        for r, s, mreg in conf['statscount']:
+            if r.match(url):
+                if matched:
+                    # FIXME: eventually, we want to allow multiple matches. But now we are debugging.
+                    sys.exit('warning: %r matches\n   %r\nbut already matched a pevious regexp:\n   %r' % (url, mreg, matched))
+                print r.sub(s, url)
                 matched = mreg
         if not matched:
             print '-'
 
         # apply postfiltering
-        for m, s, mreg in conf['statspostfilter']:
-            url = m.sub(s, url)
+        for r, s, mreg in conf['statspostfilter']:
+            url = r.sub(s, url)
 
 
     sys.exit(0)




_______________________________________________
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.org
Received on Wed Nov 25 2009 - 17:11:35 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT