story(vol07): 完成137至164章与首收阅读包
This commit is contained in:
@@ -228,6 +228,8 @@ def build_novel_edition(chapters, destination, title, scope, edition_date):
|
||||
parts.append('# 第五卷 越过边境')
|
||||
elif path.name.startswith('113_'):
|
||||
parts.append('# 第六卷 紫发魔王')
|
||||
elif path.name.startswith('137_'):
|
||||
parts.append('# 第七卷 第一片新田')
|
||||
parts.append(re.sub(r'^(#+) ', r'\1# ', source, flags=re.M).rstrip())
|
||||
write(destination, '\n\n'.join(parts) + '\n')
|
||||
return count
|
||||
@@ -302,6 +304,30 @@ def build_six_volume_editions(edition_date):
|
||||
print(sixth_out)
|
||||
|
||||
|
||||
def build_seven_volume_editions(edition_date):
|
||||
"""汇集七卷当前范围,保留此前合订本与影像资料。"""
|
||||
chapters = []
|
||||
for volume in ('第一卷', '第二卷', '第三卷', '第四卷', '第五卷', '第六卷', '第七卷'):
|
||||
paths = (NOVEL / '03_正文' / volume).glob('*.md')
|
||||
chapters.extend(sorted((p for p in paths if re.match(r'^\d+_', p.name)),
|
||||
key=lambda p: int(p.name.split('_', 1)[0])))
|
||||
numbers = [int(p.name.split('_', 1)[0]) for p in chapters]
|
||||
if numbers != list(range(165)):
|
||||
raise ValueError('七卷应为序章00和正文01—164,无缺号或重复')
|
||||
seventh = [p for p in chapters if 137 <= int(p.name.split('_', 1)[0]) <= 164]
|
||||
combined = NOVEL / '前164章_阅读合订本.md'
|
||||
seventh_out = NOVEL / '第七卷_第一片新田_阅读合订本.md'
|
||||
full_count = build_novel_edition(chapters, combined,
|
||||
'《寂静诸神:炉火》前七卷阅读合订本',
|
||||
'独立序章+正文1—164章;第一、二、五、六卷各24章,第三、四卷各20章,第七卷28章完整初稿', edition_date)
|
||||
seventh_count = build_novel_edition(seventh, seventh_out,
|
||||
'第七卷《第一片新田》阅读合订本',
|
||||
'总第137—164章,共28章;875早春—晚秋,埃利安20岁', edition_date)
|
||||
print(f'小说164章+序章;约{full_count:,}汉字;第七卷28章约{seventh_count:,}汉字(含标题)')
|
||||
print(combined)
|
||||
print(seventh_out)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--date', required=True)
|
||||
@@ -311,7 +337,9 @@ def main():
|
||||
if args.novel_only:
|
||||
if args.refresh_reading:
|
||||
parser.error('--novel-only不能与--refresh-reading同时使用')
|
||||
if (NOVEL / '03_正文/第六卷/136_春水进渠之前.md').is_file():
|
||||
if (NOVEL / '03_正文/第七卷/164_下一季的座位.md').is_file():
|
||||
build_seven_volume_editions(args.date)
|
||||
elif (NOVEL / '03_正文/第六卷/136_春水进渠之前.md').is_file():
|
||||
build_six_volume_editions(args.date)
|
||||
elif (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
|
||||
build_five_volume_editions(args.date)
|
||||
@@ -409,6 +437,8 @@ def main():
|
||||
build_five_volume_editions(args.date)
|
||||
if (NOVEL / '03_正文/第六卷/136_春水进渠之前.md').is_file():
|
||||
build_six_volume_editions(args.date)
|
||||
if (NOVEL / '03_正文/第七卷/164_下一季的座位.md').is_file():
|
||||
build_seven_volume_editions(args.date)
|
||||
print(f'EP02—12录制台词:{len(all_rows)};各集:{episode_counts}')
|
||||
print('已核对11集Fountain与阅读稿台词逐条一致。')
|
||||
print(full_out)
|
||||
|
||||
Reference in New Issue
Block a user