Re: Semantic python system includes

Eric Ludlam <[email protected]> Sat, 4 Jun 2016 17:17:35 -0400
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 05/30/2016 08:40 AM, Dominik Schrempf wrote:
> Hello,
>
> I try to use Semantic with Python.  It happens to me that Semantic only
> parses includes that are actual module files but does not find modules
> that are organized in a folder.
>
> For example, Semantic is perfectly fine with
> : import matplotlib.pyplot
> because "/usr/lib/python3.5/site-packages/matplotlib/pyplot.py" is a
> file.
>
> However, it fails on
> : import numpy
> because "/usr/lib/python3.5/site-packages/numpy" is a folder.
>
> It may be that my configuration is wrong or missing (because I do not
> specifiy any Python specific settings), but if not, is there a way to
> circumvent this problem or are you aware of this problem?

Hi,

I did not author the python mode, so I don't know much about the 
specifics.  I do know that expanding an import is language specific.  To 
make the python import work, we'd need to create a semantic database for 
an imaginary numpy.py.  semantic/db-javap.el does this for .jar files. 
If there is a rule for creating a list of interfaces in a directory like 
numpy, then creating that database would be a bit more straightforward 
than the java one that extracts symbols from .jar files.

If someone's interested in trying it out can provide some sample files 
with expected results, I could help get you started.

Eric

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e