diff --git a/bin/asciiio.py b/bin/asciiio.py index 2daf56c..2f106b8 100755 --- a/bin/asciiio.py +++ b/bin/asciiio.py @@ -39,7 +39,15 @@ class AsciiCast(object): def create(self): self._record() - return self._upload() + if self.confirm_upload(): + return self._upload() + else: + self._delete() + + def confirm_upload(self): + sys.stdout.write("~ Do you want to upload it? [Y/n] ") + answer = sys.stdin.readline().strip() + return answer == 'y' or answer == 'Y' or answer == '' def _record(self): os.makedirs(self.path) @@ -96,6 +104,9 @@ class AsciiCast(object): else: return False + def _delete(self): + shutil.rmtree(self.path) + class TimedFile(object): '''File wrapper that records write times in separate file.'''