Show More
@@ -488,22 +488,6 b' class AutoMagicChecker(PrefilterChecker):' | |||||
488 | return self.prefilter_manager.get_handler_by_name('magic') |
|
488 | return self.prefilter_manager.get_handler_by_name('magic') | |
489 |
|
489 | |||
490 |
|
490 | |||
491 | class AliasChecker(PrefilterChecker): |
|
|||
492 |
|
||||
493 | priority = Integer(800, config=True) |
|
|||
494 |
|
||||
495 | def check(self, line_info): |
|
|||
496 | "Check if the initital identifier on the line is an alias." |
|
|||
497 | # Note: aliases can not contain '.' |
|
|||
498 | head = line_info.ifun.split('.',1)[0] |
|
|||
499 | if line_info.ifun not in self.shell.alias_manager \ |
|
|||
500 | or head not in self.shell.alias_manager \ |
|
|||
501 | or is_shadowed(head, self.shell): |
|
|||
502 | return None |
|
|||
503 |
|
||||
504 | return self.prefilter_manager.get_handler_by_name('alias') |
|
|||
505 |
|
||||
506 |
|
||||
507 | class PythonOpsChecker(PrefilterChecker): |
|
491 | class PythonOpsChecker(PrefilterChecker): | |
508 |
|
492 | |||
509 | priority = Integer(900, config=True) |
|
493 | priority = Integer(900, config=True) | |
@@ -591,20 +575,6 b' class PrefilterHandler(Configurable):' | |||||
591 | return "<%s(name=%s)>" % (self.__class__.__name__, self.handler_name) |
|
575 | return "<%s(name=%s)>" % (self.__class__.__name__, self.handler_name) | |
592 |
|
576 | |||
593 |
|
577 | |||
594 | class AliasHandler(PrefilterHandler): |
|
|||
595 |
|
||||
596 | handler_name = Unicode('alias') |
|
|||
597 |
|
||||
598 | def handle(self, line_info): |
|
|||
599 | """Handle alias input lines. """ |
|
|||
600 | transformed = self.shell.alias_manager.expand_aliases(line_info.ifun,line_info.the_rest) |
|
|||
601 | # pre is needed, because it carries the leading whitespace. Otherwise |
|
|||
602 | # aliases won't work in indented sections. |
|
|||
603 | line_out = '%sget_ipython().system(%r)' % (line_info.pre_whitespace, transformed) |
|
|||
604 |
|
||||
605 | return line_out |
|
|||
606 |
|
||||
607 |
|
||||
608 | class MacroHandler(PrefilterHandler): |
|
578 | class MacroHandler(PrefilterHandler): | |
609 | handler_name = Unicode("macro") |
|
579 | handler_name = Unicode("macro") | |
610 |
|
580 |
General Comments 0
You need to be logged in to leave comments.
Login now