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 #!/usr/bin/env python3
import argparse import argparse
import sys
import yaml import yaml
from pathlib import Path from pathlib import Path
from tree import SourceNode, SourceIndex from tree import SourceNode, SourceIndex

View File

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