コード例 #1
0
    def __init__(self, shell):
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
        self.conn = None
コード例 #2
0
ファイル: script.py プロジェクト: pykomke/Kurz_Python_KE
 def __init__(self, shell=None):
     Configurable.__init__(self, config=shell.config)
     self._generate_script_magics()
     Magics.__init__(self, shell=shell)
     self.job_manager = BackgroundJobManager()
     self.bg_processes = []
     atexit.register(self.kill_bg_processes)
コード例 #3
0
    def __init__(self, shell):
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        self.shell.configurables.append(self)
        self.connection, self.engine = None, None
        self.username, self.password, self.account, self.warehouse = None, None, None, None
コード例 #4
0
 def __init__(self, shell=None):
     Configurable.__init__(self, config=shell.config)
     self._generate_script_magics()
     Magics.__init__(self, shell=shell)
     self.job_manager = BackgroundJobManager()
     self.bg_processes = []
     atexit.register(self.kill_bg_processes)
コード例 #5
0
	def __init__(self, shell):
		Configurable.__init__(self, config=shell.config)
		Magics.__init__(self, shell=shell)

		# Add ourself to the list of module configurable via %config
		self.shell.configurables.append(self)

		self.rewriter = Rewriter()
コード例 #6
0
    def __init__(self, shell):  # this is same for all magic extensions
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
        self.connection, self.engine = None, None
        self.username, self.password, self.account = None, None, None
コード例 #7
0
    def __init__(self, shell):

        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
        self.shell.ex('from gcc import ExecutableRunner')
コード例 #8
0
 def __init__(self, shell):
     """Initialize sql_magic as a magic function; and add shell to configurables
     Create connection object."""
     self.shell = shell
     self.caller = None
     self.shell.configurables.append(self)
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.conn = Connection(shell, available_connection_types, no_return_result_exceptions)
コード例 #9
0
 def __init__(self, shell):
     Magics.__init__(self, shell)
     ip = get_ipython()
     self.csd = {}
     ip.user_ns["__csd"] = self.csd
     self.orc = {}
     ip.user_ns["__orc"] = self.orc
     self.sco = {}
     ip.user_ns["__sco"] = self.sco
コード例 #10
0
ファイル: sql_magic.py プロジェクト: CedricArtigue/sql_magic
 def __init__(self, shell):
     """Initialize sql_magic as a magic function; and add shell to configurables
     Create connection object."""
     self.shell = shell
     self.caller = None
     self.shell.configurables.append(self)
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.conn = Connection(shell, available_connection_types, no_return_result_exceptions)
コード例 #11
0
ファイル: csoundmagics.py プロジェクト: fggp/ctcsound
 def __init__(self, shell):
     Magics.__init__(self, shell)
     ip = get_ipython()
     self.csd = {}
     ip.user_ns["__csd"] = self.csd
     self.orc = {}
     ip.user_ns["__orc"] = self.orc
     self.sco = {}
     ip.user_ns["__sco"] = self.sco
コード例 #12
0
    def __init__(self, shell):
        # You must call the parent constructor
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        self._tempdir = None
        self._execution_count = 0

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
コード例 #13
0
    def __init__(self, shell):
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        self._store = []  # Record sequence of SQL invocations
        shell.user_ns[
            '__querylog'] = self._store  # publish as notebook variable

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
コード例 #14
0
        def __init__(self, shell):
            Configurable.__init__(self, config=shell.config)
            Magics.__init__(self, shell=shell)

            MyriaRelation.DefaultConnection = MyriaConnection(
                rest_url=self.rest_url,
                execution_url=self.execution_url,
                timeout=self.timeout)

            self.shell.configurables.append(self)
コード例 #15
0
    def __init__(self, shell):
        # constants
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        set_logger(Logger())

        get_ipython().magic('matplotlib inline')

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)
コード例 #16
0
 def __init__(self, robot_shell):
     Magics.__init__(self, robot_shell.shell)
     self.robot_shell = robot_shell
コード例 #17
0
 def __init__(self, shell):
     Configurable.__init__(self, parent=shell)
     Magics.__init__(self, shell)
     # this adds me to the `%config` list:
     shell.configurables.append(self)
コード例 #18
0
 def __init__(self, shell=None):
     Magics.__init__(self, shell)
     Configurable.__init__(self, config=shell.config)
コード例 #19
0
ファイル: __init__.py プロジェクト: Synthetica9/JMagic
 def __init__(self, shell):
     Magics.__init__(self, shell)
     self.J_sessions = dict()
コード例 #20
0
 def __init__(self, shell, loader=None):
     Magics.__init__(self, shell)
     ImportNbExtensionBase.__init__(self, shell, loader)
コード例 #21
0
ファイル: storemagic.py プロジェクト: AlfiyaZi/ipython
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.shell.configurables.append(self)
     if self.autorestore:
         restore_data(self.shell)
コード例 #22
0
 def __init__(self, shell=None):
     Configurable.__init__(self, config=shell.config)
     self._generate_script_magics()
     Magics.__init__(self, shell=shell)
     self.job_manager = BackgroundJobManager()
コード例 #23
0
ファイル: magic.py プロジェクト: robcast/ipython-cypher
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     # Add ourself to the list of module configurable via %config
     self.shell.configurables.append(self)
     self._legal_cypher_identifier = re.compile(r'^[A-Za-z0-9#_$]+')
コード例 #24
0
 def __init__(self, shell=None, **kwargs):
     Magics.__init__(self, shell=shell, **kwargs)
     self._store = []
     shell.user_ns[store_name] = self._store
コード例 #25
0
ファイル: imongo.py プロジェクト: Bloodevil/ipython_mongo
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.shell.configurables.append(self)
コード例 #26
0
    def __init__(self, shell):
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        # Add self to list of modules configurable via %config
        self.shell.configurables.append(self)
コード例 #27
0
ファイル: sql_magic.py プロジェクト: lpekelis/potoo
 def __init__(self, shell):
     self.shell = shell
     self.shell.configurables.append(self)
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
コード例 #28
0
ファイル: magics.py プロジェクト: rmmilewi/Prove-It
 def __init__(self, shell, assignmentBehaviorModifier):
     # You must call the parent constructor
     Magics.__init__(self, shell)
     ProveItMagicCommands.__init__(self)
     self.assignmentBehaviorModifier = assignmentBehaviorModifier
     assignmentBehaviorModifier.displayAssignments(ip)
コード例 #29
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def __init__(self, shell):
     Configurable.__init__(self, parent=shell)
     Magics.__init__(self, shell)
     # this adds me to the `%config` list:
     shell.configurables.append(self)
コード例 #30
0
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     # Add ourself to the list of module configurable via %config
     self.shell.configurables.append(self)
     self._legal_cypher_identifier = re.compile(r'^[A-Za-z0-9#_$]+')
コード例 #31
0
ファイル: magic.py プロジェクト: jaredly/itreed
    def __init__(self, *a, **k):
        Magics.__init__(self, *a, **k)

        self.modules = {}
コード例 #32
0
ファイル: ipycache.py プロジェクト: jfear/ipycache
 def __init__(self, shell=None):
     Magics.__init__(self, shell)
     Configurable.__init__(self, config=shell.config)
コード例 #33
0
ファイル: magic.py プロジェクト: alope107/spark-sql-magic
 def __init__(self, shell):
     Magics.__init__(self, shell=shell)
     self.context = None
     self.user_ns = None
コード例 #34
0
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.shell.configurables.append(self)
     if self.autorestore:
         restore_data(self.shell)
コード例 #35
0
 def __init__(self, robot_shell):
     Magics.__init__(self, robot_shell.shell)
     self.robot_shell = robot_shell
コード例 #36
0
ファイル: __init__.py プロジェクト: siofongwong/iampl
 def __init__(self, shell):
     Magics.__init__(self, shell)
     self.process = None
     self.entities = {}
コード例 #37
0
ファイル: __init__.py プロジェクト: vitaut/iampl
 def __init__(self, shell):
     Magics.__init__(self, shell)
     self.process = None
     self.entities = {}
コード例 #38
0
ファイル: script.py プロジェクト: kbrooks/ipython
 def __init__(self, shell=None):
     Configurable.__init__(self, config=shell.config)
     self._generate_script_magics()
     Magics.__init__(self, shell=shell)
     self.job_manager = BackgroundJobManager()
コード例 #39
0
    def __init__(self, shell):
        # constants
        Configurable.__init__(self, config=shell.config)
        Magics.__init__(self, shell=shell)

        set_logger(Logger())

        get_ipython().magic("matplotlib inline")

        # Add ourself to the list of module configurable via %config
        self.shell.configurables.append(self)

        ip = get_ipython()
        kql_magic_load_mode = _get_kql_magic_load_mode()

        if kql_magic_load_mode != "silent":
            html_str = """<html>
            <head>
            <style>
            .kqlmagic-banner {
                display: flex; 
                background-color: #d9edf7;
            }
            .kqlmagic-banner > div {
                margin: 10px; 
                padding: 20px; 
                color: #3a87ad; 
                font-size: 13px;
            }
            </style>
            </head>
            <body>
                <div class='kqlmagic-banner'>
                    <div><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH8AAAB9CAIAAAFzEBvZAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAC8ALABpv+tl0gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAAd0SU1FB+AHBRQ2KY/vn7UAAAk5SURBVHja7V3bbxxXGT/fuc9tdz22MW7t5KFxyANRrUQ8IPFQqQihSLxERBQhVUU0qDZ1xKVJmiCBuTcpVdMkbUFFRQIJRYrUB4r6CHIRpU1DaQl/AH9BFYsGbO/MOTxMPGz2MjuzO7M7sz7f0+zszJzv+32X8507PPjJFZSFMMpI3V945sLX3vzLxa5/0fjq/VsvpSmBJv/d9pXlw6upZFg+vLp8eLWLDNHd+L+26yAIugi9fHi1qzBaq9u3b3d54f1bL7V+NS4EAM/MzPSEte2dnihFzCTjmw1WhBC02tK16+cOHJinlCYwBmMyvgQaF0u//d3pXtq4i+A7Ny8JwTP4Q9enO50hrQytGsSdjhL/3fpcGIY9he4q7ubmptaqv/HFhfi+D4BTOVCSHob1h65v3mN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jD7GZBfxPqMguIRmPuLNNAa3fwBCCKWUMcY5F0IIITjnse33HYDC5YwzIz7WZxgFYIzJvdS2PVN527rv3HxhmPhQKjXEVJmeBiHYzb9fSVZAhXRQvX4eSsl7H1y9dv38ZDhBxdCPWiiHDi38+a1n95oCStTH6XlO337/CdNBsfn+AJn7RPYkV8D29yAZ9A36Bn1Dk1brjp2G3Oex6BTA2L6JPAZ9Q7lQpvbggHH/o4+2giDY2moGQaiUphQ4Z4RQIQjnLFpTWIblFSVvGw+I/mc+/e2u93/2zFfvu3/Gn3ZrNZtzChAdo4AJuasPs+ilwJzn3NO/7vvMtevnpaRCMAAkBKOUAGDGCEKodT/MaMVor73pDfoD0iMnfpr8wLeeOu7YTErputL33XqjJgSzbSqliLQCgAEmQTFlzPef//lryQ88d+mkY0vblp5nSYtJyaNF6wCIMRIN9VUC/cnZGYwQjDFBSDWbobH9UVMYqhLuDG3yfYO+IYO+Qd+QQd+gb8igb9A36BsaPf0PJmoM1QL6Q/4AAAAASUVORK5CYII='></div>
                    <div>
                        <p>Kusto is a log analytics cloud platform optimized for ad-hoc big data queries. Read more about it here: http://aka.ms/kdocs</p>
                        <p>   &bull; kql language reference: Click on 'Help' tab > and Select 'kql referece'<br>
                          &bull; Kqlmagic configuarion: Run in cell '%config kqlmagic'<br>
                          &bull; Kqlmagic syntax: Run in cell '%kql?'<br>
                          &bull; Kqlmagic upgrate syntax: Run 'pip install git+git://github.com/Microsoft/jupyter-Kqlmagic.git --upgrade'<br>
                    </div>
                </div>
            </body>
            </html>"""
            Display.show_html(html_str)
            Display.showInfoMessage(
                """Kqlmagic package is updated frequently. Run pip install Kqlmagic --upgrade to use the latest version.<br>Kqlmagic version: """
                + VERSION +
                """, source: https://github.com/Microsoft/jupyter-Kqlmagic""")
            # <div><img src='https://az818438.vo.msecnd.net/icons/kusto.png'></div>
        _override_default_configuration(ip, kql_magic_load_mode)

        root_path = get_ipython().starting_dir.replace("\\", "/")

        folder_name = ip.run_line_magic("config", "Kqlmagic.temp_folder_name")
        showfiles_folder_Full_name = root_path + "/" + folder_name
        if not os.path.exists(showfiles_folder_Full_name):
            os.makedirs(showfiles_folder_Full_name)
        # ipython will removed folder at shutdown or by restart
        ip.tempdirs.append(showfiles_folder_Full_name)
        Display.showfiles_base_path = root_path
        Display.showfiles_folder_name = folder_name
        Display.notebooks_host = Help_html.notebooks_host = os.getenv(
            "AZURE_NOTEBOOKS_HOST")

        app = ip.run_line_magic("config", "Kqlmagic.notebook_app")
        # add help link
        add_kql_ref_to_help = ip.run_line_magic(
            "config", "Kqlmagic.add_kql_ref_to_help")
        if add_kql_ref_to_help:
            Help_html.add_menu_item("kql Reference",
                                    "http://aka.ms/kdocs",
                                    notebook_app=app)
        if app is None or app != "jupyterlab":
            display(
                Javascript(
                    """IPython.notebook.kernel.execute("NOTEBOOK_URL = '" + window.location + "'");"""
                ))
            time.sleep(5)
コード例 #40
0
ファイル: magic.py プロジェクト: alope107/spark-sql-magic
 def __init__(self, shell):
     Magics.__init__(self, shell=shell)
     self.context = None
     self.user_ns = None