| Index: sitescripts/stats/bin/logprocessor.py |
| =================================================================== |
| --- a/sitescripts/stats/bin/logprocessor.py |
| +++ b/sitescripts/stats/bin/logprocessor.py |
| @@ -425,17 +425,27 @@ def parse_record(line, ignored, geo, geo |
| if "platform" in info: |
| info["fullPlatform"] = "%s %s" % (info["platform"], info["platformVersion"]) |
| return info |
| def add_record(info, section, ignore_fields=()): |
| section["hits"] = section.get("hits", 0) + 1 |
| section["bandwidth"] = section.get("bandwidth", 0) + info["size"] |
| - if len(ignore_fields) < 2: |
| + def is_visible(name): |
| + from ..common import fields |
| + for field in fields: |
| + if field["name"] == name: |
| + return "hidden" not in field or not field["hidden"] |
|
Sebastian Noack
2014/01/28 13:30:14
In Python you would do that preferable with one lo
|
| + return False |
| + |
| + # Allow nesting filters two levels deep but only consider visible fields, |
| + # fields that aren't displayed on the web can be nested deeper. |
| + filter_level = len(filter(is_visible, ignore_fields)) |
| + if filter_level < 2: |
| for field in map(lambda f: f["name"], common.fields): |
| if field in ignore_fields or field not in info: |
| continue |
| value = info[field] |
| if field not in section: |
| section[field] = {} |
| if value not in section[field]: |