本文整理匯總了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'))