Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
Commented setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Starner committed Mar 21, 2018
1 parent 9170679 commit e58ed9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def read(*parts):


def find_info(*file_paths, info='version'):
""" Get __{info}__ from a list of file paths
"""
version_file = read(*file_paths)
version_match = re.search(f"^__{info}__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
Expand All @@ -45,6 +47,11 @@ def find_info(*file_paths, info='version'):


def confirm(prompt, expected=('yes', 'y')):
""" Prompts the user to continue with the script
:param prompt: What to show the user
:param expected: Valid answers to continue
:return:
"""
response = input(prompt + f": ({'/'.join(expected)}) ")
if response.lower() not in expected:
print(" Quitting due to invalid prompt answer.")
Expand Down

0 comments on commit e58ed9c

Please sign in to comment.