aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
437 stars 192 forks source link

Move all prompts to CLI functions #3932

Closed ltalirz closed 6 months ago

ltalirz commented 4 years ago

As pointed out by @sphuber , functions outside the commandline interface should not prompt for user input.

I originally thought there were many places where this happens but after searching for prompt( in the codebase, it turns out these two are the only ones:

https://github.com/aiidateam/aiida-core/blob/5da7120645b6cdb751d6db54431ead38417d2345/aiida/manage/external/postgres.py#L114-L127

https://github.com/aiidateam/aiida-core/blob/5da7120645b6cdb751d6db54431ead38417d2345/aiida/manage/external/postgres.py#L161-L174

Since they don't really need the internals of the Postgres class, they can be moved to stand-alone functions somewhere in the utils of the cli.

sphuber commented 6 months ago

This code seems to have been removed, so closing this issue