File tree 4 files changed +8
-8
lines changed
tests/test_core/test_graph_reference
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import os
8
8
import re
9
- from pkg_resources import resource_string
9
+ import pkgutil
10
10
11
11
import six
12
12
from requests .compat import json as _json
@@ -69,7 +69,7 @@ def get_graph_reference():
69
69
70
70
"""
71
71
path = os .path .join ('package_data' , 'plot-schema.json' )
72
- s = resource_string ('plotly' , path ).decode ('utf-8' )
72
+ s = pkgutil . get_data ('plotly' , path ).decode ('utf-8' )
73
73
graph_reference = utils .decode_unicode (_json .loads (s ))
74
74
75
75
# TODO: Patch in frames info until it hits streambed. See #659
Original file line number Diff line number Diff line change 8
8
import os
9
9
import uuid
10
10
import warnings
11
- from pkg_resources import resource_string
11
+ import pkgutil
12
12
import time
13
13
import webbrowser
14
14
@@ -38,7 +38,7 @@ def download_plotlyjs(download_url):
38
38
39
39
def get_plotlyjs ():
40
40
path = os .path .join ('package_data' , 'plotly.min.js' )
41
- plotlyjs = resource_string ('plotly' , path ).decode ('utf-8' )
41
+ plotlyjs = pkgutil . get_data ('plotly' , path ).decode ('utf-8' )
42
42
return plotlyjs
43
43
44
44
def get_image_download_script (caller ):
Original file line number Diff line number Diff line change 5
5
from __future__ import absolute_import
6
6
7
7
import os
8
- from pkg_resources import resource_string
9
8
from unittest import TestCase
10
9
11
10
from nose .plugins .attrib import attr
Original file line number Diff line number Diff line change 4
4
"""
5
5
import uuid
6
6
from collections import deque
7
- from pkg_resources import resource_string
7
+ import pkgutil
8
8
9
9
from requests .compat import json as _json
10
10
20
20
# Load JS widget code
21
21
# No officially recommended way to do this in any other way
22
22
# http://mail.scipy.org/pipermail/ipython-dev/2014-April/013835.html
23
- js_widget_code = resource_string ('plotly' ,
24
- 'package_data/graphWidget.js' ).decode ('utf-8' )
23
+ js_widget_code = pkgutil .get_data ('plotly' ,
24
+ 'package_data/graphWidget.js'
25
+ ).decode ('utf-8' )
25
26
26
27
display (Javascript (js_widget_code ))
27
28
You can’t perform that action at this time.
0 commit comments