本文整理汇总了Python中config.PORT属性的典型用法代码示例。如果您正苦于以下问题:Python config.PORT属性的具体用法?Python config.PORT怎么用?Python config.PORT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类config
的用法示例。
在下文中一共展示了config.PORT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: redis_get
# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def redis_get(rediskey):
redis_statement="""for i in {{0..15}};do redis-cli -h {host} -p {port} -n ${{i}} keys '{rediskey}'|sed '/^$/d';done|while read j;do echo -e "\\"$j\\":"; for k in {{0..15}};do redis-cli -h {host} -p {port} -n ${{k}} get $j |sed '/^$/d'|awk '{{printf "\\"%s\\"",$1}}';done ;echo ',';done""".format(rediskey=rediskey,host=HOST, port=PORT)
p = Popen(redis_statement, stdout=PIPE, shell=True)
stdout, stderr = p.communicate()
r = stdout.decode()
r="".join(r.replace('\n',''))
r=r.rstrip(",")
r="{"+r+"}"
return r
示例2: run
# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def run(self):
logging.getLogger('tornado.access').disabled = True # Disabling Tornado local logging
ws_app = Application(self.agentQueue)
server = tornado.httpserver.HTTPServer(ws_app)
server.listen(config.PORT)
tornado.ioloop.IOLoop.instance().start()
示例3: welcome_page
# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def welcome_page():
# TODO: Allow extending the current pause without unpausing
c = rpyc.connect("localhost", PORT)
if c.root.is_paused():
return render_template("welcome_page_quiet.html",
resume=c.root.get_resume_time())
else:
return render_template("welcome_page.html")
示例4: pause_page
# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def pause_page():
# TODO: Perform some type of validation of pause_duration?
pause_duration = request.form["duration"]
c = rpyc.connect("localhost", PORT)
c.root.pause(pause_duration)
return redirect(url_for('welcome_page'))
示例5: unpause_page
# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def unpause_page():
c = rpyc.connect("localhost", PORT)
c.root.resume()
return redirect(url_for('welcome_page'))