diff --git a/setup.py b/setup.py index b40dcec6b6c9adf1b3dca044873513a503bbfe71..d1259ce6cf220f473f3845ac040efd41346b9df4 100644 --- a/setup.py +++ b/setup.py @@ -109,6 +109,13 @@ scripts = ['visualdl/server/visualdl', 'demo/vdl_create_scratch_log'] if platform == 'win32': scripts.append('visualdl/server/visualDL.bat') +def frontend_package_files(directory): + paths = [] + for (path, directories, filenames) in os.walk(directory): + for filename in filenames: + paths.append(os.path.join(path, filename)) + return paths + setup( name="visualdl", version=VERSION_NUMBER, @@ -120,7 +127,7 @@ setup( install_requires=install_requires, package_data={ 'visualdl.server': - ['dist/*.js', 'dist/*.html', 'dist/fonts/*', 'dist/assets/*'], + [s[len('visualdl/server/'):] for s in frontend_package_files('visualdl/server/dist')], 'visualdl': libraries, 'visualdl.python': diff --git a/visualdl/server/lib.py b/visualdl/server/lib.py index bfd3d66b2671fd6116d5ed69ec611a810ffc3c8d..ab054d05aefdef6a0d11c6c7aeb25a72977c6af5 100644 --- a/visualdl/server/lib.py +++ b/visualdl/server/lib.py @@ -89,17 +89,13 @@ def get_image_tags(storage): with storage.mode(mode) as reader: tags = reader.tags('image') if tags: - result[mode] = {} + result[mode] = [] for tag in tags: image = reader.image(tag) for i in range(max(1, image.num_samples())): caption = tag if image.num_samples( ) <= 1 else '%s/%d' % (tag, i) - result[mode][caption] = { - 'displayName': caption, - 'description': "", - 'samples': 1, - } + result[mode].append(caption) return result @@ -179,11 +175,7 @@ def get_audio_tags(storage): for i in range(max(1, audio.num_samples())): caption = tag if audio.num_samples( ) <= 1 else '%s/%d' % (tag, i) - result[mode][caption] = { - 'displayName': caption, - 'description': "", - 'samples': 1, - } + result[mode].append(caption) return result