Skip to content

Commit

Permalink
Fix syntax warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Mar 13, 2024
1 parent d29453f commit 8f588f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions notebook/process_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RefLinks(object):
"""Handle doxygen-style @ref links in markdown"""
include_re = re.compile(r'%%include\s+([^\s)]+)')
backtick_link = re.compile(r'``([^\s`]+)``')
ref_link = re.compile('@ref\s+([^\s)]+)')
ref_link = re.compile(r'@ref\s+([^\s)]+)')

def __init__(self):
#: Mapping from identifier to URL
Expand Down Expand Up @@ -186,9 +186,9 @@ def patch_source(source, rl):
yield rl.fix_links(c)


_file_link_re = re.compile('@file\s+([^\s)]+)')
_file_link_re = re.compile(r'@file\s+([^\s)]+)')
non_jupyter_constructs = re.compile('#?%%(html|nb|colab)(exclude|only)')
jupyter_anchor_re = re.compile('\s*\{#([^\s}]+)\}')
jupyter_anchor_re = re.compile(r'\s*\{#([^\s}]+)\}')
def patch_jupyter(source, rl, toc, is_markdown):
if is_markdown:
for c in source:
Expand Down Expand Up @@ -269,7 +269,7 @@ def write(self, cell, fh):
def get_cell_subset(cells, excludestr, onlytype):
for cell in cells:
if not cell['source'] or excludestr not in cell['source'][0]:
m = re.search('%%(\S+)only', cell['source'][0])
m = re.search(r'%%(\S+)only', cell['source'][0])
if not m or m.group(1) == onlytype:
yield cell

Expand Down Expand Up @@ -392,8 +392,8 @@ def write_header(self, fh):


class TableOfContents(object):
anchor_re = re.compile('(#+)\s+(.*?)\s*\{#([^\s}]+)\}')
noanchor_re = re.compile('(#+)\s+(.*?)\s*$')
anchor_re = re.compile(r'(#+)\s+(.*?)\s*\{#([^\s}]+)\}')
noanchor_re = re.compile(r'(#+)\s+(.*?)\s*$')

def __init__(self, filenum):
self._auto_toc = 0 # autogenerated anchors for titles without them
Expand Down

0 comments on commit 8f588f5

Please sign in to comment.