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
34
from .providersimportdefault_providers, default_rewrites
36
-
37
-
try:
38
-
from .providers.url.clientimportNBViewerCurlAsyncHTTPClientasHTTPClientClass
39
-
exceptImportError:
40
-
from .providers.url.clientimportNBViewerSimpleAsyncHTTPClientasHTTPClientClass
35
+
from .providers.url.clientimportNBViewerAsyncHTTPClientasHTTPClientClass
41
36
from .ratelimitimportRateLimiter
42
37
43
38
from .logimportlog_request
@@ -92,6 +87,13 @@ class NBViewer(Application):
92
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)
93
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)
94
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
+
95
97
index=Any().tag(config=True)
96
98
@default('index')
97
99
def_load_index(self):
@@ -159,15 +161,6 @@ def cache(self):
159
161
160
162
returncache
161
163
162
-
# for some reason this needs to be a computed property,
163
-
# and not a traitlets Any(), otherwise nbviewer won't run
0 commit comments