Skip to content

Commit 73e3b1a

Browse files
committed
Attempted fix for PyCurl installation issue plus correspondingly updated documentation.
1 parent 040ce61 commit 73e3b1a

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $ docker-compose up
8484

8585
### Local Installation
8686

87-
The Notebook Viewer requires several binary packages to be installed on your system. The primary ones are `libmemcached-dev libcurl4-openssl-dev pandoc libevent-dev`. Package names may differ on your system, see [salt-states](https://github.com/rgbkrk/salt-states-nbviewer/blob/master/nbviewer/init.sls) for more details.
87+
The Notebook Viewer requires several binary packages to be installed on your system. The primary ones are `libmemcached-dev libcurl4-openssl-dev pandoc libevent-dev libgnutls28-dev`. Package names may differ on your system, see [salt-states](https://github.com/rgbkrk/salt-states-nbviewer/blob/master/nbviewer/init.sls) for more details.
8888

8989
If they are installed, you can install the required Python packages via pip.
9090

nbviewer/handlers.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,18 @@ def get_provider_rewrites(self):
7676
#-----------------------------------------------------------------------------
7777

7878
def format_handlers(formats, urlspecs, **handler_settings):
79+
"""
80+
Tornado handler URLSpec of form (route, handler_class, initalize_kwargs)
81+
https://www.tornadoweb.org/en/stable/web.html#tornado.web.URLSpec
82+
kwargs passed to initialize are None by default but can be added
83+
https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.initialize
84+
"""
7985
urlspecs = [
8086
(prefix + url, handler, {
8187
"format": format,
8288
"format_prefix": prefix
8389
})
8490
for format in formats
85-
# Tornado handler URLSpec of form (route, handler_class, initalize_kwargs)
86-
# https://www.tornadoweb.org/en/stable/web.html#tornado.web.URLSpec
87-
# kwargs passed to initialize are None by default but can be added
88-
# https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.initialize
8991
for url, handler, initialize_kwargs in urlspecs
9092
for prefix in [format_prefix + format]
9193
]
@@ -98,12 +100,14 @@ def format_handlers(formats, urlspecs, **handler_settings):
98100
return urlspecs
99101

100102
def init_handlers(formats, providers, base_url, localfiles, **handler_kwargs):
101-
# `handler_kwargs` is a dict of dicts: first dict is `handler_names`, which
102-
# specifies the handler_classes to load for the providers, the second
103-
# is `handler_settings` (see comments in format_handlers)
104-
# Only `handler_settings` should get added to the initialize_kwargs in the
105-
# handler URLSpecs, which is why we pass only it to `format_handlers`
106-
# but both it and `handler_names` to `provider_handlers`
103+
"""
104+
`handler_kwargs` is a dict of dicts: first dict is `handler_names`, which
105+
specifies the handler_classes to load for the providers, the second
106+
is `handler_settings` (see comments in format_handlers)
107+
Only `handler_settings` should get added to the initialize_kwargs in the
108+
handler URLSpecs, which is why we pass only it to `format_handlers`
109+
but both it and `handler_names` to `provider_handlers`
110+
"""
107111
handler_settings = handler_kwargs['handler_settings']
108112

109113
pre_providers = [

nbviewer/providers/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ def provider_handlers(providers, **handler_kwargs):
2020
augmented list of handlers: this allows the addition of, for
2121
example, custom URLs which should be intercepted before being
2222
handed to the basic `url` handler
23+
24+
`handler_kwargs` is a dict of dicts: first dict is `handler_names`, which
25+
specifies the handler_classes to load for the providers, the second
26+
is `handler_settings` (see comments in `format_handlers` in nbviewer/handlers.py)
2327
"""
24-
# `handler_kwargs` is a dict of dicts: first dict is `handler_names`, which
25-
# specifies the handler_classes to load for the providers, the second
26-
# is `handler_settings` (see comments in `format_handlers` in nbviewer/handlers.py)
2728
handler_names = handler_kwargs['handler_names']
2829
handler_settings = handler_kwargs['handler_settings']
2930

@@ -56,8 +57,9 @@ def _load_provider_feature(feature, providers, **handler_names):
5657
5758
The feature will be passed a list of feature implementations and must
5859
return that list, suitably modified.
60+
61+
`handler_names` is the same as the `handler_names` attribute of the NBViewer class
5962
"""
60-
# `handler_names` is the same as the `handler_names` attribute of the NBViewer class
6163

6264
# Ex: provider = 'nbviewer.providers.url'
6365
# provider.rsplit(',', 1) = ['nbviewer.providers', 'url']

0 commit comments

Comments
 (0)