예제 #1
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)
예제 #2
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)
예제 #3
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()
예제 #4
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)
예제 #5
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)
예제 #6
0
 def test_custom(self):
     config = Config()
     config.foo = 'foo'
     config.bar = 'bar'
     c1 = Configurable(config=config)
     c2 = Configurable(config=c1.config)
     c3 = Configurable(config=c2.config)
     self.assertEquals(c1.config, config)
     self.assertEquals(c2.config, config)
     self.assertEquals(c3.config, config)
     # Test that copies are not made
     self.assert_(c1.config is config)
     self.assert_(c2.config is config)
     self.assert_(c3.config is config)
     self.assert_(c1.config is c2.config)
     self.assert_(c2.config is c3.config)
예제 #7
0
 def __init__(self, config, cmd_exec=None):
     if cmd_exec == None:
         cmd_exec = os.system
     self.cmd_exec = cmd_exec
     Configurable.__init__(self, config=config)
     self.init_logger()
예제 #8
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)
예제 #9
0
파일: ipycache.py 프로젝트: ihrke/ipycache
 def __init__(self, shell=None):
     Magics.__init__(self, shell)
     Configurable.__init__(self, config=shell.config)
예제 #10
0
from sql.parse import parse
from six.moves import configparser
from IPython.config.configurable import Configurable

empty_config = Configurable()


def test_parse_no_sql():
    assert parse("will:longliveliz@localhost/shakes", empty_config) == \
           {'connection': "will:longliveliz@localhost/shakes",
            'sql': ''}


def test_parse_with_sql():
    assert parse("postgresql://*****:*****@localhost/shakes SELECT * FROM work",
                 empty_config) == \
           {'connection': "postgresql://*****:*****@localhost/shakes",
            'sql': 'SELECT * FROM work'}


def test_parse_sql_only():
    assert parse("SELECT * FROM work", empty_config) == \
           {'connection': "",
            'sql': 'SELECT * FROM work'}


def test_parse_postgresql_socket_connection():
    assert parse("postgresql:///shakes SELECT * FROM work", empty_config) == \
           {'connection': "postgresql:///shakes",
            'sql': 'SELECT * FROM work'}
예제 #11
0
 def test_default(self):
     c1 = Configurable()
     c2 = Configurable(config=c1.config)
     c3 = Configurable(config=c2.config)
     self.assertEquals(c1.config, c2.config)
     self.assertEquals(c2.config, c3.config)
예제 #12
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#_$]+')
예제 #13
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()
예제 #14
0
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.shell.configurables.append(self)
예제 #15
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)
예제 #16
0
 def __init__(self, shell=None):
     Magics.__init__(self, shell)
     Configurable.__init__(self, config=shell.config)
예제 #17
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()
예제 #18
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)
예제 #19
0
 def __init__(self, shell):
     Configurable.__init__(self, config=shell.config)
     Magics.__init__(self, shell=shell)
     self.shell.configurables.append(self)