aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/DataStructures.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/argaze/DataStructures.py b/src/argaze/DataStructures.py
index fcd91e1..6bc0b3a 100644
--- a/src/argaze/DataStructures.py
+++ b/src/argaze/DataStructures.py
@@ -42,7 +42,14 @@ class JsonEncoder(json.JSONEncoder):
# class case
except:
- return obj.__dict__
+ # ignore attribute starting with _
+ public_dict = {}
+
+ for k, v in vars(obj).items():
+ if not k.startswith('_'):
+ public_dict[k] = v
+
+ return public_dict
class TimeStampedBuffer(collections.OrderedDict):
"""Ordered dictionary to handle timestamped data.