de-linted source

This commit is contained in:
Amy G. Bowersox 2024-07-26 23:42:49 -06:00
parent 96b611880c
commit ab2b775e3a
3 changed files with 7 additions and 8 deletions

View File

@ -1 +1 @@
from .dragonglass import main
from .dragonglass import main as main

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
import sys
import yaml
from pathlib import Path
from tree import SourceNode, SourceIndex

View File

@ -50,13 +50,13 @@ class SourceNode:
def load_metadata(self, source_dir):
if self._is_md and not self._is_dir:
with open(source_dir / self._path, "r", encoding="utf-8") as f:
l = f.readline()
if l == '---\n':
cur_line = f.readline()
if cur_line == '---\n':
metalines = []
l = f.readline()
while l != '---\n':
metalines.append(l)
l = f.readline()
cur_line = f.readline()
while cur_line != '---\n':
metalines.append(cur_line)
cur_line = f.readline()
self.metadata = yaml.full_load(''.join(metalines))
def parse_markdown(self, source_dir, markdown_parser):