From 59f344f5518990c04db085bbd3875bc10fb6133e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 21 Jun 2016 00:49:15 +0300 Subject: mutual_friends.py: refactoring --- bin/mutual_friends.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/mutual_friends.py b/bin/mutual_friends.py index 07e1d95..c0d8ffc 100644 --- a/bin/mutual_friends.py +++ b/bin/mutual_friends.py @@ -41,18 +41,18 @@ class OutputWriterCSV: class OutputWriterJSON: def __init__(self, fd=sys.stdout): self._fd = fd - self._array = [] + self._arr = [] def __enter__(self): return self def __exit__(self, *args): - self._fd.write(json.dumps(self._array, indent=3, ensure_ascii=False)) + self._fd.write(json.dumps(self._arr, indent=3, ensure_ascii=False)) self._fd.write('\n') def write_mutual_friends(self, friend_list): for user in friend_list: - self._array.append(_filter_user_fields(user)) + self._arr.append(_filter_user_fields(user)) class OutputFormat(Enum): CSV = 'csv' -- cgit v1.2.3