Skip to content

Commit

Permalink
fix: only show container contents in repr in console
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Jul 22, 2020
1 parent cf0a795 commit f628470
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion brownie/network/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def __contains__(self, address: str) -> bool:
return False

def __repr__(self) -> str:
return str(self._accounts)
if CONFIG.argv["cli"] == "console":
return str(self._accounts)
return super().__repr__()

def __iter__(self) -> Iterator:
return iter(self._accounts)
Expand Down
4 changes: 3 additions & 1 deletion brownie/network/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def __len__(self) -> int:
return len(self._contracts)

def __repr__(self) -> str:
return str(self._contracts)
if CONFIG.argv["cli"] == "console":
return str(self._contracts)
return super().__repr__()

def _reset(self) -> None:
for contract in self._contracts:
Expand Down
4 changes: 3 additions & 1 deletion brownie/network/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def __init__(self) -> None:
_revert_register(self)

def __repr__(self) -> str:
return str(self._list)
if CONFIG.argv["cli"] == "console":
return str(self._list)
return super().__repr__()

def __bool__(self) -> bool:
return bool(self._list)
Expand Down

0 comments on commit f628470

Please sign in to comment.