diff --git a/bin/visual_dl.py b/bin/visual_dl.py index a43f577194cb13fbc5f62f0f01b31bbe25840ed0..3efef160cbc8561bdac0e01307c9975f8194c4c6 100644 --- a/bin/visual_dl.py +++ b/bin/visual_dl.py @@ -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)) diff --git a/python/__init__.py b/python/__init__.py deleted file mode 100644 index f91720ab47353c1f2c760297d915963310326c2d..0000000000000000000000000000000000000000 --- a/python/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -import log -import tensorboard -import timer -import util - -__all__ = [ - 'log', - 'util' -] diff --git a/python/log.py b/python/log.py deleted file mode 100644 index 5199e96e2dc3b8315e0ada1e424873f01260bd26..0000000000000000000000000000000000000000 --- a/python/log.py +++ /dev/null @@ -1,7 +0,0 @@ -import logging - -logger = logging - -logger.basicConfig( - format='[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s') -logger.getLogger().setLevel(logging.INFO) diff --git a/python/util.py b/python/util.py deleted file mode 100644 index df328d81b229a614de3ac45d3da5c57370e0b2b2..0000000000000000000000000000000000000000 --- a/python/util.py +++ /dev/null @@ -1,34 +0,0 @@ -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() diff --git a/setup.py b/setup.py index 837f823c64ba6b73f764b9db943975260806435d..fd6b7b9346955f91d9513eeb0f994fdbcee35325 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ 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'