本文整理汇总了Python中settings.Settings.getSetting方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.getSetting方法的具体用法?Python Settings.getSetting怎么用?Python Settings.getSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.getSetting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Settings
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getSetting [as 别名]
import tornado.ioloop
import tornado.web
from dispatcher import Dispatcher
from settings import Settings
import uuid
settings = Settings()
class MainHandler(tornado.web.RequestHandler):
def get(self):
dispatch = Dispatcher(str(uuid.uuid4()))
self.write(dispatch.getIdentifier())
print (self.get_argument("q"))
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app = make_app()
app.listen(settings.getSetting("portNum"))
tornado.ioloop.IOLoop.current().start()
示例2: Flask
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getSetting [as 别名]
from alias_decoder import AliasDecoder
from flask import Flask
from query_parser import QueryParser
from query_handler import QueryHandler
from settings import Settings
app = Flask(__name__)
aliases = AliasDecoder(Settings.getSetting('ALIASES_FILE_NAME')).aliases
@app.route('/alias/<string:query>', methods=['GET'])
def get_route_for_alias(query):
handler = QueryHandler(QueryParser(query))
return handler.handle_query(aliases)
示例3: __backup_search
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getSetting [as 别名]
def __backup_search(self):
return redirect('{0}{1}'.format(Settings.getSetting('BACKUP_SEARCH_BASE'), self.query_parser.query))