Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(977)

Unified Diff: plaso/containers/interface.py

Issue 325050043: [plaso] Added event data support to ZIP and GZIP storage (Closed)
Patch Set: Added event data support to ZIP and GZIP storage Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: plaso/containers/interface.py
diff --git a/plaso/containers/interface.py b/plaso/containers/interface.py
index 5df1464bd910ed2fc9552cd20c54737c52185602..199a357dced588b5b3ea7767f147d70c6c58961e 100644
--- a/plaso/containers/interface.py
+++ b/plaso/containers/interface.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
"""The attribute container interface."""
+from plaso.lib import py2to3
+
from efilter.protocols import structured
@@ -84,6 +86,28 @@ class AttributeContainer(object):
yield attribute_name, attribute_value
+ def GetAttributeValuesString(self):
+ """Retrieves a comparable string of the attribute values.
+
+ Returns:
+ int: comparable string of the attribute values.
+ """
+ attributes = []
+ for attribute_name, attribute_value in sorted(self.__dict__.items()):
+ if attribute_name.startswith(u'_') or attribute_value is None:
+ continue
+
+ if isinstance(attribute_value, dict):
+ attribute_value = sorted(attribute_value.items())
+
+ elif isinstance(attribute_value, py2to3.BYTES_TYPE):
+ attribute_value = repr(attribute_value)
+
+ attribute_string = u'{0:s}: {1!s}'.format(attribute_name, attribute_value)
+ attributes.append(attribute_string)
+
+ return u', '.join(attributes)
+
def GetIdentifier(self):
"""Retrieves the identifier.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b