nburdick / lilykde

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

Autocomplete sometimes throws up errors #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open a new file
2. Start typing something for autocomplete (I typed \fer)
3. Activate autocomplete (I have it mapped to ctrl-space - not sure what
the default is)

What is the expected output? What do you see instead?
I expected to either get a list of suggestions or nothing (I don't think
there were any valid candidates - perhaps that's what causes the bug to be
triggered). Instead I received a program error (pasted below)

What version of the product are you using? On what operating system?
0.7.16 on Ubuntu 9.10 AMD64 (installed via Frescobaldi PPA)

Please provide any additional information below.

Traceback (most recent call last):
  File "/usr/share/kde4/apps/frescobaldi/lib/frescobaldi_app/mainapp.py",
line 1092, in completionInvoked
    self, view, word, invocationType)
  File
"/usr/share/kde4/apps/frescobaldi/lib/frescobaldi_app/completion.py", line
144, in getCompletions
    matches = findMatches(model, view, word, invocationType)
  File
"/usr/share/kde4/apps/frescobaldi/lib/frescobaldi_app/completion.py", line
218, in findMatches
    return ly.words.keywords + ly.words.musiccommands + lilypondVersion()
  File "/usr/share/kde4/apps/frescobaldi/lib/ly/__init__.py", line 50, in
loader
    cache[args] = func(*args)
  File
"/usr/share/kde4/apps/frescobaldi/lib/frescobaldi_app/completion.py", line
259, in lilypondVersion
    ver = frescobaldi_app.version.defaultVersion()
  File "/usr/share/kde4/apps/frescobaldi/lib/frescobaldi_app/version.py",
line 43, in defaultVersion
    return version or
ly.version.LilyPondVersion(command("lilypond")).versionString
  File "/usr/share/kde4/apps/frescobaldi/lib/ly/version.py", line 33, in
__init__
    self.versionTuple = tuple(int(s or "0") for s in match.groups())
AttributeError: 'NoneType' object has no attribute 'groups'

Original issue reported on code.google.com by organsny...@gmail.com on 19 Nov 2009 at 5:01

GoogleCodeExporter commented 8 years ago
Thank you for this report. The routine which parses the output of lilypond -v 
(to get
the version number) seems to fail. I can fix that, but could you please tell me 
what
the command:

lilypond -v

prints on the command line?

Original comment by wbsoft on 21 Nov 2009 at 6:57

GoogleCodeExporter commented 8 years ago
That would explain my problem. I use a custom shell script to automatically 
switch
LilyPond versions depending on the input file (based on the \version command). 
When
my script is run with just -v, it fails (since it doesn't have an input file to 
look
for). I'll change my script to do something more sensible, and IMHO Frescobaldi
should throw up a warning message ("Unable to determine LilyPond version") 
instead of
a programming error.

Original comment by organsny...@gmail.com on 23 Nov 2009 at 7:30

GoogleCodeExporter commented 8 years ago
Cool idea! I've already fixed Frescobaldi to just silently leave the version
undetermined instead of throwing up this error dialog.

Original comment by wbsoft on 24 Nov 2009 at 8:15