コード例 #1
0
ファイル: test_konch.py プロジェクト: OdinsHat/konch
def test_named_config_adds_to_registry():
    assert konch._config_registry['default'] == konch._cfg
    assert len(konch._config_registry.keys()) == 1
    konch.named_config('mynamespace', {'context': {'foo': 42}})
    assert len(konch._config_registry.keys()) == 2
    # reset config_registry
    konch._config_registry = {'default': konch._cfg}
コード例 #2
0
def test_named_config_adds_to_registry():
    assert konch._config_registry['default'] == konch._cfg
    assert len(konch._config_registry.keys()) == 1
    konch.named_config('mynamespace', {'context': {'foo': 42}})
    assert len(konch._config_registry.keys()) == 2
    # reset config_registry
    konch._config_registry = {'default': konch._cfg}
コード例 #3
0
ファイル: test_konch.py プロジェクト: zlksnk/konch
def test_named_config_adds_to_registry():
    assert konch._config_registry["default"] == konch._cfg
    assert len(konch._config_registry.keys()) == 1
    konch.named_config("mynamespace", {"context": {"foo": 42}})
    assert len(konch._config_registry.keys()) == 2
    # reset config_registry
    konch._config_registry = {"default": konch._cfg}
コード例 #4
0
ファイル: test_konch.py プロジェクト: sloria/konch
def test_named_config_adds_to_registry():
    assert konch._config_registry["default"] == konch._cfg
    assert len(konch._config_registry.keys()) == 1
    konch.named_config("mynamespace", {"context": {"foo": 42}})
    assert len(konch._config_registry.keys()) == 2
    # reset config_registry
    konch._config_registry = {"default": konch._cfg}
コード例 #5
0
ファイル: konch_named.py プロジェクト: thedrow/konch
    $ konch --name=trig

or

    $ konch -n trig
"""
import os
import sys
import math


import konch

# the default config
konch.config({
    'context': [os, sys],
    'banner': 'The default shell'
})

# A named config
konch.named_config('trig', {
    'context': [math.sin, math.tan, math.cos],
    'banner': 'The trig shell'
})

konch.named_config('func', {
    'context': [math.gamma, math.exp, math.log],
    'banner': 'The func shell'
})
コード例 #6
0
# vi: set ft=python :
"""Example .konchrc with named configs.

To use a named config, run:

    $ konch --name=trig

or

    $ konch -n trig
"""
import os
import sys
import math

import konch

# the default config
konch.config({"context": [os, sys], "banner": "The default shell"})

# A named config
konch.named_config("trig", {
    "context": [math.sin, math.tan, math.cos],
    "banner": "The trig shell"
})

konch.named_config("func", {
    "context": [math.gamma, math.exp, math.log],
    "banner": "The func shell"
})
コード例 #7
0
ファイル: konch_named.py プロジェクト: OdinsHat/konch
    $ konch --name=trig

or

    $ konch -n trig
"""
import os
import sys
import math


import konch

# the default config
konch.config({
    'context': [os, sys],
    'banner': 'The default shell'
})

# A named config
konch.named_config('trig', {
    'context': [math.sin, math.tan, math.cos],
    'banner': 'The trig shell'
})

konch.named_config('func', {
    'context': [math.gamma, math.exp, math.log],
    'banner': 'The func shell'
})
コード例 #8
0
ファイル: konch_named.py プロジェクト: sloria/konch
# vi: set ft=python :
"""Example .konchrc with named configs.

To use a named config, run:

    $ konch --name=trig

or

    $ konch -n trig
"""
import os
import sys
import math


import konch

# the default config
konch.config({"context": [os, sys], "banner": "The default shell"})

# A named config
konch.named_config(
    "trig", {"context": [math.sin, math.tan, math.cos], "banner": "The trig shell"}
)

konch.named_config(
    "func", {"context": [math.gamma, math.exp, math.log], "banner": "The func shell"}
)