Skip to content

CLI Cleanup#1146

Merged
KPrasch merged 7 commits intonucypher:sekanjabinfrom
KPrasch:output-refactoring
Jul 29, 2019
Merged

CLI Cleanup#1146
KPrasch merged 7 commits intonucypher:sekanjabinfrom
KPrasch:output-refactoring

Conversation

@KPrasch
Copy link
Member

@KPrasch KPrasch commented Jul 25, 2019

@KPrasch KPrasch added Bug 🐛 Broken functionality Enhancement New or improved features CLI This effects the nucypher CLI labels Jul 25, 2019
@KPrasch KPrasch force-pushed the output-refactoring branch from 9978cf0 to 7c9c870 Compare July 25, 2019 22:22
@codecov
Copy link

codecov bot commented Jul 26, 2019

Codecov Report

Merging #1146 into sekanjabin will decrease coverage by 0.88%.
The diff coverage is 70.77%.

Impacted file tree graph

@@              Coverage Diff               @@
##           sekanjabin    #1146      +/-   ##
==============================================
- Coverage        83.4%   82.52%   -0.89%     
==============================================
  Files              72       72              
  Lines            9655     9680      +25     
==============================================
- Hits             8053     7988      -65     
- Misses           1602     1692      +90
Impacted Files Coverage Δ
nucypher/config/characters.py 99.16% <ø> (ø) ⬆️
nucypher/blockchain/eth/actors.py 84.18% <100%> (-0.06%) ⬇️
nucypher/cli/painting.py 84.31% <100%> (+2.22%) ⬆️
nucypher/crypto/powers.py 94.96% <100%> (ø) ⬆️
nucypher/blockchain/eth/interfaces.py 80.07% <100%> (-0.37%) ⬇️
nucypher/cli/characters/moe.py 64% <100%> (ø) ⬆️
nucypher/cli/characters/felix.py 60.86% <100%> (-9.79%) ⬇️
nucypher/cli/characters/ursula.py 61.26% <100%> (-0.54%) ⬇️
nucypher/cli/characters/enrico.py 70.27% <100%> (-0.79%) ⬇️
nucypher/cli/characters/alice.py 70.67% <50%> (-7.2%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1c5ecb...cdce42d. Read the comment docs.

@KPrasch KPrasch force-pushed the output-refactoring branch from a8a9a7e to 6392c1f Compare July 26, 2019 17:15


def get_nucypher_password(confirm: bool = False, envvar="NUCYPHER_KEYRING_PASSWORD") -> str:
keyring_password = os.environ.get(envvar, NO_PASSWORD)
Copy link
Contributor

@fjarri fjarri Jul 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a boolean var, it might be better to use cli/config.py:get_env_bool() here - stricter, but less surprises (the function is perhaps better moved to utilities somewhere in that case). Although there are several os.environ uses throughout the code, so this may be better left for another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know - I'm thinking of restoring the original state of this code since its not being implemented anywhere. I had started to do this thinking I was going to share one method for password collection of both client and nucypher keyrings. Instead, I ended up writing multiple functions.

def activate(self, password: str = None):
"""Be Consumed"""
self.blockchain.connect(sync_now=False)
self.blockchain.connect(fetch_registry=True, sync_now=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since False is the default now, this may not be necessary (depending on whether the intention here is "do the default action" or "never sync")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch_registry=True may clash with a fix for #1166. Is it truly necessary to always fetch registry here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be handled elsewhere, no critical reason to be here other than being prudent.

@KPrasch KPrasch changed the title [WIP] CLI Cleanup CLI Cleanup Jul 27, 2019
… unneeded feature flags. Relocate deployment console painting to painting.py.
# TODO: OH MY.
client_password = None
if not alice_config.federated_only:
if (not hw_wallet or not dev) and not click_config.json_ipc:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is hw_wallet option used at all except here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only reason the flag is used at the moment. See related #1128

controller = BOB.make_web_controller(crash_on_error=click_config.debug)
BOB.log.info('Starting HTTP Character Web Controller')
return controller.start(http_port=http_port, dry_run=dry_run)
return controller.start(http_port=controller_port , dry_run=dry_run)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" " after controller_port here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?

Copy link
Member

@cygnusv cygnusv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've been using this for #1167 and I have no complaints.

@KPrasch KPrasch merged commit bd12cc9 into nucypher:sekanjabin Jul 29, 2019
@KPrasch KPrasch deleted the output-refactoring branch March 22, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 🐛 Broken functionality CLI This effects the nucypher CLI Enhancement New or improved features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants