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)
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()
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)
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)
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()
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)
def __init__(self, shell=None): Magics.__init__(self, shell) Configurable.__init__(self, config=shell.config)
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'}
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)
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#_$]+')
def __init__(self, shell=None): Configurable.__init__(self, config=shell.config) self._generate_script_magics() Magics.__init__(self, shell=shell) self.job_manager = BackgroundJobManager()
def __init__(self, shell): Configurable.__init__(self, config=shell.config) Magics.__init__(self, shell=shell) self.shell.configurables.append(self)
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)