Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 57bce1fd authored by ulrich_y's avatar ulrich_y
Browse files

Towards #6: check function

parent c45206e6
No related branches found
No related tags found
No related merge requests found
from PathType import PathType
import os
def yn_choice(message, default='y'):
choices = 'Y/n' if default.lower() in ('y', 'yes') else 'y/N'
choice = raw_input("%s (%s) " % (message, choices))
values = ('y', 'yes', '') if choices == 'Y/n' else ('y', 'yes')
return choice.strip().lower() in values
def create_parser(subparsers):
......@@ -21,4 +29,18 @@ def create_parser(subparsers):
def main(parsed):
print parsed
def check(msg, opt=False):
if parsed.dry:
print msg
return False
if parsed.i:
ans = yn_choice(msg)
if ans:
return True
else:
if opt:
return False
else:
raise IOError("Aborting. This was not negotiable")
else:
return True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment