projects
/
apachelog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3eaa939
)
Added a way to access the keys of the data dict as attributes, for "pretty" things...
author
Joshua Kugler
<joshua@azariah.com>
Sat, 9 Jul 2011 04:21:43 +0000
(20:21 -0800)
committer
Joshua Kugler
<joshua@azariah.com>
Sat, 9 Jul 2011 04:21:43 +0000
(20:21 -0800)
apachelog.py
patch
|
blob
|
history
diff --git
a/apachelog.py
b/apachelog.py
index f6724f0ea6900b8afa5e65cd7d4c0fb55e04fa3f..d38476cfa652feab9a32428e89d9a55f51480822 100755
(executable)
--- a/
apachelog.py
+++ b/
apachelog.py
@@
-100,6
+100,14
@@
import re
class ApacheLogParserError(Exception):
pass
+class AttrDict(dict):
+ """
+ Allows dicts to be accessed via dot notation as well as subscripts
+ Makes using the friendly names nicer
+ """
+ def __getattr__(self, name):
+ return self[name]
+
class parser:
format_to_name = {
# Explanatory comments copied from