提交 b66fdea6 编写于 作者: Q qiaolongfei

rm ununsed code

上级 485623c4
......@@ -6,7 +6,7 @@ from optparse import OptionParser
from flask import Flask
from flask import request
from visual_dl.log import logger
from visualdl.log import logger
app = Flask(__name__)
......@@ -54,18 +54,6 @@ def index():
return json.dumps(result)
@app.route('/v1/scalar/start')
def start_board():
"""
:return:
"""
app_id = request.args.get('app_id')
summary_dir = request.args.get('summary_dir')
result = gen_result(status=1, msg="please set app_id and summary_dir")
return json.dumps(result)
if __name__ == '__main__':
options, args = option_parser()
logger.info(" port=" + str(options.port))
......
import log
import tensorboard
import timer
import util
__all__ = [
'log',
'util'
]
import logging
logger = logging
logger.basicConfig(
format='[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s')
logger.getLogger().setLevel(logging.INFO)
import socket
def is_open(port):
local_ip = '127.0.0.1'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((local_ip, int(port)))
s.shutdown(2)
return True
except:
return False
def get_hostname():
return socket.gethostname()
def find_unused_port():
"""
get a unused port of this machine
:return: available port
"""
min_port = 7000
max_port = 7999
aval_port = None
for port in range(min_port, max_port):
if not is_open(port):
aval_port = port
break
return aval_port
if __name__ == '__main__':
print find_unused_port()
from setuptools import setup
setup(name="VisualDL",
setup(name="visualdl",
version="0.0.1",
packages=['python'],
packages=['visualdl'],
include_package_data=True,
install_requires=[
'flask>=0.12.1'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册