code-google-com / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

[CodeTemplater] Key Error #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following errors were reported via Editra's Error Reporter:

*** Thu Apr  1 18:03:24 2010 ***
Traceback (most recent call last):
 File %22ed_stc.pyo%22, line 819, in OnUserListSel
 File %22ed_msg.pyo%22, line 256, in PostMessage
 File %22extern/pubsub.pyo%22, line 798, in sendMessage
 File %22extern/pubsub.pyo%22, line 483, in sendMessage
 File %22extern/pubsub.pyo%22, line 321, in sendMessage
 File %22/Users/harold/Library/Application
Support/Editra/plugins/CodeTemplater-0.2-py2.5.egg/codetemplater/__init__.py%22,
line 88, in OnTemplate
KeyError: uclose

*** Thu Apr  1 18:03:43 2010 ***
Traceback (most recent call last):
 File %22ed_stc.pyo%22, line 819, in OnUserListSel
 File %22ed_msg.pyo%22, line 256, in PostMessage
 File %22extern/pubsub.pyo%22, line 798, in sendMessage
 File %22extern/pubsub.pyo%22, line 483, in sendMessage
 File %22extern/pubsub.pyo%22, line 321, in sendMessage
 File %22/Users/harold/Library/Application
Support/Editra/plugins/CodeTemplater-0.2-py2.5.egg/codetemplater/__init__.py%22,
line 88, in OnTemplate
KeyError: uwindow

Original issue reported on code.google.com by CodyPrec...@gmail.com on 2 Apr 2010 at 12:45

GoogleCodeExporter commented 9 years ago
Was this with only the default templates, or have some templates been added? 
(and if 
so, should they have names close, window, or uclose, or uwindow?)

Original comment by etolle...@gmail.com on 2 Apr 2010 at 12:55

GoogleCodeExporter commented 9 years ago
I don't have any details other than the error.

It would seem that something may have gotten out out of sync somehow. Should 
probably
be checking for if the key is in the dictionary before fetching the data. Should
probably also try to determine how it could get out of sync.

Cody

Original comment by CodyPrec...@gmail.com on 2 Apr 2010 at 1:04

GoogleCodeExporter commented 9 years ago
Sorry the uclose / uwindow are probably u"close" u"window" but just got changed 
when
the text went through the error reporter.

Must have been selections made in the popup list in the buffer that got sent to 
your
plugins handler.

Cody

Original comment by CodyPrec...@gmail.com on 2 Apr 2010 at 1:05

GoogleCodeExporter commented 9 years ago
I just committed a check to ensure that only text with valid templates are 
processed 
by OnTemplate, so that should fix these errors.  If some other plugin binds to 
EDMSG_UI_STC_USERLIST_SEL and sends the same text as one of the templates, I 
have no 
way to keep it from adding the template. But that seems like a pretty unlikely 
scenario... If it becomes a problem I can implement some name mangling, but 
that's not 
worth doing unless it becomes an issue.

Let me know if this doesn't fix the error reporter problem, but it should.

Original comment by etolle...@gmail.com on 2 Apr 2010 at 5:15