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}
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}
$ 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' })
# 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" })
# 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"} )