You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from .cacheimportDummyAsyncCache, AsyncMultipartMemcache, MockCache, pylibmc
33
-
from .indeximportNoSearch, ElasticSearch
32
+
from .indeximportNoSearch
34
33
from .formatsimportconfigure_formats
35
-
36
34
from .providersimportdefault_providers, default_rewrites
37
-
38
-
try:
39
-
from .providers.url.clientimportNBViewerCurlAsyncHTTPClientasHTTPClientClass
40
-
exceptImportError:
41
-
from .providers.url.clientimportNBViewerSimpleAsyncHTTPClientasHTTPClientClass
35
+
from .providers.url.clientimportNBViewerAsyncHTTPClientasHTTPClientClass
42
36
from .ratelimitimportRateLimiter
43
37
44
38
from .logimportlog_request
@@ -93,6 +87,13 @@ class NBViewer(Application):
93
87
gist_handler=Unicode(default_value="nbviewer.providers.gist.handlers.GistHandler", help="The Tornado handler to use for viewing notebooks stored as GitHub Gists").tag(config=True)
94
88
user_gists_handler=Unicode(default_value="nbviewer.providers.gist.handlers.UserGistsHandler", help="The Tornado handler to use for viewing directory containing all of a user's Gists").tag(config=True)
95
89
90
+
client=Any().tag(config=True)
91
+
@default('client')
92
+
def_default_client(self):
93
+
client=HTTPClientClass()
94
+
client.cache=self.cache
95
+
returnclient
96
+
96
97
index=Any().tag(config=True)
97
98
@default('index')
98
99
def_load_index(self):
@@ -160,15 +161,6 @@ def cache(self):
160
161
161
162
returncache
162
163
163
-
# for some reason this needs to be a computed property,
164
-
# and not a traitlets Any(), otherwise nbviewer won't run
0 commit comments