Eric Li | e0493a4 | 2010-11-15 13:05:43 -0800 | [diff] [blame^] | 1 | AUTHOR = "Steve Howard <showard@google.com>" |
| 2 | TIME = "SHORT" |
| 3 | NAME = "Sample - Autotest console" |
| 4 | TEST_TYPE = "client" |
| 5 | TEST_CLASS = "Kernel" |
| 6 | TEST_CATEGORY = "Functional" |
| 7 | |
| 8 | DOC = """ |
| 9 | Gives you an interactive interpreter within an autotest control file. |
| 10 | |
| 11 | If you install IPython (http://ipython.scipy.org/, Ubuntu and Fedora's package |
| 12 | "ipython"), you'll get a snazzy IPython console with readline and completion |
| 13 | and all that. Otherwise you'll get a simple python console. |
| 14 | |
| 15 | The point of this control file is to give you an interactive interpreter with |
| 16 | all autotest 'magic' loaded in, so you can inspect objects and have fun. |
| 17 | """ |
| 18 | |
| 19 | try: |
| 20 | import IPython |
| 21 | ipshell = IPython.Shell.IPShellEmbed(argv=[], banner='autotest console') |
| 22 | ipshell() |
| 23 | except ImportError: |
| 24 | import code |
| 25 | code.interact('autotest console', raw_input) |