Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37b1464

Browse files
committed
Add resources file locating all non-python files.
1 parent 1b3766d commit 37b1464

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

plotly/resources.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
This module defines where non-python source files are located.
3+
4+
All paths are relative to sys.prefix. This is why they are in a plotly-specific
5+
'plotly-data' directory.
6+
7+
"""
8+
import os
9+
10+
# This is relative to `sys.prefix`. We store non-python files here.
11+
DATA_DIR = 'plotly-data'
12+
13+
# For graph object definitions and local error handling
14+
GRAPH_REFERENCE_DIR = os.path.join(DATA_DIR, 'graph_reference')
15+
GRAPH_REFERENCE_GRAPH_OBJS_META = 'plotly/graph_reference/graph_objs_meta.json'
16+
GRAPH_REFERENCE_KEY_TO_NAME = 'plotly/graph_reference/KEY_TO_NAME.json'
17+
GRAPH_REFERENCE_NAME_TO_KEY = 'plotly/graph_reference/NAME_TO_KEY.json'
18+
GRAPH_REFERENCE_OBJ_MAP = 'plotly/graph_reference/OBJ_MAP.json'
19+
GRAPH_REFERENCE_FILES = [GRAPH_REFERENCE_GRAPH_OBJS_META,
20+
GRAPH_REFERENCE_KEY_TO_NAME,
21+
GRAPH_REFERENCE_NAME_TO_KEY,
22+
GRAPH_REFERENCE_OBJ_MAP]
23+
24+
# For IPython widget support
25+
WIDGETS_DIR = os.path.join(DATA_DIR, 'widgets')
26+
WIDGETS_MAIN_JS = 'plotly/widgets/graphWidget.js'
27+
WIDGETS_FILES = [WIDGETS_MAIN_JS]

0 commit comments

Comments
 (0)