Skip to content

Commit 46218bd

Browse files
committed
Add constants for mime type
1 parent d56b226 commit 46218bd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

gedcom7/const.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
WILL = "WILL"
144144
WWW = "WWW"
145145

146+
MIME_TEXT = "text/plain"
147+
MIME_HTML = "text/html"
148+
146149
payloads = {
147150
"https://gedcom.io/terms/v7/ABBR": "http://www.w3.org/2001/XMLSchema#string",
148151
"https://gedcom.io/terms/v7/ADDR": "http://www.w3.org/2001/XMLSchema#string",

gedcom7/parser.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
"""GEDCOM 7 parser."""
22

33
import re
4-
from typing import Dict, List
54

65
from . import cast, const, grammar
76
from .types import GedcomStructure
87

98

10-
def loads(string: str) -> List[GedcomStructure]:
9+
def loads(string: str) -> list[GedcomStructure]:
1110
"""Load from a string."""
12-
context: Dict[int, GedcomStructure] = {}
13-
records: List[GedcomStructure] = []
14-
ext: Dict[str, str] = {}
11+
context: dict[int, GedcomStructure] = {}
12+
records: list[GedcomStructure] = []
13+
ext: dict[str, str] = {}
1514
for match in re.finditer(grammar.line, string):
1615
data = match.groupdict()
1716
level = int(data["level"])

0 commit comments

Comments
 (0)