If I look at the Editra log when I try to get code completion for line
25 in the attached sample, i.e.
sPane = self.Getcon"do ctrl-space for completion"
I am setting something up which is not to Editra's liking? Or am I
hitting a case which is currently not handled? Or ....?
Werner
Following is what I see in the log:
[11:58:38][pycomp][info] parseassignment: app = ab.BaseApp
[11:58:38][pycomp][info] parseassignment: dlg = ProfileView
[11:58:38][pycomp][err] src exec: invalid syntax (<string>, line 35)
[11:58:38][pycomp][info] Successfully executed: import logging
[11:58:38][pycomp][info] Successfully executed: import wx
[11:58:38][pycomp][info] Successfully executed: import
wx.lib.sized_controls as sc
[11:58:38][pycomp][info] Successfully executed: import wx.lib.agw.aui as aui
[11:58:38][pycomp][info] Successfully executed: import twcbsrc.app_base
as ab
[11:58:38][pycomp][info] Successfully executed: app = ab.BaseApp
[11:58:38][pycomp][err] local exec name 'ProfileView' is not defined
[dlg = ProfileView]
[11:58:38][pycomp][err] local exec name 'ProfileView' is not defined
[self = ProfileView]
[11:58:38][pycomp][err] local exec name '_PyCmplNoType' is not defined
[parent = _PyCmplNoType()]
[11:58:38][pycomp][err] local exec name '_PyCmplNoType' is not defined
[standalone = _PyCmplNoType()]
[11:58:38][pycomp][err] local exec invalid syntax (<string>, line 1)
[**kwds = _PyCmplNoType()]
[11:58:38][pycomp][err] local exec name 'self' is not defined [sPane =
self.Getcon]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.sPane = sc.SizedPanel]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.lPane = sc.SizedPanel]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.auiPane = sc.SizedPanel]
[11:58:38][pycomp][err] local exec name 'proportion' is not defined
[expand = True , proportion]
[11:58:38][pycomp][info] Successfully executed: bookStyle =
aui.AUI_NB_DEFAULT_STYLE
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self._auiBook = aui.AuiNotebook]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.dPane = sc.SizedPanel]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.nPane = sc.SizedPanel]
[11:58:38][pycomp][err] local exec name 'self' is not defined
[self.hPane = sc.SizedPanel]
[11:58:38][pycomp][info] Completion eval time: 0.047000
[11:58:38][pycomp][info] get_completions('self.Getcon','')
[11:58:38][pycomp][err] get_completions: name 'self' is not defined
[stmt='self']
[11:58:38][codebrowser][info] Syncing tree for position 24
[11:58:39][codebrowser][info] Syncing tree for position 24
[11:59:10][codebrowser][info] Syncing tree for position 24
I don't want to side track you from whatever you do, but I like to log
the findings here for future use.
Adding a method makes completion work, so in the sample attached instead
of doing this in __init__
sPane = self."code completion"
I do this:
self.DoInit()
def DoInit(self):
sPane = self."code completion"
In the first case the completion seems to fail on finding "self" -
assuming I am reading this log stuff correctly.
Log entries when doing it in __init__ (source dump is marked with
"[pycomp][evalsource]"):
[16:02:33][codebrowser][info] Syncing tree for position 27
[16:02:34][pycomp][err] parseassignment bad token: self.
[16:02:34][pycomp][info] parseassignment: sPane = _PyCmplNoType()
[16:02:34][pycomp][info] parseassignment: self.sPane = sc.SizedPanel
[16:02:34][pycomp][info] parseassignment: self.lPane = sc.SizedPanel
[16:02:34][pycomp][info] parseassignment: expand = True , proportion
[16:02:34][pycomp][info] parseassignment: bookStyle =
aui.AUI_NB_DEFAULT_STYLE
[16:02:34][pycomp][info] parseassignment: self._auiBook = aui.AuiNotebook
[16:02:34][pycomp][info] parseassignment: expand = True , proportion
[16:02:34][pycomp][info] parseassignment: self.dPane = sc.SizedPanel
[16:02:34][pycomp][info] parseassignment: self.nPane = sc.SizedPanel
[16:02:34][pycomp][info] parseassignment: self.hPane = sc.SizedPanel
[16:02:34][pycomp][info] parseassignment: app = ab.BaseApp
[16:02:34][pycomp][info] parseassignment: dlg = ProfileView
[16:02:34][pycomp][evalsource] Generated source: """"""
[16:02:34][pycomp][evalsource]try:
[16:02:34][pycomp][evalsource] import logging
[16:02:34][pycomp][evalsource]except ImportError:
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]try:
[16:02:34][pycomp][evalsource] import wx
[16:02:34][pycomp][evalsource]except ImportError:
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]try:
[16:02:34][pycomp][evalsource] import wx.lib.sized_controls as sc
[16:02:34][pycomp][evalsource]except ImportError:
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]try:
[16:02:34][pycomp][evalsource] import wx.lib.agw.aui as aui
[16:02:34][pycomp][evalsource]except ImportError:
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]try:
[16:02:34][pycomp][evalsource] import twcbsrc.app_base as ab
[16:02:34][pycomp][evalsource]except ImportError:
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]class _PyCmplNoType:
[16:02:34][pycomp][evalsource] def __getattr__(self,name):
[16:02:34][pycomp][evalsource] return None
[16:02:34][pycomp][evalsource]def __init__(self,parent,standalone,**kwds):
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]class ProfileView(sc.SizedDialog):
[16:02:34][pycomp][evalsource] def
__init__(self,parent,standalone,**kwds):
[16:02:34][pycomp][evalsource] pass
[16:02:34][pycomp][evalsource]app = ab.BaseApp
[16:02:34][pycomp][evalsource]dlg = ProfileView
[16:02:34][pycomp][evalsource]self = ProfileView
[16:02:34][pycomp][evalsource]parent = _PyCmplNoType()
[16:02:34][pycomp][evalsource]standalone = _PyCmplNoType()
[16:02:34][pycomp][evalsource]**kwds = _PyCmplNoType()
[16:02:34][pycomp][evalsource]sPane = _PyCmplNoType()
[16:02:34][pycomp][evalsource]self.sPane = sc.SizedPanel
[16:02:34][pycomp][evalsource]self.lPane = sc.SizedPanel
[16:02:34][pycomp][evalsource]bookStyle = aui.AUI_NB_DEFAULT_STYLE
[16:02:34][pycomp][evalsource]self._auiBook = aui.AuiNotebook
[16:02:34][pycomp][evalsource]expand = True , proportion
[16:02:34][pycomp][evalsource]self.dPane = sc.SizedPanel
[16:02:34][pycomp][evalsource]self.nPane = sc.SizedPanel
[16:02:34][pycomp][evalsource]self.hPane = sc.SizedPanel
[16:02:34][pycomp][err] src exec: invalid syntax (<string>, line 35)
[16:02:34][pycomp][info] Successfully executed: import logging
[16:02:34][pycomp][info] Successfully executed: import wx
[16:02:34][pycomp][info] Successfully executed: import
wx.lib.sized_controls as sc
[16:02:34][pycomp][info] Successfully executed: import wx.lib.agw.aui as aui
[16:02:34][pycomp][info] Successfully executed: import twcbsrc.app_base
as ab
[16:02:34][pycomp][info] Successfully executed: app = ab.BaseApp
[16:02:34][pycomp][err] local exec name 'ProfileView' is not defined
[dlg = ProfileView]
[16:02:34][pycomp][err] local exec name 'ProfileView' is not defined
[self = ProfileView]
[16:02:34][pycomp][err] local exec name '_PyCmplNoType' is not defined
[parent = _PyCmplNoType()]
[16:02:34][pycomp][err] local exec name '_PyCmplNoType' is not defined
[standalone = _PyCmplNoType()]
[16:02:34][pycomp][err] local exec invalid syntax (<string>, line 1)
[**kwds = _PyCmplNoType()]
[16:02:34][pycomp][err] local exec name '_PyCmplNoType' is not defined
[sPane = _PyCmplNoType()]
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self.sPane = sc.SizedPanel]
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self.lPane = sc.SizedPanel]
[16:02:34][pycomp][info] Successfully executed: bookStyle =
aui.AUI_NB_DEFAULT_STYLE
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self._auiBook = aui.AuiNotebook]
[16:02:34][pycomp][err] local exec name 'proportion' is not defined
[expand = True , proportion]
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self.dPane = sc.SizedPanel]
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self.nPane = sc.SizedPanel]
[16:02:34][pycomp][err] local exec name 'self' is not defined
[self.hPane = sc.SizedPanel]
[16:02:34][pycomp][info] Completion eval time: 0.016000
[16:02:34][pycomp][info] get_completions('self.','')
[16:02:34][pycomp][err] get_completions: name 'self' is not defined
[stmt='self']
[16:02:35][codebrowser][info] Syncing tree for position 27
Create a method DoInit which is called from __init__ then the same
completion works:
[16:06:02][codebrowser][info] Syncing tree for position 27
[16:06:04][pycomp][err] parseassignment bad token: self.
[16:06:04][pycomp][info] parseassignment: sPane = _PyCmplNoType()
[16:06:04][pycomp][info] parseassignment: self.sPane = sc.SizedPanel
[16:06:04][pycomp][info] parseassignment: self.lPane = sc.SizedPanel
[16:06:04][pycomp][info] parseassignment: expand = True , proportion
[16:06:04][pycomp][info] parseassignment: bookStyle =
aui.AUI_NB_DEFAULT_STYLE
[16:06:04][pycomp][info] parseassignment: self._auiBook = aui.AuiNotebook
[16:06:04][pycomp][info] parseassignment: expand = True , proportion
[16:06:04][pycomp][info] parseassignment: self.dPane = sc.SizedPanel
[16:06:04][pycomp][info] parseassignment: self.nPane = sc.SizedPanel
[16:06:04][pycomp][info] parseassignment: self.hPane = sc.SizedPanel
[16:06:04][pycomp][info] parseassignment: app = ab.BaseApp
[16:06:04][pycomp][info] parseassignment: dlg = ProfileView
[16:06:04][pycomp][evalsource] Generated source: """"""
[16:06:04][pycomp][evalsource]try:
[16:06:04][pycomp][evalsource] import logging
[16:06:04][pycomp][evalsource]except ImportError:
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]try:
[16:06:04][pycomp][evalsource] import wx
[16:06:04][pycomp][evalsource]except ImportError:
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]try:
[16:06:04][pycomp][evalsource] import wx.lib.sized_controls as sc
[16:06:04][pycomp][evalsource]except ImportError:
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]try:
[16:06:04][pycomp][evalsource] import wx.lib.agw.aui as aui
[16:06:04][pycomp][evalsource]except ImportError:
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]try:
[16:06:04][pycomp][evalsource] import twcbsrc.app_base as ab
[16:06:04][pycomp][evalsource]except ImportError:
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]class _PyCmplNoType:
[16:06:04][pycomp][evalsource] def __getattr__(self,name):
[16:06:04][pycomp][evalsource] return None
[16:06:04][pycomp][evalsource]def __init__(self,parent,standalone,**kwds):
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]def DoInit(self):
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]class ProfileView(sc.SizedDialog):
[16:06:04][pycomp][evalsource] def
__init__(self,parent,standalone,**kwds):
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource] def DoInit(self):
[16:06:04][pycomp][evalsource] pass
[16:06:04][pycomp][evalsource]app = ab.BaseApp
[16:06:04][pycomp][evalsource]dlg = ProfileView
[16:06:04][pycomp][evalsource]self = ProfileView
[16:06:04][pycomp][evalsource]sPane = _PyCmplNoType()
[16:06:04][pycomp][evalsource]self.sPane = sc.SizedPanel
[16:06:04][pycomp][evalsource]self.lPane = sc.SizedPanel
[16:06:04][pycomp][evalsource]bookStyle = aui.AUI_NB_DEFAULT_STYLE
[16:06:04][pycomp][evalsource]self._auiBook = aui.AuiNotebook
[16:06:04][pycomp][evalsource]expand = True , proportion
[16:06:04][pycomp][evalsource]self.dPane = sc.SizedPanel
[16:06:04][pycomp][evalsource]self.nPane = sc.SizedPanel
[16:06:04][pycomp][evalsource]self.hPane = sc.SizedPanel
[16:06:04][pycomp][err] src exec: name 'proportion' is not defined
[16:06:04][pycomp][info] Successfully executed: import logging
[16:06:04][pycomp][info] Successfully executed: import wx
[16:06:04][pycomp][info] Successfully executed: import
wx.lib.sized_controls as sc
[16:06:04][pycomp][info] Successfully executed: import wx.lib.agw.aui as aui
[16:06:04][pycomp][info] Successfully executed: import twcbsrc.app_base
as ab
[16:06:04][pycomp][info] Successfully executed: app = ab.BaseApp
[16:06:04][pycomp][info] Successfully executed: dlg = ProfileView
[16:06:04][pycomp][info] Successfully executed: self = ProfileView
[16:06:04][pycomp][info] Successfully executed: sPane = _PyCmplNoType()
[16:06:04][pycomp][info] Successfully executed: self.sPane = sc.SizedPanel
[16:06:04][pycomp][info] Successfully executed: self.lPane = sc.SizedPanel
[16:06:04][pycomp][info] Successfully executed: bookStyle =
aui.AUI_NB_DEFAULT_STYLE
[16:06:04][pycomp][info] Successfully executed: self._auiBook =
aui.AuiNotebook
[16:06:04][pycomp][err] local exec name 'proportion' is not defined
[expand = True , proportion]
[16:06:04][pycomp][info] Successfully executed: self.dPane = sc.SizedPanel
[16:06:04][pycomp][info] Successfully executed: self.nPane = sc.SizedPanel
[16:06:04][pycomp][info] Successfully executed: self.hPane = sc.SizedPanel
[16:06:04][pycomp][info] Completion eval time: 0.015000
[16:06:04][pycomp][info] get_completions('self.','')
[16:06:04][pycomp][info] completing: stmt:self
[16:06:04][codebrowser][info] Syncing tree for position 27
[16:06:14][codebrowser][info] Syncing tree for position 27
[16:06:15][codebrowser][info] Syncing tree for position 27
[16:06:16][codebrowser][info] Syncing tree for position 27
[16:06:17][codebrowser][info] Syncing tree for position 27
Werner
On Mon, Oct 10, 2011 at 9:26 AM, werner <wbr...@free.fr> wrote:
> On 10/10/2011 03:13 PM, Cody Precord wrote:
>>
>
> I had noted that but hoping that over time it will get even better then it
> is already:-) . I think that user feedback will help in this. It is in no
> way a complaint.
Yes of course and thank you for the feedback. I just didn't want to
get up expectations on how quickly I can get to all these issues in my
limited spare time ;)
>
> In the first case the completion seems to fail on finding "self" - assuming
> I am reading this log stuff correctly.
>
Sort of, there are a few errors in the generated source (some of which
may be easy to correct) which are leading to the breakdown. (see
below)
> [16:02:34][pycomp][evalsource]class ProfileView(sc.SizedDialog):
> [16:02:34][pycomp][evalsource] def
> __init__(self,parent,standalone,**kwds):
> [16:02:34][pycomp][evalsource] pass
> [16:02:34][pycomp][evalsource]app = ab.BaseApp
> [16:02:34][pycomp][evalsource]dlg = ProfileView
This is the second error listed below, I am not sure why it is an
error because the class 'ProfileView' was clearly detected and
generated. Only thought is that the syntax error shown below is
probably the root cause.
> [16:02:34][pycomp][evalsource]self = ProfileView
> [16:02:34][pycomp][evalsource]parent = _PyCmplNoType()
> [16:02:34][pycomp][evalsource]standalone = _PyCmplNoType()
> [16:02:34][pycomp][evalsource]**kwds = _PyCmplNoType()
The syntax error on this line is breaking the evaluation of the
generated source. This should be straight forward to fix. Please open
a ticket for it (and attach a sample file if you can to reproduce
with).
<snip>
> [16:02:34][pycomp][err] src exec: invalid syntax (<string>, line 35)
Here is the first error caused by above generated code, this would
have broken the compilation and broke the introspection to derive the
other objects. As a test you could try to remove the '**" in your fie
and retry the completion to see if it does any better. As mentioned
above it should be easy to fix this as it must be a missed case in
sanitizing the strings.
<snip>
>
>
> Create a method DoInit which is called from __init__ then the same
> completion works:
>
<snip>
> [16:06:04][pycomp][evalsource]expand = True , proportion
This is line is problematic as well in this instance since it is
picking up the following argument as well. Its interesting that in
this case the '**kwds' error did not occur something must be wrong
with how the parser is tracking the context or state.
Thanks,
Cody
>> In the first case the completion seems to fail on finding "self" - assuming
>> I am reading this log stuff correctly.
>>
> Sort of, there are a few errors in the generated source (some of which
> may be easy to correct) which are leading to the breakdown. (see
> below)
>
>
>> [16:02:34][pycomp][evalsource]class ProfileView(sc.SizedDialog):
>> [16:02:34][pycomp][evalsource] def
>> __init__(self,parent,standalone,**kwds):
>> [16:02:34][pycomp][evalsource] pass
>> [16:02:34][pycomp][evalsource]app = ab.BaseApp
>> [16:02:34][pycomp][evalsource]dlg = ProfileView
> This is the second error listed below, I am not sure why it is an
> error because the class 'ProfileView' was clearly detected and
> generated. Only thought is that the syntax error shown below is
> probably the root cause.
>
>> [16:02:34][pycomp][evalsource]self = ProfileView
>> [16:02:34][pycomp][evalsource]parent = _PyCmplNoType()
>> [16:02:34][pycomp][evalsource]standalone = _PyCmplNoType()
>> [16:02:34][pycomp][evalsource]**kwds = _PyCmplNoType()
> The syntax error on this line is breaking the evaluation of the
> generated source. This should be straight forward to fix. Please open
> a ticket for it (and attach a sample file if you can to reproduce
> with).
>
Created: Issue 700, attached a simpler version of code to the issue
which allows to reproduce this.
> <snip>
>
>> [16:02:34][pycomp][err] src exec: invalid syntax (<string>, line 35)
> Here is the first error caused by above generated code, this would
> have broken the compilation and broke the introspection to derive the
> other objects. As a test you could try to remove the '**" in your fie
> and retry the completion to see if it does any better. As mentioned
> above it should be easy to fix this as it must be a missed case in
> sanitizing the strings.
Removing the "**" didn't help.
Werner
On Mon, Oct 10, 2011 at 10:32 AM, werner <wbr...@free.fr> wrote:
> On 10/10/2011 05:03 PM, Cody wrote:
>>
>> The syntax error on this line is breaking the evaluation of the
>> generated source. This should be straight forward to fix. Please open
>> a ticket for it (and attach a sample file if you can to reproduce
>> with).
>>
> Created: Issue 700, attached a simpler version of code to the issue which
> allows to reproduce this.
>>
Thanks, for the concise information. Made it easy enough to locate the
issue without much effort. Should be fixed in current SVN.
Cody
You see, you are just to fast in reacting/fixing things;-) .
Works great!
Thanks a lot
Werner