Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py/visdom/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2.post1
0.2.3
5 changes: 3 additions & 2 deletions py/visdom/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ def load_layouts(self):
RuntimeWarning
)
return ""
layout_filepath = os.path.join(self.env_path, 'view', LAYOUT_FILE)
ensure_dir_exists(layout_filepath)
layout_dir = os.path.join(self.env_path, 'view')
layout_filepath = os.path.join(layout_dir, LAYOUT_FILE)
if os.path.isfile(layout_filepath):
with open(layout_filepath, 'r') as fn:
return fn.read()
else:
ensure_dir_exists(layout_dir)
return ""

def load_state(self):
Expand Down
2 changes: 1 addition & 1 deletion py/visdom/server/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import visdom
from urllib import request
from urllib.error import HTTPError, URLError
from visdom.utils.shared_utils import ensure_dir_exists, get_visdom_path
from visdom.utils.shared_utils import get_visdom_path


def download_scripts(proxies=None, install_dir=None):
Expand Down
1 change: 1 addition & 0 deletions py/visdom/server/run_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def start_server(port=DEFAULT_PORT, hostname=DEFAULT_HOSTNAME,
else:
app.listen(port, max_buffer_size=1024 ** 3)
logging.info("Application Started")
logging.info(f"Working directory: {os.path.abspath(env_path)}")

if "HOSTNAME" in os.environ and hostname == DEFAULT_HOSTNAME:
hostname = os.environ["HOSTNAME"]
Expand Down
3 changes: 1 addition & 2 deletions py/visdom/utils/server_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
from visdom.utils.shared_utils import (
warn_once,
get_rand_id,
get_new_window_id,
ensure_dir_exists,
get_new_window_id
)


Expand Down
4 changes: 2 additions & 2 deletions py/visdom/utils/shared_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def get_new_window_id():


def ensure_dir_exists(path):
"""Make sure the parent dir exists for path so we can write a file."""
"""Make sure the dir exists so we can write a file."""
try:
os.makedirs(os.path.dirname(os.path.abspath(path)))
os.makedirs(os.path.abspath(path))
except OSError as e1:
assert e1.errno == 17 # errno.EEXIST

Expand Down