File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 12
12
import ipywidgets .embed
13
13
import nbconvert
14
14
15
- import jupyter_sphinx as js
16
15
from .utils import strip_latex_delimiters , sphinx_abs_dir
17
16
from .thebelab import ThebeSourceNode , ThebeOutputNode
18
17
@@ -77,6 +76,8 @@ class JupyterCell(Directive):
77
76
}
78
77
79
78
def run (self ):
79
+ # This only works lazily because the logger is inited by Sphinx
80
+ from . import logger
80
81
location = self .state_machine .get_source_and_line (self .lineno )
81
82
82
83
if self .arguments :
@@ -85,7 +86,7 @@ def run(self):
85
86
rel_filename , filename = env .relfn2path (self .arguments [0 ])
86
87
env .note_dependency (rel_filename )
87
88
if self .content :
88
- js . logger .warning (
89
+ logger .warning (
89
90
'Ignoring inline code in Jupyter cell included from "{}"' .format (
90
91
rel_filename
91
92
),
@@ -108,7 +109,7 @@ def run(self):
108
109
nlines = len (content )
109
110
hl_lines = parselinenos (emphasize_linespec , nlines )
110
111
if any (i >= nlines for i in hl_lines ):
111
- js . logger .warning (
112
+ logger .warning (
112
113
"Line number spec is out of range(1-{}): {}" .format (
113
114
nlines , emphasize_linespec
114
115
),
You can’t perform that action at this time.
0 commit comments