예제 #1
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}
예제 #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 --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 --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"}
)