Skip to content

Commit

Permalink
The workflow now correctly handles nonexistent verses
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Evans committed Feb 27, 2014
1 parent e3814bf commit 21eec53
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions get_bible_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,16 @@ def get_bible_reference(query_str):
# Parse HTML content
parser = VerseParser(verse_id)
parser.feed(html)
# Print formatted verse reference
return '{verse}\n({verse_name} {version})'.format(verse=parser.verse, verse_name=parser.verse_name, version=version)

# If verse was found
if parser.verse != '':
# Print formatted verse reference
return '{verse}\n({verse_name} {version})'.format(verse=parser.verse, verse_name=parser.verse_name, version=version)
else:
# Otherwise, return empty string
return ''

else:
# Otherwise, return an empty string
# Otherwise, return empty string

return ''

Expand Down

0 comments on commit 21eec53

Please sign in to comment.