code-google-com / bpbible

Automatically exported from code.google.com/p/bpbible
Other
0 stars 0 forks source link

Harmonies should handle invalid references #158

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open Harmony
2. type "commisssion" into the search box (as in "Great Commission")
3. press Enter or click Find Bible Reference

What is the expected output? What do you see instead?
Search should be performed, instead I see this:

Traceback (most recent call last):
  File "/home/andreas/Apps/bpbible-r1031/harmony/harmonyframe.py", line 208, in bible_ref_enter
    self.update_bible_ui(self.tool_bible_ref.GetValue())
  File "/home/andreas/Apps/bpbible-r1031/harmony/harmonyframe.py", line 262, in update_bible_ui
    peri = self.harmony.top.find_reference(ref)
  File "/home/andreas/Apps/bpbible-r1031/harmony/read_harmony.py", line 177, in find_reference
    ansa = child.find_reference(reference)
  File "/home/andreas/Apps/bpbible-r1031/harmony/read_harmony.py", line 165, in find_reference
    if ref and ref.VerseInRange(reference):
  File "/home/andreas/Apps/bpbible-r1031/swlib/pysw.py", line 1024, in VerseInRange
    vk = VerseList(verse)[0]
IndexError: list index out of range

What version of the product are you using? On what operating system?
bpbible-r1031 on Linux

Original issue reported on code.google.com by war...@gmail.com on 30 Jun 2010 at 9:09

GoogleCodeExporter commented 9 years ago
This is as designed.  That search is looking up a reference, not doing a 
search.  If you were to enter Matthew 2, it would find the section that 
contained Matthew 2:1.

However, it should certainly display a sensible error rather than crashing, and 
search in a harmony content and sections wouldake sense too.

Original comment by jonmmor...@gmail.com on 30 Jun 2010 at 12:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here's a suggestion: Maybe the search box could remain the same, BUT behave 
differently depending on the stuff entered. If it's a reference, go to this 
reference, if it's not a reference, do a search? It seems the code to detect a 
biblical reference is already there in the main application.

Original comment by war...@gmail.com on 30 Jun 2010 at 4:50

GoogleCodeExporter commented 9 years ago
General search isn't implemented for harmonies.  It will probably be 
implemented for release 0.5.  I have raised issue 161 to cover this.

Having search and reference entry combined is certainly done by a number of 
apps, and we have considered it.  However, my main concern is how well it is 
able to handle:
1. Strings that are both valid references and valid searches (e.g. Joshua).
2. Strings that are not valid references, but were intended to be and were 
mistyped slightly (e.g. Joshlua 1 is not a valid reference, but we probably 
don't want to start searching for it either).

There are ways around both of these, but I don't think they will always give 
consistent results, and so we have left it on the "think about later or don't 
do" list.  I definitely think we shouldn't do it unless it is done for all the 
places you enter references in the application.

Original comment by jonmmor...@gmail.com on 1 Jul 2010 at 3:46

GoogleCodeExporter commented 9 years ago
Valid points. Combining those could be cumbersome.

> I definitely think we shouldn't do it unless it is done for all the places 
you enter > references in the application.

I agree with that, the GUI should be consistent. Maybe then just a regular 
CTRL-F and a menu item could pop up a search window for Harmony when you are in 
the Harmony window.

Original comment by war...@gmail.com on 1 Jul 2010 at 2:15

GoogleCodeExporter commented 9 years ago
Fixed in r1035.

Original comment by jonmmor...@gmail.com on 4 Jul 2010 at 1:01