コード例 #1
0
 def initialize(config:Configurable):
     AllowPyCommentsBeforeCell.config = config
     AllowPyCommentsBeforeCell.allow_py_comments_before_cell_default = config.allow_py_comments_before_cell
     if config.is_magic is True:
         AllowPyCommentsBeforeCell.allow_py_Comments_before_cell(config.allow_py_comments_before_cell)
     else:
         config.set_trait("allow_py_comments_before_cell", False, force=True)
     
     config.observe(AllowPyCommentsBeforeCell.observe_allow_py_comments_before_cell, names=["allow_py_comments_before_cell"])
     config.observe(AllowPyCommentsBeforeCell.observe_is_magic, names=["is_magic"])
コード例 #2
0
 def initialize(config: Configurable):
     ActivateKernelCommand.config = config
     ActivateKernelCommand.is_kqlmagic_kernel_default = config.kqlmagic_kernel
     if config.is_magic is True:
         if config.kqlmagic_kernel:
             ActivateKernelCommand.execute(True)
     else:
         config.set_trait("kqlmagic_kernel", False, force=True)
     config.observe(ActivateKernelCommand.observe_is_magic,
                    names=["is_magic"])
コード例 #3
0
    def initialize(config: Configurable):
        AllowSingleLineCell.config = config
        AllowSingleLineCell.allow_single_line_cell_default = config.allow_single_line_cell
        if config.is_magic is True:
            AllowSingleLineCell.allow_single_line_cell(
                config.allow_single_line_cell)
        else:
            config.set_trait("allow_single_line_cell", False, force=True)

        config.observe(AllowSingleLineCell.observe_allow_single_line_cell,
                       names=["allow_single_line_cell"])
        config.observe(AllowSingleLineCell.observe_is_magic,
                       names=["is_magic"])