|
8 | 8 |
|
9 | 9 | import os |
10 | 10 | import os.path |
| 11 | +from pathlib import Path |
11 | 12 | from glob import glob |
12 | 13 | import re |
13 | 14 | import pickle |
@@ -68,11 +69,14 @@ def fetch_intersphinx_inventory(uri): |
68 | 69 |
|
69 | 70 | # See https://stackoverflow.com/a/30981554 |
70 | 71 | class MockConfig(object): |
| 72 | + intersphinx_cache_limit = None |
71 | 73 | intersphinx_timeout = None |
72 | 74 | tls_verify = False |
| 75 | + tls_cacerts = None |
| 76 | + user_agent = None |
73 | 77 |
|
74 | 78 | class MockApp(object): |
75 | | - srcdir = '' |
| 79 | + srcdir = Path('') |
76 | 80 | config = MockConfig() |
77 | 81 |
|
78 | 82 | def warn(self, msg): |
@@ -126,6 +130,8 @@ def preprocess_script_string(str): |
126 | 130 |
|
127 | 131 | # Remove header comment |
128 | 132 | str = re.sub(r'^(#[^#\n]+\n){5}\n*', r'', str) |
| 133 | + # Remove r from r""" ... """ |
| 134 | + str = re.sub('^r"""', '"""', str, flags=re.MULTILINE) |
129 | 135 | # Insert notebook plotting configuration function |
130 | 136 | str = re.sub(r'from sporco import plot', r'from sporco import plot' |
131 | 137 | '\nplot.config_notebook_plotting()', |
@@ -500,7 +506,7 @@ def write_notebook_rst(txt, res, fnm, pth): |
500 | 506 | # Partial path for current output image |
501 | 507 | rpth = os.path.join(extfnm, rnew) |
502 | 508 | # In RST text, replace old output name with the new one |
503 | | - txt = re.sub('\.\. image:: ' + r, '.. image:: ' + rpth, txt, re.M) |
| 509 | + txt = re.sub(r'\.\. image:: ' + r, '.. image:: ' + rpth, txt, re.M) |
504 | 510 | # Full path of the current output image |
505 | 511 | fullrpth = os.path.join(pth, rpth) |
506 | 512 | # Write the current output image to disk |
@@ -818,7 +824,7 @@ def __init__(self, env, inv, baseurl): |
818 | 824 | self.citeid = {} |
819 | 825 | if not hasattr(env, 'bibtex_cache'): |
820 | 826 | for cite in env.domaindata['cite']['citations']: |
821 | | - self.citenum[cite.key] = cite.label |
| 827 | + self.citenum[cite.key] = cite.citation_id[2:] |
822 | 828 | self.citeid[cite.key] = cite.citation_id |
823 | 829 |
|
824 | 830 |
|
|
0 commit comments