MCPcopy Create free account
hub / github.com/praw-dev/praw / get_entry_slice

Function get_entry_slice

tools/extract_log_entry.py:12–23  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

10
11
12def get_entry_slice(doc):
13 current_version = sys.stdin.readline().strip()
14 start_line = None
15 end_line = None
16 for section in doc.children[0].children:
17 if start_line:
18 end_line = section.children[0].line - 2
19 break
20 header = section.children[0]
21 if current_version in getattr(header, "rawsource", ""):
22 start_line = header.line - 2
23 return slice(start_line, end_line)
24
25
26def parse_rst(text: str) -> docutils.nodes.document:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…