[wingide-users] Source code browser

Adrian Klaver adrian.klaver at gmail.com
Fri Feb 1 10:19:00 EST 2013


On 02/01/2013 05:19 AM, Wingware Support wrote:
> Adrian Klaver wrote:
>> It can't be unusual to have a source directory and then have a package
>> installed in site or dist -package, so how do people handle that?
>>
>> In the meantime I removed the package from site-package and the removed
>> some of the duplication. Now what I see is this:
>>
>> dir A <--- In source assistant, no path
>>    file a
>>    file b
>> dir A <-- In source assistant a path to its location in the source dir
>>    file a
>>    file b
>>
>> The files in either case point to the same path.
>> Not sure if it is related to the below in PYTHONPATH pulled from WingIDE
>> error-log:
>>
>>   PYTHONPATH [u'/home/aklaver/software_projects/greenhouse_app',
>> u'', ..
>>
>> The first listing is the project root. The project files live in the
>> project root, could that be the problem? It is double counting the
>> project directory?
>
> If the effective current directory ('', which can be set with Debug >
> Initial Directory project property and defaults to project location) is
> the same as /home/aklaver/software_projects/greenhouse_app then maybe
> it's leading to duplication somehow.

There is no Initial Directory set, so from the tool tip it should be 
defaulting to the project root listed above.

>
> This would be a bug, however.  Contrary to what I wrote yesterday, the
> Source Browser doesn't look at Python Path but only what's in the
> project.  That is why it shows one entry for each copy of a file/class.

That would seem to at odds with the documentation:

"..set PYTHONPATH so Wing's source analyzer and debugger can find your 
files, and set any other necessary runtime environment for your code ..."

and with what I am seeing. When I removed the code from site-packages it 
disappeared from the Source Browser.

>
> Given that, omitting site-packages from the Project view should solve
> the problem w/o actually removing the site-packages on disk.  Doing this
> should also make Search in Files w/ Project Files and Open From Project
> and other project-based features more useful and reduces the chances of
> opening the wrong file to edit.

If by Project view the Project tab that shows up with F2 then I do not 
have site-packages in there. The only directories listed there are the 
sub-directories of the project root.

>
> Sorry, somehow I didn't think this through entirely yesterday and got
> confused into thinking Python Path is used.

It would seem it is in fact used.

>
> If that doesn't help w/ removing the duplication in Source Browser
> please let me know.  I am not seeing in the code how duplicate Python
> Path entries could result in duplicate Source Browser entries but I can
> take a closer look if you find that is indeed the cause.

I would appreciate if you could. There seems to be theory/reality 
discrepancy going on:) It could be something I am doing on my end, but 
from what I gather from the docs I should not be seeing duplicates.

>


-- 
Adrian Klaver
adrian.klaver at gmail.com


More information about the wingide-users mailing list