aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/utils.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/rumba/utils.py b/rumba/utils.py
index 5348b0a..2fc623c 100644
--- a/rumba/utils.py
+++ b/rumba/utils.py
@@ -8,7 +8,11 @@ logger = log.get_logger(__name__)
class ExperimentManager(object):
- def __init__(self, experiment, do_swap_out=True):
+ PROMPT = 1
+ AUTO = 2
+ NO = 3
+
+ def __init__(self, experiment, do_swap_out=AUTO):
assert isinstance(experiment, model.Experiment), \
'An experiment instance is required.'
self.experiment = experiment
@@ -18,7 +22,11 @@ class ExperimentManager(object):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
- if self.do_swap_out:
+ if self.do_swap_out == self.PROMPT:
+ logger.info('Press ENTER to start swap out.')
+ input('')
+ if self.do_swap_out == self.PROMPT \
+ or self.do_swap_out == self.AUTO:
self.experiment.swap_out()
if exc_val is not None:
logger.error('Something went wrong. Got %s: %s',