##// END OF EJS Templates
Format with `black`
Emilio Graff -
Show More
@@ -519,26 +519,40 b' class AutoreloadMagics(Magics):'
519
519
520 @line_magic
520 @line_magic
521 @magic_arguments.magic_arguments()
521 @magic_arguments.magic_arguments()
522 @magic_arguments.argument('mode', type=str, default='now', nargs='?',
522 @magic_arguments.argument(
523 help="""
523 "mode",
524 blank or 'now' - Reload all modules (except those excluded by
524 type=str,
525 %%aimport) automaticallynow.
525 default="now",
526
526 nargs="?",
527 '0' or 'off' - Disable automatic reloading.
527 help="""blank or 'now' - Reload all modules (except those excluded by %%aimport)
528
528 automatically now.
529 '1' or 'explicit' - Reload only modules imported with %%aimport every
529
530 time before executing the Python code typed.
530 '0' or 'off' - Disable automatic reloading.
531
531
532 '2' or 'all' - Reload all modules (except those excluded by %%aimport)
532 '1' or 'explicit' - Reload only modules imported with %%aimport every
533 every time before executing the Python code typed.
533 time before executing the Python code typed.
534
534
535 '3' or 'complete' - Same as 2/all, but also but also adds any new
535 '2' or 'all' - Reload all modules (except those excluded by %%aimport)
536 objects in the module.
536 every time before executing the Python code typed.
537 """)
537
538 @magic_arguments.argument('-p', '--print', action='store_true', default=False,
538 '3' or 'complete' - Same as 2/all, but also but also adds any new
539 help='Show autoreload activity using `print` statements')
539 objects in the module.
540 @magic_arguments.argument('-l', '--log', action='store_true', default=False,
540 """,
541 help='Show autoreload activity using the logger')
541 )
542 @magic_arguments.argument(
543 "-p",
544 "--print",
545 action="store_true",
546 default=False,
547 help="Show autoreload activity using `print` statements",
548 )
549 @magic_arguments.argument(
550 "-l",
551 "--log",
552 action="store_true",
553 default=False,
554 help="Show autoreload activity using the logger",
555 )
542 def autoreload(self, line=""):
556 def autoreload(self, line=""):
543 r"""%autoreload => Reload modules automatically
557 r"""%autoreload => Reload modules automatically
544
558
@@ -593,10 +607,10 b' class AutoreloadMagics(Magics):'
593 """
607 """
594 args = magic_arguments.parse_argstring(self.autoreload, line)
608 args = magic_arguments.parse_argstring(self.autoreload, line)
595 mode = args.mode.lower()
609 mode = args.mode.lower()
596
610
597 def p(msg):
611 def p(msg):
598 print(msg)
612 print(msg)
599
613
600 def l(msg):
614 def l(msg):
601 logging.getLogger("autoreload").info(msg)
615 logging.getLogger("autoreload").info(msg)
602
616
General Comments 0
You need to be logged in to leave comments. Login now