本文整理汇总了Python中klein.Klein.config方法的典型用法代码示例。如果您正苦于以下问题:Python Klein.config方法的具体用法?Python Klein.config怎么用?Python Klein.config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类klein.Klein
的用法示例。
在下文中一共展示了Klein.config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Klein
# 需要导入模块: from klein import Klein [as 别名]
# 或者: from klein.Klein import config [as 别名]
import ConfigParser
from twisted.python import log
import sys
from leap.common.events import server as events_server
from pixelated.config import app_factory
import pixelated.config.args as input_args
import pixelated.bitmask_libraries.register as leap_register
from pixelated.bitmask_libraries.leap_srp import LeapAuthException
import pixelated.config.credentials_prompt as credentials_prompt
import pixelated.support.ext_protobuf # monkey patch for protobuf in OSX
import pixelated.support.ext_sqlcipher # monkey patch for sqlcipher in debian
app = Klein()
app.config = {}
def setup():
args = input_args.parse()
setup_debugger(args.debug)
if args.register:
register(*args.register[::-1])
else:
if args.dispatcher:
config = fetch_credentials_from_dispatcher(args.dispatcher)
app.config['LEAP_SERVER_NAME'] = config['leap_provider_hostname']
app.config['LEAP_USERNAME'] = config['user']
app.config['LEAP_PASSWORD'] = config['password']
else: