示例#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
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
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
# 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"}
)