Skip to content

Commit

Permalink
Merge pull request #707 from eth-brownie/feat-console-output
Browse files Browse the repository at this point in the history
Console output
  • Loading branch information
iamdefinitelyahuman authored Aug 1, 2020
2 parents 6c1ab10 + f628470 commit 9464474
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 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
2 changes: 1 addition & 1 deletion brownie/network/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 9464474

Please sign in to comment.