diff options
author | André Erdmann <dywi@mailerd.de> | 2013-07-24 17:50:07 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2013-07-24 17:50:33 +0200 |
commit | ab6e6efd260a868f27c9b27b85417d2ba96cd769 (patch) | |
tree | bb0d7c8912d27668c6850a4f2b1d38da265df8d1 /roverlay/console | |
parent | debug-scripts/nosync-rforge: print repo info (diff) | |
download | R_overlay-ab6e6efd260a868f27c9b27b85417d2ba96cd769.tar.gz R_overlay-ab6e6efd260a868f27c9b27b85417d2ba96cd769.tar.bz2 R_overlay-ab6e6efd260a868f27c9b27b85417d2ba96cd769.zip |
roverlay/console: support "with" statement
Diffstat (limited to 'roverlay/console')
-rw-r--r-- | roverlay/console/base.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/roverlay/console/base.py b/roverlay/console/base.py index acd4ca0..a3717c9 100644 --- a/roverlay/console/base.py +++ b/roverlay/console/base.py @@ -76,4 +76,12 @@ class MainConsole ( RoverlayConsole ): retry = self._want_resume() # --- end of run_forever (...) --- + def __enter__ ( self ): + return self + # --- end of __enter__ (...) --- + + def __exit__ ( self, *args, **kwargs ): + self.close() + # --- end of __exit__ (...) --- + # --- end of MainConsole --- |