diff options
author | Eduardo Pedroni <e.pedroni91@gmail.com> | 2017-02-23 10:16:59 +0100 |
---|---|---|
committer | Eduardo Pedroni <e.pedroni91@gmail.com> | 2017-02-23 10:16:59 +0100 |
commit | a490027e0c4c8cf70774382b586e3e66d7e7b274 (patch) | |
tree | 5fd41fa999f7e044c1065e65331d3c320bec9b64 /flashcards | |
parent | 9d45ae4034d1ef7999a598f6a5b2433632e92ed6 (diff) |
Fixed bug where last card was not loaded, multiple line breaks between cards are no longer printed
Diffstat (limited to 'flashcards')
-rwxr-xr-x | flashcards | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -38,11 +38,13 @@ def extractCards(f): match = re.match(cardRegex, l) if match: if front != "": - cards.append([front, back]) + cards.append([front.strip(), back.strip()]) back = "" front = match.string[prefixLength:] else: back += l + # do the last front-back pair before returning + cards.append([front.strip(), back.strip()]) return cards # Loops serving cards to the user until the program is exited |