Show More
@@ -36,6 +36,7 b' class IPyAutocall(object):' | |||||
36 | develop macro-like mechanisms. |
|
36 | develop macro-like mechanisms. | |
37 | """ |
|
37 | """ | |
38 | _ip = None |
|
38 | _ip = None | |
|
39 | rewrite = True | |||
39 | def __init__(self, ip=None): |
|
40 | def __init__(self, ip=None): | |
40 | self._ip = ip |
|
41 | self._ip = ip | |
41 |
|
42 | |||
@@ -51,6 +52,7 b' class IPyAutocall(object):' | |||||
51 | class ExitAutocall(IPyAutocall): |
|
52 | class ExitAutocall(IPyAutocall): | |
52 | """An autocallable object which will be added to the user namespace so that |
|
53 | """An autocallable object which will be added to the user namespace so that | |
53 | exit, exit(), quit or quit() are all valid ways to close the shell.""" |
|
54 | exit, exit(), quit or quit() are all valid ways to close the shell.""" | |
|
55 | rewrite = False | |||
54 |
|
56 | |||
55 | def __call__(self): |
|
57 | def __call__(self): | |
56 | self._ip.ask_exit() |
|
58 | self._ip.ask_exit() |
@@ -894,7 +894,7 b' class AutoHandler(PrefilterHandler):' | |||||
894 | return line |
|
894 | return line | |
895 |
|
895 | |||
896 | force_auto = isinstance(obj, IPyAutocall) |
|
896 | force_auto = isinstance(obj, IPyAutocall) | |
897 | auto_rewrite = True |
|
897 | auto_rewrite = getattr(obj, 'rewrite', True) | |
898 |
|
898 | |||
899 | if pre == ESC_QUOTE: |
|
899 | if pre == ESC_QUOTE: | |
900 | # Auto-quote splitting on whitespace |
|
900 | # Auto-quote splitting on whitespace |
General Comments 0
You need to be logged in to leave comments.
Login now