@@ -12,14 +12,15 @@ def __init__(self) -> None:
1212 self .successor : Optional ['PoemLine' ] = None
1313 self .seq = - 1
1414
15- def populate_note (self , note : 'Note' , title : str , tags : List [str ],
15+ def populate_note (self , note : 'Note' , title : str , author : str , tags : List [str ],
1616 context_lines : int , recite_lines : int , deck_id : int ) -> None :
1717 """
1818 Fill the _note_ with content testing on the current line.
1919 """
2020 note .model ()['did' ] = deck_id # type: ignore
2121 note .tags = tags
2222 note ['Title' ] = title
23+ note ['Author' ] = author
2324 note ['Sequence' ] = str (self .seq )
2425 note ['Context' ] = self ._format_context (context_lines )
2526 note ['Line' ] = self ._format_text (recite_lines )
@@ -80,7 +81,7 @@ def _get_text(self, _lines: int) -> List[str]:
8081 """
8182 raise NotImplementedError
8283
83- def populate_note (self , note : 'Note' , title : str , tags : List [str ],
84+ def populate_note (self , note : 'Note' , title : str , author : str , tags : List [str ],
8485 context_lines : int , recite_lines : int , deck_id : int ) -> None :
8586 raise AssertionError ("The Beginning node cannot be used to populate a note." )
8687
@@ -243,10 +244,11 @@ def _normalize_blank_lines(text_lines):
243244
244245
245246def add_notes (col : Any , note_constructor : Callable ,
246- title : str , tags : List [str ], text : List [str ], deck_id : int ,
247- context_lines : int , group_lines : int , recite_lines : int ):
247+ title : str , author :str , tags : List [str ], text : List [str ],
248+ deck_id : int , context_lines : int , group_lines : int ,
249+ recite_lines : int ):
248250 """
249- Generate notes from the given title, tags, poem text, and number of
251+ Generate notes from the given title, author, tags, poem text, and number of
250252 lines of context. Return the number of notes added.
251253
252254 Return the number of notes added.
@@ -258,7 +260,7 @@ def add_notes(col: Any, note_constructor: Callable,
258260 added = 0
259261 for line in _poemlines_from_textlines (text , group_lines ):
260262 n = note_constructor (col , col .models .byName ("LPCG 1.0" ))
261- line .populate_note (n , title , tags , context_lines , recite_lines , deck_id )
263+ line .populate_note (n , title , author , tags , context_lines , recite_lines , deck_id )
262264 col .addNote (n )
263265 added += 1
264266 return added
0 commit comments