コード例 #1
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)
コード例 #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
ファイル: extension.py プロジェクト: helgag/myria-python
        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
ファイル: extension.py プロジェクト: tomerk/myria-python
        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
ファイル: test_configurable.py プロジェクト: bworg/emacs.d
 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
ファイル: linter.py プロジェクト: mattvonrocketstein/smash
 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
ファイル: test_configurable.py プロジェクト: bworg/emacs.d
 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
ファイル: magic.py プロジェクト: crabhi/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#_$]+')
コード例 #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
ファイル: 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)
コード例 #15
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)
コード例 #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
ファイル: magic.py プロジェクト: bopopescu/SourceCodeReading
    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
ファイル: 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)