Skip to content

Commit

Permalink
Better function name
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Sep 2, 2022
1 parent 4b47e8e commit cf582b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/towncrier/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def append_to_newsfile(
"""
news_file = os.path.join(directory, filename)

header, prev_body = _load_existing_content(news_file, start_string, single_file)
header, prev_body = _figure_out_existing_content(
news_file, start_string, single_file
)

if top_line and top_line in prev_body:
raise ValueError("It seems you've already produced newsfiles for this version?")
Expand All @@ -49,7 +51,7 @@ def _write_news(f, header, start_string, new_content, old_body):
f.write(f"\n\n{old_body}")


def _load_existing_content(news_file, start_string, single_file):
def _figure_out_existing_content(news_file, start_string, single_file):
"""
Try to read *news_file* and split it into header (everything before
*start_string*) and the old body (everything after *start_string*).
Expand Down

0 comments on commit cf582b2

Please sign in to comment.