Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #34 from SimplyVC/miguel/setup_hotfix
Browse files Browse the repository at this point in the history
Fixed prompts and config clearing
  • Loading branch information
Dylan Galea authored Jan 13, 2020
2 parents bb07176 + 2db8097 commit 9893270
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/setup/setup_user_config_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def setup_nodes(cp: ConfigParser) -> None:
'new list of nodes, if you wish to do so (Y/n)\n'):
return

# Ask if they want to set it up
if not yn_prompt('Do you wish to set up the list of nodes? (Y/n)\n'):
return

# Clear config and initialise new list
cp.clear()
nodes = []

# Ask if they want to set it up
if not yn_prompt('Do you wish to set up the list of nodes? (Y/n)\n'):
return

# Get node details and append them to the list of nodes
while True:
node = get_node(nodes)
Expand Down
15 changes: 7 additions & 8 deletions src/setup/setup_user_config_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,20 @@ def setup_repos(cp: ConfigParser) -> None:
'of GitHub repositories to monitor will now be set up.')

# Check if list already set up
already_set_up = len(cp.sections()) > 0
if already_set_up and \
if len(cp.sections()) > 0 and \
not yn_prompt('The list of repositories is already set up. Do you '
'wish clear this list? You will then be asked to set '
'up a new list, if you wish to do so (Y/n)\n'):
return

# Ask if they want to set it up
if not yn_prompt('Do you wish to set up the list of repos? (Y/n)\n'):
'wish to clear this list? You will then be asked to '
'set up a new list, if you wish to do so (Y/n)\n'):
return

# Clear config and initialise new list
cp.clear()
repos = []

# Ask if they want to set it up
if not yn_prompt('Do you wish to set up the list of repos? (Y/n)\n'):
return

# Get repository details and append them to the list of repositories
while True:
repo = get_repo()
Expand Down

0 comments on commit 9893270

Please sign in to comment.