From cf0a795aaf8f79098276b9c2e9b7b4886a117e90 Mon Sep 17 00:00:00 2001 From: Ben Hauser Date: Wed, 22 Jul 2020 19:05:22 +0300 Subject: [PATCH 1/2] fix: add newline before showing rpc launch info --- brownie/network/rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/network/rpc.py b/brownie/network/rpc.py index 9f56447ba..ac7eaf9ae 100644 --- a/brownie/network/rpc.py +++ b/brownie/network/rpc.py @@ -113,7 +113,7 @@ def launch(self, cmd: str, **kwargs: Dict) -> None: f'"{key}" with value "{value}".', InvalidArgumentWarning, ) - print(f"Launching '{' '.join(cmd_list)}'...") + print(f"\nLaunching '{' '.join(cmd_list)}'...") out = DEVNULL if sys.platform == "win32" else PIPE self._rpc = psutil.Popen(cmd_list, stdin=DEVNULL, stdout=out, stderr=out) # check that web3 can connect From f628470516617104ef7957e5715fcd3237b760de Mon Sep 17 00:00:00 2001 From: Ben Hauser Date: Wed, 22 Jul 2020 19:05:45 +0300 Subject: [PATCH 2/2] fix: only show container contents in repr in console --- brownie/network/account.py | 4 +++- brownie/network/contract.py | 4 +++- brownie/network/state.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/brownie/network/account.py b/brownie/network/account.py index ff41c5ba0..26d157e1f 100644 --- a/brownie/network/account.py +++ b/brownie/network/account.py @@ -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) diff --git a/brownie/network/contract.py b/brownie/network/contract.py index b5b09c521..63b44b03a 100644 --- a/brownie/network/contract.py +++ b/brownie/network/contract.py @@ -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: diff --git a/brownie/network/state.py b/brownie/network/state.py index 1260e0c3f..e920a5261 100644 --- a/brownie/network/state.py +++ b/brownie/network/state.py @@ -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)