本文整理汇总了Python中context.Context.get_skin方法的典型用法代码示例。如果您正苦于以下问题:Python Context.get_skin方法的具体用法?Python Context.get_skin怎么用?Python Context.get_skin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类context.Context
的用法示例。
在下文中一共展示了Context.get_skin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def get(domain, function=False, **kwargs):
"""
Get a single piece of data. function needs to be true if you want
a callable.
"""
return Context.get_skin(function=function).get(domain, **kwargs)
示例2: wrap
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def wrap(*args, **kwargs):
# Convert all positional arguments to kwargs
argdic = dict(zip(fn.__code__.co_varnames, args))
kw = (Context.get_skin(function=False).get(DEFAULTS_DOMAIN) or {}).copy()
kw.update(kwargs)
kw.update(argdic)
return fn(**kw)
示例3: get_fn
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def get_fn(name, domain=None, **kw):
"""
Access functions in a domain.
"""
d = Context.get_skin(function=True)[domain or name]
try:
return d[name]
except TypeError:
return d
示例4: append
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def append(domain, value, function=False, **kwargs):
return Context.get_skin(function=function).append(domain, value, **kwargs)
示例5: set
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def set(domain, value, function=False):
Context.get_skin(function=function)[domain] = value
示例6: attribute_resolvers
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def attribute_resolvers():
"""
Get a list of the attribute resolvers available.
"""
Context.get_skin(function=True)["resolvers"]
示例7: jsondump
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import get_skin [as 别名]
def jsondump():
return Context.get_skin(function=False).dump()